Complex Operations#

The table below lists the costs for standard single-precision, floating-point functions. For OpenCL, it assumes the -cl-fast-relaxed-math compilation flag.

A low cost represents less than 30 hardware instructions, and a high cost represents more than 100 instructions. 30 to 100 instructions is considered a medium cost.

Function

Cost

x+y

Low

x*y

Low

x/y

Low

1/x

Low

rsqrt(x), 1/sqrt(x)

Low

sqrt(x)

Low

cbrt(x)

Low

hypot(x)

Medium

exp(x)

Medium

exp2(x)

Low

exp10(x)

Medium

expml(x)

Medium

log(x)

Low

log2(x)

Low

log10(x)

Low

loglp(x)

High

sin(x)

Low

cos(x)

Low

tan(x)

High

sincos(x, cptr)

Medium

asin(x)

Medium

acos(x)

Medium

atan(x)

Low

atan2(y,x)

Medium

sinh(x)

Medium

cosh(x)

Medium

tanh(x)

Medium

asinh(x)

High

acosh(x)

High

atanh(x)

High

pow(x,y)

High

fma(x,y,z)

Low

frexp(x,exp)

Low

ldexp(x,exp)

Medium

logb(x)

Low

ilogb(x)

Low

fmod(x,y)

Medium

remainder(x,y)

High

remquo(x,y,iptr)

High

modf(x,iptr)

Low

fdim(x,y)

Low

trunc(x)

Low

round(x)

Low

rint(x)

Low

ceil(x)

Low

floor(x)

Low

asinpi(x)

Medium

acospi(x)

Medium

atanpi(x)

Low

atan2pi(x,y)

Medium

copysign(x,y)

Low

sinpi(x)

Medium

cospi(x)

Medium

tanpi(x)

Medium

fabs(x)

Low

fmax(x,y)

Low

fmin(x,y)

Low

fract(x,ptr)

Low

hypot(x,y)

Medium

ldexp(x,y)

Medium

mad(x,y,z)

Low

maxmag(x,y)

Low

minmag(x,y)

Low

nan(x)

Low

nextafter(x,y)

Low

powr(x,y)

High

pown(x,y)

High

rootn(x,y)

High

signbit(x)

Low