cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
1,208 Views
Registered: ‎07-25-2018

erfc and erf build in functions

Jump to solution

Hi,

 

I have used erfc() in my kerneland I am using SW_Simulation.

 

 

for (int i = 0 ; i < n_elements ; i += BUFFER_SIZE)
    {printf("%f\n", erfc(0.35));}

 

 

the program runs but the result is just like the bellow lines. the first 0.0 output and a lot of Nan out put. What should I do? could you please help me?

 

0.000000
-nan
-nan
-nan
-nan

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
1,059 Views
Registered: ‎11-04-2010

Hi,  @ramin_rasoulinezhad ,

Have you tried SDx 2018.2?  I don't see the issue in 2018.2 with erfc and erf.

 

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

0 Kudos
5 Replies
Highlighted
1,196 Views
Registered: ‎07-25-2018

Another try:

 

for (int k=+100;k>-100;k--){
        ali = erfc(k * 0.01);
        printf("&&%g\n", ali);

}

 

output:

&&-5.48613e+303
&&-5.48612e+303
&&-5.48612e+303
&&-5.48612e+303
&&-5.48612e+303

.... (just like the last one)

 

0 Kudos
Highlighted
Moderator
Moderator
1,161 Views
Registered: ‎11-04-2010
Hi, @ramin_rasoulinezhad ,
Which version of sw are you using?
Have you tried the latest version of sw?
Please share more code for us to reproduce the issue.
-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
1,129 Views
Registered: ‎07-25-2018

I am using 2017.2. Is it OK?

 

In this version, all the mathematic functions work except erf and erfc.  Which version do you recommend? I am downloading 2018.2 now

 

Regards,

Ramin

0 Kudos
Highlighted
Moderator
Moderator
1,124 Views
Registered: ‎11-04-2010
Hi, @ramin_rasoulinezhad ,
Please check whether the issue can still be seen in 2018.2(The latest Version is recommended)
-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Moderator
Moderator
1,060 Views
Registered: ‎11-04-2010

Hi,  @ramin_rasoulinezhad ,

Have you tried SDx 2018.2?  I don't see the issue in 2018.2 with erfc and erf.

 

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

0 Kudos