\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\mathsf{fma}\left(x, 6, \left(9 \cdot x\right) \cdot \left(-x\right)\right)double f(double x) {
double r650194 = 3.0;
double r650195 = 2.0;
double r650196 = x;
double r650197 = r650196 * r650194;
double r650198 = r650195 - r650197;
double r650199 = r650194 * r650198;
double r650200 = r650199 * r650196;
return r650200;
}
double f(double x) {
double r650201 = x;
double r650202 = 6.0;
double r650203 = 9.0;
double r650204 = r650203 * r650201;
double r650205 = -r650201;
double r650206 = r650204 * r650205;
double r650207 = fma(r650201, r650202, r650206);
return r650207;
}




Bits error versus x
| Original | 0.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.1 |
Initial program 0.2
Taylor expanded around 0 0.2
Simplified0.1
rmApplied pow10.1
Applied pow10.1
Applied pow10.1
Applied pow-prod-down0.1
Applied pow-prod-down0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019196 +o rules:numerics
(FPCore (x)
:name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, E"
:herbie-target
(- (* 6.0 x) (* 9.0 (* x x)))
(* (* 3.0 (- 2.0 (* x 3.0))) x))