Average Error: 0.1 → 0.1
Time: 3.0s
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 r187183 = x;
        double r187184 = y;
        double r187185 = r187184 - r187183;
        double r187186 = fabs(r187185);
        double r187187 = 2.0;
        double r187188 = r187186 / r187187;
        double r187189 = r187183 + r187188;
        return r187189;
}

double f(double x, double y) {
        double r187190 = x;
        double r187191 = y;
        double r187192 = r187191 - r187190;
        double r187193 = fabs(r187192);
        double r187194 = 2.0;
        double r187195 = r187193 / r187194;
        double r187196 = r187190 + r187195;
        return r187196;
}

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