Average Error: 0.2 → 0.2
Time: 17.0s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[6 \cdot x - 9 \cdot \left(x \cdot x\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
6 \cdot x - 9 \cdot \left(x \cdot x\right)
double f(double x) {
        double r121310992 = 3.0;
        double r121310993 = 2.0;
        double r121310994 = x;
        double r121310995 = r121310994 * r121310992;
        double r121310996 = r121310993 - r121310995;
        double r121310997 = r121310992 * r121310996;
        double r121310998 = r121310997 * r121310994;
        return r121310998;
}

double f(double x) {
        double r121310999 = 6.0;
        double r121311000 = x;
        double r121311001 = r121310999 * r121311000;
        double r121311002 = 9.0;
        double r121311003 = r121311000 * r121311000;
        double r121311004 = r121311002 * r121311003;
        double r121311005 = r121311001 - r121311004;
        return r121311005;
}

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. Simplified0.2

    \[\leadsto \color{blue}{6 \cdot x - 9 \cdot \left(x \cdot x\right)}\]
  7. Final simplification0.2

    \[\leadsto 6 \cdot x - 9 \cdot \left(x \cdot x\right)\]

Reproduce

herbie shell --seed 2019173 
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"

  :herbie-target
  (- (* 6.0 x) (* 9.0 (* x x)))

  (* (* 3.0 (- 2.0 (* x 3.0))) x))