Average Error: 0.1 → 0.1
Time: 12.6s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r10704850 = x;
        double r10704851 = y;
        double r10704852 = r10704851 - r10704850;
        double r10704853 = fabs(r10704852);
        double r10704854 = 2.0;
        double r10704855 = r10704853 / r10704854;
        double r10704856 = r10704850 + r10704855;
        return r10704856;
}

double f(double x, double y) {
        double r10704857 = y;
        double r10704858 = x;
        double r10704859 = r10704857 - r10704858;
        double r10704860 = fabs(r10704859);
        double r10704861 = 2.0;
        double r10704862 = r10704860 / r10704861;
        double r10704863 = r10704862 + r10704858;
        return r10704863;
}

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 \frac{\left|y - x\right|}{2} + x\]

Reproduce

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