Average Error: 0.2 → 0.2
Time: 13.5s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[\left(6 - 9 \cdot x\right) \cdot x\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\left(6 - 9 \cdot x\right) \cdot x
double f(double x) {
        double r415360 = 3.0;
        double r415361 = 2.0;
        double r415362 = x;
        double r415363 = r415362 * r415360;
        double r415364 = r415361 - r415363;
        double r415365 = r415360 * r415364;
        double r415366 = r415365 * r415362;
        return r415366;
}

double f(double x) {
        double r415367 = 6.0;
        double r415368 = 9.0;
        double r415369 = x;
        double r415370 = r415368 * r415369;
        double r415371 = r415367 - r415370;
        double r415372 = r415371 * r415369;
        return r415372;
}

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}{\left(6 - 9 \cdot x\right)} \cdot x\]
  3. Using strategy rm
  4. Applied flip--0.3

    \[\leadsto \color{blue}{\frac{6 \cdot 6 - \left(9 \cdot x\right) \cdot \left(9 \cdot x\right)}{6 + 9 \cdot x}} \cdot x\]
  5. Simplified0.3

    \[\leadsto \frac{6 \cdot 6 - \left(9 \cdot x\right) \cdot \left(9 \cdot x\right)}{\color{blue}{9 \cdot x + 6}} \cdot x\]
  6. Taylor expanded around 0 0.2

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

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

Reproduce

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

  :herbie-target
  (- (* 6 x) (* 9 (* x x)))

  (* (* 3 (- 2 (* x 3))) x))