3.5.1.19.9 Standard C Math Library (math.h)
(Ask a Question)SmartHLS™ supports a subset of the C Math Library. These functions are supported for functionality, however, may not lead to an efficient hardware implementation. If you require high performance, we recommend restructuring your software code to not call these math functions. For example, you can use the SmartHLS Fixed-Point Math Library (see the next section.) The table below shows supported math functions.
Function Types | Function Names | |
---|---|---|
Trigonometric functions | cos, cosf, sin, sinf, tan, tanf, acos, acosf, asin, asinf, atan, atanf, atan2 | |
Hyperbolic functions | cosh, coshf, sinh, sinhf, tanh, tanhf, acosh, acoshf, asinh, asinhf, atanh, atanhf | |
Exponential and logarithmic functions | exp, expf, frexp, log, logf, log10, modf, exp2, expm1, ilogb, log1p, log2, logb, scalbn, scalbln | |
Power functions | pow, powf, sqrt, hypot, cbrt | |
Error and gamma functions | erf, erfc, tgamma | |
Rounding and remainder functions | ceil, floor, fmod, fmodf, trunc, round, lround, llround, rint, lrint, llrint, nearbyint, remainder, remquo | |
Floating-point manipulation functions | copysign, nan, nextafter | |
Minimum, maximum, difference functions | fdim, fmax, fmin | |
Other functions | fabs, fabsf, fma | |
Implemented as macros in C and as functions in C++ | Classification macros or functions | isinf, isnan |
Comparison macros or functions | isgreater, isgreaterequal, isless, islessequal, islessgreater |