Average Error: 0.1 → 0.1
Time: 11.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 r108947 = x;
        double r108948 = y;
        double r108949 = r108948 - r108947;
        double r108950 = fabs(r108949);
        double r108951 = 2.0;
        double r108952 = r108950 / r108951;
        double r108953 = r108947 + r108952;
        return r108953;
}

double f(double x, double y) {
        double r108954 = x;
        double r108955 = y;
        double r108956 = r108955 - r108954;
        double r108957 = fabs(r108956);
        double r108958 = 2.0;
        double r108959 = r108957 / r108958;
        double r108960 = r108954 + r108959;
        return r108960;
}

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