Average Error: 0.1 → 0.1
Time: 2.0s
Precision: binary64
\[\]
\[\]
double code(double x) {
	return ((double) (3.0 * ((double) (((double) (((double) (((double) (x * 3.0)) * x)) - ((double) (x * 4.0)))) + 1.0))));
}
double code(double x) {
	return ((double) (3.0 + ((double) (x * ((double) (((double) (x * 9.0)) - 12.0))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[\]

Derivation

  1. Initial program 0.1

    \[\]
  2. Simplified0.1

    \[\leadsto \]
  3. Taylor expanded around 0 0.1

    \[\leadsto \]
  4. Simplified0.1

    \[\leadsto \]
  5. Final simplification0.1

    \[\leadsto \]

Reproduce

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

  :herbie-target
  (+ 3.0 (- (* (* 9.0 x) x) (* 12.0 x)))

  (* 3.0 (+ (- (* (* x 3.0) x) (* x 4.0)) 1.0)))