Average Error: 0.0 → 0.0
Time: 12.7s
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 r168602 = x;
        double r168603 = y;
        double r168604 = r168603 - r168602;
        double r168605 = fabs(r168604);
        double r168606 = 2.0;
        double r168607 = r168605 / r168606;
        double r168608 = r168602 + r168607;
        return r168608;
}

double f(double x, double y) {
        double r168609 = x;
        double r168610 = y;
        double r168611 = r168610 - r168609;
        double r168612 = fabs(r168611);
        double r168613 = 2.0;
        double r168614 = r168612 / r168613;
        double r168615 = r168609 + r168614;
        return r168615;
}

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