slizovskiy

25 Reputation

8 Badges

12 years, 177 days

MaplePrimes Activity


These are answers submitted by slizovskiy

@acer 

Hello acer,  thank you for your reply, here are more detailes,  Ubuntu Linux 11.10, 64 bit , Maple 16.01

While posting this, again the same magic happened:  when I copy-paste the result of optimize to manually create the procedure, it works!

Now, when I know where my c code is stored it is interesting to compare the two codes, to see what was wrong:

relevant part of my code:

iang1 := proc (m1, vF1, omega, q) local t1, t11, t13, t14, t17, t18, t19, t2, t20, t21, t22, t23, t24, t25, t26, t27, t3; t17 := q^2; t14 := t17/m1; t24 := t17*vF1; t11 := -t24+t14; t13 := -(2*I)*omega; t25 := vF1^2*t17; t20 := (4*t25-(4*t13+4*t24)*t11)^(1/2); t21 := (2*q+2*t17)*vF1-2*t14; t22 := vF1*q*t20; t23 := 2*t11*(t13+t14)-4*t25; t19 := (-2*t22+t23)^(1/2); t3 := 1/t19; t27 := (t20+t21)*t3; t18 := (2*t22+t23)^(1/2); t2 := 1/t18; t26 := (-t20+t21)*t2; t1 := 4*q*2^(1/2)*t11*(t19*(ln(t26)-ln(-t26))+(ln(-t27)-ln(t27))*t18)*t3*t2/t20 end proc

> infolevel[Compiler] := 3;
3
> iang1c := Compiler[Compile](iang1);
 
Now I attach the new (now working) c file:
#include <mrt.h>


#include <mrt.h>

/* THIS FILE AUTOMATICALLY GENERATED BY THE MAPLE COMPILER -- DO NOT EDIT */
/* Translation of "iang1":

proc (m1, vF1, omega, q) local t1, t11, t13, t14, t17, t18, t19, t2, t20, t21, t22, t23, t24, t25, t26, t27, t3; t17 := q^2; t14 := t17/m1; t24 := t17*vF1; t11 := -t24+t14; t13 := -2*I*omega; t25 := vF1^2*t17; t20 := (4*t25-4*(t13+t24)*t11)^(1/2); t21 := 2*(q+t17)*vF1-2*t14; t22 := vF1*q*t20; t23 := 2*t11*(t13+t14)-4*t25; t19 := (-2*t22+t23)^(1/2); t3 := 1/t19; t27 := (t20+t21)*t3; t18 := (2*t22+t23)^(1/2); t2 := 1/t18; t26 := (-t20+t21)*t2; t1 := 4*q*2^(1/2)*t11*(t19*(ln(t26)-ln(-t26))+(ln(-t27)-ln(t27))*t18)/t20*t3*t2 end proc

*/
#include <mrt.h>

/* Constants table */

static const complex_t ___mrt_zcons1 = { 0, -2 };

/* C-callable entry point */

complex_t
_cb80b3f1301afd551913f21bb90baec4b( const MKernelVector ___k___, double m1, M_INT vF1, complex_t omega, M_INT q )
{
complex_t t1 = { 0.0, 0.0 };
complex_t t11 = { 0.0, 0.0 };
complex_t t13 = { 0.0, 0.0 };
M_INT t14 = 0;
M_INT t17 = 0;
complex_t t18 = { 0.0, 0.0 };
complex_t t19 = { 0.0, 0.0 };
complex_t t2 = { 0.0, 0.0 };
complex_t t20 = { 0.0, 0.0 };
M_INT t21 = 0;
complex_t t22 = { 0.0, 0.0 };
complex_t t23 = { 0.0, 0.0 };
complex_t t24 = { 0.0, 0.0 };
M_INT t25 = 0;
complex_t t26 = { 0.0, 0.0 };
complex_t t27 = { 0.0, 0.0 };
complex_t t3 = { 0.0, 0.0 };
t17 = (M_INT) (mrt_imul( ___k___, q, q ));
t14 = (M_INT) (((double) t17 * 0.1e1 / m1));
t24 = mrt_znew( ((double) t17 * (double) vF1), 0.0 );
t11 = mrt_znew( (-(double) t24 + (double) t14), 0.0 );
t13 = (mrt_zmul( ___mrt_zcons1, omega ));
t25 = (M_INT) ((mrt_imul( ___k___, vF1, vF1 ) * (double) t17));
t20 = mrt_zsqrt( mrt_zsub( mrt_znew( mrt_imul( ___k___, 4, t25 ), 0.0 ), (mrt_zmul( mrt_znew( ((double)(4)), 0.0 ), mrt_zmul( (mrt_zadd( t13, t24 )), t11))) ) ) ;
t21 = mrt_iadd( ___k___, mrt_imul( ___k___, 2,mrt_imul( ___k___, mrt_iadd( ___k___, q, t17 ),vF1)), -mrt_imul( ___k___, 2, t14 ) );
t22 = (mrt_zmul( mrt_znew( vF1, 0.0 ), mrt_zmul( mrt_znew( q, 0.0 ), t20)));
t23 = mrt_zsub( (mrt_zmul( mrt_znew( ((double)(2)), 0.0 ), mrt_zmul( t11, (mrt_zadd( t13, mrt_znew( t14, 0.0 ) ))))), mrt_znew( mrt_imul( ___k___, 4, t25 ), 0.0 ) );
t19 = mrt_zsqrt( (mrt_zadd( mrt_zneg( (mrt_zmul( mrt_znew( ((double)(2)), 0.0 ), t22 )) ), t23 )) ) ;
t3 = mrt_zinv( t19 );
t27 = (mrt_zmul( (mrt_zadd( t20, mrt_znew( t21, 0.0 ) )), t3 ));
t18 = mrt_zsqrt( (mrt_zadd( (mrt_zmul( mrt_znew( ((double)(2)), 0.0 ), t22 )), t23 )) ) ;
t2 = mrt_zinv( t18 );
t26 = (mrt_zmul( (mrt_zadd( mrt_zneg( t20 ), mrt_znew( t21, 0.0 ) )), t2 ));
t1 = (mrt_zmul( mrt_znew( ((double)(4)), 0.0 ), mrt_zmul( mrt_znew( q, 0.0 ), mrt_zmul( mrt_znew( mrt_sqrt( 0.2e1 ) , 0.0 ), mrt_zmul( t11, mrt_zmul( (mrt_zadd( (mrt_zmul( t19, mrt_zsub( mrt_zln( t26 ) , mrt_zln( mrt_zneg( t26 ) ) ) )), (mrt_zmul( mrt_zsub( mrt_zln( mrt_zneg( t27 ) ) , mrt_zln( t27 ) ), t18 )) )), mrt_zmul( mrt_zinv( t20 ), mrt_zmul( t3, t2))))))));
return t1;

}
 
 
Comparing this c file with the one in my first post, i notice only a small diference - some variables have type M_INT  instead of complex_t .  
So, it's very very strange.   Actually, I have already posted on the same topic,
http://www.mapleprimes.com/questions/135011-Compiling-Errors
 but now I look at the c code trying to debug... 
Page 1 of 1