Average Error: 0.2 → 0.2
Time: 14.4s
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 r37488726 = 3.0;
        double r37488727 = 2.0;
        double r37488728 = x;
        double r37488729 = r37488728 * r37488726;
        double r37488730 = r37488727 - r37488729;
        double r37488731 = r37488726 * r37488730;
        double r37488732 = r37488731 * r37488728;
        return r37488732;
}

double f(double x) {
        double r37488733 = 6.0;
        double r37488734 = x;
        double r37488735 = 9.0;
        double r37488736 = r37488734 * r37488735;
        double r37488737 = r37488733 - r37488736;
        double r37488738 = r37488737 * r37488734;
        return r37488738;
}

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}{\left(6 - 9 \cdot x\right)} \cdot x\]
  3. Final simplification0.2

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

Reproduce

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