Average Error: 0.1 → 0.1
Time: 2.6s
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 r181823 = x;
        double r181824 = y;
        double r181825 = r181824 - r181823;
        double r181826 = fabs(r181825);
        double r181827 = 2.0;
        double r181828 = r181826 / r181827;
        double r181829 = r181823 + r181828;
        return r181829;
}

double f(double x, double y) {
        double r181830 = x;
        double r181831 = y;
        double r181832 = r181831 - r181830;
        double r181833 = fabs(r181832);
        double r181834 = 2.0;
        double r181835 = r181833 / r181834;
        double r181836 = r181830 + r181835;
        return r181836;
}

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