Average Error: 0.1 → 0.1
Time: 9.1s
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 r184192 = x;
        double r184193 = y;
        double r184194 = r184193 - r184192;
        double r184195 = fabs(r184194);
        double r184196 = 2.0;
        double r184197 = r184195 / r184196;
        double r184198 = r184192 + r184197;
        return r184198;
}

double f(double x, double y) {
        double r184199 = x;
        double r184200 = y;
        double r184201 = r184200 - r184199;
        double r184202 = fabs(r184201);
        double r184203 = 2.0;
        double r184204 = r184202 / r184203;
        double r184205 = r184199 + r184204;
        return r184205;
}

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