x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;\frac{y}{z} - \frac{t}{1 - z} \le -1.044749646739892 \cdot 10^{229}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le -1.81094046641606889 \cdot 10^{-275}:\\
\;\;\;\;\frac{x}{\frac{z}{y - \frac{z}{\frac{1 - z}{t}}}}\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 4.67726574765448314 \cdot 10^{-292}:\\
\;\;\;\;\frac{\left(y \cdot \left(1 - z\right) - z \cdot t\right) \cdot \frac{x}{z}}{1 - z}\\
\mathbf{elif}\;\frac{y}{z} - \frac{t}{1 - z} \le 1.8997455834822073 \cdot 10^{244}:\\
\;\;\;\;\frac{x}{\frac{z}{y - \frac{z}{\frac{1 - z}{t}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y \cdot \left(1 - z\right) - z \cdot t\right)}{z \cdot \left(1 - z\right)}\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (x * ((double) ((y / z) - (t / ((double) (1.0 - z)))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= -1.044749646739892e+229)) {
VAR = (((double) (x * ((double) (((double) (y * ((double) (1.0 - z)))) - ((double) (z * t)))))) / ((double) (z * ((double) (1.0 - z)))));
} else {
double VAR_1;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= -1.810940466416069e-275)) {
VAR_1 = (x / (z / ((double) (y - (z / (((double) (1.0 - z)) / t))))));
} else {
double VAR_2;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= 4.677265747654483e-292)) {
VAR_2 = (((double) (((double) (((double) (y * ((double) (1.0 - z)))) - ((double) (z * t)))) * (x / z))) / ((double) (1.0 - z)));
} else {
double VAR_3;
if ((((double) ((y / z) - (t / ((double) (1.0 - z))))) <= 1.8997455834822073e+244)) {
VAR_3 = (x / (z / ((double) (y - (z / (((double) (1.0 - z)) / t))))));
} else {
VAR_3 = (((double) (x * ((double) (((double) (y * ((double) (1.0 - z)))) - ((double) (z * t)))))) / ((double) (z * ((double) (1.0 - z)))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.9 |
|---|---|
| Target | 4.5 |
| Herbie | 0.6 |
if (- (/ y z) (/ t (- 1.0 z))) < -1.044749646739892e229 or 1.8997455834822073e244 < (- (/ y z) (/ t (- 1.0 z))) Initial program 26.8
rmApplied frac-sub28.7
Applied associate-*r/2.4
if -1.044749646739892e229 < (- (/ y z) (/ t (- 1.0 z))) < -1.81094046641606889e-275 or 4.67726574765448314e-292 < (- (/ y z) (/ t (- 1.0 z))) < 1.8997455834822073e244Initial program 0.2
rmApplied frac-sub23.3
Applied associate-*r/28.4
rmApplied associate-/l*23.3
Simplified0.3
if -1.81094046641606889e-275 < (- (/ y z) (/ t (- 1.0 z))) < 4.67726574765448314e-292Initial program 17.2
rmApplied frac-sub22.8
Applied associate-*r/20.2
rmApplied associate-/r*10.9
Simplified0.5
Final simplification0.6
herbie shell --seed 2020182
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (neg (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))