Average Error: 0.0 → 0.0
Time: 10.8s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r121934 = x;
        double r121935 = y;
        double r121936 = r121935 - r121934;
        double r121937 = fabs(r121936);
        double r121938 = 2.0;
        double r121939 = r121937 / r121938;
        double r121940 = r121934 + r121939;
        return r121940;
}

double f(double x, double y) {
        double r121941 = y;
        double r121942 = x;
        double r121943 = r121941 - r121942;
        double r121944 = fabs(r121943);
        double r121945 = 2.0;
        double r121946 = r121944 / r121945;
        double r121947 = r121946 + r121942;
        return r121947;
}

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 \frac{\left|y - x\right|}{2} + x\]

Reproduce

herbie shell --seed 2019194 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))