Average Error: 0.2 → 0.2
Time: 15.0s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[x \cdot 6 + \left(-9 \cdot {x}^{2}\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
x \cdot 6 + \left(-9 \cdot {x}^{2}\right)
double f(double x) {
        double r436604 = 3.0;
        double r436605 = 2.0;
        double r436606 = x;
        double r436607 = r436606 * r436604;
        double r436608 = r436605 - r436607;
        double r436609 = r436604 * r436608;
        double r436610 = r436609 * r436606;
        return r436610;
}

double f(double x) {
        double r436611 = x;
        double r436612 = 6.0;
        double r436613 = r436611 * r436612;
        double r436614 = 9.0;
        double r436615 = 2.0;
        double r436616 = pow(r436611, r436615);
        double r436617 = r436614 * r436616;
        double r436618 = -r436617;
        double r436619 = r436613 + r436618;
        return r436619;
}

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

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

    \[\leadsto \color{blue}{x \cdot \left(6 - 9 \cdot x\right)}\]
  4. Using strategy rm
  5. Applied sub-neg0.2

    \[\leadsto x \cdot \color{blue}{\left(6 + \left(-9 \cdot x\right)\right)}\]
  6. Applied distribute-lft-in0.2

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

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

    \[\leadsto x \cdot 6 + \left(-9 \cdot {x}^{2}\right)\]

Reproduce

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