Average Error: 0.0 → 0.0
Time: 12.4s
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 r118800 = x;
        double r118801 = y;
        double r118802 = r118801 - r118800;
        double r118803 = fabs(r118802);
        double r118804 = 2.0;
        double r118805 = r118803 / r118804;
        double r118806 = r118800 + r118805;
        return r118806;
}

double f(double x, double y) {
        double r118807 = x;
        double r118808 = y;
        double r118809 = r118808 - r118807;
        double r118810 = fabs(r118809);
        double r118811 = 2.0;
        double r118812 = r118810 / r118811;
        double r118813 = r118807 + r118812;
        return r118813;
}

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