Average Error: 0.0 → 0.0
Time: 8.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 r135886 = x;
        double r135887 = y;
        double r135888 = r135887 - r135886;
        double r135889 = fabs(r135888);
        double r135890 = 2.0;
        double r135891 = r135889 / r135890;
        double r135892 = r135886 + r135891;
        return r135892;
}

double f(double x, double y) {
        double r135893 = x;
        double r135894 = y;
        double r135895 = r135894 - r135893;
        double r135896 = fabs(r135895);
        double r135897 = 2.0;
        double r135898 = r135896 / r135897;
        double r135899 = r135893 + r135898;
        return r135899;
}

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

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

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

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)))