\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -900492426030022.75 \lor \neg \left(x \le 4.9676132502495131 \cdot 10^{-71}\right):\\
\;\;\;\;1 \cdot \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 r658375 = x;
double r658376 = 2.0;
double r658377 = r658375 * r658376;
double r658378 = y;
double r658379 = z;
double r658380 = r658378 * r658379;
double r658381 = t;
double r658382 = r658381 * r658379;
double r658383 = r658380 - r658382;
double r658384 = r658377 / r658383;
return r658384;
}
double f(double x, double y, double z, double t) {
double r658385 = x;
double r658386 = -900492426030022.8;
bool r658387 = r658385 <= r658386;
double r658388 = 4.967613250249513e-71;
bool r658389 = r658385 <= r658388;
double r658390 = !r658389;
bool r658391 = r658387 || r658390;
double r658392 = 1.0;
double r658393 = y;
double r658394 = t;
double r658395 = r658393 - r658394;
double r658396 = 2.0;
double r658397 = r658395 / r658396;
double r658398 = r658385 / r658397;
double r658399 = z;
double r658400 = r658398 / r658399;
double r658401 = r658392 * r658400;
double r658402 = r658385 / r658399;
double r658403 = r658402 / r658397;
double r658404 = r658391 ? r658401 : r658403;
return r658404;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 2.1 |
| Herbie | 2.5 |
if x < -900492426030022.8 or 4.967613250249513e-71 < x Initial program 10.7
Simplified9.8
rmApplied *-un-lft-identity9.8
Applied times-frac9.7
Applied *-un-lft-identity9.7
Applied times-frac3.0
Simplified3.0
rmApplied *-un-lft-identity3.0
Applied associate-*l*3.0
Simplified2.9
if -900492426030022.8 < x < 4.967613250249513e-71Initial program 3.2
Simplified2.0
rmApplied *-un-lft-identity2.0
Applied times-frac2.0
Applied associate-/r*2.1
Simplified2.1
Final simplification2.5
herbie shell --seed 2020036
(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))))