Average Error: 0.1 → 0.1
Time: 4.7s
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 r111143 = x;
        double r111144 = y;
        double r111145 = r111144 - r111143;
        double r111146 = fabs(r111145);
        double r111147 = 2.0;
        double r111148 = r111146 / r111147;
        double r111149 = r111143 + r111148;
        return r111149;
}

double f(double x, double y) {
        double r111150 = x;
        double r111151 = y;
        double r111152 = r111151 - r111150;
        double r111153 = fabs(r111152);
        double r111154 = 2.0;
        double r111155 = r111153 / r111154;
        double r111156 = r111150 + r111155;
        return r111156;
}

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