(FPCore () :precision binary64 (/ 1.0 (+ 0.5 (sqrt 1.25))))
double code() { return 1.0 / (0.5 + sqrt(1.25)); }
real(8) function code() code = 1.0d0 / (0.5d0 + sqrt(1.25d0)) end function
public static double code() { return 1.0 / (0.5 + Math.sqrt(1.25)); }
def code(): return 1.0 / (0.5 + math.sqrt(1.25))
function code() return Float64(1.0 / Float64(0.5 + sqrt(1.25))) end
function tmp = code() tmp = 1.0 / (0.5 + sqrt(1.25)); end
code[] := N[(1.0 / N[(0.5 + N[Sqrt[1.25], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{1}{0.5 + \sqrt{1.25}} \end{array}
Sampling outcomes in binary64 precision:
Herbie found 1 alternatives:
Alternative | Accuracy | Speedup |
---|
(FPCore () :precision binary64 (/ 1.0 (+ 0.5 (sqrt 1.25))))
double code() { return 1.0 / (0.5 + sqrt(1.25)); }
real(8) function code() code = 1.0d0 / (0.5d0 + sqrt(1.25d0)) end function
public static double code() { return 1.0 / (0.5 + Math.sqrt(1.25)); }
def code(): return 1.0 / (0.5 + math.sqrt(1.25))
function code() return Float64(1.0 / Float64(0.5 + sqrt(1.25))) end
function tmp = code() tmp = 1.0 / (0.5 + sqrt(1.25)); end
code[] := N[(1.0 / N[(0.5 + N[Sqrt[1.25], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l} \\ \frac{1}{0.5 + \sqrt{1.25}} \end{array}
(FPCore () :precision binary64 (- (sqrt 1.25) 0.5))
double code() { return sqrt(1.25) - 0.5; }
real(8) function code() code = sqrt(1.25d0) - 0.5d0 end function
public static double code() { return Math.sqrt(1.25) - 0.5; }
def code(): return math.sqrt(1.25) - 0.5
function code() return Float64(sqrt(1.25) - 0.5) end
function tmp = code() tmp = sqrt(1.25) - 0.5; end
code[] := N[(N[Sqrt[1.25], $MachinePrecision] - 0.5), $MachinePrecision]
\begin{array}{l} \\ \sqrt{1.25} - 0.5 \end{array}
Initial program 98.4%
metadata-eval
N/A
rem-square-sqrt
N/A
metadata-eval
N/A
+-commutative
N/A
flip--
N/A
--lowering--.f64
N/A
sqrt-lowering-sqrt.f64
100.0
Applied egg-rr100.0%
herbie shell --seed 5
(FPCore ()
:name "1/(0.5+sqrt(1.25))"
:precision binary64
(/ 1.0 (+ 0.5 (sqrt 1.25))))