Average Error: 0.0 → 0.0
Time: 3.4s
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 r146651 = x;
        double r146652 = y;
        double r146653 = r146652 - r146651;
        double r146654 = fabs(r146653);
        double r146655 = 2.0;
        double r146656 = r146654 / r146655;
        double r146657 = r146651 + r146656;
        return r146657;
}

double f(double x, double y) {
        double r146658 = x;
        double r146659 = y;
        double r146660 = r146659 - r146658;
        double r146661 = fabs(r146660);
        double r146662 = 2.0;
        double r146663 = r146661 / r146662;
        double r146664 = r146658 + r146663;
        return r146664;
}

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