Average Error: 0.1 → 0.1
Time: 8.3s
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 r169262 = x;
        double r169263 = y;
        double r169264 = r169263 - r169262;
        double r169265 = fabs(r169264);
        double r169266 = 2.0;
        double r169267 = r169265 / r169266;
        double r169268 = r169262 + r169267;
        return r169268;
}

double f(double x, double y) {
        double r169269 = x;
        double r169270 = y;
        double r169271 = r169270 - r169269;
        double r169272 = fabs(r169271);
        double r169273 = 2.0;
        double r169274 = r169272 / r169273;
        double r169275 = r169269 + r169274;
        return r169275;
}

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