Average Error: 0.1 → 0.1
Time: 16.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 r208232 = x;
        double r208233 = y;
        double r208234 = r208233 - r208232;
        double r208235 = fabs(r208234);
        double r208236 = 2.0;
        double r208237 = r208235 / r208236;
        double r208238 = r208232 + r208237;
        return r208238;
}

double f(double x, double y) {
        double r208239 = x;
        double r208240 = y;
        double r208241 = r208240 - r208239;
        double r208242 = fabs(r208241);
        double r208243 = 2.0;
        double r208244 = r208242 / r208243;
        double r208245 = r208239 + r208244;
        return r208245;
}

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