Average Error: 0.2 → 0.2
Time: 14.5s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[x \cdot \left(6 - 9 \cdot x\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
x \cdot \left(6 - 9 \cdot x\right)
double f(double x) {
        double r443937 = 3.0;
        double r443938 = 2.0;
        double r443939 = x;
        double r443940 = r443939 * r443937;
        double r443941 = r443938 - r443940;
        double r443942 = r443937 * r443941;
        double r443943 = r443942 * r443939;
        return r443943;
}

double f(double x) {
        double r443944 = x;
        double r443945 = 6.0;
        double r443946 = 9.0;
        double r443947 = r443946 * r443944;
        double r443948 = r443945 - r443947;
        double r443949 = r443944 * r443948;
        return r443949;
}

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. Taylor expanded around 0 0.2

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

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

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

Reproduce

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