\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -6.9379949802427703 \cdot 10^{-128}:\\
\;\;\;\;\frac{\sqrt[3]{x}}{\frac{y - t}{\sqrt[3]{x}}} \cdot \left(\frac{\sqrt[3]{x}}{z} \cdot 2\right)\\
\mathbf{elif}\;z \le 4.5360233662522261 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{\frac{y - t}{2} \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\end{array}double f(double x, double y, double z, double t) {
double r658525 = x;
double r658526 = 2.0;
double r658527 = r658525 * r658526;
double r658528 = y;
double r658529 = z;
double r658530 = r658528 * r658529;
double r658531 = t;
double r658532 = r658531 * r658529;
double r658533 = r658530 - r658532;
double r658534 = r658527 / r658533;
return r658534;
}
double f(double x, double y, double z, double t) {
double r658535 = z;
double r658536 = -6.93799498024277e-128;
bool r658537 = r658535 <= r658536;
double r658538 = x;
double r658539 = cbrt(r658538);
double r658540 = y;
double r658541 = t;
double r658542 = r658540 - r658541;
double r658543 = r658542 / r658539;
double r658544 = r658539 / r658543;
double r658545 = r658539 / r658535;
double r658546 = 2.0;
double r658547 = r658545 * r658546;
double r658548 = r658544 * r658547;
double r658549 = 4.536023366252226e-37;
bool r658550 = r658535 <= r658549;
double r658551 = r658542 / r658546;
double r658552 = r658551 * r658535;
double r658553 = r658538 / r658552;
double r658554 = r658538 / r658535;
double r658555 = r658554 / r658551;
double r658556 = r658550 ? r658553 : r658555;
double r658557 = r658537 ? r658548 : r658556;
return r658557;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.2 |
| Herbie | 2.3 |
if z < -6.93799498024277e-128Initial program 7.5
Simplified6.1
rmApplied *-un-lft-identity6.1
Applied times-frac6.1
Applied associate-/r*2.4
Simplified2.4
rmApplied div-inv2.4
Applied *-un-lft-identity2.4
Applied add-cube-cbrt3.1
Applied times-frac3.1
Applied times-frac1.9
Simplified1.9
Simplified1.9
if -6.93799498024277e-128 < z < 4.536023366252226e-37Initial program 3.5
Simplified3.5
rmApplied *-un-lft-identity3.5
Applied times-frac3.5
Applied associate-/r*11.9
Simplified11.9
rmApplied div-inv12.0
Applied associate-/l*3.6
Simplified3.5
if 4.536023366252226e-37 < z Initial program 9.5
Simplified7.5
rmApplied *-un-lft-identity7.5
Applied times-frac7.5
Applied associate-/r*1.6
Simplified1.6
Final simplification2.3
herbie shell --seed 2020047
(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))))