Average Error: 0.0 → 0.0
Time: 3.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 r152271 = x;
        double r152272 = y;
        double r152273 = r152272 - r152271;
        double r152274 = fabs(r152273);
        double r152275 = 2.0;
        double r152276 = r152274 / r152275;
        double r152277 = r152271 + r152276;
        return r152277;
}

double f(double x, double y) {
        double r152278 = x;
        double r152279 = y;
        double r152280 = r152279 - r152278;
        double r152281 = fabs(r152280);
        double r152282 = 2.0;
        double r152283 = r152281 / r152282;
        double r152284 = r152278 + r152283;
        return r152284;
}

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