Average Error: 0.0 → 0.0
Time: 9.5s
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 r116937 = x;
        double r116938 = y;
        double r116939 = r116938 - r116937;
        double r116940 = fabs(r116939);
        double r116941 = 2.0;
        double r116942 = r116940 / r116941;
        double r116943 = r116937 + r116942;
        return r116943;
}

double f(double x, double y) {
        double r116944 = x;
        double r116945 = y;
        double r116946 = r116945 - r116944;
        double r116947 = fabs(r116946);
        double r116948 = 2.0;
        double r116949 = r116947 / r116948;
        double r116950 = r116944 + r116949;
        return r116950;
}

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

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

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

Reproduce

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