Average Error: 0.1 → 0.1
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 r143811 = x;
        double r143812 = y;
        double r143813 = r143812 - r143811;
        double r143814 = fabs(r143813);
        double r143815 = 2.0;
        double r143816 = r143814 / r143815;
        double r143817 = r143811 + r143816;
        return r143817;
}

double f(double x, double y) {
        double r143818 = x;
        double r143819 = y;
        double r143820 = r143819 - r143818;
        double r143821 = fabs(r143820);
        double r143822 = 2.0;
        double r143823 = r143821 / r143822;
        double r143824 = r143818 + r143823;
        return r143824;
}

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