\frac{x \cdot 2}{y \cdot z - t \cdot z}\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \left(\frac{2}{y - t} \cdot \frac{\sqrt[3]{x}}{\sqrt[3]{z}}\right)(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
(FPCore (x y z t) :precision binary64 (* (/ (* (cbrt x) (cbrt x)) (* (cbrt z) (cbrt z))) (* (/ 2.0 (- y t)) (/ (cbrt x) (cbrt z)))))
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) ((((double) (((double) cbrt(x)) * ((double) cbrt(x)))) / ((double) (((double) cbrt(z)) * ((double) cbrt(z))))) * ((double) ((2.0 / ((double) (y - t))) * (((double) cbrt(x)) / ((double) cbrt(z)))))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 2.1 |
| Herbie | 1.9 |
Initial program Error: 7.3 bits
SimplifiedError: 6.3 bits
rmApplied *-un-lft-identityError: 6.3 bits
Applied times-fracError: 6.0 bits
Applied associate-*r*Error: 5.8 bits
SimplifiedError: 5.8 bits
rmApplied add-cube-cbrtError: 6.4 bits
Applied add-cube-cbrtError: 6.6 bits
Applied times-fracError: 6.6 bits
Applied associate-*l*Error: 1.9 bits
SimplifiedError: 1.9 bits
Final simplificationError: 1.9 bits
herbie shell --seed 2020203
(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))))