\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\mathsf{fma}\left(6, x, -9 \cdot {x}^{2}\right)double f(double x) {
double r649290 = 3.0;
double r649291 = 2.0;
double r649292 = x;
double r649293 = r649292 * r649290;
double r649294 = r649291 - r649293;
double r649295 = r649290 * r649294;
double r649296 = r649295 * r649292;
return r649296;
}
double f(double x) {
double r649297 = 6.0;
double r649298 = x;
double r649299 = 9.0;
double r649300 = 2.0;
double r649301 = pow(r649298, r649300);
double r649302 = r649299 * r649301;
double r649303 = -r649302;
double r649304 = fma(r649297, r649298, r649303);
return r649304;
}




Bits error versus x
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 0.2
rmApplied flip--0.3
Simplified0.3
Simplified0.3
Taylor expanded around 0 0.2
rmApplied fma-neg0.1
Final simplification0.1
herbie shell --seed 2020089 +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))