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 r541931 = x;
double r541932 = y;
double r541933 = r541931 - r541932;
double r541934 = 2.0;
double r541935 = r541933 / r541934;
double r541936 = r541931 + r541935;
return r541936;
}
double f(double x, double y) {
double r541937 = 1.5;
double r541938 = x;
double r541939 = 0.5;
double r541940 = -r541939;
double r541941 = y;
double r541942 = r541940 * r541941;
double r541943 = fma(r541937, r541938, r541942);
return r541943;
}




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 2019194 +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)))