(FPCore (x) :precision binary64 (/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))
(FPCore (x) :precision binary64 (let* ((t_0 (log (sqrt (exp (/ (+ x -1.0) (+ x (fma 4.0 (sqrt x) 1.0)))))))) (log (pow (exp (+ t_0 t_0)) 6.0))))
double code(double x) {
return (6.0 * (x - 1.0)) / ((x + 1.0) + (4.0 * sqrt(x)));
}
double code(double x) {
double t_0 = log(sqrt(exp(((x + -1.0) / (x + fma(4.0, sqrt(x), 1.0))))));
return log(pow(exp((t_0 + t_0)), 6.0));
}
function code(x) return Float64(Float64(6.0 * Float64(x - 1.0)) / Float64(Float64(x + 1.0) + Float64(4.0 * sqrt(x)))) end
function code(x) t_0 = log(sqrt(exp(Float64(Float64(x + -1.0) / Float64(x + fma(4.0, sqrt(x), 1.0)))))) return log((exp(Float64(t_0 + t_0)) ^ 6.0)) end
code[x_] := N[(N[(6.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / N[(N[(x + 1.0), $MachinePrecision] + N[(4.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Log[N[Sqrt[N[Exp[N[(N[(x + -1.0), $MachinePrecision] / N[(x + N[(4.0 * N[Sqrt[x], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[Log[N[Power[N[Exp[N[(t$95$0 + t$95$0), $MachinePrecision]], $MachinePrecision], 6.0], $MachinePrecision]], $MachinePrecision]]
\frac{6 \cdot \left(x - 1\right)}{\left(x + 1\right) + 4 \cdot \sqrt{x}}
\begin{array}{l}
t_0 := \log \left(\sqrt{e^{\frac{x + -1}{x + \mathsf{fma}\left(4, \sqrt{x}, 1\right)}}}\right)\\
\log \left({\left(e^{t_0 + t_0}\right)}^{6}\right)
\end{array}




Bits error versus x
| Original | 0.2 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
Initial program 0.2
Applied egg-rr0.1
Applied egg-rr0.1
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022160
(FPCore (x)
:name "Data.Approximate.Numerics:blog from approximate-0.2.2.1"
:precision binary64
:herbie-target
(/ 6.0 (/ (+ (+ x 1.0) (* 4.0 (sqrt x))) (- x 1.0)))
(/ (* 6.0 (- x 1.0)) (+ (+ x 1.0) (* 4.0 (sqrt x)))))