Average Error: 0.1 → 0.1
Time: 13.3s
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 r135654 = x;
        double r135655 = y;
        double r135656 = r135655 - r135654;
        double r135657 = fabs(r135656);
        double r135658 = 2.0;
        double r135659 = r135657 / r135658;
        double r135660 = r135654 + r135659;
        return r135660;
}

double f(double x, double y) {
        double r135661 = x;
        double r135662 = y;
        double r135663 = r135662 - r135661;
        double r135664 = fabs(r135663);
        double r135665 = 2.0;
        double r135666 = r135664 / r135665;
        double r135667 = r135661 + r135666;
        return r135667;
}

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