# Suggest an irrational number from decimal one

I want to know is there any function in Mathematica that suggests a simple irrational number combination for decimal one?

For example, if I give 0.804738 then I get (Sqrt[2] + 1)/3.

(EDIT)

Or consider 1.301290284568573 = π/(Sqrt[2] + 1).

It seems for the first example RootApproximant gives the correct answer but for the second its answer is not useful at all.

• Have you seen RootApproximant? – Michael E2 Apr 10 at 2:31
• Thank you! This works for this number. But I suggest that, for example, 0.8185261683292934 should be related to sqrt[2] with simple relation. – Rasoul-Ghadimi Apr 10 at 2:36
• I want a function that also predicts something like \pi, RootApproximant[[Pi]] is not that. – Rasoul-Ghadimi Apr 10 at 3:30
• Pi*RootApproximant[1.30129028/Pi] – Bob Hanlon Apr 10 at 4:43
• AskConstants is pretty amazing for this task. – Roman Apr 10 at 6:56

Try WolframAlpha

guess[x_]:=WolframAlpha["identify "<>ToString@x]


• There's no need for coding here: you can get the same effect by pressing "=" twice and entering the number (or any W$\alpha$ query) directly. – Roman Apr 10 at 8:12
• Thank you. Yes, it works. – Rasoul-Ghadimi Apr 11 at 1:56

AskConstants is extremely powerful. For the second example it gives several results:

(-1 + Sqrt[2]) \[Pi]
\[Pi] Tanh[ArcCosh[3]/4]
\[Pi] Sqrt[ModularLambda[I Sqrt[2]]]
(1 + Sqrt[2]) \[Pi] Sqrt[ModularLambda[2 I]]
1/2 \[Pi] Tanh[ArcCoth[2 + Sqrt[2]] + ArcCsch[1]]


• While this package might be powerful, it is huge (!) and strangely organized. I read  INSTALL.nb and  LOAD_ASKCONSTANTS.nb twice, and still could not figure out how to install this thing. – yarchik Apr 11 at 16:07