\frac{x \cdot 2.0}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;y \cdot z - t \cdot z \le -2.189692383898529 \cdot 10^{+133}:\\
\;\;\;\;\frac{\frac{2.0 \cdot x}{z}}{y - t}\\
\mathbf{elif}\;y \cdot z - t \cdot z \le 5.325542296946449 \cdot 10^{+160}:\\
\;\;\;\;\frac{2.0 \cdot x}{y \cdot z - t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2.0 \cdot x}{z}}{y - t}\\
\end{array}double f(double x, double y, double z, double t) {
double r26134143 = x;
double r26134144 = 2.0;
double r26134145 = r26134143 * r26134144;
double r26134146 = y;
double r26134147 = z;
double r26134148 = r26134146 * r26134147;
double r26134149 = t;
double r26134150 = r26134149 * r26134147;
double r26134151 = r26134148 - r26134150;
double r26134152 = r26134145 / r26134151;
return r26134152;
}
double f(double x, double y, double z, double t) {
double r26134153 = y;
double r26134154 = z;
double r26134155 = r26134153 * r26134154;
double r26134156 = t;
double r26134157 = r26134156 * r26134154;
double r26134158 = r26134155 - r26134157;
double r26134159 = -2.189692383898529e+133;
bool r26134160 = r26134158 <= r26134159;
double r26134161 = 2.0;
double r26134162 = x;
double r26134163 = r26134161 * r26134162;
double r26134164 = r26134163 / r26134154;
double r26134165 = r26134153 - r26134156;
double r26134166 = r26134164 / r26134165;
double r26134167 = 5.325542296946449e+160;
bool r26134168 = r26134158 <= r26134167;
double r26134169 = r26134163 / r26134158;
double r26134170 = r26134168 ? r26134169 : r26134166;
double r26134171 = r26134160 ? r26134166 : r26134170;
return r26134171;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.6 |
|---|---|
| Target | 2.1 |
| Herbie | 1.7 |
if (- (* y z) (* t z)) < -2.189692383898529e+133 or 5.325542296946449e+160 < (- (* y z) (* t z)) Initial program 11.8
Simplified1.3
rmApplied add-cube-cbrt1.8
Applied *-un-lft-identity1.8
Applied times-frac1.8
Applied associate-*r*5.5
Simplified5.5
rmApplied *-un-lft-identity5.5
Applied cbrt-prod5.5
Applied *-un-lft-identity5.5
Applied times-frac5.5
Applied associate-*r*5.5
Simplified5.5
rmApplied associate-*l/1.8
Simplified1.3
if -2.189692383898529e+133 < (- (* y z) (* t z)) < 5.325542296946449e+160Initial program 2.1
Final simplification1.7
herbie shell --seed 2019164
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:herbie-target
(if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.045027827330126e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))