Average Error: 0.1 → 0.1
Time: 2.8s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[x + \frac{\left|y - x\right|}{2}\]
x + \frac{\left|y - x\right|}{2}
x + \frac{\left|y - x\right|}{2}
double f(double x, double y) {
        double r136210 = x;
        double r136211 = y;
        double r136212 = r136211 - r136210;
        double r136213 = fabs(r136212);
        double r136214 = 2.0;
        double r136215 = r136213 / r136214;
        double r136216 = r136210 + r136215;
        return r136216;
}

double f(double x, double y) {
        double r136217 = x;
        double r136218 = y;
        double r136219 = r136218 - r136217;
        double r136220 = fabs(r136219);
        double r136221 = 2.0;
        double r136222 = r136220 / r136221;
        double r136223 = r136217 + r136222;
        return r136223;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.1

    \[\leadsto x + \frac{\left|y - x\right|}{2}\]

Reproduce

herbie shell --seed 2020025 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))