Average Error: 0.0 → 0.0
Time: 4.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 r141770 = x;
        double r141771 = y;
        double r141772 = r141771 - r141770;
        double r141773 = fabs(r141772);
        double r141774 = 2.0;
        double r141775 = r141773 / r141774;
        double r141776 = r141770 + r141775;
        return r141776;
}

double f(double x, double y) {
        double r141777 = x;
        double r141778 = y;
        double r141779 = r141778 - r141777;
        double r141780 = fabs(r141779);
        double r141781 = 2.0;
        double r141782 = r141780 / r141781;
        double r141783 = r141777 + r141782;
        return r141783;
}

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