Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jpanta
Beginner
981 Views

Where is the sincos function?

Jump to solution

I was sure that this is supported in older version but whenever I use a sincos function now (sincos(float v,float *sinv,float *cosv)), I get an undefined function error by the compiler.

Is it really dropped?

Thank you.

0 Kudos
1 Solution
Richard_A_Intel
Employee
981 Views

It may be worth knowing that the Intel compiler will automatically generate  __svml_sincosf8..() when a sin() and cos() is used on the same value.  This optimization happens on O2 and O3 and does not need to be explicitly programmed in the source.

View solution in original post

9 Replies
TimP
Black Belt
981 Views

I'm guessing that you are using a linux or MAC compiler and relying on C++ support in glibc or MSVC library.  Your man page on sincos and sincosf ought to discuss the supported ways of calling the function directly.

If I'm guessing wrong, a little more information from you would be helpful, such as the exact wording of the error.

I think standard compliant use of cosf() and sinf() may be more reliable, Compilers look for opportunities to combine them into a single sincos call, possibly a short vector version.

jpanta
Beginner
981 Views

Nop, I am talking about Visual Studio + XE Composer 15. I thought that sincosf was a library function (not coming from MSVC library, it is not available there) since I had this working with older compiler (11.1 series). But... I may be wrong and had it somewhere defined myself that I overlooked.

TimP
Black Belt
981 Views

MSDN describes sincosf but C++11 has changed implementation of some forms of mixed data type math functions, so it's probably better to adhere strictly to what is described in documents.  I wouldn't count on not specifying /Qstd=c++11 as a way of retaining the older interpretation of math functions.

jpanta
Beginner
981 Views

Great, thank you for the explanation.

Bernard
Black Belt
981 Views

 As described in MSDN sincos is part of DirectX HLSL intrinsic functions.

SergeyKostrov
Valued Contributor II
981 Views
>>...I thought that sincosf was a library function (not coming from MSVC library... I'd like to inform you that 'sincos' function never was a part of CRT library ( C Run-Time ). It is possible that MKL library is used in your software development environment, or some another 3-rd party library is linked.
Richard_A_Intel
Employee
982 Views

It may be worth knowing that the Intel compiler will automatically generate  __svml_sincosf8..() when a sin() and cos() is used on the same value.  This optimization happens on O2 and O3 and does not need to be explicitly programmed in the source.

View solution in original post

TimP
Black Belt
981 Views

RICHARD A. (Intel) wrote:

It may be worth knowing that the Intel compiler with automatically generate  __svml_sincosf8..() when a sin() and cos() is used on the same value.  This optimization happens on O2 and O3 and does not need to be explicated programed in the source.

I alluded to this in #2, without specifically mentioning the ICL options.    If options such as /fp:source are set, /Qfast-transcendentals would need to be set as well.

jpanta
Beginner
981 Views

Thank you all for the clarifications.

Reply