Average Error: 0.0 → 0.0
Time: 12.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 r106353 = x;
        double r106354 = y;
        double r106355 = r106354 - r106353;
        double r106356 = fabs(r106355);
        double r106357 = 2.0;
        double r106358 = r106356 / r106357;
        double r106359 = r106353 + r106358;
        return r106359;
}

double f(double x, double y) {
        double r106360 = x;
        double r106361 = y;
        double r106362 = r106361 - r106360;
        double r106363 = fabs(r106362);
        double r106364 = 2.0;
        double r106365 = r106363 / r106364;
        double r106366 = r106360 + r106365;
        return r106366;
}

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