Average Error: 0.0 → 0.0
Time: 2.2s
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 r160290 = x;
        double r160291 = y;
        double r160292 = r160291 - r160290;
        double r160293 = fabs(r160292);
        double r160294 = 2.0;
        double r160295 = r160293 / r160294;
        double r160296 = r160290 + r160295;
        return r160296;
}

double f(double x, double y) {
        double r160297 = x;
        double r160298 = y;
        double r160299 = r160298 - r160297;
        double r160300 = fabs(r160299);
        double r160301 = 2.0;
        double r160302 = r160300 / r160301;
        double r160303 = r160297 + r160302;
        return r160303;
}

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