Average Error: 0.1 → 0.1
Time: 11.5s
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 r773520 = x;
        double r773521 = y;
        double r773522 = r773521 - r773520;
        double r773523 = fabs(r773522);
        double r773524 = 2.0;
        double r773525 = r773523 / r773524;
        double r773526 = r773520 + r773525;
        return r773526;
}

double f(double x, double y) {
        double r773527 = x;
        double r773528 = y;
        double r773529 = r773528 - r773527;
        double r773530 = fabs(r773529);
        double r773531 = 2.0;
        double r773532 = r773530 / r773531;
        double r773533 = r773527 + r773532;
        return r773533;
}

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