Average Error: 0.1 → 0.1
Time: 2.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 r147200 = x;
        double r147201 = y;
        double r147202 = r147201 - r147200;
        double r147203 = fabs(r147202);
        double r147204 = 2.0;
        double r147205 = r147203 / r147204;
        double r147206 = r147200 + r147205;
        return r147206;
}

double f(double x, double y) {
        double r147207 = x;
        double r147208 = y;
        double r147209 = r147208 - r147207;
        double r147210 = fabs(r147209);
        double r147211 = 2.0;
        double r147212 = r147210 / r147211;
        double r147213 = r147207 + r147212;
        return r147213;
}

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