Average Error: 0.1 → 0.1
Time: 3.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 r166169 = x;
        double r166170 = y;
        double r166171 = r166170 - r166169;
        double r166172 = fabs(r166171);
        double r166173 = 2.0;
        double r166174 = r166172 / r166173;
        double r166175 = r166169 + r166174;
        return r166175;
}

double f(double x, double y) {
        double r166176 = x;
        double r166177 = y;
        double r166178 = r166177 - r166176;
        double r166179 = fabs(r166178);
        double r166180 = 2.0;
        double r166181 = r166179 / r166180;
        double r166182 = r166176 + r166181;
        return r166182;
}

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