Average Error: 0.0 → 0.0
Time: 7.4s
Precision: 64
\[\left(x + a \cdot g\right) + b \cdot g\]
\[\left(x + a \cdot g\right) + b \cdot g\]
\left(x + a \cdot g\right) + b \cdot g
\left(x + a \cdot g\right) + b \cdot g
double f(double x, double a, double g, double b) {
        double r2489572 = x;
        double r2489573 = a;
        double r2489574 = g;
        double r2489575 = r2489573 * r2489574;
        double r2489576 = r2489572 + r2489575;
        double r2489577 = b;
        double r2489578 = r2489577 * r2489574;
        double r2489579 = r2489576 + r2489578;
        return r2489579;
}

double f(double x, double a, double g, double b) {
        double r2489580 = x;
        double r2489581 = a;
        double r2489582 = g;
        double r2489583 = r2489581 * r2489582;
        double r2489584 = r2489580 + r2489583;
        double r2489585 = b;
        double r2489586 = r2489585 * r2489582;
        double r2489587 = r2489584 + r2489586;
        return r2489587;
}

Error

Bits error versus x

Bits error versus a

Bits error versus g

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(x + a \cdot g\right) + b \cdot g\]
  2. Final simplification0.0

    \[\leadsto \left(x + a \cdot g\right) + b \cdot g\]

Reproduce

herbie shell --seed 1 
(FPCore (x a g b)
  :name "x + a * g + b * g"
  :precision binary64
  (+ (+ x (* a g)) (* b g)))