Average Error: 0.1 → 0.1
Time: 9.3s
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 r600262 = 3.0;
        double r600263 = x;
        double r600264 = r600263 * r600262;
        double r600265 = r600264 * r600263;
        double r600266 = 4.0;
        double r600267 = r600263 * r600266;
        double r600268 = r600265 - r600267;
        double r600269 = 1.0;
        double r600270 = r600268 + r600269;
        double r600271 = r600262 * r600270;
        return r600271;
}

double f(double x) {
        double r600272 = x;
        double r600273 = 9.0;
        double r600274 = r600273 * r600272;
        double r600275 = 12.0;
        double r600276 = r600274 - r600275;
        double r600277 = r600272 * r600276;
        double r600278 = 3.0;
        double r600279 = r600277 + r600278;
        return r600279;
}

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

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

Reproduce

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