\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -1.783459363067827924540279194552192802352 \cdot 10^{138}:\\
\;\;\;\;\left(x \cdot y\right) \cdot -1\\
\mathbf{elif}\;z \le 4.762366900384719143369985213022816341136 \cdot 10^{70}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r238976 = x;
double r238977 = y;
double r238978 = r238976 * r238977;
double r238979 = z;
double r238980 = r238978 * r238979;
double r238981 = r238979 * r238979;
double r238982 = t;
double r238983 = a;
double r238984 = r238982 * r238983;
double r238985 = r238981 - r238984;
double r238986 = sqrt(r238985);
double r238987 = r238980 / r238986;
return r238987;
}
double f(double x, double y, double z, double t, double a) {
double r238988 = z;
double r238989 = -1.783459363067828e+138;
bool r238990 = r238988 <= r238989;
double r238991 = x;
double r238992 = y;
double r238993 = r238991 * r238992;
double r238994 = -1.0;
double r238995 = r238993 * r238994;
double r238996 = 4.762366900384719e+70;
bool r238997 = r238988 <= r238996;
double r238998 = r238988 * r238988;
double r238999 = t;
double r239000 = a;
double r239001 = r238999 * r239000;
double r239002 = r238998 - r239001;
double r239003 = sqrt(r239002);
double r239004 = r238988 / r239003;
double r239005 = r238993 * r239004;
double r239006 = r238997 ? r239005 : r238993;
double r239007 = r238990 ? r238995 : r239006;
return r239007;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.8 |
|---|---|
| Target | 7.5 |
| Herbie | 6.2 |
if z < -1.783459363067828e+138Initial program 49.6
rmApplied *-un-lft-identity49.6
Applied sqrt-prod49.6
Applied times-frac48.6
Simplified48.6
Taylor expanded around -inf 1.7
if -1.783459363067828e+138 < z < 4.762366900384719e+70Initial program 10.6
rmApplied *-un-lft-identity10.6
Applied sqrt-prod10.6
Applied times-frac9.0
Simplified9.0
if 4.762366900384719e+70 < z Initial program 40.6
rmApplied *-un-lft-identity40.6
Applied sqrt-prod40.6
Applied times-frac37.8
Simplified37.8
rmApplied div-inv37.8
Taylor expanded around inf 2.9
Final simplification6.2
herbie shell --seed 2020002 +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)))))