\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -3.707866008615156 \cdot 10^{-76} \lor \neg \left(x \cdot 2 \leq 11433628.305164771\right):\\
\;\;\;\;\frac{x \cdot \frac{2}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\left(y - t\right) \cdot 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)) <= -3.707866008615156e-76) || !(((double) (x * 2.0)) <= 11433628.305164771))) {
VAR = (((double) (x * (2.0 / ((double) (y - t))))) / z);
} else {
VAR = (((double) (x * 2.0)) / ((double) (((double) (y - t)) * z)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 2.1 |
| Herbie | 2.4 |
if (* x 2.0) < -3.70786600861515622e-76 or 11433628.3051647712 < (* x 2.0) Initial program 9.6
Simplified8.9
rmApplied *-un-lft-identity8.9
Applied times-frac8.5
Applied associate-*r*9.5
Simplified9.4
rmApplied associate-*l/2.7
if -3.70786600861515622e-76 < (* x 2.0) < 11433628.3051647712Initial program 3.2
Simplified2.4
rmApplied associate-*r/2.1
Final simplification2.4
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))))