(FPCore (x y z t) :precision binary64 (- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))
(FPCore (x y z t) :precision binary64 (fma 1.0 x (/ -2.0 (- (* 2.0 (/ z y)) (/ t z)))))
double code(double x, double y, double z, double t) {
return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
}
double code(double x, double y, double z, double t) {
return fma(1.0, x, (-2.0 / ((2.0 * (z / y)) - (t / z))));
}
function code(x, y, z, t) return Float64(x - Float64(Float64(Float64(y * 2.0) * z) / Float64(Float64(Float64(z * 2.0) * z) - Float64(y * t)))) end
function code(x, y, z, t) return fma(1.0, x, Float64(-2.0 / Float64(Float64(2.0 * Float64(z / y)) - Float64(t / z)))) end
code[x_, y_, z_, t_] := N[(x - N[(N[(N[(y * 2.0), $MachinePrecision] * z), $MachinePrecision] / N[(N[(N[(z * 2.0), $MachinePrecision] * z), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(1.0 * x + N[(-2.0 / N[(N[(2.0 * N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
\mathsf{fma}\left(1, x, \frac{-2}{2 \cdot \frac{z}{y} - \frac{t}{z}}\right)




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 11.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 11.7
Simplified0.1
Applied egg-rr0.1
Final simplification0.1
herbie shell --seed 2022162
(FPCore (x y z t)
:name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
:precision binary64
:herbie-target
(- x (/ 1.0 (- (/ z y) (/ (/ t 2.0) z))))
(- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))