Average Error: 0.2 → 0.2
Time: 13.9s
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 r30652186 = 3.0;
        double r30652187 = 2.0;
        double r30652188 = x;
        double r30652189 = r30652188 * r30652186;
        double r30652190 = r30652187 - r30652189;
        double r30652191 = r30652186 * r30652190;
        double r30652192 = r30652191 * r30652188;
        return r30652192;
}

double f(double x) {
        double r30652193 = 6.0;
        double r30652194 = x;
        double r30652195 = 9.0;
        double r30652196 = r30652194 * r30652195;
        double r30652197 = r30652193 - r30652196;
        double r30652198 = r30652197 * r30652194;
        return r30652198;
}

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 +o rules:numerics
(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))