Average Error: 0.1 → 0.1
Time: 11.8s
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 r128532 = x;
        double r128533 = y;
        double r128534 = r128533 - r128532;
        double r128535 = fabs(r128534);
        double r128536 = 2.0;
        double r128537 = r128535 / r128536;
        double r128538 = r128532 + r128537;
        return r128538;
}

double f(double x, double y) {
        double r128539 = x;
        double r128540 = y;
        double r128541 = r128540 - r128539;
        double r128542 = fabs(r128541);
        double r128543 = 2.0;
        double r128544 = r128542 / r128543;
        double r128545 = r128539 + r128544;
        return r128545;
}

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 2019326 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))