x + \frac{x - y}{2}\mathsf{fma}\left(1.5, x, -0.5 \cdot y\right)double f(double x, double y) {
double r27081674 = x;
double r27081675 = y;
double r27081676 = r27081674 - r27081675;
double r27081677 = 2.0;
double r27081678 = r27081676 / r27081677;
double r27081679 = r27081674 + r27081678;
return r27081679;
}
double f(double x, double y) {
double r27081680 = 1.5;
double r27081681 = x;
double r27081682 = 0.5;
double r27081683 = y;
double r27081684 = r27081682 * r27081683;
double r27081685 = -r27081684;
double r27081686 = fma(r27081680, r27081681, r27081685);
return r27081686;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0 |
Initial program 0.1
Taylor expanded around 0 0.1
rmApplied fma-neg0
Final simplification0
herbie shell --seed 2019192 +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)))