Average Error: 0.3 → 0.3
Time: 2.3s
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 r718257 = 3.0;
        double r718258 = 2.0;
        double r718259 = x;
        double r718260 = r718259 * r718257;
        double r718261 = r718258 - r718260;
        double r718262 = r718257 * r718261;
        double r718263 = r718262 * r718259;
        return r718263;
}

double f(double x) {
        double r718264 = 3.0;
        double r718265 = 2.0;
        double r718266 = x;
        double r718267 = r718266 * r718264;
        double r718268 = r718265 - r718267;
        double r718269 = r718268 * r718266;
        double r718270 = r718264 * r718269;
        return r718270;
}

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 2020039 
(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))