Average Error: 0.2 → 0.2
Time: 2.7s
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 r650275 = 3.0;
        double r650276 = 2.0;
        double r650277 = x;
        double r650278 = r650277 * r650275;
        double r650279 = r650276 - r650278;
        double r650280 = r650275 * r650279;
        double r650281 = r650280 * r650277;
        return r650281;
}

double f(double x) {
        double r650282 = 6.0;
        double r650283 = 9.0;
        double r650284 = x;
        double r650285 = r650283 * r650284;
        double r650286 = r650282 - r650285;
        double r650287 = r650286 * r650284;
        return r650287;
}

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