Average Error: 0.0 → 0.0
Time: 6.5s
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 r158841 = x;
        double r158842 = y;
        double r158843 = r158842 - r158841;
        double r158844 = fabs(r158843);
        double r158845 = 2.0;
        double r158846 = r158844 / r158845;
        double r158847 = r158841 + r158846;
        return r158847;
}

double f(double x, double y) {
        double r158848 = x;
        double r158849 = y;
        double r158850 = r158849 - r158848;
        double r158851 = fabs(r158850);
        double r158852 = 2.0;
        double r158853 = r158851 / r158852;
        double r158854 = r158848 + r158853;
        return r158854;
}

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