Average Error: 0.1 → 0.1
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 r133153 = x;
        double r133154 = y;
        double r133155 = r133154 - r133153;
        double r133156 = fabs(r133155);
        double r133157 = 2.0;
        double r133158 = r133156 / r133157;
        double r133159 = r133153 + r133158;
        return r133159;
}

double f(double x, double y) {
        double r133160 = x;
        double r133161 = y;
        double r133162 = r133161 - r133160;
        double r133163 = fabs(r133162);
        double r133164 = 2.0;
        double r133165 = r133163 / r133164;
        double r133166 = r133160 + r133165;
        return r133166;
}

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