Average Error: 0.1 → 0.1
Time: 1.8s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[9 \cdot {x}^{2} + \left(3 - 12 \cdot x\right)\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
9 \cdot {x}^{2} + \left(3 - 12 \cdot x\right)
double f(double x) {
        double r675210 = 3.0;
        double r675211 = x;
        double r675212 = r675211 * r675210;
        double r675213 = r675212 * r675211;
        double r675214 = 4.0;
        double r675215 = r675211 * r675214;
        double r675216 = r675213 - r675215;
        double r675217 = 1.0;
        double r675218 = r675216 + r675217;
        double r675219 = r675210 * r675218;
        return r675219;
}

double f(double x) {
        double r675220 = 9.0;
        double r675221 = x;
        double r675222 = 2.0;
        double r675223 = pow(r675221, r675222);
        double r675224 = r675220 * r675223;
        double r675225 = 3.0;
        double r675226 = 12.0;
        double r675227 = r675226 * r675221;
        double r675228 = r675225 - r675227;
        double r675229 = r675224 + r675228;
        return r675229;
}

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. Using strategy rm
  5. Applied associate--l+0.1

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

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

Reproduce

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