Average Error: 0.2 → 0.2
Time: 12.0s
Precision: 64
\[\left(x \cdot 3\right) \cdot x\]
\[3 \cdot \left(x \cdot x\right)\]
\left(x \cdot 3\right) \cdot x
3 \cdot \left(x \cdot x\right)
double f(double x) {
        double r150757 = x;
        double r150758 = 3.0;
        double r150759 = r150757 * r150758;
        double r150760 = r150759 * r150757;
        return r150760;
}

double f(double x) {
        double r150761 = 3.0;
        double r150762 = x;
        double r150763 = r150762 * r150762;
        double r150764 = r150761 * r150763;
        return r150764;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\left(x \cdot 3\right) \cdot x\]
  2. Simplified0.2

    \[\leadsto \color{blue}{x \cdot \left(x \cdot 3\right)}\]
  3. Using strategy rm
  4. Applied associate-*r*0.2

    \[\leadsto \color{blue}{\left(x \cdot x\right) \cdot 3}\]
  5. Final simplification0.2

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

Reproduce

herbie shell --seed 2019174 +o rules:numerics
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, F"
  (* (* x 3.0) x))