\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -3.0679094448922225 \cdot 10^{66}:\\
\;\;\;\;\frac{\sqrt[3]{x}}{\frac{z}{\sqrt[3]{x}}} \cdot \frac{\sqrt[3]{x}}{\frac{y - t}{2}}\\
\mathbf{elif}\;z \le 5.15733133231175267 \cdot 10^{-28}:\\
\;\;\;\;\frac{x}{z \cdot \frac{y - t}{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\end{array}double f(double x, double y, double z, double t) {
double r2563 = x;
double r2564 = 2.0;
double r2565 = r2563 * r2564;
double r2566 = y;
double r2567 = z;
double r2568 = r2566 * r2567;
double r2569 = t;
double r2570 = r2569 * r2567;
double r2571 = r2568 - r2570;
double r2572 = r2565 / r2571;
return r2572;
}
double f(double x, double y, double z, double t) {
double r2573 = z;
double r2574 = -3.0679094448922225e+66;
bool r2575 = r2573 <= r2574;
double r2576 = x;
double r2577 = cbrt(r2576);
double r2578 = r2573 / r2577;
double r2579 = r2577 / r2578;
double r2580 = y;
double r2581 = t;
double r2582 = r2580 - r2581;
double r2583 = 2.0;
double r2584 = r2582 / r2583;
double r2585 = r2577 / r2584;
double r2586 = r2579 * r2585;
double r2587 = 5.157331332311753e-28;
bool r2588 = r2573 <= r2587;
double r2589 = r2573 * r2584;
double r2590 = r2576 / r2589;
double r2591 = r2576 / r2573;
double r2592 = r2591 / r2584;
double r2593 = r2588 ? r2590 : r2592;
double r2594 = r2575 ? r2586 : r2593;
return r2594;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.0 |
|---|---|
| Target | 2.2 |
| Herbie | 2.1 |
if z < -3.0679094448922225e+66Initial program 13.6
Simplified11.1
rmApplied *-un-lft-identity11.1
Applied times-frac11.1
Applied add-cube-cbrt11.5
Applied times-frac1.7
Simplified1.7
if -3.0679094448922225e+66 < z < 5.157331332311753e-28Initial program 2.4
Simplified2.4
rmApplied *-un-lft-identity2.4
Applied times-frac2.4
Simplified2.4
if 5.157331332311753e-28 < z Initial program 9.5
Simplified7.2
rmApplied *-un-lft-identity7.2
Applied times-frac7.2
Applied associate-/r*1.7
Simplified1.7
Final simplification2.1
herbie shell --seed 2020025
(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))))