x + \frac{x - y}{2}\mathsf{fma}\left(1.5, x, \left(-0.5\right) \cdot y\right)double f(double x, double y) {
double r352224 = x;
double r352225 = y;
double r352226 = r352224 - r352225;
double r352227 = 2.0;
double r352228 = r352226 / r352227;
double r352229 = r352224 + r352228;
return r352229;
}
double f(double x, double y) {
double r352230 = 1.5;
double r352231 = x;
double r352232 = 0.5;
double r352233 = -r352232;
double r352234 = y;
double r352235 = r352233 * r352234;
double r352236 = fma(r352230, r352231, r352235);
return r352236;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0 |
Initial program 0.1
rmApplied div-sub0.1
Applied associate-+r-0.1
Simplified0.1
Taylor expanded around 0 0.1
Simplified0
Final simplification0
herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y)
:name "Graphics.Rendering.Chart.Axis.Types:hBufferRect from Chart-1.5.3"
:herbie-target
(- (* 1.5 x) (* 0.5 y))
(+ x (/ (- x y) 2.0)))