\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \le -6.341587143310155927610127187698487770803 \cdot 10^{119}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;z \le 1.874715117526437905041862577558668025639 \cdot 10^{146}:\\
\;\;\;\;x \cdot \frac{y}{\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 r305290 = x;
double r305291 = y;
double r305292 = r305290 * r305291;
double r305293 = z;
double r305294 = r305292 * r305293;
double r305295 = r305293 * r305293;
double r305296 = t;
double r305297 = a;
double r305298 = r305296 * r305297;
double r305299 = r305295 - r305298;
double r305300 = sqrt(r305299);
double r305301 = r305294 / r305300;
return r305301;
}
double f(double x, double y, double z, double t, double a) {
double r305302 = z;
double r305303 = -6.341587143310156e+119;
bool r305304 = r305302 <= r305303;
double r305305 = -1.0;
double r305306 = x;
double r305307 = y;
double r305308 = r305306 * r305307;
double r305309 = r305305 * r305308;
double r305310 = 1.874715117526438e+146;
bool r305311 = r305302 <= r305310;
double r305312 = r305302 * r305302;
double r305313 = t;
double r305314 = a;
double r305315 = r305313 * r305314;
double r305316 = r305312 - r305315;
double r305317 = sqrt(r305316);
double r305318 = r305317 / r305302;
double r305319 = r305307 / r305318;
double r305320 = r305306 * r305319;
double r305321 = r305311 ? r305320 : r305308;
double r305322 = r305304 ? r305309 : r305321;
return r305322;
}




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.7 |
| Herbie | 6.1 |
if z < -6.341587143310156e+119Initial program 47.4
rmApplied associate-/l*46.0
rmApplied *-un-lft-identity46.0
Applied *-un-lft-identity46.0
Applied sqrt-prod46.0
Applied times-frac46.0
Applied times-frac46.0
Simplified46.0
rmApplied associate-*r/46.0
Taylor expanded around -inf 1.8
if -6.341587143310156e+119 < z < 1.874715117526438e+146Initial program 11.1
rmApplied associate-/l*8.9
rmApplied *-un-lft-identity8.9
Applied *-un-lft-identity8.9
Applied sqrt-prod8.9
Applied times-frac8.9
Applied times-frac8.5
Simplified8.5
if 1.874715117526438e+146 < z Initial program 52.8
Taylor expanded around inf 1.7
Final simplification6.1
herbie shell --seed 2019353 +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)))))