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 <= -4.3510246037590785e+67) || !(y <= 2.434587238763775e-17))) {
VAR = ((double) (((double) (((double) (x / y)) + -1.0)) / ((double) (x * 2.0))));
} else {
VAR = ((double) (1.0 / ((double) (y * ((double) (x / ((double) (((double) (x - y)) / 2.0))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.5 |
|---|---|
| Target | 0.0 |
| Herbie | 0.2 |
if y < -4.351024603759079e67 or 2.43458723876377507e-17 < y Initial program 16.9
rmApplied *-un-lft-identity16.9
Applied times-frac0.1
Simplified0.1
rmApplied associate-*l/0.1
Simplified0.1
if -4.351024603759079e67 < y < 2.43458723876377507e-17Initial program 14.3
rmApplied clear-num14.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020192
(FPCore (x y)
:name "Linear.Projection:inversePerspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(- (/ 0.5 y) (/ 0.5 x))
(/ (- x y) (* (* x 2.0) y)))