Average Error: 0.1 → 0.1
Time: 19.5s
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 r112207 = x;
        double r112208 = y;
        double r112209 = r112208 - r112207;
        double r112210 = fabs(r112209);
        double r112211 = 2.0;
        double r112212 = r112210 / r112211;
        double r112213 = r112207 + r112212;
        return r112213;
}

double f(double x, double y) {
        double r112214 = x;
        double r112215 = y;
        double r112216 = r112215 - r112214;
        double r112217 = fabs(r112216);
        double r112218 = 2.0;
        double r112219 = r112217 / r112218;
        double r112220 = r112214 + r112219;
        return r112220;
}

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