Average Error: 0.0 → 0.0
Time: 35.1s
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 r6887994 = x;
        double r6887995 = y;
        double r6887996 = r6887995 - r6887994;
        double r6887997 = fabs(r6887996);
        double r6887998 = 2.0;
        double r6887999 = r6887997 / r6887998;
        double r6888000 = r6887994 + r6887999;
        return r6888000;
}

double f(double x, double y) {
        double r6888001 = y;
        double r6888002 = x;
        double r6888003 = r6888001 - r6888002;
        double r6888004 = fabs(r6888003);
        double r6888005 = 2.0;
        double r6888006 = r6888004 / r6888005;
        double r6888007 = r6888006 + r6888002;
        return r6888007;
}

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