Average Error: 0.0 → 0.0
Time: 3.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 r135844 = x;
        double r135845 = y;
        double r135846 = r135845 - r135844;
        double r135847 = fabs(r135846);
        double r135848 = 2.0;
        double r135849 = r135847 / r135848;
        double r135850 = r135844 + r135849;
        return r135850;
}

double f(double x, double y) {
        double r135851 = x;
        double r135852 = y;
        double r135853 = r135852 - r135851;
        double r135854 = fabs(r135853);
        double r135855 = 2.0;
        double r135856 = r135854 / r135855;
        double r135857 = r135851 + r135856;
        return r135857;
}

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.0

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.0

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

Reproduce

herbie shell --seed 2020001 +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)))