\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \cdot 2 \leq -4.9660709412788435 \cdot 10^{-216} \lor \neg \left(x \cdot 2 \leq 15670887.655105175\right):\\
\;\;\;\;\frac{\frac{x \cdot 2}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{\left(y - t\right) \cdot z}\\
\end{array}(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
(FPCore (x y z t)
:precision binary64
(if (or (<= (* x 2.0) -4.9660709412788435e-216)
(not (<= (* x 2.0) 15670887.655105175)))
(/ (/ (* x 2.0) (- y t)) z)
(/ (* x 2.0) (* (- y t) 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 tmp;
if (((x * 2.0) <= -4.9660709412788435e-216) || !((x * 2.0) <= 15670887.655105175)) {
tmp = ((x * 2.0) / (y - t)) / z;
} else {
tmp = (x * 2.0) / ((y - t) * z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.1 |
|---|---|
| Target | 2.1 |
| Herbie | 3.0 |
if (*.f64 x 2) < -4.9660709412788435e-216 or 15670887.6551051755 < (*.f64 x 2) Initial program 9.2
Simplified7.7
rmApplied associate-*r/_binary64_155013.5
rmApplied associate-*r/_binary64_155013.5
if -4.9660709412788435e-216 < (*.f64 x 2) < 15670887.6551051755Initial program 3.4
Simplified2.3
rmApplied associate-*r/_binary64_155017.9
rmApplied associate-*r/_binary64_155017.8
Applied associate-/l/_binary64_155062.1
Simplified2.1
Final simplification3.0
herbie shell --seed 2020277
(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))))