Average Error: 0.0 → 0.0
Time: 19.5s
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 r8313180 = x;
        double r8313181 = y;
        double r8313182 = r8313181 - r8313180;
        double r8313183 = fabs(r8313182);
        double r8313184 = 2.0;
        double r8313185 = r8313183 / r8313184;
        double r8313186 = r8313180 + r8313185;
        return r8313186;
}

double f(double x, double y) {
        double r8313187 = y;
        double r8313188 = x;
        double r8313189 = r8313187 - r8313188;
        double r8313190 = fabs(r8313189);
        double r8313191 = 2.0;
        double r8313192 = r8313190 / r8313191;
        double r8313193 = r8313192 + r8313188;
        return r8313193;
}

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.0

    \[x + \frac{\left|y - x\right|}{2.0}\]
  2. Final simplification0.0

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

Reproduce

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