Average Error: 0.1 → 0.1
Time: 15.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 r107015 = x;
        double r107016 = y;
        double r107017 = r107016 - r107015;
        double r107018 = fabs(r107017);
        double r107019 = 2.0;
        double r107020 = r107018 / r107019;
        double r107021 = r107015 + r107020;
        return r107021;
}

double f(double x, double y) {
        double r107022 = x;
        double r107023 = y;
        double r107024 = r107023 - r107022;
        double r107025 = fabs(r107024);
        double r107026 = 2.0;
        double r107027 = r107025 / r107026;
        double r107028 = r107022 + r107027;
        return r107028;
}

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 2019199 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))