Average Error: 0.0 → 0.0
Time: 13.6s
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 r223717 = x;
        double r223718 = y;
        double r223719 = r223718 - r223717;
        double r223720 = fabs(r223719);
        double r223721 = 2.0;
        double r223722 = r223720 / r223721;
        double r223723 = r223717 + r223722;
        return r223723;
}

double f(double x, double y) {
        double r223724 = x;
        double r223725 = y;
        double r223726 = r223725 - r223724;
        double r223727 = fabs(r223726);
        double r223728 = 2.0;
        double r223729 = r223727 / r223728;
        double r223730 = r223724 + r223729;
        return r223730;
}

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