\frac{\left(1 - x\right) \cdot \left(3 - x\right)}{y \cdot 3}\frac{1 - x}{y \cdot \frac{3}{3 - x}}double f(double x, double y) {
double r874401 = 1.0;
double r874402 = x;
double r874403 = r874401 - r874402;
double r874404 = 3.0;
double r874405 = r874404 - r874402;
double r874406 = r874403 * r874405;
double r874407 = y;
double r874408 = r874407 * r874404;
double r874409 = r874406 / r874408;
return r874409;
}
double f(double x, double y) {
double r874410 = 1.0;
double r874411 = x;
double r874412 = r874410 - r874411;
double r874413 = y;
double r874414 = 3.0;
double r874415 = r874414 - r874411;
double r874416 = r874414 / r874415;
double r874417 = r874413 * r874416;
double r874418 = r874412 / r874417;
return r874418;
}




Bits error versus x




Bits error versus y
Results
| Original | 5.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 5.8
rmApplied associate-/l*0.3
Simplified0.1
rmApplied expm1-log1p-u0.1
rmApplied expm1-log1p0.1
Final simplification0.1
herbie shell --seed 2020042 +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)))