Average Error: 0.1 → 0
Time: 2.3s
Precision: 64
\[\left(x \cdot x\right) \cdot x\]
\[{x}^{3}\]
double f(double x) {
        double r46217774 = x;
        double r46217775 = r46217774 * r46217774;
        double r46217776 = r46217775 * r46217774;
        return r46217776;
}

double f(double x) {
        double r46217777 = x;
        double r46217778 = 3.0;
        double r46217779 = pow(r46217777, r46217778);
        return r46217779;
}

\left(x \cdot x\right) \cdot x
{x}^{3}

Error

Bits error versus x

Target

Original0.1
Target0
Herbie0
\[{x}^{3}\]

Derivation

  1. Initial program 0.1

    \[\left(x \cdot x\right) \cdot x\]
  2. Using strategy rm
  3. Applied pow10.1

    \[\leadsto \left(x \cdot x\right) \cdot \color{blue}{{x}^{1}}\]
  4. Applied pow20.1

    \[\leadsto \color{blue}{{x}^{2}} \cdot {x}^{1}\]
  5. Applied pow-prod-up0

    \[\leadsto \color{blue}{{x}^{\left(2 + 1\right)}}\]
  6. Simplified0

    \[\leadsto {x}^{\color{blue}{3}}\]
  7. Final simplification0

    \[\leadsto {x}^{3}\]

Reproduce

herbie shell --seed 2019101 
(FPCore (x)
  :name "math.cube on real"

  :herbie-target
  (pow x 3)

  (* (* x x) x))