Average Error: 0.0 → 0.0
Time: 3.1s
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 r147563 = x;
        double r147564 = y;
        double r147565 = r147564 - r147563;
        double r147566 = fabs(r147565);
        double r147567 = 2.0;
        double r147568 = r147566 / r147567;
        double r147569 = r147563 + r147568;
        return r147569;
}

double f(double x, double y) {
        double r147570 = x;
        double r147571 = y;
        double r147572 = r147571 - r147570;
        double r147573 = fabs(r147572);
        double r147574 = 2.0;
        double r147575 = r147573 / r147574;
        double r147576 = r147570 + r147575;
        return r147576;
}

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