Average Error: 0.2 → 0.2
Time: 15.4s
Precision: 64
\[\left(3.0 \cdot \left(2.0 - x \cdot 3.0\right)\right) \cdot x\]
\[\left(6.0 - x \cdot 9.0\right) \cdot x\]
\left(3.0 \cdot \left(2.0 - x \cdot 3.0\right)\right) \cdot x
\left(6.0 - x \cdot 9.0\right) \cdot x
double f(double x) {
        double r19154873 = 3.0;
        double r19154874 = 2.0;
        double r19154875 = x;
        double r19154876 = r19154875 * r19154873;
        double r19154877 = r19154874 - r19154876;
        double r19154878 = r19154873 * r19154877;
        double r19154879 = r19154878 * r19154875;
        return r19154879;
}

double f(double x) {
        double r19154880 = 6.0;
        double r19154881 = x;
        double r19154882 = 9.0;
        double r19154883 = r19154881 * r19154882;
        double r19154884 = r19154880 - r19154883;
        double r19154885 = r19154884 * r19154881;
        return r19154885;
}

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.0 \cdot x - 9.0 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.2

    \[\left(3.0 \cdot \left(2.0 - x \cdot 3.0\right)\right) \cdot x\]
  2. Taylor expanded around 0 0.2

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

    \[\leadsto \color{blue}{x \cdot \left(6.0 - x \cdot 9.0\right)}\]
  4. Final simplification0.2

    \[\leadsto \left(6.0 - x \cdot 9.0\right) \cdot x\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(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))