Average Error: 0.2 → 0.2
Time: 2.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 r591160 = 3.0;
        double r591161 = 2.0;
        double r591162 = x;
        double r591163 = r591162 * r591160;
        double r591164 = r591161 - r591163;
        double r591165 = r591160 * r591164;
        double r591166 = r591165 * r591162;
        return r591166;
}

double f(double x) {
        double r591167 = 6.0;
        double r591168 = 9.0;
        double r591169 = x;
        double r591170 = r591168 * r591169;
        double r591171 = r591167 - r591170;
        double r591172 = r591171 * r591169;
        return r591172;
}

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