Average Error: 0.0 → 0.0
Time: 4.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 r259116 = x;
        double r259117 = y;
        double r259118 = r259117 - r259116;
        double r259119 = fabs(r259118);
        double r259120 = 2.0;
        double r259121 = r259119 / r259120;
        double r259122 = r259116 + r259121;
        return r259122;
}

double f(double x, double y) {
        double r259123 = x;
        double r259124 = y;
        double r259125 = r259124 - r259123;
        double r259126 = fabs(r259125);
        double r259127 = 2.0;
        double r259128 = r259126 / r259127;
        double r259129 = r259123 + r259128;
        return r259129;
}

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