Average Error: 0.1 → 0.1
Time: 14.8s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[x \cdot \left(x \cdot 9 - 12\right) + 1 \cdot 3\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
x \cdot \left(x \cdot 9 - 12\right) + 1 \cdot 3
double f(double x) {
        double r34377680 = 3.0;
        double r34377681 = x;
        double r34377682 = r34377681 * r34377680;
        double r34377683 = r34377682 * r34377681;
        double r34377684 = 4.0;
        double r34377685 = r34377681 * r34377684;
        double r34377686 = r34377683 - r34377685;
        double r34377687 = 1.0;
        double r34377688 = r34377686 + r34377687;
        double r34377689 = r34377680 * r34377688;
        return r34377689;
}

double f(double x) {
        double r34377690 = x;
        double r34377691 = 9.0;
        double r34377692 = r34377690 * r34377691;
        double r34377693 = 12.0;
        double r34377694 = r34377692 - r34377693;
        double r34377695 = r34377690 * r34377694;
        double r34377696 = 1.0;
        double r34377697 = 3.0;
        double r34377698 = r34377696 * r34377697;
        double r34377699 = r34377695 + r34377698;
        return r34377699;
}

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.2

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

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

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

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

Reproduce

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

  :herbie-target
  (+ 3.0 (- (* (* 9.0 x) x) (* 12.0 x)))

  (* 3.0 (+ (- (* (* x 3.0) x) (* x 4.0)) 1.0)))