\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -2.320741883373177528540339099083515625063 \cdot 10^{180} \lor \neg \left(x \le 266999013784891418240589234176\right):\\
\;\;\;\;\frac{\sqrt{1}}{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 r638559 = x;
double r638560 = 2.0;
double r638561 = r638559 * r638560;
double r638562 = y;
double r638563 = z;
double r638564 = r638562 * r638563;
double r638565 = t;
double r638566 = r638565 * r638563;
double r638567 = r638564 - r638566;
double r638568 = r638561 / r638567;
return r638568;
}
double f(double x, double y, double z, double t) {
double r638569 = x;
double r638570 = -2.3207418833731775e+180;
bool r638571 = r638569 <= r638570;
double r638572 = 2.6699901378489142e+29;
bool r638573 = r638569 <= r638572;
double r638574 = !r638573;
bool r638575 = r638571 || r638574;
double r638576 = 1.0;
double r638577 = sqrt(r638576);
double r638578 = r638577 / r638576;
double r638579 = y;
double r638580 = t;
double r638581 = r638579 - r638580;
double r638582 = 2.0;
double r638583 = r638581 / r638582;
double r638584 = r638569 / r638583;
double r638585 = z;
double r638586 = r638584 / r638585;
double r638587 = r638578 * r638586;
double r638588 = r638569 / r638585;
double r638589 = r638588 / r638583;
double r638590 = r638575 ? r638587 : r638589;
return r638590;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.1 |
| Herbie | 2.8 |
if x < -2.3207418833731775e+180 or 2.6699901378489142e+29 < x Initial program 13.0
Simplified12.4
rmApplied *-un-lft-identity12.4
Applied times-frac12.4
Applied *-un-lft-identity12.4
Applied times-frac3.2
Simplified3.2
rmApplied *-un-lft-identity3.2
Applied add-sqr-sqrt3.2
Applied times-frac3.2
Applied associate-*l*3.2
Simplified3.1
if -2.3207418833731775e+180 < x < 2.6699901378489142e+29Initial program 4.5
Simplified3.1
rmApplied *-un-lft-identity3.1
Applied times-frac3.1
Applied associate-/r*2.7
Simplified2.7
Final simplification2.8
herbie shell --seed 2019362 +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))))