Average Error: 0.0 → 0.0
Time: 8.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 r160529 = x;
        double r160530 = y;
        double r160531 = r160530 - r160529;
        double r160532 = fabs(r160531);
        double r160533 = 2.0;
        double r160534 = r160532 / r160533;
        double r160535 = r160529 + r160534;
        return r160535;
}

double f(double x, double y) {
        double r160536 = x;
        double r160537 = y;
        double r160538 = r160537 - r160536;
        double r160539 = fabs(r160538);
        double r160540 = 2.0;
        double r160541 = r160539 / r160540;
        double r160542 = r160536 + r160541;
        return r160542;
}

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