Average Error: 0.1 → 0.1
Time: 5.6s
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 r155589 = x;
        double r155590 = y;
        double r155591 = r155590 - r155589;
        double r155592 = fabs(r155591);
        double r155593 = 2.0;
        double r155594 = r155592 / r155593;
        double r155595 = r155589 + r155594;
        return r155595;
}

double f(double x, double y) {
        double r155596 = x;
        double r155597 = y;
        double r155598 = r155597 - r155596;
        double r155599 = fabs(r155598);
        double r155600 = 2.0;
        double r155601 = r155599 / r155600;
        double r155602 = r155596 + r155601;
        return r155602;
}

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