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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.9 |
|---|---|
| Target | 2.2 |
| Herbie | 1.8 |
Initial program 6.9
Simplified5.4
Applied add-cube-cbrt_binary646.1
Applied add-cube-cbrt_binary646.3
Applied times-frac_binary646.3
Applied associate-*r*_binary641.8
Final simplification1.8
herbie shell --seed 2022081
(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.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))