Average Error: 0.3 → 0.3
Time: 2.6s
Precision: 64
\[\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x\]
\[3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)\]
\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)
double f(double x) {
        double r750284 = 3.0;
        double r750285 = 2.0;
        double r750286 = x;
        double r750287 = r750286 * r750284;
        double r750288 = r750285 - r750287;
        double r750289 = r750284 * r750288;
        double r750290 = r750289 * r750286;
        return r750290;
}

double f(double x) {
        double r750291 = 3.0;
        double r750292 = 2.0;
        double r750293 = x;
        double r750294 = r750293 * r750291;
        double r750295 = r750292 - r750294;
        double r750296 = r750295 * r750293;
        double r750297 = r750291 * r750296;
        return r750297;
}

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.3
\[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.3

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

    \[\leadsto 3 \cdot \left(\left(2 - x \cdot 3\right) \cdot x\right)\]

Reproduce

herbie shell --seed 2020002 +o rules:numerics
(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))