Average Error: 0.0 → 0.0
Time: 12.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 r105212 = x;
        double r105213 = y;
        double r105214 = r105213 - r105212;
        double r105215 = fabs(r105214);
        double r105216 = 2.0;
        double r105217 = r105215 / r105216;
        double r105218 = r105212 + r105217;
        return r105218;
}

double f(double x, double y) {
        double r105219 = x;
        double r105220 = y;
        double r105221 = r105220 - r105219;
        double r105222 = fabs(r105221);
        double r105223 = 2.0;
        double r105224 = r105222 / r105223;
        double r105225 = r105219 + r105224;
        return r105225;
}

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.0

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.0

    \[\leadsto x + \frac{\left|y - x\right|}{2}\]

Reproduce

herbie shell --seed 2019305 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))