Average Error: 0.2 → 0.2
Time: 2.6s
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 r647530 = 3.0;
        double r647531 = 2.0;
        double r647532 = x;
        double r647533 = r647532 * r647530;
        double r647534 = r647531 - r647533;
        double r647535 = r647530 * r647534;
        double r647536 = r647535 * r647532;
        return r647536;
}

double f(double x) {
        double r647537 = 6.0;
        double r647538 = 9.0;
        double r647539 = x;
        double r647540 = r647538 * r647539;
        double r647541 = r647537 - r647540;
        double r647542 = r647541 * r647539;
        return r647542;
}

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 2020001 +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))