Average Error: 0.0 → 0.0
Time: 3.2s
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 r159518 = x;
        double r159519 = y;
        double r159520 = r159519 - r159518;
        double r159521 = fabs(r159520);
        double r159522 = 2.0;
        double r159523 = r159521 / r159522;
        double r159524 = r159518 + r159523;
        return r159524;
}

double f(double x, double y) {
        double r159525 = x;
        double r159526 = y;
        double r159527 = r159526 - r159525;
        double r159528 = fabs(r159527);
        double r159529 = 2.0;
        double r159530 = r159528 / r159529;
        double r159531 = r159525 + r159530;
        return r159531;
}

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