Average Error: 0.1 → 0.1
Time: 17.7s
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 r8310712 = x;
        double r8310713 = y;
        double r8310714 = r8310713 - r8310712;
        double r8310715 = fabs(r8310714);
        double r8310716 = 2.0;
        double r8310717 = r8310715 / r8310716;
        double r8310718 = r8310712 + r8310717;
        return r8310718;
}

double f(double x, double y) {
        double r8310719 = y;
        double r8310720 = x;
        double r8310721 = r8310719 - r8310720;
        double r8310722 = fabs(r8310721);
        double r8310723 = 2.0;
        double r8310724 = r8310722 / r8310723;
        double r8310725 = r8310724 + r8310720;
        return r8310725;
}

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

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

Reproduce

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