\frac{x \cdot 2}{y \cdot z - t \cdot z}\begin{array}{l}
\mathbf{if}\;x \le -4.0866792333001667 \cdot 10^{24}:\\
\;\;\;\;\frac{1}{z} \cdot \frac{x}{\frac{y - t}{2}}\\
\mathbf{elif}\;x \le 4.59220674827240897 \cdot 10^{108}:\\
\;\;\;\;x \cdot \frac{\frac{2}{y - t}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{x}}{z} \cdot \frac{\sqrt{x}}{\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 ((x <= -4.0866792333001667e+24)) {
VAR = ((double) (((double) (1.0 / z)) * ((double) (x / ((double) (((double) (y - t)) / 2.0))))));
} else {
double VAR_1;
if ((x <= 4.592206748272409e+108)) {
VAR_1 = ((double) (x * ((double) (((double) (2.0 / ((double) (y - t)))) / z))));
} else {
VAR_1 = ((double) (((double) (((double) sqrt(x)) / z)) * ((double) (((double) sqrt(x)) / ((double) (((double) (y - t)) / 2.0))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 7.1 |
|---|---|
| Target | 2.1 |
| Herbie | 3.0 |
if x < -4.0866792333001667e+24Initial program 12.5
Simplified11.8
rmApplied *-un-lft-identity11.8
Applied times-frac11.7
Applied *-un-lft-identity11.7
Applied times-frac3.0
Simplified3.0
if -4.0866792333001667e+24 < x < 4.592206748272409e+108Initial program 3.7
Simplified2.3
rmApplied div-inv2.6
Simplified2.5
if 4.592206748272409e+108 < x Initial program 15.0
Simplified14.2
rmApplied *-un-lft-identity14.2
Applied times-frac14.2
Applied add-sqr-sqrt14.4
Applied times-frac5.8
Simplified5.8
Final simplification3.0
herbie shell --seed 2020129
(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))))