Average Error: 0.0 → 0.0
Time: 2.9s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[x + \frac{\left|y - x\right|}{2}\]
x + \frac{\left|y - x\right|}{2}
x + \frac{\left|y - x\right|}{2}
double f(double x, double y) {
        double r160048 = x;
        double r160049 = y;
        double r160050 = r160049 - r160048;
        double r160051 = fabs(r160050);
        double r160052 = 2.0;
        double r160053 = r160051 / r160052;
        double r160054 = r160048 + r160053;
        return r160054;
}

double f(double x, double y) {
        double r160055 = x;
        double r160056 = y;
        double r160057 = r160056 - r160055;
        double r160058 = fabs(r160057);
        double r160059 = 2.0;
        double r160060 = r160058 / r160059;
        double r160061 = r160055 + r160060;
        return r160061;
}

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 x + \frac{\left|y - x\right|}{2}\]

Reproduce

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