Average Error: 0.1 → 0.1
Time: 14.8s
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 r7584948 = x;
        double r7584949 = y;
        double r7584950 = r7584949 - r7584948;
        double r7584951 = fabs(r7584950);
        double r7584952 = 2.0;
        double r7584953 = r7584951 / r7584952;
        double r7584954 = r7584948 + r7584953;
        return r7584954;
}

double f(double x, double y) {
        double r7584955 = y;
        double r7584956 = x;
        double r7584957 = r7584955 - r7584956;
        double r7584958 = fabs(r7584957);
        double r7584959 = 2.0;
        double r7584960 = r7584958 / r7584959;
        double r7584961 = r7584960 + r7584956;
        return r7584961;
}

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