Average Error: 0.0 → 0.0
Time: 17.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 r105227 = x;
        double r105228 = y;
        double r105229 = r105228 - r105227;
        double r105230 = fabs(r105229);
        double r105231 = 2.0;
        double r105232 = r105230 / r105231;
        double r105233 = r105227 + r105232;
        return r105233;
}

double f(double x, double y) {
        double r105234 = x;
        double r105235 = y;
        double r105236 = r105235 - r105234;
        double r105237 = fabs(r105236);
        double r105238 = 2.0;
        double r105239 = r105237 / r105238;
        double r105240 = r105234 + r105239;
        return r105240;
}

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