Average Error: 0.1 → 0.1
Time: 2.9s
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 r185091 = x;
        double r185092 = y;
        double r185093 = r185092 - r185091;
        double r185094 = fabs(r185093);
        double r185095 = 2.0;
        double r185096 = r185094 / r185095;
        double r185097 = r185091 + r185096;
        return r185097;
}

double f(double x, double y) {
        double r185098 = x;
        double r185099 = y;
        double r185100 = r185099 - r185098;
        double r185101 = fabs(r185100);
        double r185102 = 2.0;
        double r185103 = r185101 / r185102;
        double r185104 = r185098 + r185103;
        return r185104;
}

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