Average Error: 0.1 → 0.1
Time: 3.4s
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 r145102 = x;
        double r145103 = y;
        double r145104 = r145103 - r145102;
        double r145105 = fabs(r145104);
        double r145106 = 2.0;
        double r145107 = r145105 / r145106;
        double r145108 = r145102 + r145107;
        return r145108;
}

double f(double x, double y) {
        double r145109 = x;
        double r145110 = y;
        double r145111 = r145110 - r145109;
        double r145112 = fabs(r145111);
        double r145113 = 2.0;
        double r145114 = r145112 / r145113;
        double r145115 = r145109 + r145114;
        return r145115;
}

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