Average Error: 0.1 → 0.1
Time: 48.7s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r9088552 = x;
        double r9088553 = y;
        double r9088554 = r9088553 - r9088552;
        double r9088555 = fabs(r9088554);
        double r9088556 = 2.0;
        double r9088557 = r9088555 / r9088556;
        double r9088558 = r9088552 + r9088557;
        return r9088558;
}

double f(double x, double y) {
        double r9088559 = y;
        double r9088560 = x;
        double r9088561 = r9088559 - r9088560;
        double r9088562 = fabs(r9088561);
        double r9088563 = 2.0;
        double r9088564 = r9088562 / r9088563;
        double r9088565 = r9088564 + r9088560;
        return r9088565;
}

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 \frac{\left|y - x\right|}{2} + x\]

Reproduce

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