Average Error: 0.1 → 0.1
Time: 14.8s
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 r10178684 = x;
        double r10178685 = y;
        double r10178686 = r10178685 - r10178684;
        double r10178687 = fabs(r10178686);
        double r10178688 = 2.0;
        double r10178689 = r10178687 / r10178688;
        double r10178690 = r10178684 + r10178689;
        return r10178690;
}

double f(double x, double y) {
        double r10178691 = y;
        double r10178692 = x;
        double r10178693 = r10178691 - r10178692;
        double r10178694 = fabs(r10178693);
        double r10178695 = 2.0;
        double r10178696 = r10178694 / r10178695;
        double r10178697 = r10178696 + r10178692;
        return r10178697;
}

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