Average Error: 0.1 → 0.1
Time: 4.2s
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 r139239 = x;
        double r139240 = y;
        double r139241 = r139240 - r139239;
        double r139242 = fabs(r139241);
        double r139243 = 2.0;
        double r139244 = r139242 / r139243;
        double r139245 = r139239 + r139244;
        return r139245;
}

double f(double x, double y) {
        double r139246 = x;
        double r139247 = y;
        double r139248 = r139247 - r139246;
        double r139249 = fabs(r139248);
        double r139250 = 2.0;
        double r139251 = r139249 / r139250;
        double r139252 = r139246 + r139251;
        return r139252;
}

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