Average Error: 0.1 → 0.1
Time: 5.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 r161147 = x;
        double r161148 = y;
        double r161149 = r161148 - r161147;
        double r161150 = fabs(r161149);
        double r161151 = 2.0;
        double r161152 = r161150 / r161151;
        double r161153 = r161147 + r161152;
        return r161153;
}

double f(double x, double y) {
        double r161154 = x;
        double r161155 = y;
        double r161156 = r161155 - r161154;
        double r161157 = fabs(r161156);
        double r161158 = 2.0;
        double r161159 = r161157 / r161158;
        double r161160 = r161154 + r161159;
        return r161160;
}

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