\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -2.46601267578198948 \cdot 10^{117}:\\
\;\;\;\;x \cdot \left(-1 \cdot y\right)\\
\mathbf{elif}\;z \le 1.153415909331297 \cdot 10^{100}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot 1\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (((x * y) * z) / sqrt(((z * z) - (t * a))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((z <= -2.4660126757819895e+117)) {
VAR = (x * (-1.0 * y));
} else {
double VAR_1;
if ((z <= 1.1534159093312974e+100)) {
VAR_1 = (((x * y) / sqrt(sqrt(((z * z) - (t * a))))) * (z / sqrt(sqrt(((z * z) - (t * a))))));
} else {
VAR_1 = ((x * y) * 1.0);
}
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 | 24.2 |
|---|---|
| Target | 7.5 |
| Herbie | 6.7 |
if z < -2.4660126757819895e+117Initial program 46.3
rmApplied *-un-lft-identity46.3
Applied sqrt-prod46.3
Applied times-frac44.3
Simplified44.3
rmApplied associate-*l*44.3
Taylor expanded around -inf 2.2
if -2.4660126757819895e+117 < z < 1.1534159093312974e+100Initial program 10.7
rmApplied add-sqr-sqrt10.7
Applied sqrt-prod10.9
Applied times-frac9.7
if 1.1534159093312974e+100 < z Initial program 42.5
rmApplied *-un-lft-identity42.5
Applied sqrt-prod42.5
Applied times-frac40.6
Simplified40.6
Taylor expanded around inf 2.0
Final simplification6.7
herbie shell --seed 2020078 +o rules:numerics
(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)))))