Average Error: 0.1 → 0.1
Time: 2.6s
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 r188708 = x;
        double r188709 = y;
        double r188710 = r188709 - r188708;
        double r188711 = fabs(r188710);
        double r188712 = 2.0;
        double r188713 = r188711 / r188712;
        double r188714 = r188708 + r188713;
        return r188714;
}

double f(double x, double y) {
        double r188715 = x;
        double r188716 = y;
        double r188717 = r188716 - r188715;
        double r188718 = fabs(r188717);
        double r188719 = 2.0;
        double r188720 = r188718 / r188719;
        double r188721 = r188715 + r188720;
        return r188721;
}

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