Average Error: 0.2 → 0.2
Time: 9.3s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[6 \cdot x - 9 \cdot {x}^{2}\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
6 \cdot x - 9 \cdot {x}^{2}
double f(double x) {
        double r464986 = 3.0;
        double r464987 = 2.0;
        double r464988 = x;
        double r464989 = r464988 * r464986;
        double r464990 = r464987 - r464989;
        double r464991 = r464986 * r464990;
        double r464992 = r464991 * r464988;
        return r464992;
}

double f(double x) {
        double r464993 = 6.0;
        double r464994 = x;
        double r464995 = r464993 * r464994;
        double r464996 = 9.0;
        double r464997 = 2.0;
        double r464998 = pow(r464994, r464997);
        double r464999 = r464996 * r464998;
        double r465000 = r464995 - r464999;
        return r465000;
}

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 flip--0.3

    \[\leadsto \left(3 \cdot \color{blue}{\frac{2 \cdot 2 - \left(x \cdot 3\right) \cdot \left(x \cdot 3\right)}{2 + x \cdot 3}}\right) \cdot x\]
  4. Applied associate-*r/0.3

    \[\leadsto \color{blue}{\frac{3 \cdot \left(2 \cdot 2 - \left(x \cdot 3\right) \cdot \left(x \cdot 3\right)\right)}{2 + x \cdot 3}} \cdot x\]
  5. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{6 \cdot x - 9 \cdot {x}^{2}}\]
  6. Final simplification0.2

    \[\leadsto 6 \cdot x - 9 \cdot {x}^{2}\]

Reproduce

herbie shell --seed 2019212 
(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))