Average Error: 0.1 → 0.1
Time: 17.2s
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 r7760024 = x;
        double r7760025 = y;
        double r7760026 = r7760025 - r7760024;
        double r7760027 = fabs(r7760026);
        double r7760028 = 2.0;
        double r7760029 = r7760027 / r7760028;
        double r7760030 = r7760024 + r7760029;
        return r7760030;
}

double f(double x, double y) {
        double r7760031 = y;
        double r7760032 = x;
        double r7760033 = r7760031 - r7760032;
        double r7760034 = fabs(r7760033);
        double r7760035 = 2.0;
        double r7760036 = r7760034 / r7760035;
        double r7760037 = r7760036 + r7760032;
        return r7760037;
}

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