Average Error: 0.0 → 0.0
Time: 5.5s
Precision: 64
\[\left(x + y\right) - \frac{\frac{x}{y}}{2}\]
\[\left(x + y\right) - \frac{\frac{x}{y}}{2}\]
\left(x + y\right) - \frac{\frac{x}{y}}{2}
\left(x + y\right) - \frac{\frac{x}{y}}{2}
double f(double x, double y) {
        double r2101664 = x;
        double r2101665 = y;
        double r2101666 = r2101664 + r2101665;
        double r2101667 = r2101664 / r2101665;
        double r2101668 = 2.0;
        double r2101669 = r2101667 / r2101668;
        double r2101670 = r2101666 - r2101669;
        return r2101670;
}

double f(double x, double y) {
        double r2101671 = x;
        double r2101672 = y;
        double r2101673 = r2101671 + r2101672;
        double r2101674 = r2101671 / r2101672;
        double r2101675 = 2.0;
        double r2101676 = r2101674 / r2101675;
        double r2101677 = r2101673 - r2101676;
        return r2101677;
}

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

    \[\left(x + y\right) - \frac{\frac{x}{y}}{2}\]
  2. Final simplification0.0

    \[\leadsto \left(x + y\right) - \frac{\frac{x}{y}}{2}\]

Reproduce

herbie shell --seed 1 
(FPCore (x y)
  :name "x+y - ((x/y)/2)"
  :precision binary64
  (- (+ x y) (/ (/ x y) 2)))