Average Error: 0.1 → 0.1
Time: 4.8s
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 r129116 = x;
        double r129117 = y;
        double r129118 = r129117 - r129116;
        double r129119 = fabs(r129118);
        double r129120 = 2.0;
        double r129121 = r129119 / r129120;
        double r129122 = r129116 + r129121;
        return r129122;
}

double f(double x, double y) {
        double r129123 = x;
        double r129124 = y;
        double r129125 = r129124 - r129123;
        double r129126 = fabs(r129125);
        double r129127 = 2.0;
        double r129128 = r129126 / r129127;
        double r129129 = r129123 + r129128;
        return r129129;
}

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 2019308 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  :precision binary64
  (+ x (/ (fabs (- y x)) 2)))