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 r201745 = x;
        double r201746 = y;
        double r201747 = r201746 - r201745;
        double r201748 = fabs(r201747);
        double r201749 = 2.0;
        double r201750 = r201748 / r201749;
        double r201751 = r201745 + r201750;
        return r201751;
}

double f(double x, double y) {
        double r201752 = x;
        double r201753 = y;
        double r201754 = r201753 - r201752;
        double r201755 = fabs(r201754);
        double r201756 = 2.0;
        double r201757 = r201755 / r201756;
        double r201758 = r201752 + r201757;
        return r201758;
}

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 2020001 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))