\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\frac{1 - x}{y} \cdot \left(1 - 0.333333333333333315 \cdot x\right)double code(double x, double y) {
return (((1.0 - x) * (3.0 - x)) / (y * 3.0));
}
double code(double x, double y) {
return (((1.0 - x) / y) * (1.0 - (0.3333333333333333 * x)));
}




Bits error versus x




Bits error versus y
Results
| Original | 5.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 5.7
rmApplied times-frac0.1
Taylor expanded around 0 0.2
Final simplification0.2
herbie shell --seed 2020103 +o rules:numerics
(FPCore (x y)
:name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(* (/ (- 1 x) y) (/ (- 3 x) 3))
(/ (* (- 1 x) (- 3 x)) (* y 3)))