Average Error: 0.1 → 0.1
Time: 3.8s
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 r219199 = x;
        double r219200 = y;
        double r219201 = r219200 - r219199;
        double r219202 = fabs(r219201);
        double r219203 = 2.0;
        double r219204 = r219202 / r219203;
        double r219205 = r219199 + r219204;
        return r219205;
}

double f(double x, double y) {
        double r219206 = x;
        double r219207 = y;
        double r219208 = r219207 - r219206;
        double r219209 = fabs(r219208);
        double r219210 = 2.0;
        double r219211 = r219209 / r219210;
        double r219212 = r219206 + r219211;
        return r219212;
}

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