Average Error: 0.0 → 0.0
Time: 3.6s
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 r131380 = x;
        double r131381 = y;
        double r131382 = r131381 - r131380;
        double r131383 = fabs(r131382);
        double r131384 = 2.0;
        double r131385 = r131383 / r131384;
        double r131386 = r131380 + r131385;
        return r131386;
}

double f(double x, double y) {
        double r131387 = x;
        double r131388 = y;
        double r131389 = r131388 - r131387;
        double r131390 = fabs(r131389);
        double r131391 = 2.0;
        double r131392 = r131390 / r131391;
        double r131393 = r131387 + r131392;
        return r131393;
}

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