Average Error: 0.0 → 0.0
Time: 8.9s
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 r162833 = x;
        double r162834 = y;
        double r162835 = r162834 - r162833;
        double r162836 = fabs(r162835);
        double r162837 = 2.0;
        double r162838 = r162836 / r162837;
        double r162839 = r162833 + r162838;
        return r162839;
}

double f(double x, double y) {
        double r162840 = y;
        double r162841 = x;
        double r162842 = r162840 - r162841;
        double r162843 = fabs(r162842);
        double r162844 = 2.0;
        double r162845 = r162843 / r162844;
        double r162846 = r162845 + r162841;
        return r162846;
}

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.0

    \[x + \frac{\left|y - x\right|}{2}\]
  2. Final simplification0.0

    \[\leadsto \frac{\left|y - x\right|}{2} + x\]

Reproduce

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