Average Error: 0.3 → 0.2
Time: 14.3s
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 r542057 = 3.0;
        double r542058 = 2.0;
        double r542059 = x;
        double r542060 = r542059 * r542057;
        double r542061 = r542058 - r542060;
        double r542062 = r542057 * r542061;
        double r542063 = r542062 * r542059;
        return r542063;
}

double f(double x) {
        double r542064 = 6.0;
        double r542065 = 9.0;
        double r542066 = x;
        double r542067 = r542065 * r542066;
        double r542068 = r542064 - r542067;
        double r542069 = r542068 * r542066;
        return r542069;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.2
\[6 \cdot x - 9 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.3

    \[\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 2019303 
(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))