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



Bits error versus x



Bits error versus y
Results
Initial program Error: 0.1 bits
Final simplificationError: 0.1 bits
herbie shell --seed 2020204
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
:precision binary64
(+ x (/ (fabs (- y x)) 2.0)))