Average Error: 0.1 → 0.1
Time: 13.3s
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 r114830 = x;
        double r114831 = y;
        double r114832 = r114831 - r114830;
        double r114833 = fabs(r114832);
        double r114834 = 2.0;
        double r114835 = r114833 / r114834;
        double r114836 = r114830 + r114835;
        return r114836;
}

double f(double x, double y) {
        double r114837 = x;
        double r114838 = y;
        double r114839 = r114838 - r114837;
        double r114840 = fabs(r114839);
        double r114841 = 2.0;
        double r114842 = r114840 / r114841;
        double r114843 = r114837 + r114842;
        return r114843;
}

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