\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq 9.735236105864914 \cdot 10^{+54}:\\
\;\;\;\;\frac{2 \cdot \frac{x}{z}}{y - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{2}{y - t}}{z}\\
\end{array}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) {
double VAR;
if ((((double) (x * 2.0)) <= 9.735236105864914e+54)) {
VAR = (((double) (2.0 * (x / z))) / ((double) (y - t)));
} else {
VAR = (((double) (x * (2.0 / ((double) (y - t))))) / z);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.3 |
|---|---|
| Target | 2.3 |
| Herbie | 4.0 |
if (* x 2.0) < 9.73523610586491391e54Initial program 5.9
Simplified4.8
rmApplied *-un-lft-identity4.8
Applied times-frac4.6
Applied associate-*r*4.3
Simplified4.2
rmApplied associate-*r/4.2
if 9.73523610586491391e54 < (* x 2.0) Initial program 13.3
Simplified12.6
rmApplied *-un-lft-identity12.6
Applied times-frac11.8
Applied associate-*r*12.6
Simplified12.6
rmApplied associate-*l/2.9
Final simplification4.0
herbie shell --seed 2020196
(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))))