Average Error: 0.2 → 0.2
Time: 2.2s
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 r693459 = 3.0;
        double r693460 = 2.0;
        double r693461 = x;
        double r693462 = r693461 * r693459;
        double r693463 = r693460 - r693462;
        double r693464 = r693459 * r693463;
        double r693465 = r693464 * r693461;
        return r693465;
}

double f(double x) {
        double r693466 = 6.0;
        double r693467 = 9.0;
        double r693468 = x;
        double r693469 = r693467 * r693468;
        double r693470 = r693466 - r693469;
        double r693471 = r693470 * r693468;
        return r693471;
}

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 2020049 
(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))