\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -5.199714169449318426725790466332778930458 \cdot 10^{116}:\\
\;\;\;\;-x \cdot y\\
\mathbf{elif}\;z \le 2.818827562843424905673562246640834606804 \cdot 10^{156}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r187600 = x;
double r187601 = y;
double r187602 = r187600 * r187601;
double r187603 = z;
double r187604 = r187602 * r187603;
double r187605 = r187603 * r187603;
double r187606 = t;
double r187607 = a;
double r187608 = r187606 * r187607;
double r187609 = r187605 - r187608;
double r187610 = sqrt(r187609);
double r187611 = r187604 / r187610;
return r187611;
}
double f(double x, double y, double z, double t, double a) {
double r187612 = z;
double r187613 = -5.1997141694493184e+116;
bool r187614 = r187612 <= r187613;
double r187615 = x;
double r187616 = y;
double r187617 = r187615 * r187616;
double r187618 = -r187617;
double r187619 = 2.818827562843425e+156;
bool r187620 = r187612 <= r187619;
double r187621 = r187612 * r187612;
double r187622 = t;
double r187623 = a;
double r187624 = r187622 * r187623;
double r187625 = r187621 - r187624;
double r187626 = sqrt(r187625);
double r187627 = r187612 / r187626;
double r187628 = r187616 * r187627;
double r187629 = r187615 * r187628;
double r187630 = r187620 ? r187629 : r187617;
double r187631 = r187614 ? r187618 : r187630;
return r187631;
}




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.5 |
| Herbie | 6.0 |
if z < -5.1997141694493184e+116Initial program 47.7
rmApplied *-un-lft-identity47.7
Applied sqrt-prod47.7
Applied times-frac45.7
Simplified45.7
Taylor expanded around -inf 1.7
if -5.1997141694493184e+116 < z < 2.818827562843425e+156Initial program 10.9
rmApplied *-un-lft-identity10.9
Applied sqrt-prod10.9
Applied times-frac8.7
Simplified8.7
rmApplied associate-*l*8.4
if 2.818827562843425e+156 < z Initial program 54.8
Taylor expanded around inf 1.3
Final simplification6.0
herbie shell --seed 2019322
(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)))))