Average Error: 0.0 → 0.0
Time: 984.0ms
Precision: 64
\[x + x \cdot x\]
\[x \cdot x + x\]
double f(double x) {
        double r13453222 = x;
        double r13453223 = r13453222 * r13453222;
        double r13453224 = r13453222 + r13453223;
        return r13453224;
}

double f(double x) {
        double r13453225 = x;
        double r13453226 = r13453225 * r13453225;
        double r13453227 = r13453226 + r13453225;
        return r13453227;
}

x + x \cdot x
x \cdot x + x

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 0.0

    \[x + x \cdot x\]
  2. Final simplification0.0

    \[\leadsto x \cdot x + x\]

Reproduce

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

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

  (+ x (* x x)))