Average Error: 0.1 → 0.1
Time: 2.3s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[\left(\left(9 \cdot \left|x\right|\right) \cdot \sqrt{{x}^{2}} + 3\right) - 12 \cdot x\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
\left(\left(9 \cdot \left|x\right|\right) \cdot \sqrt{{x}^{2}} + 3\right) - 12 \cdot x
double f(double x) {
        double r633682 = 3.0;
        double r633683 = x;
        double r633684 = r633683 * r633682;
        double r633685 = r633684 * r633683;
        double r633686 = 4.0;
        double r633687 = r633683 * r633686;
        double r633688 = r633685 - r633687;
        double r633689 = 1.0;
        double r633690 = r633688 + r633689;
        double r633691 = r633682 * r633690;
        return r633691;
}

double f(double x) {
        double r633692 = 9.0;
        double r633693 = x;
        double r633694 = fabs(r633693);
        double r633695 = r633692 * r633694;
        double r633696 = 2.0;
        double r633697 = pow(r633693, r633696);
        double r633698 = sqrt(r633697);
        double r633699 = r633695 * r633698;
        double r633700 = 3.0;
        double r633701 = r633699 + r633700;
        double r633702 = 12.0;
        double r633703 = r633702 * r633693;
        double r633704 = r633701 - r633703;
        return r633704;
}

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. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{\left(9 \cdot {x}^{2} + 3\right) - 12 \cdot x}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.1

    \[\leadsto \left(9 \cdot \color{blue}{\left(\sqrt{{x}^{2}} \cdot \sqrt{{x}^{2}}\right)} + 3\right) - 12 \cdot x\]
  6. Applied associate-*r*0.1

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

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

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

Reproduce

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