Average Error: 0.0 → 0.0
Time: 6.4s
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 r187832 = x;
        double r187833 = y;
        double r187834 = r187833 - r187832;
        double r187835 = fabs(r187834);
        double r187836 = 2.0;
        double r187837 = r187835 / r187836;
        double r187838 = r187832 + r187837;
        return r187838;
}

double f(double x, double y) {
        double r187839 = x;
        double r187840 = y;
        double r187841 = r187840 - r187839;
        double r187842 = fabs(r187841);
        double r187843 = 2.0;
        double r187844 = r187842 / r187843;
        double r187845 = r187839 + r187844;
        return r187845;
}

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

Reproduce

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