Average Error: 0.1 → 0.1
Time: 10.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 r94980 = x;
        double r94981 = y;
        double r94982 = r94981 - r94980;
        double r94983 = fabs(r94982);
        double r94984 = 2.0;
        double r94985 = r94983 / r94984;
        double r94986 = r94980 + r94985;
        return r94986;
}

double f(double x, double y) {
        double r94987 = x;
        double r94988 = y;
        double r94989 = r94988 - r94987;
        double r94990 = fabs(r94989);
        double r94991 = 2.0;
        double r94992 = r94990 / r94991;
        double r94993 = r94987 + r94992;
        return r94993;
}

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