\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -3.07723386361766317 \cdot 10^{167}:\\
\;\;\;\;x \cdot \left(-1 \cdot y\right)\\
\mathbf{elif}\;z \le -1.4763620082139605 \cdot 10^{-232}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{\frac{1}{\sqrt{z \cdot z - t \cdot a}}}{\frac{1}{z}}\\
\mathbf{elif}\;z \le 1.1968985287902123 \cdot 10^{-192}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot z\right)}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{elif}\;z \le 1.39325280236721814 \cdot 10^{110}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r291026 = x;
double r291027 = y;
double r291028 = r291026 * r291027;
double r291029 = z;
double r291030 = r291028 * r291029;
double r291031 = r291029 * r291029;
double r291032 = t;
double r291033 = a;
double r291034 = r291032 * r291033;
double r291035 = r291031 - r291034;
double r291036 = sqrt(r291035);
double r291037 = r291030 / r291036;
return r291037;
}
double f(double x, double y, double z, double t, double a) {
double r291038 = z;
double r291039 = -3.077233863617663e+167;
bool r291040 = r291038 <= r291039;
double r291041 = x;
double r291042 = -1.0;
double r291043 = y;
double r291044 = r291042 * r291043;
double r291045 = r291041 * r291044;
double r291046 = -1.4763620082139605e-232;
bool r291047 = r291038 <= r291046;
double r291048 = r291041 * r291043;
double r291049 = 1.0;
double r291050 = r291038 * r291038;
double r291051 = t;
double r291052 = a;
double r291053 = r291051 * r291052;
double r291054 = r291050 - r291053;
double r291055 = sqrt(r291054);
double r291056 = r291049 / r291055;
double r291057 = r291049 / r291038;
double r291058 = r291056 / r291057;
double r291059 = r291048 * r291058;
double r291060 = 1.1968985287902123e-192;
bool r291061 = r291038 <= r291060;
double r291062 = r291043 * r291038;
double r291063 = r291041 * r291062;
double r291064 = r291063 / r291055;
double r291065 = 1.3932528023672181e+110;
bool r291066 = r291038 <= r291065;
double r291067 = r291055 / r291038;
double r291068 = r291049 / r291067;
double r291069 = r291048 * r291068;
double r291070 = r291066 ? r291069 : r291048;
double r291071 = r291061 ? r291064 : r291070;
double r291072 = r291047 ? r291059 : r291071;
double r291073 = r291040 ? r291045 : r291072;
return r291073;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.9 |
|---|---|
| Target | 7.6 |
| Herbie | 6.9 |
if z < -3.077233863617663e+167Initial program 53.5
rmApplied *-un-lft-identity53.5
Applied sqrt-prod53.5
Applied times-frac53.1
Simplified53.1
rmApplied associate-*l*53.1
Taylor expanded around -inf 1.1
if -3.077233863617663e+167 < z < -1.4763620082139605e-232Initial program 12.9
rmApplied *-un-lft-identity12.9
Applied sqrt-prod12.9
Applied times-frac9.3
Simplified9.3
rmApplied clear-num9.3
rmApplied div-inv9.4
Applied associate-/r*9.3
if -1.4763620082139605e-232 < z < 1.1968985287902123e-192Initial program 18.6
rmApplied associate-*l*17.9
if 1.1968985287902123e-192 < z < 1.3932528023672181e+110Initial program 8.8
rmApplied *-un-lft-identity8.8
Applied sqrt-prod8.8
Applied times-frac6.2
Simplified6.2
rmApplied clear-num6.2
if 1.3932528023672181e+110 < z Initial program 44.8
rmApplied *-un-lft-identity44.8
Applied sqrt-prod44.8
Applied times-frac43.0
Simplified43.0
rmApplied clear-num43.0
Taylor expanded around inf 1.9
Final simplification6.9
herbie shell --seed 2020064 +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)))))