Average Error: 0.0 → 0.0
Time: 12.4s
Precision: 64
\[x + \frac{\left|y - x\right|}{2}\]
\[\frac{\left|y - x\right|}{2} + x\]
x + \frac{\left|y - x\right|}{2}
\frac{\left|y - x\right|}{2} + x
double f(double x, double y) {
        double r8649648 = x;
        double r8649649 = y;
        double r8649650 = r8649649 - r8649648;
        double r8649651 = fabs(r8649650);
        double r8649652 = 2.0;
        double r8649653 = r8649651 / r8649652;
        double r8649654 = r8649648 + r8649653;
        return r8649654;
}

double f(double x, double y) {
        double r8649655 = y;
        double r8649656 = x;
        double r8649657 = r8649655 - r8649656;
        double r8649658 = fabs(r8649657);
        double r8649659 = 2.0;
        double r8649660 = r8649658 / r8649659;
        double r8649661 = r8649660 + r8649656;
        return r8649661;
}

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 \frac{\left|y - x\right|}{2} + x\]

Reproduce

herbie shell --seed 2019171 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderSpotLegend from Chart-1.5.3"
  (+ x (/ (fabs (- y x)) 2.0)))