Average Error: 0.0 → 0.0
Time: 3.1s
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 r245935 = x;
        double r245936 = y;
        double r245937 = r245936 - r245935;
        double r245938 = fabs(r245937);
        double r245939 = 2.0;
        double r245940 = r245938 / r245939;
        double r245941 = r245935 + r245940;
        return r245941;
}

double f(double x, double y) {
        double r245942 = x;
        double r245943 = y;
        double r245944 = r245943 - r245942;
        double r245945 = fabs(r245944);
        double r245946 = 2.0;
        double r245947 = r245945 / r245946;
        double r245948 = r245942 + r245947;
        return r245948;
}

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