Average Error: 0.2 → 0.1
Time: 3.5s
Precision: 64
\[3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)\]
\[x \cdot \left(9 \cdot x - 12\right) + 3\]
3 \cdot \left(\left(\left(x \cdot 3\right) \cdot x - x \cdot 4\right) + 1\right)
x \cdot \left(9 \cdot x - 12\right) + 3
double f(double x) {
        double r4194 = 3.0;
        double r4195 = x;
        double r4196 = r4195 * r4194;
        double r4197 = r4196 * r4195;
        double r4198 = 4.0;
        double r4199 = r4195 * r4198;
        double r4200 = r4197 - r4199;
        double r4201 = 1.0;
        double r4202 = r4200 + r4201;
        double r4203 = r4194 * r4202;
        return r4203;
}

double f(double x) {
        double r4204 = x;
        double r4205 = 9.0;
        double r4206 = r4205 * r4204;
        double r4207 = 12.0;
        double r4208 = r4206 - r4207;
        double r4209 = r4204 * r4208;
        double r4210 = 3.0;
        double r4211 = r4209 + r4210;
        return r4211;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.2
Target0.1
Herbie0.1
\[3 + \left(\left(9 \cdot x\right) \cdot x - 12 \cdot x\right)\]

Derivation

  1. Initial program 0.2

    \[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(9 \cdot x - 12\right) + 3}\]
  6. Final simplification0.1

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

Reproduce

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