\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -1.67001758597271323 \cdot 10^{-63} \lor \neg \left(x \le 5.06956684508544874 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{\frac{x}{\frac{y - t}{2}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\end{array}double f(double x, double y, double z, double t) {
double r569427 = x;
double r569428 = 2.0;
double r569429 = r569427 * r569428;
double r569430 = y;
double r569431 = z;
double r569432 = r569430 * r569431;
double r569433 = t;
double r569434 = r569433 * r569431;
double r569435 = r569432 - r569434;
double r569436 = r569429 / r569435;
return r569436;
}
double f(double x, double y, double z, double t) {
double r569437 = x;
double r569438 = -1.6700175859727132e-63;
bool r569439 = r569437 <= r569438;
double r569440 = 5.069566845085449e-32;
bool r569441 = r569437 <= r569440;
double r569442 = !r569441;
bool r569443 = r569439 || r569442;
double r569444 = y;
double r569445 = t;
double r569446 = r569444 - r569445;
double r569447 = 2.0;
double r569448 = r569446 / r569447;
double r569449 = r569437 / r569448;
double r569450 = z;
double r569451 = r569449 / r569450;
double r569452 = r569437 / r569450;
double r569453 = r569452 / r569448;
double r569454 = r569443 ? r569451 : r569453;
return r569454;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.1 |
|---|---|
| Target | 2.1 |
| Herbie | 2.0 |
if x < -1.6700175859727132e-63 or 5.069566845085449e-32 < x Initial program 9.9
Simplified8.9
rmApplied *-un-lft-identity8.9
Applied times-frac8.9
Applied associate-/r*9.3
Simplified9.3
rmApplied div-inv9.4
rmApplied associate-*l/2.3
Simplified2.3
if -1.6700175859727132e-63 < x < 5.069566845085449e-32Initial program 3.8
Simplified2.2
rmApplied *-un-lft-identity2.2
Applied times-frac2.2
Applied associate-/r*1.7
Simplified1.7
Final simplification2.0
herbie shell --seed 2020020 +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))))