Average Error: 0.1 → 0.1
Time: 3.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 r175699 = x;
        double r175700 = y;
        double r175701 = r175700 - r175699;
        double r175702 = fabs(r175701);
        double r175703 = 2.0;
        double r175704 = r175702 / r175703;
        double r175705 = r175699 + r175704;
        return r175705;
}

double f(double x, double y) {
        double r175706 = x;
        double r175707 = y;
        double r175708 = r175707 - r175706;
        double r175709 = fabs(r175708);
        double r175710 = 2.0;
        double r175711 = r175709 / r175710;
        double r175712 = r175706 + r175711;
        return r175712;
}

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