double code(double x, double y, double z, double t) {
return ((double) (x * ((double) (((double) (y / z)) - ((double) (t / ((double) (1.0 - z))))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((z <= -4.146166835886616e-148) || !(z <= 1.530035490509503e-182))) {
VAR = ((double) (((double) (x * ((double) (y / z)))) + ((double) (x / ((double) (((double) (z / t)) - ((double) (1.0 / t))))))));
} else {
VAR = ((double) (((double) (x * ((double) (((double) (y * ((double) (1.0 - z)))) - ((double) (z * t)))))) / ((double) (z * ((double) (1.0 - z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.5 |
|---|---|
| Target | 4.1 |
| Herbie | 4.0 |
if z < -4.1461668358866157e-148 or 1.5300354905095031e-182 < z Initial program 2.9
rmApplied clear-num3.0
rmApplied div-sub3.0
rmApplied sub-neg3.0
Applied distribute-lft-in3.0
Simplified3.0
if -4.1461668358866157e-148 < z < 1.5300354905095031e-182Initial program 12.9
rmApplied frac-sub12.9
Applied associate-*r/8.9
Final simplification4.0
herbie shell --seed 2020191
(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)))))