Average Error: 0.1 → 0.1
Time: 4.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 r183808 = x;
        double r183809 = y;
        double r183810 = r183809 - r183808;
        double r183811 = fabs(r183810);
        double r183812 = 2.0;
        double r183813 = r183811 / r183812;
        double r183814 = r183808 + r183813;
        return r183814;
}

double f(double x, double y) {
        double r183815 = x;
        double r183816 = y;
        double r183817 = r183816 - r183815;
        double r183818 = fabs(r183817);
        double r183819 = 2.0;
        double r183820 = r183818 / r183819;
        double r183821 = r183815 + r183820;
        return r183821;
}

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