Average Error: 0.1 → 0.1
Time: 3.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 r172858 = x;
        double r172859 = y;
        double r172860 = r172859 - r172858;
        double r172861 = fabs(r172860);
        double r172862 = 2.0;
        double r172863 = r172861 / r172862;
        double r172864 = r172858 + r172863;
        return r172864;
}

double f(double x, double y) {
        double r172865 = x;
        double r172866 = y;
        double r172867 = r172866 - r172865;
        double r172868 = fabs(r172867);
        double r172869 = 2.0;
        double r172870 = r172868 / r172869;
        double r172871 = r172865 + r172870;
        return r172871;
}

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.1

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.1

    \[\leadsto x + \frac{\left|y - x\right|}{2}\]

Reproduce

herbie shell --seed 2019353 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))