\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -5.192230488731093 \cdot 10^{36}:\\
\;\;\;\;y \cdot \left(-1 \cdot x\right)\\
\mathbf{elif}\;z \le 2.3156939502955866 \cdot 10^{75}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot z\right)}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{\mathsf{fma}\left(\frac{-1}{2} \cdot \frac{a}{z}, t, z\right)}\right)\\
\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 <= -5.192230488731093e+36)) {
VAR = (y * (-1.0 * x));
} else {
double VAR_1;
if ((z <= 2.3156939502955866e+75)) {
VAR_1 = ((x * (y * z)) / sqrt(((z * z) - (t * a))));
} else {
VAR_1 = (y * (x * (z / fma((-0.5 * (a / z)), t, z))));
}
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.1 |
|---|---|
| Target | 7.9 |
| Herbie | 7.7 |
if z < -5.192230488731093e+36Initial program 36.2
rmApplied associate-/l*34.0
rmApplied *-commutative34.0
Applied associate-/l*34.0
rmApplied clear-num34.0
Applied associate-/l/34.0
Applied associate-/r/33.9
Simplified33.9
Taylor expanded around -inf 4.1
if -5.192230488731093e+36 < z < 2.3156939502955866e+75Initial program 11.9
rmApplied associate-*l*12.0
if 2.3156939502955866e+75 < z Initial program 40.6
rmApplied associate-/l*38.1
rmApplied *-commutative38.1
Applied associate-/l*38.1
rmApplied clear-num38.1
Applied associate-/l/38.1
Applied associate-/r/38.1
Simplified38.1
Taylor expanded around inf 5.7
Simplified2.5
Final simplification7.7
herbie shell --seed 2020071 +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)))))