Average Error: 0.1 → 0.1
Time: 52.4s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r7241011 = x;
        double r7241012 = y;
        double r7241013 = r7241012 - r7241011;
        double r7241014 = fabs(r7241013);
        double r7241015 = 2.0;
        double r7241016 = r7241014 / r7241015;
        double r7241017 = r7241011 + r7241016;
        return r7241017;
}

double f(double x, double y) {
        double r7241018 = y;
        double r7241019 = x;
        double r7241020 = r7241018 - r7241019;
        double r7241021 = fabs(r7241020);
        double r7241022 = 2.0;
        double r7241023 = r7241021 / r7241022;
        double r7241024 = r7241023 + r7241019;
        return r7241024;
}

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

Reproduce

herbie shell --seed 2019200 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))