Average Error: 0.1 → 0.1
Time: 3.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 r130942 = x;
        double r130943 = y;
        double r130944 = r130943 - r130942;
        double r130945 = fabs(r130944);
        double r130946 = 2.0;
        double r130947 = r130945 / r130946;
        double r130948 = r130942 + r130947;
        return r130948;
}

double f(double x, double y) {
        double r130949 = x;
        double r130950 = y;
        double r130951 = r130950 - r130949;
        double r130952 = fabs(r130951);
        double r130953 = 2.0;
        double r130954 = r130952 / r130953;
        double r130955 = r130949 + r130954;
        return r130955;
}

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