Annotation of OpenXM/src/asir-port/cgi/r-fd.rr, Revision 1.3
1.3 ! takayama 1: /* $OpenXM: OpenXM/src/asir-port/cgi/r-fd.rr,v 1.2 2014/07/31 06:24:11 takayama Exp $ */
1.1 takayama 2: load("tk_fd.rr")$
1.2 takayama 3: import("tk_r.rr")$
1.3 ! takayama 4: import("oh_number.rr")$
! 5:
! 6: /* r_d2rat(0.3) --> precision loss in truncation if not ctrl("bigfloat",1) */
! 7: ctrl("bigfloat",1)$
! 8: def r_d2rat(Y) {
! 9: if ((type(Y) ==4)||(type(Y)==5)||(type(Y)==6)) return map(r_d2rat,Y);
! 10: if ((type(Y) == 1) && (ntype(Y) >= 1)) {
! 11: S = rtostr(Y); Y = "eval(("+S+")*exp(0));";
! 12: /* print(Y); */
! 13: Y = eval_str(Y);
! 14: return oh_number.rats(Y);
! 15: }else return Y;
! 16: }
1.1 takayama 17: def r_ahvec(A,B,C,Y) {
1.3 ! takayama 18: Y = r_d2rat(Y);
1.1 takayama 19: R=tk_fd.ygahvec(A,B,C,Y|all=1);
20: Gamma=R[1];
21: Der=R[0];
22: Z=R[2]*Gamma;
23: Der2 = newvect(length(Der));
24: for (I=0; I<length(Der); I++) Der2[I] = Der[I]*Gamma;
25: Der2 = vtol(Der2);
26: Ans=cons(Z,Der2);
27: /* Fans=map(rtostr,map(tk_fd.tk_number_rattofloat,Ans)); */
28: Fans=map(deval,Ans);
1.2 takayama 29: Fans = tk_r.asir2r_c(Fans);
1.1 takayama 30: return Fans;
31: }
32: end$
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>