\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\mathsf{fma}\left(0.3333333333333333148296162562473909929395, \frac{x}{\frac{y}{x}}, \frac{1}{y}\right) - 1.333333333333333259318465024989563971758 \cdot \frac{x}{y}double f(double x, double y) {
double r31570416 = 1.0;
double r31570417 = x;
double r31570418 = r31570416 - r31570417;
double r31570419 = 3.0;
double r31570420 = r31570419 - r31570417;
double r31570421 = r31570418 * r31570420;
double r31570422 = y;
double r31570423 = r31570422 * r31570419;
double r31570424 = r31570421 / r31570423;
return r31570424;
}
double f(double x, double y) {
double r31570425 = 0.3333333333333333;
double r31570426 = x;
double r31570427 = y;
double r31570428 = r31570427 / r31570426;
double r31570429 = r31570426 / r31570428;
double r31570430 = 1.0;
double r31570431 = r31570430 / r31570427;
double r31570432 = fma(r31570425, r31570429, r31570431);
double r31570433 = 1.3333333333333333;
double r31570434 = r31570426 / r31570427;
double r31570435 = r31570433 * r31570434;
double r31570436 = r31570432 - r31570435;
return r31570436;
}




Bits error versus x




Bits error versus y
| Original | 5.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 5.9
rmApplied associate-/l*0.3
Taylor expanded around 0 5.7
Simplified0.2
Final simplification0.2
herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y)
:name "Diagrams.TwoD.Arc:bezierFromSweepQ1 from diagrams-lib-1.3.0.3"
:herbie-target
(* (/ (- 1.0 x) y) (/ (- 3.0 x) 3.0))
(/ (* (- 1.0 x) (- 3.0 x)) (* y 3.0)))