Average Error: 0.1 → 0.1
Time: 10.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 r142622 = x;
        double r142623 = y;
        double r142624 = r142623 - r142622;
        double r142625 = fabs(r142624);
        double r142626 = 2.0;
        double r142627 = r142625 / r142626;
        double r142628 = r142622 + r142627;
        return r142628;
}

double f(double x, double y) {
        double r142629 = x;
        double r142630 = y;
        double r142631 = r142630 - r142629;
        double r142632 = fabs(r142631);
        double r142633 = 2.0;
        double r142634 = r142632 / r142633;
        double r142635 = r142629 + r142634;
        return r142635;
}

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