Average Error: 0.1 → 0.1
Time: 15.1s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[x \cdot \left(9 \cdot x - 12\right) + 3\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
x \cdot \left(9 \cdot x - 12\right) + 3
double f(double x) {
        double r429680 = 3.0;
        double r429681 = x;
        double r429682 = r429681 * r429680;
        double r429683 = r429682 * r429681;
        double r429684 = 4.0;
        double r429685 = r429681 * r429684;
        double r429686 = r429683 - r429685;
        double r429687 = 1.0;
        double r429688 = r429686 + r429687;
        double r429689 = r429680 * r429688;
        return r429689;
}

double f(double x) {
        double r429690 = x;
        double r429691 = 9.0;
        double r429692 = r429691 * r429690;
        double r429693 = 12.0;
        double r429694 = r429692 - r429693;
        double r429695 = r429690 * r429694;
        double r429696 = 3.0;
        double r429697 = r429695 + r429696;
        return r429697;
}

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

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

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

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

Reproduce

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