\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \cdot 2 \le -1797394269439569915404580548509696:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{x \cdot 2}{y - t}}}\\
\mathbf{elif}\;x \cdot 2 \le 5681626209917895739607412273022943363072:\\
\;\;\;\;\frac{x \cdot 2}{z \cdot \left(y - t\right) + z \cdot \left(\left(-t\right) + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{y - t} \cdot \frac{1}{z}\\
\end{array}double f(double x, double y, double z, double t) {
double r336087 = x;
double r336088 = 2.0;
double r336089 = r336087 * r336088;
double r336090 = y;
double r336091 = z;
double r336092 = r336090 * r336091;
double r336093 = t;
double r336094 = r336093 * r336091;
double r336095 = r336092 - r336094;
double r336096 = r336089 / r336095;
return r336096;
}
double f(double x, double y, double z, double t) {
double r336097 = x;
double r336098 = 2.0;
double r336099 = r336097 * r336098;
double r336100 = -1.79739426943957e+33;
bool r336101 = r336099 <= r336100;
double r336102 = 1.0;
double r336103 = z;
double r336104 = y;
double r336105 = t;
double r336106 = r336104 - r336105;
double r336107 = r336099 / r336106;
double r336108 = r336103 / r336107;
double r336109 = r336102 / r336108;
double r336110 = 5.681626209917896e+39;
bool r336111 = r336099 <= r336110;
double r336112 = r336103 * r336106;
double r336113 = -r336105;
double r336114 = r336113 + r336105;
double r336115 = r336103 * r336114;
double r336116 = r336112 + r336115;
double r336117 = r336099 / r336116;
double r336118 = r336102 / r336103;
double r336119 = r336107 * r336118;
double r336120 = r336111 ? r336117 : r336119;
double r336121 = r336101 ? r336109 : r336120;
return r336121;
}




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.5 |
if (* x 2.0) < -1.79739426943957e+33Initial program 11.2
Simplified10.4
rmApplied add-cube-cbrt10.8
Applied add-sqr-sqrt37.2
Applied prod-diff37.2
Applied distribute-lft-in37.9
Simplified12.1
Simplified10.4
rmApplied clear-num10.5
Simplified3.5
if -1.79739426943957e+33 < (* x 2.0) < 5.681626209917896e+39Initial program 3.4
Simplified2.0
rmApplied add-cube-cbrt2.4
Applied add-sqr-sqrt33.0
Applied prod-diff33.0
Applied distribute-lft-in34.7
Simplified5.6
Simplified2.0
if 5.681626209917896e+39 < (* x 2.0) Initial program 12.5
Simplified12.1
rmApplied add-cube-cbrt12.5
Applied add-sqr-sqrt39.1
Applied prod-diff39.1
Applied distribute-lft-in39.7
Simplified13.6
Simplified12.1
rmApplied clear-num12.1
Simplified3.4
rmApplied associate-/r/3.0
Final simplification2.5
herbie shell --seed 2019347 +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))))