\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -3.642853120035631608470979075188817806619 \cdot 10^{155}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z \le 8.145165494197675224530244364370982483974 \cdot 10^{96}:\\
\;\;\;\;x \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}double f(double x, double y, double z, double t, double a) {
double r188718 = x;
double r188719 = y;
double r188720 = r188718 * r188719;
double r188721 = z;
double r188722 = r188720 * r188721;
double r188723 = r188721 * r188721;
double r188724 = t;
double r188725 = a;
double r188726 = r188724 * r188725;
double r188727 = r188723 - r188726;
double r188728 = sqrt(r188727);
double r188729 = r188722 / r188728;
return r188729;
}
double f(double x, double y, double z, double t, double a) {
double r188730 = z;
double r188731 = -3.6428531200356316e+155;
bool r188732 = r188730 <= r188731;
double r188733 = y;
double r188734 = x;
double r188735 = r188733 * r188734;
double r188736 = -r188735;
double r188737 = 8.145165494197675e+96;
bool r188738 = r188730 <= r188737;
double r188739 = r188730 * r188730;
double r188740 = t;
double r188741 = a;
double r188742 = r188740 * r188741;
double r188743 = r188739 - r188742;
double r188744 = sqrt(r188743);
double r188745 = r188744 / r188730;
double r188746 = r188733 / r188745;
double r188747 = r188734 * r188746;
double r188748 = r188738 ? r188747 : r188735;
double r188749 = r188732 ? r188736 : r188748;
return r188749;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.2 |
|---|---|
| Target | 8.1 |
| Herbie | 6.5 |
if z < -3.6428531200356316e+155Initial program 53.8
Taylor expanded around -inf 1.3
Simplified1.3
if -3.6428531200356316e+155 < z < 8.145165494197675e+96Initial program 11.1
rmApplied associate-/l*9.5
rmApplied *-un-lft-identity9.5
Applied *-un-lft-identity9.5
Applied sqrt-prod9.5
Applied times-frac9.5
Applied times-frac9.0
Simplified9.0
if 8.145165494197675e+96 < z Initial program 42.6
Taylor expanded around inf 2.7
Simplified2.7
Final simplification6.5
herbie shell --seed 2019209 +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.1921305903852764e46) (- (* y x)) (if (< z 5.9762681209208942e90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))