Average Error: 0.1 → 0.1
Time: 16.4s
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 r121423 = x;
        double r121424 = y;
        double r121425 = r121424 - r121423;
        double r121426 = fabs(r121425);
        double r121427 = 2.0;
        double r121428 = r121426 / r121427;
        double r121429 = r121423 + r121428;
        return r121429;
}

double f(double x, double y) {
        double r121430 = x;
        double r121431 = y;
        double r121432 = r121431 - r121430;
        double r121433 = fabs(r121432);
        double r121434 = 2.0;
        double r121435 = r121433 / r121434;
        double r121436 = r121430 + r121435;
        return r121436;
}

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