Average Error: 0.1 → 0.1
Time: 11.9s
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 r143967 = x;
        double r143968 = y;
        double r143969 = r143968 - r143967;
        double r143970 = fabs(r143969);
        double r143971 = 2.0;
        double r143972 = r143970 / r143971;
        double r143973 = r143967 + r143972;
        return r143973;
}

double f(double x, double y) {
        double r143974 = y;
        double r143975 = x;
        double r143976 = r143974 - r143975;
        double r143977 = fabs(r143976);
        double r143978 = 2.0;
        double r143979 = r143977 / r143978;
        double r143980 = r143979 + r143975;
        return r143980;
}

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