Average Error: 0.0 → 0.0
Time: 2.2s
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 r121683 = x;
        double r121684 = y;
        double r121685 = r121684 - r121683;
        double r121686 = fabs(r121685);
        double r121687 = 2.0;
        double r121688 = r121686 / r121687;
        double r121689 = r121683 + r121688;
        return r121689;
}

double f(double x, double y) {
        double r121690 = x;
        double r121691 = y;
        double r121692 = r121691 - r121690;
        double r121693 = fabs(r121692);
        double r121694 = 2.0;
        double r121695 = r121693 / r121694;
        double r121696 = r121690 + r121695;
        return r121696;
}

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 2020002 +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)))