\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;z \le -4.154512528065834 \cdot 10^{229} \lor \neg \left(z \le 9.1298419035993844 \cdot 10^{-77}\right):\\
\;\;\;\;1 \cdot \frac{\frac{x}{\frac{y - t}{2}}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z}}{y - t} \cdot \frac{x}{\frac{1}{2}}\\
\end{array}double f(double x, double y, double z, double t) {
double r552140 = x;
double r552141 = 2.0;
double r552142 = r552140 * r552141;
double r552143 = y;
double r552144 = z;
double r552145 = r552143 * r552144;
double r552146 = t;
double r552147 = r552146 * r552144;
double r552148 = r552145 - r552147;
double r552149 = r552142 / r552148;
return r552149;
}
double f(double x, double y, double z, double t) {
double r552150 = z;
double r552151 = -4.154512528065834e+229;
bool r552152 = r552150 <= r552151;
double r552153 = 9.129841903599384e-77;
bool r552154 = r552150 <= r552153;
double r552155 = !r552154;
bool r552156 = r552152 || r552155;
double r552157 = 1.0;
double r552158 = x;
double r552159 = y;
double r552160 = t;
double r552161 = r552159 - r552160;
double r552162 = 2.0;
double r552163 = r552161 / r552162;
double r552164 = r552158 / r552163;
double r552165 = r552164 / r552150;
double r552166 = r552157 * r552165;
double r552167 = r552157 / r552150;
double r552168 = r552167 / r552161;
double r552169 = r552157 / r552162;
double r552170 = r552158 / r552169;
double r552171 = r552168 * r552170;
double r552172 = r552156 ? r552166 : r552171;
return r552172;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.1 |
| Herbie | 3.5 |
if z < -4.154512528065834e+229 or 9.129841903599384e-77 < z Initial program 10.0
Simplified7.9
rmApplied *-un-lft-identity7.9
Applied times-frac7.9
Applied *-un-lft-identity7.9
Applied times-frac2.5
Simplified2.5
rmApplied *-un-lft-identity2.5
Applied *-un-lft-identity2.5
Applied times-frac2.5
Applied associate-*l*2.5
Simplified2.4
if -4.154512528065834e+229 < z < 9.129841903599384e-77Initial program 4.6
Simplified4.2
rmApplied *-un-lft-identity4.2
Applied times-frac4.2
Applied *-un-lft-identity4.2
Applied times-frac7.7
Simplified7.7
rmApplied div-inv7.7
Applied *-un-lft-identity7.7
Applied times-frac7.7
Applied associate-*r*4.3
Simplified4.2
Final simplification3.5
herbie shell --seed 2020027 +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))))