Average Error: 0.1 → 0.1
Time: 3.6s
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 r136721 = x;
        double r136722 = y;
        double r136723 = r136722 - r136721;
        double r136724 = fabs(r136723);
        double r136725 = 2.0;
        double r136726 = r136724 / r136725;
        double r136727 = r136721 + r136726;
        return r136727;
}

double f(double x, double y) {
        double r136728 = x;
        double r136729 = y;
        double r136730 = r136729 - r136728;
        double r136731 = fabs(r136730);
        double r136732 = 2.0;
        double r136733 = r136731 / r136732;
        double r136734 = r136728 + r136733;
        return r136734;
}

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