(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
(FPCore (x y) :precision binary64 (fma (sqrt x) (+ (* 3.0 y) -3.0) (sqrt (/ 0.1111111111111111 x))))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
double code(double x, double y) {
return fma(sqrt(x), ((3.0 * y) + -3.0), sqrt((0.1111111111111111 / x)));
}
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0)) end
function code(x, y) return fma(sqrt(x), Float64(Float64(3.0 * y) + -3.0), sqrt(Float64(0.1111111111111111 / x))) end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(N[(3.0 * y), $MachinePrecision] + -3.0), $MachinePrecision] + N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\mathsf{fma}\left(\sqrt{x}, 3 \cdot y + -3, \sqrt{\frac{0.1111111111111111}{x}}\right)




Bits error versus x




Bits error versus y
| Original | 0.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
Initial program 0.4
Simplified0.4
Taylor expanded in y around 0 0.4
Simplified0.4
Applied egg-rr0.3
Taylor expanded in x around 0 0.3
Taylor expanded in y around 0 0.3
Final simplification0.3
herbie shell --seed 2022166
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x))))
(* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))