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 r535304 = x;
double r535305 = y;
double r535306 = r535304 - r535305;
double r535307 = 2.0;
double r535308 = r535306 / r535307;
double r535309 = r535304 + r535308;
return r535309;
}
double f(double x, double y) {
double r535310 = 1.5;
double r535311 = x;
double r535312 = 0.5;
double r535313 = -r535312;
double r535314 = y;
double r535315 = r535313 * r535314;
double r535316 = fma(r535310, r535311, r535315);
return r535316;
}




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