Average Error: 0.3 → 0.2
Time: 8.0s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[6 \cdot x - 9 \cdot {x}^{2}\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
6 \cdot x - 9 \cdot {x}^{2}
double f(double x) {
        double r595416 = 3.0;
        double r595417 = 2.0;
        double r595418 = x;
        double r595419 = r595418 * r595416;
        double r595420 = r595417 - r595419;
        double r595421 = r595416 * r595420;
        double r595422 = r595421 * r595418;
        return r595422;
}

double f(double x) {
        double r595423 = 6.0;
        double r595424 = x;
        double r595425 = r595423 * r595424;
        double r595426 = 9.0;
        double r595427 = 2.0;
        double r595428 = pow(r595424, r595427);
        double r595429 = r595426 * r595428;
        double r595430 = r595425 - r595429;
        return r595430;
}

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. Using strategy rm
  3. Applied associate-*l*0.3

    \[\leadsto \color{blue}{3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)}\]
  4. Using strategy rm
  5. Applied add-cube-cbrt0.3

    \[\leadsto \color{blue}{\left(\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \sqrt[3]{3}\right)} \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)\]
  6. Applied associate-*l*0.5

    \[\leadsto \color{blue}{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \left(\sqrt[3]{3} \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)\right)}\]
  7. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{6 \cdot x - 9 \cdot {x}^{2}}\]
  8. Final simplification0.2

    \[\leadsto 6 \cdot x - 9 \cdot {x}^{2}\]

Reproduce

herbie shell --seed 2020046 
(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))