Average Error: 0.0 → 0.0
Time: 3.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 r170861 = x;
        double r170862 = y;
        double r170863 = r170862 - r170861;
        double r170864 = fabs(r170863);
        double r170865 = 2.0;
        double r170866 = r170864 / r170865;
        double r170867 = r170861 + r170866;
        return r170867;
}

double f(double x, double y) {
        double r170868 = x;
        double r170869 = y;
        double r170870 = r170869 - r170868;
        double r170871 = fabs(r170870);
        double r170872 = 2.0;
        double r170873 = r170871 / r170872;
        double r170874 = r170868 + r170873;
        return r170874;
}

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