\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -2.037157504084274034815349795281714872542 \cdot 10^{-36}:\\
\;\;\;\;\frac{\frac{x \cdot 2}{z}}{y - t}\\
\mathbf{elif}\;z \le 3.818366843617034597316373479678641130316 \cdot 10^{83}:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{2}{y - t}}{z}\\
\end{array}double f(double x, double y, double z, double t) {
double r348277 = x;
double r348278 = 2.0;
double r348279 = r348277 * r348278;
double r348280 = y;
double r348281 = z;
double r348282 = r348280 * r348281;
double r348283 = t;
double r348284 = r348283 * r348281;
double r348285 = r348282 - r348284;
double r348286 = r348279 / r348285;
return r348286;
}
double f(double x, double y, double z, double t) {
double r348287 = z;
double r348288 = -2.037157504084274e-36;
bool r348289 = r348287 <= r348288;
double r348290 = x;
double r348291 = 2.0;
double r348292 = r348290 * r348291;
double r348293 = r348292 / r348287;
double r348294 = y;
double r348295 = t;
double r348296 = r348294 - r348295;
double r348297 = r348293 / r348296;
double r348298 = 3.8183668436170346e+83;
bool r348299 = r348287 <= r348298;
double r348300 = r348287 * r348296;
double r348301 = r348292 / r348300;
double r348302 = r348291 / r348296;
double r348303 = r348290 * r348302;
double r348304 = r348303 / r348287;
double r348305 = r348299 ? r348301 : r348304;
double r348306 = r348289 ? r348297 : r348305;
return r348306;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 2.2 |
| Herbie | 2.4 |
if z < -2.037157504084274e-36Initial program 9.3
Simplified7.6
rmApplied associate-/r*2.2
if -2.037157504084274e-36 < z < 3.8183668436170346e+83Initial program 2.5
Simplified2.5
rmApplied div-inv2.9
rmApplied add-cube-cbrt2.9
Applied times-frac2.9
Simplified2.9
Simplified2.9
rmApplied frac-times2.9
Applied associate-*r/2.5
Simplified2.5
if 3.8183668436170346e+83 < z Initial program 12.9
Simplified10.2
rmApplied div-inv10.3
rmApplied add-cube-cbrt10.3
Applied times-frac9.6
Simplified9.6
Simplified9.6
rmApplied associate-*l/9.6
Applied associate-*r/2.5
Simplified2.5
Final simplification2.4
herbie shell --seed 2019323
(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.045027827330126e-269) (/ (* (/ x z) 2) (- y t)) (* (/ x (* (- y t) z)) 2)))
(/ (* x 2) (- (* y z) (* t z))))