version 1.23, 2018/03/27 06:29:19 |
version 1.24, 2018/03/28 05:27:22 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/pf.c,v 1.22 2015/08/14 13:51:54 fujimoto Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/pf.c,v 1.23 2018/03/27 06:29:19 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "math.h" |
#include "math.h" |
|
|
#include <alloca.h> |
#include <alloca.h> |
#endif |
#endif |
|
|
double const_pi(),const_e(); |
double const_pi(),const_e(), double_factorial(); |
|
|
void make_ihyp(void); |
void make_ihyp(void); |
void make_hyp(void); |
void make_hyp(void); |
Line 94 int mp_pi(),mp_e(); |
|
Line 94 int mp_pi(),mp_e(); |
|
int mp_exp(), mp_log(), mp_pow(); |
int mp_exp(), mp_log(), mp_pow(); |
int mp_sin(),mp_cos(),mp_tan(),mp_asin(),mp_acos(),mp_atan(); |
int mp_sin(),mp_cos(),mp_tan(),mp_asin(),mp_acos(),mp_atan(); |
int mp_sinh(),mp_cosh(),mp_tanh(),mp_asinh(),mp_acosh(),mp_atanh(); |
int mp_sinh(),mp_cosh(),mp_tanh(),mp_asinh(),mp_acosh(),mp_atanh(); |
|
int mp_factorial(),mp_abs(); |
|
|
|
|
static V *uarg,*darg; |
static V *uarg,*darg; |
static P x,y; |
static P x,y; |
static PF pidef,edef; |
static PF pidef,edef; |
Line 104 static PF sindef,cosdef,tandef; |
|
Line 104 static PF sindef,cosdef,tandef; |
|
static PF asindef,acosdef,atandef; |
static PF asindef,acosdef,atandef; |
static PF sinhdef,coshdef,tanhdef; |
static PF sinhdef,coshdef,tanhdef; |
static PF asinhdef,acoshdef,atanhdef; |
static PF asinhdef,acoshdef,atanhdef; |
|
static PF factorialdef,absdef; |
|
|
#define OALLOC(p,n) ((p)=(Obj *)CALLOC((n),sizeof(Obj))) |
#define OALLOC(p,n) ((p)=(Obj *)CALLOC((n),sizeof(Obj))) |
|
|
double const_pi() { return 3.14159265358979323846264338327950288; } |
double const_pi() { return 3.14159265358979323846264338327950288; } |
double const_e() { return 2.718281828459045235360287471352662497; } |
double const_e() { return 2.718281828459045235360287471352662497; } |
|
|
|
double double_factorial(double x) |
|
{ |
|
return tgamma(x+1); |
|
} |
|
|
int simplify_elemfunc_ins(); |
int simplify_elemfunc_ins(); |
|
int simplify_factorial_ins(); |
|
int simplify_abs_ins(); |
|
|
void pf_init() { |
void pf_init() { |
uarg = (V *)CALLOC(1,sizeof(V)); |
uarg = (V *)CALLOC(1,sizeof(V)); |
Line 122 void pf_init() { |
|
Line 130 void pf_init() { |
|
|
|
mkpf("@pi",0,0,0,(int (*)())mp_pi,const_pi,simplify_elemfunc_ins,&pidef); |
mkpf("@pi",0,0,0,(int (*)())mp_pi,const_pi,simplify_elemfunc_ins,&pidef); |
mkpf("@e",0,0,0,(int (*)())mp_e,const_e,simplify_elemfunc_ins,&edef); |
mkpf("@e",0,0,0,(int (*)())mp_e,const_e,simplify_elemfunc_ins,&edef); |
|
|
|
mkpf("factorial",0,1,uarg,(int (*)())mp_factorial,double_factorial,simplify_factorial_ins,&factorialdef); |
|
mkpf("abs",0,1,uarg,(int (*)())mp_abs,fabs,simplify_abs_ins,&absdef); |
|
|
mkpf("log",0,1,uarg,(int (*)())mp_log,log,simplify_elemfunc_ins,&logdef); |
mkpf("log",0,1,uarg,(int (*)())mp_log,log,simplify_elemfunc_ins,&logdef); |
mkpf("exp",0,1,uarg,(int (*)())mp_exp,exp,simplify_elemfunc_ins,&expdef); |
mkpf("exp",0,1,uarg,(int (*)())mp_exp,exp,simplify_elemfunc_ins,&expdef); |