Average Error: 0.2 → 0.2
Time: 15.0s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[\left(6 - x \cdot 9\right) \cdot x\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\left(6 - x \cdot 9\right) \cdot x
double f(double x) {
        double r32609262 = 3.0;
        double r32609263 = 2.0;
        double r32609264 = x;
        double r32609265 = r32609264 * r32609262;
        double r32609266 = r32609263 - r32609265;
        double r32609267 = r32609262 * r32609266;
        double r32609268 = r32609267 * r32609264;
        return r32609268;
}

double f(double x) {
        double r32609269 = 6.0;
        double r32609270 = x;
        double r32609271 = 9.0;
        double r32609272 = r32609270 * r32609271;
        double r32609273 = r32609269 - r32609272;
        double r32609274 = r32609273 * r32609270;
        return r32609274;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.2
Target0.2
Herbie0.2
\[6 \cdot x - 9 \cdot \left(x \cdot x\right)\]

Derivation

  1. Initial program 0.2

    \[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
  2. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{6 \cdot x - 9 \cdot {x}^{2}}\]
  3. Simplified0.2

    \[\leadsto \color{blue}{x \cdot \left(6 - x \cdot 9\right)}\]
  4. Final simplification0.2

    \[\leadsto \left(6 - x \cdot 9\right) \cdot x\]

Reproduce

herbie shell --seed 2019170 
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"

  :herbie-target
  (- (* 6.0 x) (* 9.0 (* x x)))

  (* (* 3.0 (- 2.0 (* x 3.0))) x))