Average Error: 0.1 → 0.1
Time: 2.2s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[\left(9 \cdot {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(9 \cdot {x}^{2} + 3\right) - 12 \cdot x
double f(double x) {
        double r811089 = 3.0;
        double r811090 = x;
        double r811091 = r811090 * r811089;
        double r811092 = r811091 * r811090;
        double r811093 = 4.0;
        double r811094 = r811090 * r811093;
        double r811095 = r811092 - r811094;
        double r811096 = 1.0;
        double r811097 = r811095 + r811096;
        double r811098 = r811089 * r811097;
        return r811098;
}

double f(double x) {
        double r811099 = 9.0;
        double r811100 = x;
        double r811101 = 2.0;
        double r811102 = pow(r811100, r811101);
        double r811103 = r811099 * r811102;
        double r811104 = 3.0;
        double r811105 = r811103 + r811104;
        double r811106 = 12.0;
        double r811107 = r811106 * r811100;
        double r811108 = r811105 - r811107;
        return r811108;
}

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. Final simplification0.1

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

Reproduce

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