\frac{\left(x \cdot 2\right) \cdot y}{x - y}\frac{{0.5}^{-0.5}}{\frac{\sqrt{0.5}}{y} - \frac{\sqrt{0.5}}{x}}(FPCore (x y) :precision binary64 (/ (* (* x 2.0) y) (- x y)))
(FPCore (x y) :precision binary64 (/ (pow 0.5 -0.5) (- (/ (sqrt 0.5) y) (/ (sqrt 0.5) x))))
double code(double x, double y) {
return ((x * 2.0) * y) / (x - y);
}
double code(double x, double y) {
return pow(0.5, -0.5) / ((sqrt(0.5) / y) - (sqrt(0.5) / x));
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.1 |
Initial program 14.7
rmApplied clear-num_binary6414.8
Simplified0.2
rmApplied *-un-lft-identity_binary640.2
Applied add-sqr-sqrt_binary640.7
Applied times-frac_binary640.5
Applied *-un-lft-identity_binary640.5
Applied add-sqr-sqrt_binary641.1
Applied times-frac_binary640.9
Applied distribute-lft-out--_binary640.9
Applied add-sqr-sqrt_binary640.9
Applied times-frac_binary641.0
Simplified1.0
Simplified1.0
rmApplied pow1/2_binary641.0
Applied pow-flip_binary640.3
Simplified0.3
rmApplied *-un-lft-identity_binary640.3
Applied associate-*l*_binary640.3
Simplified0.1
Final simplification0.1
herbie shell --seed 2021128
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))