Average Error: 0.1 → 0.1
Time: 11.5s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r106476 = x;
        double r106477 = y;
        double r106478 = r106477 - r106476;
        double r106479 = fabs(r106478);
        double r106480 = 2.0;
        double r106481 = r106479 / r106480;
        double r106482 = r106476 + r106481;
        return r106482;
}

double f(double x, double y) {
        double r106483 = y;
        double r106484 = x;
        double r106485 = r106483 - r106484;
        double r106486 = fabs(r106485);
        double r106487 = 2.0;
        double r106488 = r106486 / r106487;
        double r106489 = r106488 + r106484;
        return r106489;
}

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 \frac{\left|y - x\right|}{2} + x\]

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))