Average Error: 0.0 → 0.0
Time: 3.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 r169212 = x;
        double r169213 = y;
        double r169214 = r169213 - r169212;
        double r169215 = fabs(r169214);
        double r169216 = 2.0;
        double r169217 = r169215 / r169216;
        double r169218 = r169212 + r169217;
        return r169218;
}

double f(double x, double y) {
        double r169219 = x;
        double r169220 = y;
        double r169221 = r169220 - r169219;
        double r169222 = fabs(r169221);
        double r169223 = 2.0;
        double r169224 = r169222 / r169223;
        double r169225 = r169219 + r169224;
        return r169225;
}

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