Average Error: 0.0 → 0.0
Time: 3.2s
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 r119634 = x;
        double r119635 = y;
        double r119636 = r119635 - r119634;
        double r119637 = fabs(r119636);
        double r119638 = 2.0;
        double r119639 = r119637 / r119638;
        double r119640 = r119634 + r119639;
        return r119640;
}

double f(double x, double y) {
        double r119641 = x;
        double r119642 = y;
        double r119643 = r119642 - r119641;
        double r119644 = fabs(r119643);
        double r119645 = 2.0;
        double r119646 = r119644 / r119645;
        double r119647 = r119641 + r119646;
        return r119647;
}

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