Average Error: 0.0 → 0.0
Time: 3.0s
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 r141995 = x;
        double r141996 = y;
        double r141997 = r141996 - r141995;
        double r141998 = fabs(r141997);
        double r141999 = 2.0;
        double r142000 = r141998 / r141999;
        double r142001 = r141995 + r142000;
        return r142001;
}

double f(double x, double y) {
        double r142002 = x;
        double r142003 = y;
        double r142004 = r142003 - r142002;
        double r142005 = fabs(r142004);
        double r142006 = 2.0;
        double r142007 = r142005 / r142006;
        double r142008 = r142002 + r142007;
        return r142008;
}

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