Average Error: 0.0 → 0.0
Time: 2.9s
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 r170691 = x;
        double r170692 = y;
        double r170693 = r170692 - r170691;
        double r170694 = fabs(r170693);
        double r170695 = 2.0;
        double r170696 = r170694 / r170695;
        double r170697 = r170691 + r170696;
        return r170697;
}

double f(double x, double y) {
        double r170698 = x;
        double r170699 = y;
        double r170700 = r170699 - r170698;
        double r170701 = fabs(r170700);
        double r170702 = 2.0;
        double r170703 = r170701 / r170702;
        double r170704 = r170698 + r170703;
        return r170704;
}

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