Average Error: 0.0 → 0.0
Time: 2.2s
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 r124147 = x;
        double r124148 = y;
        double r124149 = r124148 - r124147;
        double r124150 = fabs(r124149);
        double r124151 = 2.0;
        double r124152 = r124150 / r124151;
        double r124153 = r124147 + r124152;
        return r124153;
}

double f(double x, double y) {
        double r124154 = x;
        double r124155 = y;
        double r124156 = r124155 - r124154;
        double r124157 = fabs(r124156);
        double r124158 = 2.0;
        double r124159 = r124157 / r124158;
        double r124160 = r124154 + r124159;
        return r124160;
}

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