Average Error: 0.0 → 0.0
Time: 12.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 r124560 = x;
        double r124561 = y;
        double r124562 = r124561 - r124560;
        double r124563 = fabs(r124562);
        double r124564 = 2.0;
        double r124565 = r124563 / r124564;
        double r124566 = r124560 + r124565;
        return r124566;
}

double f(double x, double y) {
        double r124567 = x;
        double r124568 = y;
        double r124569 = r124568 - r124567;
        double r124570 = fabs(r124569);
        double r124571 = 2.0;
        double r124572 = r124570 / r124571;
        double r124573 = r124567 + r124572;
        return r124573;
}

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.0

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.0

    \[\leadsto x + \frac{\left|y - x\right|}{2}\]

Reproduce

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