Average Error: 0.3 → 0.2
Time: 9.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 r826859 = 3.0;
        double r826860 = 2.0;
        double r826861 = x;
        double r826862 = r826861 * r826859;
        double r826863 = r826860 - r826862;
        double r826864 = r826859 * r826863;
        double r826865 = r826864 * r826861;
        return r826865;
}

double f(double x) {
        double r826866 = 6.0;
        double r826867 = x;
        double r826868 = r826866 * r826867;
        double r826869 = 9.0;
        double r826870 = 2.0;
        double r826871 = pow(r826867, r826870);
        double r826872 = r826869 * r826871;
        double r826873 = r826868 - r826872;
        return r826873;
}

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 add-cube-cbrt0.3

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

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

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

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

Reproduce

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