Intel® High Level Synthesis Compiler Pro Edition: Reference Manual

ID 683349
Date 6/26/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

B.5. Math Functions Provided by the hls_float_math.h Header File

Adding the hls_float_math.h header file adds support for the following arbitrary precision floating point (hls_float_math.h) data type functions:
  • square root: ihc_sqrt
  • cube root: ihc_cbrt
  • reciprocal (inverse): ihc_recip
  • reciprocal (inverse) square root: ihc_rsqrt
  • hypotenuse: ihc_hypot
  • e x : ihc_exp
  • e x-1 : ihc_expm1
  • 2 x : ihc_exp2
  • 10 x : ihc_exp10
  • ln(x): ihc_log
  • log2(x): ihc_log2
  • log10(x): ihc_log10
  • ln(1+x): ihc_log1p
  • x y : ihc_pow

    Both x and y are hls_float data types

  • x n : ihc_pown

    x is hls_float data type, n is ac_int data type

  • x y : ihc_powr

    Both x and y are hls_float data types. With the restriction that x>=0 -> x^y, x>=0, undefined behavior if x < 0

  • sin: ihc_sin
  • sinpi: ihc_sinpi
  • cos: ihc_cos
  • cospi: ihc_cospi
  • sincos: ihc_sincos
  • sincospi: ihc_sincospi
  • arcsin: ihc_asin
  • arcsinpi: ihc_asinpi
  • arccos: ihc_acos
  • arccospi: ihc_acospi
  • arctan: ihc_atan
  • arctanpi: ihc_atanpi
  • arctan(x/y): ihc_atan2

    Both x and y are hls_float data types

For details about inputs type restrictions, input value limits, and output type propagation rules, review the comments in the hls_float_math.h header file.