Average Error: 0.1 → 0.1
Time: 8.7s
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 r172526 = x;
        double r172527 = y;
        double r172528 = r172527 - r172526;
        double r172529 = fabs(r172528);
        double r172530 = 2.0;
        double r172531 = r172529 / r172530;
        double r172532 = r172526 + r172531;
        return r172532;
}

double f(double x, double y) {
        double r172533 = x;
        double r172534 = y;
        double r172535 = r172534 - r172533;
        double r172536 = fabs(r172535);
        double r172537 = 2.0;
        double r172538 = r172536 / r172537;
        double r172539 = r172533 + r172538;
        return r172539;
}

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