\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -2.854073483132409627892280748735859896789 \cdot 10^{-80} \lor \neg \left(x \le 4.280064491975717546527013185442469963537 \cdot 10^{-221}\right):\\
\;\;\;\;\frac{\sqrt{1}}{1} \cdot \frac{\frac{x}{\frac{y - t}{2}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{1}}{1} \cdot \frac{x}{z \cdot \frac{y - t}{2}}\\
\end{array}double f(double x, double y, double z, double t) {
double r653458 = x;
double r653459 = 2.0;
double r653460 = r653458 * r653459;
double r653461 = y;
double r653462 = z;
double r653463 = r653461 * r653462;
double r653464 = t;
double r653465 = r653464 * r653462;
double r653466 = r653463 - r653465;
double r653467 = r653460 / r653466;
return r653467;
}
double f(double x, double y, double z, double t) {
double r653468 = x;
double r653469 = -2.8540734831324096e-80;
bool r653470 = r653468 <= r653469;
double r653471 = 4.2800644919757175e-221;
bool r653472 = r653468 <= r653471;
double r653473 = !r653472;
bool r653474 = r653470 || r653473;
double r653475 = 1.0;
double r653476 = sqrt(r653475);
double r653477 = r653476 / r653475;
double r653478 = y;
double r653479 = t;
double r653480 = r653478 - r653479;
double r653481 = 2.0;
double r653482 = r653480 / r653481;
double r653483 = r653468 / r653482;
double r653484 = z;
double r653485 = r653483 / r653484;
double r653486 = r653477 * r653485;
double r653487 = r653484 * r653482;
double r653488 = r653468 / r653487;
double r653489 = r653477 * r653488;
double r653490 = r653474 ? r653486 : r653489;
return r653490;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 2.2 |
| Herbie | 3.4 |
if x < -2.8540734831324096e-80 or 4.2800644919757175e-221 < x Initial program 8.3
Simplified7.2
rmApplied *-un-lft-identity7.2
Applied times-frac7.2
Applied *-un-lft-identity7.2
Applied times-frac3.9
Simplified3.9
rmApplied *-un-lft-identity3.9
Applied add-sqr-sqrt3.9
Applied times-frac3.9
Applied associate-*l*3.9
Simplified3.8
if -2.8540734831324096e-80 < x < 4.2800644919757175e-221Initial program 3.5
Simplified2.2
rmApplied *-un-lft-identity2.2
Applied times-frac2.2
Applied *-un-lft-identity2.2
Applied times-frac9.9
Simplified9.9
rmApplied *-un-lft-identity9.9
Applied add-sqr-sqrt9.9
Applied times-frac9.9
Applied associate-*l*9.9
Simplified9.9
rmApplied div-inv9.9
Applied associate-/l*2.3
Simplified2.2
Final simplification3.4
herbie shell --seed 2019354 +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))))