Average Error: 0.1 → 0.1
Time: 3.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 r179535 = x;
        double r179536 = y;
        double r179537 = r179536 - r179535;
        double r179538 = fabs(r179537);
        double r179539 = 2.0;
        double r179540 = r179538 / r179539;
        double r179541 = r179535 + r179540;
        return r179541;
}

double f(double x, double y) {
        double r179542 = x;
        double r179543 = y;
        double r179544 = r179543 - r179542;
        double r179545 = fabs(r179544);
        double r179546 = 2.0;
        double r179547 = r179545 / r179546;
        double r179548 = r179542 + r179547;
        return r179548;
}

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