Average Error: 0.1 → 0.1
Time: 11.5s
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 r5144079 = x;
        double r5144080 = y;
        double r5144081 = r5144080 - r5144079;
        double r5144082 = fabs(r5144081);
        double r5144083 = 2.0;
        double r5144084 = r5144082 / r5144083;
        double r5144085 = r5144079 + r5144084;
        return r5144085;
}

double f(double x, double y) {
        double r5144086 = y;
        double r5144087 = x;
        double r5144088 = r5144086 - r5144087;
        double r5144089 = fabs(r5144088);
        double r5144090 = 2.0;
        double r5144091 = r5144089 / r5144090;
        double r5144092 = r5144091 + r5144087;
        return r5144092;
}

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

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

Reproduce

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