Average Error: 0.0 → 0.0
Time: 2.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 r132449 = x;
        double r132450 = y;
        double r132451 = r132450 - r132449;
        double r132452 = fabs(r132451);
        double r132453 = 2.0;
        double r132454 = r132452 / r132453;
        double r132455 = r132449 + r132454;
        return r132455;
}

double f(double x, double y) {
        double r132456 = x;
        double r132457 = y;
        double r132458 = r132457 - r132456;
        double r132459 = fabs(r132458);
        double r132460 = 2.0;
        double r132461 = r132459 / r132460;
        double r132462 = r132456 + r132461;
        return r132462;
}

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