Average Error: 0.1 → 0.1
Time: 13.5s
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 r10548310 = x;
        double r10548311 = y;
        double r10548312 = r10548311 - r10548310;
        double r10548313 = fabs(r10548312);
        double r10548314 = 2.0;
        double r10548315 = r10548313 / r10548314;
        double r10548316 = r10548310 + r10548315;
        return r10548316;
}

double f(double x, double y) {
        double r10548317 = x;
        double r10548318 = y;
        double r10548319 = r10548318 - r10548317;
        double r10548320 = fabs(r10548319);
        double r10548321 = 2.0;
        double r10548322 = r10548320 / r10548321;
        double r10548323 = r10548317 + r10548322;
        return r10548323;
}

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