\left(3 \cdot \left(2 - x \cdot 3\right)\right) \cdot x
\mathsf{fma}\left(x, 6, \left(x \cdot 9\right) \cdot \left(-x\right)\right)double f(double x) {
double r29702969 = 3.0;
double r29702970 = 2.0;
double r29702971 = x;
double r29702972 = r29702971 * r29702969;
double r29702973 = r29702970 - r29702972;
double r29702974 = r29702969 * r29702973;
double r29702975 = r29702974 * r29702971;
return r29702975;
}
double f(double x) {
double r29702976 = x;
double r29702977 = 6.0;
double r29702978 = 9.0;
double r29702979 = r29702976 * r29702978;
double r29702980 = -r29702976;
double r29702981 = r29702979 * r29702980;
double r29702982 = fma(r29702976, r29702977, r29702981);
return r29702982;
}




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