Average Error: 0.0 → 0.0
Time: 17.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 r109097 = x;
        double r109098 = y;
        double r109099 = r109098 - r109097;
        double r109100 = fabs(r109099);
        double r109101 = 2.0;
        double r109102 = r109100 / r109101;
        double r109103 = r109097 + r109102;
        return r109103;
}

double f(double x, double y) {
        double r109104 = x;
        double r109105 = y;
        double r109106 = r109105 - r109104;
        double r109107 = fabs(r109106);
        double r109108 = 2.0;
        double r109109 = r109107 / r109108;
        double r109110 = r109104 + r109109;
        return r109110;
}

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

Reproduce

herbie shell --seed 2019347 +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)))