Average Error: 0.0 → 0.0
Time: 15.5s
Precision: 64
\[x + \frac{\left|y - x\right|}{2.0}\]
\[\frac{\left|y - x\right|}{2.0} + x\]
x + \frac{\left|y - x\right|}{2.0}
\frac{\left|y - x\right|}{2.0} + x
double f(double x, double y) {
        double r9681707 = x;
        double r9681708 = y;
        double r9681709 = r9681708 - r9681707;
        double r9681710 = fabs(r9681709);
        double r9681711 = 2.0;
        double r9681712 = r9681710 / r9681711;
        double r9681713 = r9681707 + r9681712;
        return r9681713;
}

double f(double x, double y) {
        double r9681714 = y;
        double r9681715 = x;
        double r9681716 = r9681714 - r9681715;
        double r9681717 = fabs(r9681716);
        double r9681718 = 2.0;
        double r9681719 = r9681717 / r9681718;
        double r9681720 = r9681719 + r9681715;
        return r9681720;
}

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.0}\]
  2. Final simplification0.0

    \[\leadsto \frac{\left|y - x\right|}{2.0} + x\]

Reproduce

herbie shell --seed 2019158 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))