Average Error: 0.2 → 0.2
Time: 14.7s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[\left(6 - 9 \cdot x\right) \cdot x\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\left(6 - 9 \cdot x\right) \cdot x
double f(double x) {
        double r446076 = 3.0;
        double r446077 = 2.0;
        double r446078 = x;
        double r446079 = r446078 * r446076;
        double r446080 = r446077 - r446079;
        double r446081 = r446076 * r446080;
        double r446082 = r446081 * r446078;
        return r446082;
}

double f(double x) {
        double r446083 = 6.0;
        double r446084 = 9.0;
        double r446085 = x;
        double r446086 = r446084 * r446085;
        double r446087 = r446083 - r446086;
        double r446088 = r446087 * r446085;
        return r446088;
}

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 - 9 \cdot x\right) \cdot x\]

Reproduce

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