Average Error: 0.1 → 0.1
Time: 3.8s
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 r131665 = x;
        double r131666 = y;
        double r131667 = r131666 - r131665;
        double r131668 = fabs(r131667);
        double r131669 = 2.0;
        double r131670 = r131668 / r131669;
        double r131671 = r131665 + r131670;
        return r131671;
}

double f(double x, double y) {
        double r131672 = x;
        double r131673 = y;
        double r131674 = r131673 - r131672;
        double r131675 = fabs(r131674);
        double r131676 = 2.0;
        double r131677 = r131675 / r131676;
        double r131678 = r131672 + r131677;
        return r131678;
}

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.1

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.1

    \[\leadsto x + \frac{\left|y - x\right|}{2}\]

Reproduce

herbie shell --seed 2020060 +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)))