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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.9 |
|---|---|
| Target | 2.3 |
| Herbie | 1.8 |
Initial program 6.9
Simplified5.8
rmApplied *-un-lft-identity5.8
Applied times-frac5.8
Applied *-un-lft-identity5.8
Applied times-frac5.6
Simplified5.6
rmApplied *-un-lft-identity5.6
Applied add-cube-cbrt6.2
Applied times-frac6.2
Applied add-cube-cbrt6.4
Applied times-frac6.4
Applied associate-*r*1.8
Simplified1.8
Final simplification1.8
herbie shell --seed 2020056 +o rules:numerics
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(if (< (/ (* x 2) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2) (if (< (/ (* x 2) (- (* y z) (* t z))) 1.0450278273301259e-269) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2)))
(/ (* x 2) (- (* y z) (* t z))))