Average Error: 0.0 → 0.0
Time: 5.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 r160619 = x;
        double r160620 = y;
        double r160621 = r160620 - r160619;
        double r160622 = fabs(r160621);
        double r160623 = 2.0;
        double r160624 = r160622 / r160623;
        double r160625 = r160619 + r160624;
        return r160625;
}

double f(double x, double y) {
        double r160626 = x;
        double r160627 = y;
        double r160628 = r160627 - r160626;
        double r160629 = fabs(r160628);
        double r160630 = 2.0;
        double r160631 = r160629 / r160630;
        double r160632 = r160626 + r160631;
        return r160632;
}

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 2020021 +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)))