Average Error: 0.1 → 0.1
Time: 8.3s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[3 \cdot 1 + \left(9 \cdot {x}^{2} - 12 \cdot x\right)\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
3 \cdot 1 + \left(9 \cdot {x}^{2} - 12 \cdot x\right)
double f(double x) {
        double r813709 = 3.0;
        double r813710 = x;
        double r813711 = r813710 * r813709;
        double r813712 = r813711 * r813710;
        double r813713 = 4.0;
        double r813714 = r813710 * r813713;
        double r813715 = r813712 - r813714;
        double r813716 = 1.0;
        double r813717 = r813715 + r813716;
        double r813718 = r813709 * r813717;
        return r813718;
}

double f(double x) {
        double r813719 = 3.0;
        double r813720 = 1.0;
        double r813721 = r813719 * r813720;
        double r813722 = 9.0;
        double r813723 = x;
        double r813724 = 2.0;
        double r813725 = pow(r813723, r813724);
        double r813726 = r813722 * r813725;
        double r813727 = 12.0;
        double r813728 = r813727 * r813723;
        double r813729 = r813726 - r813728;
        double r813730 = r813721 + r813729;
        return r813730;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[3 + \left(\left(9 \cdot x\right) \cdot x - 12 \cdot x\right)\]

Derivation

  1. Initial program 0.1

    \[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
  2. Simplified0.1

    \[\leadsto \color{blue}{3 \cdot \left(1 + x \cdot \left(x \cdot 3 - 4\right)\right)}\]
  3. Using strategy rm
  4. Applied distribute-lft-in0.1

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

    \[\leadsto 3 \cdot 1 + \color{blue}{\left(\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \sqrt[3]{3}\right)} \cdot \left(x \cdot \left(x \cdot 3 - 4\right)\right)\]
  7. Applied associate-*l*0.2

    \[\leadsto 3 \cdot 1 + \color{blue}{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \left(\sqrt[3]{3} \cdot \left(x \cdot \left(x \cdot 3 - 4\right)\right)\right)}\]
  8. Taylor expanded around 0 0.1

    \[\leadsto 3 \cdot 1 + \color{blue}{\left(9 \cdot {x}^{2} - 12 \cdot x\right)}\]
  9. Final simplification0.1

    \[\leadsto 3 \cdot 1 + \left(9 \cdot {x}^{2} - 12 \cdot x\right)\]

Reproduce

herbie shell --seed 2020046 
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, D"
  :precision binary64

  :herbie-target
  (+ 3 (- (* (* 9 x) x) (* 12 x)))

  (* 3 (+ (- (* (* x 3) x) (* x 4)) 1)))