Average Error: 0.0 → 0.0
Time: 22.2s
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 r116714 = x;
        double r116715 = y;
        double r116716 = r116715 - r116714;
        double r116717 = fabs(r116716);
        double r116718 = 2.0;
        double r116719 = r116717 / r116718;
        double r116720 = r116714 + r116719;
        return r116720;
}

double f(double x, double y) {
        double r116721 = x;
        double r116722 = y;
        double r116723 = r116722 - r116721;
        double r116724 = fabs(r116723);
        double r116725 = 2.0;
        double r116726 = r116724 / r116725;
        double r116727 = r116721 + r116726;
        return r116727;
}

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 2019323 +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)))