Average Error: 0.1 → 0.1
Time: 11.9s
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 r115808 = x;
        double r115809 = y;
        double r115810 = r115809 - r115808;
        double r115811 = fabs(r115810);
        double r115812 = 2.0;
        double r115813 = r115811 / r115812;
        double r115814 = r115808 + r115813;
        return r115814;
}

double f(double x, double y) {
        double r115815 = x;
        double r115816 = y;
        double r115817 = r115816 - r115815;
        double r115818 = fabs(r115817);
        double r115819 = 2.0;
        double r115820 = r115818 / r115819;
        double r115821 = r115815 + r115820;
        return r115821;
}

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

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

Reproduce

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