Origin Ver. and Service Release (Select Help-->About Origin): 8.0 SR6 Operating System: Xp sp3
Friends, I have an issue to use Erfc with complex numbers. My code goes like,
#include <origin.h> #include <oc_nag8.h> #include <complex.h> void _nlsfcomp_err_func1( // Fit Parameter(s): double x1, double D1, double g1, double c1, // Independent Variable(s): double x, // Dependent Variable(s): double& y) { // Beginning of editable part // Beginning of editable part complex z1,y1,e1; z1=-(x1-1i*D1-x)/g1; e1= erfc(z1); y1=c1*1i*sqrt(Pi)/g1*exp(-z1^2)*e1; y=y1.m_im;
// End of editable part }
If I give a double value to erfc() argument, it compiles fine. Since z1 is complex, it is showing error such as :Error, cannot convert argument in function call Can we work with erfc() using complex arguments by adding some additional header files? I also tried nag_erfc(), the problem is still there,
Thank you Iris. I was not aware of that function before. It works great. Next step is to include one more variable. I am working on it. And let you know the result. thank you very much for the hint.