\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -2.7183563329919357 \cdot 10^{77}:\\
\;\;\;\;\frac{1}{\frac{y - t}{2}} \cdot \frac{x}{z}\\
\mathbf{elif}\;z \le 8.1507283132915605 \cdot 10^{-182}:\\
\;\;\;\;\frac{x}{\frac{1 \cdot \left(z \cdot \left(y - t\right)\right)}{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{\frac{y - t}{2}}{x}}}{z}\\
\end{array}double f(double x, double y, double z, double t) {
double r504293 = x;
double r504294 = 2.0;
double r504295 = r504293 * r504294;
double r504296 = y;
double r504297 = z;
double r504298 = r504296 * r504297;
double r504299 = t;
double r504300 = r504299 * r504297;
double r504301 = r504298 - r504300;
double r504302 = r504295 / r504301;
return r504302;
}
double f(double x, double y, double z, double t) {
double r504303 = z;
double r504304 = -2.7183563329919357e+77;
bool r504305 = r504303 <= r504304;
double r504306 = 1.0;
double r504307 = y;
double r504308 = t;
double r504309 = r504307 - r504308;
double r504310 = 2.0;
double r504311 = r504309 / r504310;
double r504312 = r504306 / r504311;
double r504313 = x;
double r504314 = r504313 / r504303;
double r504315 = r504312 * r504314;
double r504316 = 8.15072831329156e-182;
bool r504317 = r504303 <= r504316;
double r504318 = r504303 * r504309;
double r504319 = r504306 * r504318;
double r504320 = r504319 / r504310;
double r504321 = r504313 / r504320;
double r504322 = r504311 / r504313;
double r504323 = r504306 / r504322;
double r504324 = r504323 / r504303;
double r504325 = r504317 ? r504321 : r504324;
double r504326 = r504305 ? r504315 : r504325;
return r504326;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 2.1 |
| Herbie | 3.1 |
if z < -2.7183563329919357e+77Initial program 12.9
Simplified10.5
rmApplied *-un-lft-identity10.5
Applied times-frac10.5
Applied *-un-lft-identity10.5
Applied times-frac2.1
Simplified2.1
rmApplied associate-*l/2.0
Simplified2.0
rmApplied clear-num2.1
rmApplied *-un-lft-identity2.1
Applied div-inv2.1
Applied add-sqr-sqrt2.1
Applied times-frac2.1
Applied times-frac2.1
Simplified2.1
Simplified2.1
if -2.7183563329919357e+77 < z < 8.15072831329156e-182Initial program 3.1
Simplified3.0
rmApplied *-un-lft-identity3.0
if 8.15072831329156e-182 < z Initial program 7.6
Simplified5.9
rmApplied *-un-lft-identity5.9
Applied times-frac5.9
Applied *-un-lft-identity5.9
Applied times-frac3.4
Simplified3.4
rmApplied associate-*l/3.4
Simplified3.4
rmApplied clear-num3.6
Final simplification3.1
herbie shell --seed 2020100 +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))))