\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;y \cdot z - z \cdot t \le -7.26168499596656202 \cdot 10^{163}:\\
\;\;\;\;\frac{\frac{x \cdot 2}{y - t}}{z}\\
\mathbf{elif}\;y \cdot z - z \cdot t \le -1.10808632511487916 \cdot 10^{-99}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - z \cdot t}\\
\mathbf{elif}\;y \cdot z - z \cdot t \le 2.2261687342694704 \cdot 10^{-174}:\\
\;\;\;\;\frac{\frac{x \cdot 2}{y - t}}{z}\\
\mathbf{elif}\;y \cdot z - z \cdot t \le 5.3233307638701136 \cdot 10^{293}:\\
\;\;\;\;\frac{x \cdot 2}{y \cdot z - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \frac{2}{y - t}\right) \cdot \frac{1}{z}\\
\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) (z * t)))) <= -7.261684995966562e+163)) {
VAR = ((double) (((double) (((double) (x * 2.0)) / ((double) (y - t)))) / z));
} else {
double VAR_1;
if ((((double) (((double) (y * z)) - ((double) (z * t)))) <= -1.1080863251148792e-99)) {
VAR_1 = ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (z * t))))));
} else {
double VAR_2;
if ((((double) (((double) (y * z)) - ((double) (z * t)))) <= 2.2261687342694704e-174)) {
VAR_2 = ((double) (((double) (((double) (x * 2.0)) / ((double) (y - t)))) / z));
} else {
double VAR_3;
if ((((double) (((double) (y * z)) - ((double) (z * t)))) <= 5.3233307638701136e+293)) {
VAR_3 = ((double) (((double) (x * 2.0)) / ((double) (((double) (y * z)) - ((double) (z * t))))));
} else {
VAR_3 = ((double) (((double) (x * ((double) (2.0 / ((double) (y - t)))))) * ((double) (1.0 / z))));
}
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 | 7.0 |
|---|---|
| Target | 2.1 |
| Herbie | 0.7 |
if (- (* y z) (* t z)) < -7.26168499596656202e163 or -1.10808632511487916e-99 < (- (* y z) (* t z)) < 2.2261687342694704e-174Initial program 10.0
Simplified10.5
rmApplied *-un-lft-identity10.5
Applied times-frac9.8
Applied associate-*r*1.7
Simplified1.7
rmApplied associate-*l/1.8
rmApplied associate-*r/1.8
if -7.26168499596656202e163 < (- (* y z) (* t z)) < -1.10808632511487916e-99 or 2.2261687342694704e-174 < (- (* y z) (* t z)) < 5.3233307638701136e293Initial program 0.3
if 5.3233307638701136e293 < (- (* y z) (* t z)) Initial program 26.4
Simplified18.0
rmApplied *-un-lft-identity18.0
Applied times-frac16.6
Applied associate-*r*0.1
Simplified0.1
rmApplied associate-*l/0.1
rmApplied div-inv0.1
Final simplification0.7
herbie shell --seed 2020184
(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))))