Average Error: 0.1 → 0.1
Time: 8.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 r152841 = x;
        double r152842 = y;
        double r152843 = r152842 - r152841;
        double r152844 = fabs(r152843);
        double r152845 = 2.0;
        double r152846 = r152844 / r152845;
        double r152847 = r152841 + r152846;
        return r152847;
}

double f(double x, double y) {
        double r152848 = x;
        double r152849 = y;
        double r152850 = r152849 - r152848;
        double r152851 = fabs(r152850);
        double r152852 = 2.0;
        double r152853 = r152851 / r152852;
        double r152854 = r152848 + r152853;
        return r152854;
}

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