Average Error: 0.0 → 0.0
Time: 12.3s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r7250235 = x;
        double r7250236 = y;
        double r7250237 = r7250236 - r7250235;
        double r7250238 = fabs(r7250237);
        double r7250239 = 2.0;
        double r7250240 = r7250238 / r7250239;
        double r7250241 = r7250235 + r7250240;
        return r7250241;
}

double f(double x, double y) {
        double r7250242 = y;
        double r7250243 = x;
        double r7250244 = r7250242 - r7250243;
        double r7250245 = fabs(r7250244);
        double r7250246 = 2.0;
        double r7250247 = r7250245 / r7250246;
        double r7250248 = r7250247 + r7250243;
        return r7250248;
}

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

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

Reproduce

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