Average Error: 0.1 → 0.1
Time: 2.5s
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 r137582 = x;
        double r137583 = y;
        double r137584 = r137583 - r137582;
        double r137585 = fabs(r137584);
        double r137586 = 2.0;
        double r137587 = r137585 / r137586;
        double r137588 = r137582 + r137587;
        return r137588;
}

double f(double x, double y) {
        double r137589 = x;
        double r137590 = y;
        double r137591 = r137590 - r137589;
        double r137592 = fabs(r137591);
        double r137593 = 2.0;
        double r137594 = r137592 / r137593;
        double r137595 = r137589 + r137594;
        return r137595;
}

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