Average Error: 0.3 → 0.2
Time: 2.3s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[x \cdot \left(6 - x \cdot 9\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
x \cdot \left(6 - x \cdot 9\right)
double f(double x) {
        double r753244 = 3.0;
        double r753245 = 2.0;
        double r753246 = x;
        double r753247 = r753246 * r753244;
        double r753248 = r753245 - r753247;
        double r753249 = r753244 * r753248;
        double r753250 = r753249 * r753246;
        return r753250;
}

double f(double x) {
        double r753251 = x;
        double r753252 = 6.0;
        double r753253 = 9.0;
        double r753254 = r753251 * r753253;
        double r753255 = r753252 - r753254;
        double r753256 = r753251 * r753255;
        return r753256;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.3

    \[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto \color{blue}{3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)}\]
  4. Taylor expanded around 0 0.2

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

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

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

Reproduce

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