Average Error: 0.0 → 0.0
Time: 19.7s
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 r9933886 = x;
        double r9933887 = r9933886 * r9933886;
        double r9933888 = r9933886 * r9933887;
        double r9933889 = r9933888 + r9933887;
        return r9933889;
}

double f(double x) {
        double r9933890 = x;
        double r9933891 = r9933890 * r9933890;
        double r9933892 = r9933890 * r9933891;
        double r9933893 = r9933891 + r9933892;
        return r9933893;
}

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 
(FPCore (x)
  :name "Expression 3, p15"
  :pre (<= 0 x 2)

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

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