\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -1.01532130093420398 \cdot 10^{154}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \le 6.4447789061204586 \cdot 10^{97}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{1}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r260638 = x;
double r260639 = y;
double r260640 = r260638 * r260639;
double r260641 = z;
double r260642 = r260640 * r260641;
double r260643 = r260641 * r260641;
double r260644 = t;
double r260645 = a;
double r260646 = r260644 * r260645;
double r260647 = r260643 - r260646;
double r260648 = sqrt(r260647);
double r260649 = r260642 / r260648;
return r260649;
}
double f(double x, double y, double z, double t, double a) {
double r260650 = z;
double r260651 = -1.015321300934204e+154;
bool r260652 = r260650 <= r260651;
double r260653 = x;
double r260654 = y;
double r260655 = -r260654;
double r260656 = r260653 * r260655;
double r260657 = 6.4447789061204586e+97;
bool r260658 = r260650 <= r260657;
double r260659 = 1.0;
double r260660 = r260650 * r260650;
double r260661 = t;
double r260662 = a;
double r260663 = r260661 * r260662;
double r260664 = r260660 - r260663;
double r260665 = sqrt(r260664);
double r260666 = r260665 / r260650;
double r260667 = r260659 / r260666;
double r260668 = r260654 * r260667;
double r260669 = r260653 * r260668;
double r260670 = r260654 * r260653;
double r260671 = r260658 ? r260669 : r260670;
double r260672 = r260652 ? r260656 : r260671;
return r260672;
}




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.9 |
| Herbie | 6.4 |
if z < -1.015321300934204e+154Initial program 54.3
rmApplied associate-/l*53.9
rmApplied *-un-lft-identity53.9
Applied *-un-lft-identity53.9
Applied sqrt-prod53.9
Applied times-frac53.9
Applied times-frac53.9
Simplified53.9
Taylor expanded around -inf 1.3
Simplified1.3
if -1.015321300934204e+154 < z < 6.4447789061204586e+97Initial program 11.7
rmApplied associate-/l*9.8
rmApplied *-un-lft-identity9.8
Applied *-un-lft-identity9.8
Applied sqrt-prod9.8
Applied times-frac9.8
Applied times-frac9.3
Simplified9.3
rmApplied div-inv9.3
if 6.4447789061204586e+97 < z Initial program 43.3
Taylor expanded around inf 2.0
Simplified2.0
Final simplification6.4
herbie shell --seed 2019199 +o rules:numerics
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
: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)))))