Average Error: 0.0 → 0.0
Time: 15.1s
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 r189724 = x;
        double r189725 = y;
        double r189726 = r189725 - r189724;
        double r189727 = fabs(r189726);
        double r189728 = 2.0;
        double r189729 = r189727 / r189728;
        double r189730 = r189724 + r189729;
        return r189730;
}

double f(double x, double y) {
        double r189731 = x;
        double r189732 = y;
        double r189733 = r189732 - r189731;
        double r189734 = fabs(r189733);
        double r189735 = 2.0;
        double r189736 = r189734 / r189735;
        double r189737 = r189731 + r189736;
        return r189737;
}

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