Average Error: 0.1 → 0.1
Time: 15.0s
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 r9720958 = x;
        double r9720959 = y;
        double r9720960 = r9720959 - r9720958;
        double r9720961 = fabs(r9720960);
        double r9720962 = 2.0;
        double r9720963 = r9720961 / r9720962;
        double r9720964 = r9720958 + r9720963;
        return r9720964;
}

double f(double x, double y) {
        double r9720965 = y;
        double r9720966 = x;
        double r9720967 = r9720965 - r9720966;
        double r9720968 = fabs(r9720967);
        double r9720969 = 2.0;
        double r9720970 = r9720968 / r9720969;
        double r9720971 = r9720970 + r9720966;
        return r9720971;
}

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