Average Error: 0.1 → 0.1
Time: 13.7s
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 r103214 = x;
        double r103215 = y;
        double r103216 = r103215 - r103214;
        double r103217 = fabs(r103216);
        double r103218 = 2.0;
        double r103219 = r103217 / r103218;
        double r103220 = r103214 + r103219;
        return r103220;
}

double f(double x, double y) {
        double r103221 = x;
        double r103222 = y;
        double r103223 = r103222 - r103221;
        double r103224 = fabs(r103223);
        double r103225 = 2.0;
        double r103226 = r103224 / r103225;
        double r103227 = r103221 + r103226;
        return r103227;
}

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 2019198 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))