\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -5.6260780497245676 \cdot 10^{34} \lor \neg \left(x \le 3.47347495168652677 \cdot 10^{-84}\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 r490702 = x;
double r490703 = 2.0;
double r490704 = r490702 * r490703;
double r490705 = y;
double r490706 = z;
double r490707 = r490705 * r490706;
double r490708 = t;
double r490709 = r490708 * r490706;
double r490710 = r490707 - r490709;
double r490711 = r490704 / r490710;
return r490711;
}
double f(double x, double y, double z, double t) {
double r490712 = x;
double r490713 = -5.626078049724568e+34;
bool r490714 = r490712 <= r490713;
double r490715 = 3.4734749516865268e-84;
bool r490716 = r490712 <= r490715;
double r490717 = !r490716;
bool r490718 = r490714 || r490717;
double r490719 = 1.0;
double r490720 = sqrt(r490719);
double r490721 = r490720 / r490719;
double r490722 = y;
double r490723 = t;
double r490724 = r490722 - r490723;
double r490725 = 2.0;
double r490726 = r490724 / r490725;
double r490727 = r490712 / r490726;
double r490728 = z;
double r490729 = r490727 / r490728;
double r490730 = r490721 * r490729;
double r490731 = r490712 / r490728;
double r490732 = r490731 / r490726;
double r490733 = r490718 ? r490730 : r490732;
return r490733;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.2 |
|---|---|
| Target | 2.2 |
| Herbie | 2.2 |
if x < -5.626078049724568e+34 or 3.4734749516865268e-84 < x Initial program 10.7
Simplified9.8
rmApplied *-un-lft-identity9.8
Applied times-frac9.8
Applied *-un-lft-identity9.8
Applied times-frac2.6
Simplified2.6
rmApplied *-un-lft-identity2.6
Applied add-sqr-sqrt2.6
Applied times-frac2.6
Applied associate-*l*2.6
Simplified2.5
if -5.626078049724568e+34 < x < 3.4734749516865268e-84Initial program 3.6
Simplified2.2
rmApplied *-un-lft-identity2.2
Applied times-frac2.2
Applied associate-/r*1.9
Simplified1.9
Final simplification2.2
herbie shell --seed 2020064
(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))))