Average Error: 0.0 → 0.0
Time: 19.9s
Precision: 64
\[x \cdot \left(x \cdot x\right) + x \cdot x\]
\[x \cdot x + x \cdot \left(x \cdot x\right)\]
double f(double x) {
        double r12993098 = x;
        double r12993099 = r12993098 * r12993098;
        double r12993100 = r12993098 * r12993099;
        double r12993101 = r12993100 + r12993099;
        return r12993101;
}

double f(double x) {
        double r12993102 = x;
        double r12993103 = r12993102 * r12993102;
        double r12993104 = r12993102 * r12993103;
        double r12993105 = r12993103 + r12993104;
        return r12993105;
}

x \cdot \left(x \cdot x\right) + x \cdot x
x \cdot x + x \cdot \left(x \cdot x\right)

Error

Bits error versus x

Target

Original0.0
Target0.0
Herbie0.0
\[\left(\left(1.0 + x\right) \cdot x\right) \cdot x\]

Derivation

  1. Initial program 0.0

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

    \[\leadsto x \cdot x + x \cdot \left(x \cdot x\right)\]

Reproduce

herbie shell --seed 2019101 +o rules:numerics
(FPCore (x)
  :name "Expression 3, p15"
  :pre (<= 0 x 2)

  :herbie-target
  (* (* (+ 1.0 x) x) x)

  (+ (* x (* x x)) (* x x)))