Average Error: 0.1 → 0.1
Time: 2.7s
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 r170086 = x;
        double r170087 = y;
        double r170088 = r170087 - r170086;
        double r170089 = fabs(r170088);
        double r170090 = 2.0;
        double r170091 = r170089 / r170090;
        double r170092 = r170086 + r170091;
        return r170092;
}

double f(double x, double y) {
        double r170093 = x;
        double r170094 = y;
        double r170095 = r170094 - r170093;
        double r170096 = fabs(r170095);
        double r170097 = 2.0;
        double r170098 = r170096 / r170097;
        double r170099 = r170093 + r170098;
        return r170099;
}

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 2020056 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))