Average Error: 0.1 → 0.1
Time: 2.9s
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 r136645 = x;
        double r136646 = y;
        double r136647 = r136646 - r136645;
        double r136648 = fabs(r136647);
        double r136649 = 2.0;
        double r136650 = r136648 / r136649;
        double r136651 = r136645 + r136650;
        return r136651;
}

double f(double x, double y) {
        double r136652 = x;
        double r136653 = y;
        double r136654 = r136653 - r136652;
        double r136655 = fabs(r136654);
        double r136656 = 2.0;
        double r136657 = r136655 / r136656;
        double r136658 = r136652 + r136657;
        return r136658;
}

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