Average Error: 0.2 → 0.2
Time: 15.3s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)
double f(double x) {
        double r383863 = 3.0;
        double r383864 = 2.0;
        double r383865 = x;
        double r383866 = r383865 * r383863;
        double r383867 = r383864 - r383866;
        double r383868 = r383863 * r383867;
        double r383869 = r383868 * r383865;
        return r383869;
}

double f(double x) {
        double r383870 = 3.0;
        double r383871 = 2.0;
        double r383872 = x;
        double r383873 = r383872 * r383870;
        double r383874 = r383871 - r383873;
        double r383875 = r383874 * r383872;
        double r383876 = r383870 * r383875;
        return r383876;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.2
Target0.2
Herbie0.2
\[6 \cdot x - 9 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.2

    \[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

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

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

Reproduce

herbie shell --seed 2019323 +o rules:numerics
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"
  :precision binary64

  :herbie-target
  (- (* 6 x) (* 9 (* x x)))

  (* (* 3 (- 2 (* x 3))) x))