Average Error: 0.0 → 0.0
Time: 2.6s
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 r143817 = x;
        double r143818 = y;
        double r143819 = r143818 - r143817;
        double r143820 = fabs(r143819);
        double r143821 = 2.0;
        double r143822 = r143820 / r143821;
        double r143823 = r143817 + r143822;
        return r143823;
}

double f(double x, double y) {
        double r143824 = x;
        double r143825 = y;
        double r143826 = r143825 - r143824;
        double r143827 = fabs(r143826);
        double r143828 = 2.0;
        double r143829 = r143827 / r143828;
        double r143830 = r143824 + r143829;
        return r143830;
}

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. Final simplification0.0

    \[\leadsto x + \frac{\left|y - x\right|}{2}\]

Reproduce

herbie shell --seed 2020018 +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)))