Quantcast
Channel: Community : All Content - OpenCL
Viewing all articles
Browse latest Browse all 2400

Opencl math question New to opencl trying to convert octave to opencl getting different results

$
0
0

I just need a little help converting these lines of octave to opencl i guess i'm confused on the translation ^ to pow her is octave/opencl code but the results are not the same

v1=0.3; 

E1=(207*(10^9)); 

E2=(3*(10^6)); 

v2=0.49;

octave

Er=1/(1/pi*((1-v1^2)/E1+(1-v2^2)/E2));%MPa

DEFACTOR=(6*n*U*B^2)/Er/(sigma^3);

 

my opencl attempt at translation

  

   Er=(1.00/(1.00/pi*((1.00-pow(v1 ,2))/E1+(1.00-pow(v2, 2))/E2)));           //MPa

   DEFACTOR=6*n*U*pow(B,2)/Er/pow(sigma,3);

 

octave results

//er 1.2402e+07

//DEFACTOR 30.962

 

opencl results

Er 139.336666

DEFACTOR -0.000003

 

not sure what i've done wrong but if someone sees it please help

Thanks chocjulio


Viewing all articles
Browse latest Browse all 2400

Trending Articles