\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\frac{3 - x}{3} \cdot \left(\frac{1}{y} - \frac{x}{y}\right)(FPCore (x y) :precision binary64 (/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))
(FPCore (x y) :precision binary64 (* (/ (- 3.0 x) 3.0) (- (/ 1.0 y) (/ x y))))
double code(double x, double y) {
return ((1.0 - x) * (3.0 - x)) / (y * 3.0);
}
double code(double x, double y) {
return ((3.0 - x) / 3.0) * ((1.0 / y) - (x / y));
}







Bits error versus x







Bits error versus y
Results
| Original | 5.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
| Alternative 1 | |
|---|---|
| Accuracy | 0.6 |
| Cost | 1728 |
| Alternative 2 | |
|---|---|
| Accuracy | 1.3 |
| Cost | 1344 |
| Alternative 3 | |
|---|---|
| Accuracy | 58.7 |
| Cost | 1408 |
Initial program 5.4
rmApplied times-frac_binary64_171340.1
rmApplied frac-2neg_binary64_171390.1
Simplified0.1
rmApplied *-un-lft-identity_binary64_171280.1
Applied distribute-lft-neg-in_binary64_170850.1
Applied *-un-lft-identity_binary64_171280.1
Applied times-frac_binary64_171340.1
Applied associate-*l*_binary64_170690.1
Simplified0.1
Taylor expanded around 0 0.1
Final simplification0.1
herbie shell --seed 2020322
(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)))