Average Error: 0.1 → 0.1
Time: 2.1s
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) + 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) + 3
double f(double x) {
        double r706267 = 3.0;
        double r706268 = x;
        double r706269 = r706268 * r706267;
        double r706270 = r706269 * r706268;
        double r706271 = 4.0;
        double r706272 = r706268 * r706271;
        double r706273 = r706270 - r706272;
        double r706274 = 1.0;
        double r706275 = r706273 + r706274;
        double r706276 = r706267 * r706275;
        return r706276;
}

double f(double x) {
        double r706277 = x;
        double r706278 = 9.0;
        double r706279 = r706277 * r706278;
        double r706280 = 12.0;
        double r706281 = r706279 - r706280;
        double r706282 = r706277 * r706281;
        double r706283 = 3.0;
        double r706284 = r706282 + r706283;
        return r706284;
}

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

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

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

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

Reproduce

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