Average Error: 0.1 → 0.1
Time: 13.7s
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 r12392159 = x;
        double r12392160 = y;
        double r12392161 = r12392160 - r12392159;
        double r12392162 = fabs(r12392161);
        double r12392163 = 2.0;
        double r12392164 = r12392162 / r12392163;
        double r12392165 = r12392159 + r12392164;
        return r12392165;
}

double f(double x, double y) {
        double r12392166 = x;
        double r12392167 = y;
        double r12392168 = r12392167 - r12392166;
        double r12392169 = fabs(r12392168);
        double r12392170 = 2.0;
        double r12392171 = r12392169 / r12392170;
        double r12392172 = r12392166 + r12392171;
        return r12392172;
}

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 2019174 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))