\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -1.6523033549097704 \cdot 10^{92}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;z \le 6.97183686719479099 \cdot 10^{152}:\\
\;\;\;\;\frac{\frac{\left(x \cdot y\right) \cdot z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (((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 <= -1.6523033549097704e+92)) {
VAR = ((double) (-1.0 * ((double) (x * y))));
} else {
double VAR_1;
if ((z <= 6.971836867194791e+152)) {
VAR_1 = ((double) (((double) (((double) (((double) (x * y)) * z)) / ((double) sqrt(((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))))))) / ((double) sqrt(((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a))))))))));
} else {
VAR_1 = ((double) (x * y));
}
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.3 |
|---|---|
| Target | 7.7 |
| Herbie | 7.8 |
if z < -1.6523033549097704e92Initial program 42.8
Taylor expanded around -inf 2.5
if -1.6523033549097704e92 < z < 6.97183686719479099e152Initial program 11.2
rmApplied add-sqr-sqrt11.2
Applied sqrt-prod11.3
Applied associate-/r*11.3
if 6.97183686719479099e152 < z Initial program 54.4
Taylor expanded around inf 1.6
Final simplification7.8
herbie shell --seed 2020150
(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) (neg (* 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)))))