Average Error: 0.1 → 0.1
Time: 13.6s
Precision: 64
\[x + \frac{\left|y - x\right|}{2.0}\]
\[\frac{\left|y - x\right|}{2.0} + x\]
x + \frac{\left|y - x\right|}{2.0}
\frac{\left|y - x\right|}{2.0} + x
double f(double x, double y) {
        double r9103172 = x;
        double r9103173 = y;
        double r9103174 = r9103173 - r9103172;
        double r9103175 = fabs(r9103174);
        double r9103176 = 2.0;
        double r9103177 = r9103175 / r9103176;
        double r9103178 = r9103172 + r9103177;
        return r9103178;
}

double f(double x, double y) {
        double r9103179 = y;
        double r9103180 = x;
        double r9103181 = r9103179 - r9103180;
        double r9103182 = fabs(r9103181);
        double r9103183 = 2.0;
        double r9103184 = r9103182 / r9103183;
        double r9103185 = r9103184 + r9103180;
        return r9103185;
}

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.0}\]
  2. Final simplification0.1

    \[\leadsto \frac{\left|y - x\right|}{2.0} + x\]

Reproduce

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