Average Error: 0.0 → 0.0
Time: 11.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 r126906 = x;
        double r126907 = y;
        double r126908 = r126907 - r126906;
        double r126909 = fabs(r126908);
        double r126910 = 2.0;
        double r126911 = r126909 / r126910;
        double r126912 = r126906 + r126911;
        return r126912;
}

double f(double x, double y) {
        double r126913 = x;
        double r126914 = y;
        double r126915 = r126914 - r126913;
        double r126916 = fabs(r126915);
        double r126917 = 2.0;
        double r126918 = r126916 / r126917;
        double r126919 = r126913 + r126918;
        return r126919;
}

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 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))