\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \leq -7.285238985507498 \cdot 10^{+137}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}{z}}\\
\mathbf{elif}\;z \leq 1.5076725501489753 \cdot 10^{+41}:\\
\;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{z + \left(\frac{a}{z} \cdot t\right) \cdot -0.5}\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (((double) (((double) (x * y)) * z)) / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((z <= -7.285238985507498e+137)) {
VAR = (((double) (x * y)) / (((double) (((double) (0.5 * ((double) ((a / z) * t)))) - z)) / z));
} else {
double VAR_1;
if ((z <= 1.5076725501489753e+41)) {
VAR_1 = (((double) (x * y)) / (((double) sqrt(((double) (((double) (z * z)) - ((double) (a * t)))))) / z));
} else {
VAR_1 = ((double) (x * ((double) (y * (z / ((double) (z + ((double) (((double) ((a / z) * t)) * -0.5)))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 25.2 |
|---|---|
| Target | 7.5 |
| Herbie | 6.8 |
if z < -7.28523898550749776e137Initial program Error: 49.7 bits
SimplifiedError: 48.6 bits
rmApplied associate-*r*Error: 48.6 bits
rmApplied clear-numError: 48.6 bits
rmApplied un-div-invError: 48.6 bits
Taylor expanded around -inf Error: 5.0 bits
SimplifiedError: 1.6 bits
if -7.28523898550749776e137 < z < 1.5076725501489753e41Initial program Error: 11.3 bits
SimplifiedError: 10.0 bits
rmApplied associate-*r*Error: 9.9 bits
rmApplied clear-numError: 10.1 bits
rmApplied un-div-invError: 10.1 bits
if 1.5076725501489753e41 < z Initial program Error: 37.2 bits
SimplifiedError: 34.7 bits
Taylor expanded around inf Error: 6.3 bits
SimplifiedError: 3.4 bits
Final simplificationError: 6.8 bits
herbie shell --seed 2020200
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))