Average Error: 0.0 → 0.0
Time: 10.9s
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 r89978 = x;
        double r89979 = y;
        double r89980 = r89979 - r89978;
        double r89981 = fabs(r89980);
        double r89982 = 2.0;
        double r89983 = r89981 / r89982;
        double r89984 = r89978 + r89983;
        return r89984;
}

double f(double x, double y) {
        double r89985 = x;
        double r89986 = y;
        double r89987 = r89986 - r89985;
        double r89988 = fabs(r89987);
        double r89989 = 2.0;
        double r89990 = r89988 / r89989;
        double r89991 = r89985 + r89990;
        return r89991;
}

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