\frac{x \cdot 2}{y \cdot z - t \cdot z}\left(x \cdot \frac{\sqrt[3]{\frac{2}{y - t}} \cdot \left(\sqrt[3]{\frac{1}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}} \cdot \sqrt[3]{\frac{2}{\sqrt[3]{y - t}}}\right)}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\frac{2}{y - t}}}{\sqrt[3]{z}}(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
(FPCore (x y z t)
:precision binary64
(*
(*
x
(/
(*
(cbrt (/ 2.0 (- y t)))
(*
(cbrt (/ 1.0 (* (cbrt (- y t)) (cbrt (- y t)))))
(cbrt (/ 2.0 (cbrt (- y t))))))
(* (cbrt z) (cbrt z))))
(/ (cbrt (/ 2.0 (- y t))) (cbrt z))))double code(double x, double y, double z, double t) {
return (x * 2.0) / ((y * z) - (t * z));
}
double code(double x, double y, double z, double t) {
return (x * ((cbrt(2.0 / (y - t)) * (cbrt(1.0 / (cbrt(y - t) * cbrt(y - t))) * cbrt(2.0 / cbrt(y - t)))) / (cbrt(z) * cbrt(z)))) * (cbrt(2.0 / (y - t)) / cbrt(z));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 2.2 |
| Herbie | 1.9 |
Initial program 7.0
Simplified5.7
rmApplied add-cube-cbrt_binary646.4
Applied add-cube-cbrt_binary646.5
Applied times-frac_binary646.5
Applied associate-*r*_binary641.9
rmApplied add-cube-cbrt_binary641.9
Applied *-un-lft-identity_binary641.9
Applied times-frac_binary641.9
Applied cbrt-prod_binary641.9
Final simplification1.9
herbie shell --seed 2020219
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.0450278273301259e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))