Average Error: 0.0 → 0.0
Time: 12.1s
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 r163394 = x;
        double r163395 = y;
        double r163396 = r163395 - r163394;
        double r163397 = fabs(r163396);
        double r163398 = 2.0;
        double r163399 = r163397 / r163398;
        double r163400 = r163394 + r163399;
        return r163400;
}

double f(double x, double y) {
        double r163401 = x;
        double r163402 = y;
        double r163403 = r163402 - r163401;
        double r163404 = fabs(r163403);
        double r163405 = 2.0;
        double r163406 = r163404 / r163405;
        double r163407 = r163401 + r163406;
        return r163407;
}

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