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 r8213703 = x;
        double r8213704 = y;
        double r8213705 = r8213704 - r8213703;
        double r8213706 = fabs(r8213705);
        double r8213707 = 2.0;
        double r8213708 = r8213706 / r8213707;
        double r8213709 = r8213703 + r8213708;
        return r8213709;
}

double f(double x, double y) {
        double r8213710 = y;
        double r8213711 = x;
        double r8213712 = r8213710 - r8213711;
        double r8213713 = fabs(r8213712);
        double r8213714 = 2.0;
        double r8213715 = r8213713 / r8213714;
        double r8213716 = r8213715 + r8213711;
        return r8213716;
}

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