double code(double x, double y) {
return ((double) (((double) (x + y)) / ((double) (((double) (x * 2.0)) * y))));
}
double code(double x, double y) {
double VAR;
if (((y <= -1.667320367462466e+26) || !(y <= 2.291406381019822e+37))) {
VAR = ((double) (((double) (((double) (y + x)) / y)) / ((double) (x * 2.0))));
} else {
VAR = ((double) (1.0 / ((double) (y * ((double) (x / ((double) (((double) (y + x)) / 2.0))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.5 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
if y < -1.66732036746246606e26 or 2.29140638101982187e37 < y Initial program 17.1
rmApplied *-un-lft-identity17.1
Applied times-frac0.1
rmApplied associate-*l/0.1
Simplified0.1
if -1.66732036746246606e26 < y < 2.29140638101982187e37Initial program 14.2
rmApplied clear-num14.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020190
(FPCore (x y)
:name "Linear.Projection:inversePerspective from linear-1.19.1.3, C"
:precision binary64
:herbie-target
(+ (/ 0.5 x) (/ 0.5 y))
(/ (+ x y) (* (* x 2.0) y)))