Average Error: 0.2 → 0.2
Time: 12.1s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[\left(6 - x \cdot 9\right) \cdot x\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\left(6 - x \cdot 9\right) \cdot x
double f(double x) {
        double r34011900 = 3.0;
        double r34011901 = 2.0;
        double r34011902 = x;
        double r34011903 = r34011902 * r34011900;
        double r34011904 = r34011901 - r34011903;
        double r34011905 = r34011900 * r34011904;
        double r34011906 = r34011905 * r34011902;
        return r34011906;
}

double f(double x) {
        double r34011907 = 6.0;
        double r34011908 = x;
        double r34011909 = 9.0;
        double r34011910 = r34011908 * r34011909;
        double r34011911 = r34011907 - r34011910;
        double r34011912 = r34011911 * r34011908;
        return r34011912;
}

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 - x \cdot 9\right)}\]
  4. Taylor expanded around 0 0.2

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

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

Reproduce

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