\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -3.603369414995160960353922152048984349949 \cdot 10^{90}:\\
\;\;\;\;-x \cdot y\\
\mathbf{elif}\;z \le 1.292716185531284079912157099666096901234 \cdot 10^{-12}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\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 r177076 = x;
double r177077 = y;
double r177078 = r177076 * r177077;
double r177079 = z;
double r177080 = r177078 * r177079;
double r177081 = r177079 * r177079;
double r177082 = t;
double r177083 = a;
double r177084 = r177082 * r177083;
double r177085 = r177081 - r177084;
double r177086 = sqrt(r177085);
double r177087 = r177080 / r177086;
return r177087;
}
double f(double x, double y, double z, double t, double a) {
double r177088 = z;
double r177089 = -3.603369414995161e+90;
bool r177090 = r177088 <= r177089;
double r177091 = x;
double r177092 = y;
double r177093 = r177091 * r177092;
double r177094 = -r177093;
double r177095 = 1.292716185531284e-12;
bool r177096 = r177088 <= r177095;
double r177097 = r177088 * r177092;
double r177098 = r177091 * r177097;
double r177099 = r177088 * r177088;
double r177100 = t;
double r177101 = a;
double r177102 = r177100 * r177101;
double r177103 = r177099 - r177102;
double r177104 = sqrt(r177103);
double r177105 = r177098 / r177104;
double r177106 = r177096 ? r177105 : r177093;
double r177107 = r177090 ? r177094 : r177106;
return r177107;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.6 |
|---|---|
| Target | 7.3 |
| Herbie | 7.9 |
if z < -3.603369414995161e+90Initial program 42.5
rmApplied *-un-lft-identity42.5
Applied sqrt-prod42.5
Applied associate-/r*42.5
Simplified43.8
Taylor expanded around -inf 2.5
Simplified2.5
if -3.603369414995161e+90 < z < 1.292716185531284e-12Initial program 11.4
rmApplied *-un-lft-identity11.4
Applied sqrt-prod11.4
Applied associate-/r*11.4
Simplified12.0
if 1.292716185531284e-12 < z Initial program 31.8
rmApplied *-un-lft-identity31.8
Applied sqrt-prod31.8
Applied associate-/r*31.8
Simplified34.0
Taylor expanded around inf 5.6
Final simplification7.9
herbie shell --seed 2019305 +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)))))