\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \leq -5.539714192103757 \cdot 10^{+92}:\\
\;\;\;\;-x \cdot y\\
\mathbf{elif}\;z \leq -4.636365954139031 \cdot 10^{-158}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{elif}\;z \leq -2.403671892753973 \cdot 10^{-282}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{elif}\;z \leq 1.0018756625348413 \cdot 10^{+142}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.539714192103757e+92)
(- (* x y))
(if (<= z -4.636365954139031e-158)
(* x (* y (/ z (sqrt (- (* z z) (* t a))))))
(if (<= z -2.403671892753973e-282)
(/ (* z (* x y)) (sqrt (- (* z z) (* t a))))
(if (<= z 1.0018756625348413e+142)
(* x (* y (/ z (sqrt (- (* z z) (* t a))))))
(* x y))))))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 tmp;
if ((z <= -5.539714192103757e+92)) {
tmp = ((double) -(((double) (x * y))));
} else {
double tmp_1;
if ((z <= -4.636365954139031e-158)) {
tmp_1 = ((double) (x * ((double) (y * (z / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))))))));
} else {
double tmp_2;
if ((z <= -2.403671892753973e-282)) {
tmp_2 = (((double) (z * ((double) (x * y)))) / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))));
} else {
double tmp_3;
if ((z <= 1.0018756625348413e+142)) {
tmp_3 = ((double) (x * ((double) (y * (z / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))))))));
} else {
tmp_3 = ((double) (x * y));
}
tmp_2 = tmp_3;
}
tmp_1 = tmp_2;
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.5 |
|---|---|
| Target | 7.6 |
| Herbie | 6.5 |
if z < -5.5397141921037568e92Initial program 42.8
Taylor expanded around -inf 2.5
Simplified2.5
if -5.5397141921037568e92 < z < -4.636365954139031e-158 or -2.4036718927539731e-282 < z < 1.0018756625348413e142Initial program 10.3
rmApplied *-un-lft-identity_binary6410.3
Applied sqrt-prod_binary6410.3
Applied times-frac_binary648.4
Simplified8.4
rmApplied associate-*l*_binary647.9
if -4.636365954139031e-158 < z < -2.4036718927539731e-282Initial program 18.1
if 1.0018756625348413e142 < z Initial program 50.5
Taylor expanded around inf 1.6
Final simplification6.5
herbie shell --seed 2020205
(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)))))