Average Error: 0.1 → 0.1
Time: 3.3s
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 r143634 = x;
        double r143635 = y;
        double r143636 = r143635 - r143634;
        double r143637 = fabs(r143636);
        double r143638 = 2.0;
        double r143639 = r143637 / r143638;
        double r143640 = r143634 + r143639;
        return r143640;
}

double f(double x, double y) {
        double r143641 = x;
        double r143642 = y;
        double r143643 = r143642 - r143641;
        double r143644 = fabs(r143643);
        double r143645 = 2.0;
        double r143646 = r143644 / r143645;
        double r143647 = r143641 + r143646;
        return r143647;
}

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 2020062 +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)))