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 r153877 = x;
        double r153878 = y;
        double r153879 = r153878 - r153877;
        double r153880 = fabs(r153879);
        double r153881 = 2.0;
        double r153882 = r153880 / r153881;
        double r153883 = r153877 + r153882;
        return r153883;
}

double f(double x, double y) {
        double r153884 = x;
        double r153885 = y;
        double r153886 = r153885 - r153884;
        double r153887 = fabs(r153886);
        double r153888 = 2.0;
        double r153889 = r153887 / r153888;
        double r153890 = r153884 + r153889;
        return r153890;
}

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