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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 1.9 |
| Herbie | 1.8 |
Initial program 6.6
Simplified5.5
rmApplied associate-/r*5.2
rmApplied add-cube-cbrt5.8
Applied add-cube-cbrt6.0
Applied *-un-lft-identity6.0
Applied times-frac6.0
Applied times-frac6.0
Applied associate-*r*1.7
Simplified1.8
Final simplification1.8
herbie shell --seed 2020198
(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))))