Average Error: 0.0 → 0.0
Time: 20.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 r126754 = x;
        double r126755 = y;
        double r126756 = r126755 - r126754;
        double r126757 = fabs(r126756);
        double r126758 = 2.0;
        double r126759 = r126757 / r126758;
        double r126760 = r126754 + r126759;
        return r126760;
}

double f(double x, double y) {
        double r126761 = x;
        double r126762 = y;
        double r126763 = r126762 - r126761;
        double r126764 = fabs(r126763);
        double r126765 = 2.0;
        double r126766 = r126764 / r126765;
        double r126767 = r126761 + r126766;
        return r126767;
}

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