Average Error: 0.2 → 0.2
Time: 14.6s
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 r30779991 = 3.0;
        double r30779992 = 2.0;
        double r30779993 = x;
        double r30779994 = r30779993 * r30779991;
        double r30779995 = r30779992 - r30779994;
        double r30779996 = r30779991 * r30779995;
        double r30779997 = r30779996 * r30779993;
        return r30779997;
}

double f(double x) {
        double r30779998 = 6.0;
        double r30779999 = x;
        double r30780000 = 9.0;
        double r30780001 = r30779999 * r30780000;
        double r30780002 = r30779998 - r30780001;
        double r30780003 = r30780002 * r30779999;
        return r30780003;
}

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

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

Reproduce

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