Average Error: 0.1 → 0.1
Time: 11.0s
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 r99029 = x;
        double r99030 = y;
        double r99031 = r99030 - r99029;
        double r99032 = fabs(r99031);
        double r99033 = 2.0;
        double r99034 = r99032 / r99033;
        double r99035 = r99029 + r99034;
        return r99035;
}

double f(double x, double y) {
        double r99036 = x;
        double r99037 = y;
        double r99038 = r99037 - r99036;
        double r99039 = fabs(r99038);
        double r99040 = 2.0;
        double r99041 = r99039 / r99040;
        double r99042 = r99036 + r99041;
        return r99042;
}

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

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

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))