Average Error: 0.3 → 0.2
Time: 6.5s
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 r552186 = 3.0;
        double r552187 = 2.0;
        double r552188 = x;
        double r552189 = r552188 * r552186;
        double r552190 = r552187 - r552189;
        double r552191 = r552186 * r552190;
        double r552192 = r552191 * r552188;
        return r552192;
}

double f(double x) {
        double r552193 = 6.0;
        double r552194 = 9.0;
        double r552195 = x;
        double r552196 = r552194 * r552195;
        double r552197 = r552193 - r552196;
        double r552198 = r552197 * r552195;
        return r552198;
}

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