Average Error: 0.1 → 0.1
Time: 13.6s
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 r771204 = x;
        double r771205 = y;
        double r771206 = r771205 - r771204;
        double r771207 = fabs(r771206);
        double r771208 = 2.0;
        double r771209 = r771207 / r771208;
        double r771210 = r771204 + r771209;
        return r771210;
}

double f(double x, double y) {
        double r771211 = x;
        double r771212 = y;
        double r771213 = r771212 - r771211;
        double r771214 = fabs(r771213);
        double r771215 = 2.0;
        double r771216 = r771214 / r771215;
        double r771217 = r771211 + r771216;
        return r771217;
}

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