Average Error: 0.1 → 0.1
Time: 11.4s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[\left(9 \cdot \left(x \cdot x\right) + 3\right) - x \cdot 12\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
\left(9 \cdot \left(x \cdot x\right) + 3\right) - x \cdot 12
double f(double x) {
        double r33251299 = 3.0;
        double r33251300 = x;
        double r33251301 = r33251300 * r33251299;
        double r33251302 = r33251301 * r33251300;
        double r33251303 = 4.0;
        double r33251304 = r33251300 * r33251303;
        double r33251305 = r33251302 - r33251304;
        double r33251306 = 1.0;
        double r33251307 = r33251305 + r33251306;
        double r33251308 = r33251299 * r33251307;
        return r33251308;
}

double f(double x) {
        double r33251309 = 9.0;
        double r33251310 = x;
        double r33251311 = r33251310 * r33251310;
        double r33251312 = r33251309 * r33251311;
        double r33251313 = 3.0;
        double r33251314 = r33251312 + r33251313;
        double r33251315 = 12.0;
        double r33251316 = r33251310 * r33251315;
        double r33251317 = r33251314 - r33251316;
        return r33251317;
}

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}{\left(x \cdot \left(x \cdot 9\right) + 3\right) - 12 \cdot x}\]
  4. Using strategy rm
  5. Applied associate-*r*0.1

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

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

Reproduce

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