Average Error: 0.1 → 0.1
Time: 11.3s
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 r139314 = x;
        double r139315 = y;
        double r139316 = r139315 - r139314;
        double r139317 = fabs(r139316);
        double r139318 = 2.0;
        double r139319 = r139317 / r139318;
        double r139320 = r139314 + r139319;
        return r139320;
}

double f(double x, double y) {
        double r139321 = x;
        double r139322 = y;
        double r139323 = r139322 - r139321;
        double r139324 = fabs(r139323);
        double r139325 = 2.0;
        double r139326 = r139324 / r139325;
        double r139327 = r139321 + r139326;
        return r139327;
}

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