Average Error: 0.1 → 0.1
Time: 13.6s
Precision: 64
\[x + \frac{\left|y - x\right|}{2.0}\]
\[\frac{\left|y - x\right|}{2.0} + x\]
x + \frac{\left|y - x\right|}{2.0}
\frac{\left|y - x\right|}{2.0} + x
double f(double x, double y) {
        double r7035801 = x;
        double r7035802 = y;
        double r7035803 = r7035802 - r7035801;
        double r7035804 = fabs(r7035803);
        double r7035805 = 2.0;
        double r7035806 = r7035804 / r7035805;
        double r7035807 = r7035801 + r7035806;
        return r7035807;
}

double f(double x, double y) {
        double r7035808 = y;
        double r7035809 = x;
        double r7035810 = r7035808 - r7035809;
        double r7035811 = fabs(r7035810);
        double r7035812 = 2.0;
        double r7035813 = r7035811 / r7035812;
        double r7035814 = r7035813 + r7035809;
        return r7035814;
}

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.0}\]
  2. Final simplification0.1

    \[\leadsto \frac{\left|y - x\right|}{2.0} + x\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))