Average Error: 0.1 → 0.1
Time: 9.1s
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 r3069777 = x;
        double r3069778 = y;
        double r3069779 = r3069778 - r3069777;
        double r3069780 = fabs(r3069779);
        double r3069781 = 2.0;
        double r3069782 = r3069780 / r3069781;
        double r3069783 = r3069777 + r3069782;
        return r3069783;
}

double f(double x, double y) {
        double r3069784 = y;
        double r3069785 = x;
        double r3069786 = r3069784 - r3069785;
        double r3069787 = fabs(r3069786);
        double r3069788 = 2.0;
        double r3069789 = r3069787 / r3069788;
        double r3069790 = r3069789 + r3069785;
        return r3069790;
}

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