Average Error: 0.0 → 0.0
Time: 3.2s
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 r179104 = x;
        double r179105 = y;
        double r179106 = r179105 - r179104;
        double r179107 = fabs(r179106);
        double r179108 = 2.0;
        double r179109 = r179107 / r179108;
        double r179110 = r179104 + r179109;
        return r179110;
}

double f(double x, double y) {
        double r179111 = x;
        double r179112 = y;
        double r179113 = r179112 - r179111;
        double r179114 = fabs(r179113);
        double r179115 = 2.0;
        double r179116 = r179114 / r179115;
        double r179117 = r179111 + r179116;
        return r179117;
}

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