Average Error: 0.1 → 0.1
Time: 2.6s
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 r730419 = 3.0;
        double r730420 = x;
        double r730421 = r730420 * r730419;
        double r730422 = r730421 * r730420;
        double r730423 = 4.0;
        double r730424 = r730420 * r730423;
        double r730425 = r730422 - r730424;
        double r730426 = 1.0;
        double r730427 = r730425 + r730426;
        double r730428 = r730419 * r730427;
        return r730428;
}

double f(double x) {
        double r730429 = 9.0;
        double r730430 = x;
        double r730431 = 2.0;
        double r730432 = pow(r730430, r730431);
        double r730433 = r730429 * r730432;
        double r730434 = 3.0;
        double r730435 = r730433 + r730434;
        double r730436 = 12.0;
        double r730437 = r730436 * r730430;
        double r730438 = r730435 - r730437;
        return r730438;
}

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 2020001 
(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)))