x + \frac{\left|y - x\right|}{2}
\mathsf{fma}\left(\left|y - x\right|, 0.5, x\right)
(FPCore (x y) :precision binary64 (+ x (/ (fabs (- y x)) 2.0)))
(FPCore (x y) :precision binary64 (fma (fabs (- y x)) 0.5 x))
double code(double x, double y) {
return x + (fabs(y - x) / 2.0);
}
double code(double x, double y) {
return fma(fabs(y - x), 0.5, x);
}



Bits error versus x



Bits error versus y
Initial program 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2022077
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
:precision binary64
(+ x (/ (fabs (- y x)) 2.0)))