\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;y \cdot z - t \cdot z \le -4.75121709163883817 \cdot 10^{241}:\\
\;\;\;\;\frac{\frac{x}{\frac{y - t}{2}}}{z}\\
\mathbf{elif}\;y \cdot z - t \cdot z \le -3.60190838907854557 \cdot 10^{-204}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{elif}\;y \cdot z - t \cdot z \le 3.05095781584335686 \cdot 10^{-289}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\mathbf{elif}\;y \cdot z - t \cdot z \le 2.5078442216331947 \cdot 10^{188}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - t \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{y - t}{2}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) (((double) (y * z)) - ((double) (t * z)))) <= -4.751217091638838e+241)) {
VAR = ((double) (((double) (x / ((double) (((double) (y - t)) / 2.0)))) / z));
} else {
double VAR_1;
if ((((double) (((double) (y * z)) - ((double) (t * z)))) <= -3.6019083890785456e-204)) {
VAR_1 = ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z))))));
} else {
double VAR_2;
if ((((double) (((double) (y * z)) - ((double) (t * z)))) <= 3.050957815843357e-289)) {
VAR_2 = ((double) (((double) (x / z)) / ((double) (((double) (y - t)) / 2.0))));
} else {
double VAR_3;
if ((((double) (((double) (y * z)) - ((double) (t * z)))) <= 2.5078442216331947e+188)) {
VAR_3 = ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (t * z))))));
} else {
VAR_3 = ((double) (((double) (x / z)) / ((double) (((double) (y - t)) / 2.0))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.8 |
|---|---|
| Target | 2.1 |
| Herbie | 0.3 |
if (- (* y z) (* t z)) < -4.75121709163883817e241Initial program 14.0
Simplified14.0
rmApplied *-un-lft-identity14.0
Applied times-frac14.0
Applied *-un-lft-identity14.0
Applied times-frac0.2
Simplified0.2
rmApplied associate-*l/0.2
Simplified0.2
if -4.75121709163883817e241 < (- (* y z) (* t z)) < -3.60190838907854557e-204 or 3.05095781584335686e-289 < (- (* y z) (* t z)) < 2.5078442216331947e188Initial program 0.2
if -3.60190838907854557e-204 < (- (* y z) (* t z)) < 3.05095781584335686e-289 or 2.5078442216331947e188 < (- (* y z) (* t z)) Initial program 18.0
Simplified13.8
rmApplied *-un-lft-identity13.8
Applied times-frac13.8
Applied associate-/r*0.7
Simplified0.7
Final simplification0.3
herbie shell --seed 2020162
(FPCore (x y z t)
:name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
:precision binary64
: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.0450278273301259e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))
(/ (* x 2.0) (- (* y z) (* t z))))