\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\mathsf{fma}\left(6, x, -x \cdot \left(x \cdot 9\right)\right)double f(double x) {
double r43660339 = 3.0;
double r43660340 = 2.0;
double r43660341 = x;
double r43660342 = r43660341 * r43660339;
double r43660343 = r43660340 - r43660342;
double r43660344 = r43660339 * r43660343;
double r43660345 = r43660344 * r43660341;
return r43660345;
}
double f(double x) {
double r43660346 = 6.0;
double r43660347 = x;
double r43660348 = 9.0;
double r43660349 = r43660347 * r43660348;
double r43660350 = r43660347 * r43660349;
double r43660351 = -r43660350;
double r43660352 = fma(r43660346, r43660347, r43660351);
return r43660352;
}




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