Average Error: 0.1 → 0.1
Time: 12.1s
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 r103005 = x;
        double r103006 = y;
        double r103007 = r103006 - r103005;
        double r103008 = fabs(r103007);
        double r103009 = 2.0;
        double r103010 = r103008 / r103009;
        double r103011 = r103005 + r103010;
        return r103011;
}

double f(double x, double y) {
        double r103012 = x;
        double r103013 = y;
        double r103014 = r103013 - r103012;
        double r103015 = fabs(r103014);
        double r103016 = 2.0;
        double r103017 = r103015 / r103016;
        double r103018 = r103012 + r103017;
        return r103018;
}

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 2019235 +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)))