Average Error: 0.1 → 0.1
Time: 2.7s
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 r173839 = x;
        double r173840 = y;
        double r173841 = r173840 - r173839;
        double r173842 = fabs(r173841);
        double r173843 = 2.0;
        double r173844 = r173842 / r173843;
        double r173845 = r173839 + r173844;
        return r173845;
}

double f(double x, double y) {
        double r173846 = x;
        double r173847 = y;
        double r173848 = r173847 - r173846;
        double r173849 = fabs(r173848);
        double r173850 = 2.0;
        double r173851 = r173849 / r173850;
        double r173852 = r173846 + r173851;
        return r173852;
}

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