double code(double x, double y) {
return ((double) (((double) (((double) (1.0 - x)) * ((double) (3.0 - x)))) / ((double) (y * 3.0))));
}
double code(double x, double y) {
return ((double) (((double) (1.0 - x)) * ((double) (((double) (1.0 - ((double) (x / 3.0)))) / y))));
}




Bits error versus x




Bits error versus y
Results
| Original | 5.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 5.6
Simplified0.4
rmApplied associate-/r*0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020191
(FPCore (x y)
:name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(* (/ (- 1.0 x) y) (/ (- 3.0 x) 3.0))
(/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))