elem.log 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. Sat Jun 29 13:38:22 PDT 1991
  2. REDUCE 3.4, 15-Jul-91 ...
  3. 1: 1:
  4. 2: 2:
  5. 3: 3: comment
  6. Integer functions that work in all domain modes, independent of switch
  7. NUMVAL, so long as their arguments evaluate to real numbers.
  8. Functions of one argument:
  9. FIX, SGN, ROUND, CEILING, FLOOR, ISQRT, ICBRT, ILOG2.
  10. Function of two arguments: IROOTN
  11. The second argument of IROOTN must evaluate to an integer;
  12. $
  13. fix a;
  14. FIX(A)
  15. % will be evaluated only if a evaluates to a real number.
  16. a := 27/4;
  17. 27
  18. A := ----
  19. 4
  20. fix a;
  21. 6
  22. fix 12.345;
  23. 12
  24. sgn (-15/2);
  25. -1
  26. round 12.5;
  27. 13
  28. ceiling 12.5;
  29. 13
  30. floor 12.5;
  31. 12
  32. isqrt 12.5;
  33. 3
  34. icbrt 12.5;
  35. 2
  36. ilog2 130.7;
  37. 7
  38. irootn(72,4);
  39. 2
  40. irootn(72,3/2);
  41. 3
  42. IROOTN(72,---)
  43. 2
  44. % this will not evaluate.
  45. comment Functions which require arguments which evaluate to integers:
  46. Function of one argument: FACTORIAL
  47. Fumction of two arguments: PERM, CHOOSE;
  48. $
  49. factorial 10;
  50. 3628800
  51. perm(5,10);
  52. 30240
  53. % permutations of 5 out of 10.
  54. choose(5,10);
  55. 252
  56. % choose 5 out of 10;
  57. comment
  58. These functions are evaluated in dmodes REALS and COMPLEX-VARIABLE
  59. (ON REALS,COMPLEX) so long as their arguments and values evaluate to
  60. real numbers and NUMVAL (normally ON) is ON.
  61. Variable treated as function of no arguments: E, PI.
  62. Functions of one argument:
  63. EXP, LOG, LN, LOG10, NORM, ARG, SQRT, CBRT,
  64. RAD2DEG, RAD2DMS, DEG2RAD, DEG2DMS, DMS2DEG, DMS2RAD,
  65. SIN, ASIN, COS, ACOS, TAN, ATAN, COT, ACOT, SEC, ASEC, CSC, ACSC,
  66. SINH, ASINH, COSH, ACOSH, TANH, ATANH, COTH, ACOTH, SECH, ASECH,
  67. CSCH, ACSCH,
  68. SIND, ASIND, COSD, ACOSD, TAND, ATAND, COTD, ACOTD, SECD, ASECD,
  69. CSCD, ACSCD.
  70. Functions of two arguments:
  71. EXPT, LOGB, HYPOT, ATAN2, ATAN2D.
  72. Function evaluation is carried out to the precision specified in the
  73. latest PRECISION statement.;
  74. $
  75. on rounded;
  76. precision 6;
  77. 12
  78. a := exp 3;
  79. A := 20.0855
  80. log a;
  81. 3.0
  82. ln a;
  83. 3.0
  84. log10 1000;
  85. 3.0
  86. norm (-12.345);
  87. 12.345
  88. % for real x, this is equivalent to ABS x.
  89. arg (-12.345);
  90. 3.14159
  91. % for real x, this -> if x<0 then pi else 0.0.
  92. sqrt 3;
  93. 1.73205
  94. ws**2;
  95. 3.0
  96. cbrt 3;
  97. 1.44225
  98. ws**3;
  99. 3.0
  100. deg2rad 30;
  101. 0.523599
  102. rad2deg ws;
  103. 30.0
  104. a := deg2dms 12.345;
  105. A := {12,20,42.0}
  106. % a will be a list.
  107. dms2deg ws;
  108. 12.345
  109. dms2rad a;
  110. 0.215461
  111. rad2deg ws;
  112. 12.345
  113. asin 0.5;
  114. 0.523599
  115. sin ws;
  116. 0.5
  117. acos 0.5;
  118. 1.0472
  119. cos ws;
  120. 0.5
  121. atan 0.5;
  122. 0.463648
  123. tan ws;
  124. 0.5
  125. acot 0.5;
  126. 1.10715
  127. cot ws;
  128. 0.5
  129. asec 3;
  130. 1.23096
  131. sec ws;
  132. 3.0
  133. acsc 3;
  134. 0.339837
  135. csc ws;
  136. 3.0
  137. asinh 0.5;
  138. 0.481212
  139. sinh ws;
  140. 0.5
  141. acosh 2;
  142. 1.31696
  143. cosh ws;
  144. 2.0
  145. atanh 0.5;
  146. 0.549306
  147. tanh ws;
  148. 0.5
  149. acoth 2;
  150. 0.549306
  151. coth ws;
  152. 2.0
  153. sech 1;
  154. 0.648054
  155. asech ws;
  156. 1
  157. csch 1;
  158. 0.850918
  159. acsch ws;
  160. 1
  161. sind 30;
  162. 0.5
  163. asind ws;
  164. 30.0
  165. cosd 30;
  166. 0.866025
  167. acosd ws;
  168. 30.0
  169. tand 30;
  170. 0.57735
  171. atand ws;
  172. 30.0
  173. cotd 30;
  174. 1.73205
  175. acotd ws;
  176. 30.0
  177. secd 30;
  178. 1.1547
  179. asecd ws;
  180. 30.0
  181. cscd 30;
  182. 2.0
  183. acscd ws;
  184. 30.0
  185. expt(2,1.234);
  186. 2.35218
  187. logb(ws,2);
  188. 1.234
  189. hypot(3,4);
  190. 5.0
  191. a := -3*pi/4;
  192. A := - 2.35619
  193. % any -pi<a<=pi should work.
  194. atan2(sin a,cos a);
  195. - 2.35619
  196. % this should = a.
  197. a := -135;
  198. A := -135
  199. atan2d(sind a,cosd a);
  200. - 135.0
  201. precision 20;
  202. 6
  203. % functions will be computed to 20 places.
  204. sind 60;
  205. 0.866 02540 37844 38646 76
  206. asind ws;
  207. 60.0
  208. precision 50;
  209. 20
  210. % fuctions computed to 50 places.
  211. sind 60;
  212. 0.866 02540 37844 38646 76372 31707 52936 18347 14026 26905 19
  213. asind ws;
  214. 60.0
  215. precision 6;
  216. 50
  217. comment If argument or value are complex, functions are not computed
  218. when dmode is REALS;
  219. $
  220. sin(1+i);
  221. SIN(I + 1)
  222. % complex argument.
  223. asin 2;
  224. ASIN(2)
  225. % value would be complex.
  226. on complex;
  227. *** Domain mode ROUNDED changed to COMPLEX-ROUNDED
  228. comment Complex functions of one argument:
  229. EXP, LOG, NORM, ARG, SQRT,
  230. SIN, ASIN, COS, ACOS, TAN, ATAN, COT, ACOT, SEC, ASEC, CSC, ACSC,
  231. SINH, ASINH, COSH. ACOSH, TANH, ATANH, COTH, ACOTH, SECH, ASECH,
  232. CSCH, ACSCH.
  233. Complex function of two variables: EXPT;
  234. $
  235. e**(pi*i);
  236. - 1
  237. log(1+i);
  238. 0.346574 + 0.785398*I
  239. exp ws;
  240. 1 + I
  241. norm(5*exp(2i));
  242. 5.0
  243. arg(5*exp(2i));
  244. 2.0
  245. sqrt(1+i);
  246. 1.09868 + 0.45509*I
  247. ws**2;
  248. 1 + I
  249. asin 2;
  250. 1.5708 - 1.31696*I
  251. sin ws;
  252. 2.0
  253. acos 2;
  254. 1.31696*I
  255. cos ws;
  256. 2.0
  257. atan(1+i);
  258. 1.01722 + 0.402359*I
  259. tan ws;
  260. 1 + I
  261. acot(1+i);
  262. 0.553574 - 0.402359*I
  263. cot ws;
  264. 1 + I
  265. asec 0.1;
  266. 2.99322*I
  267. sec ws;
  268. 0.1
  269. acsc 0.1;
  270. 1.5708 - 2.99322*I
  271. csc ws;
  272. 0.1
  273. sinh(1+i);
  274. 0.634964 + 1.29846*I
  275. asinh ws;
  276. 1 + I
  277. cosh(1+i);
  278. 0.83373 + 0.988898*I
  279. acosh ws;
  280. 1 + I
  281. atanh 2;
  282. 0.549306 + 1.5708*I
  283. tanh ws;
  284. 2.0
  285. acoth 0.3;
  286. 0.30952 + 1.5708*I
  287. coth ws;
  288. 0.3
  289. asech(1-i);
  290. 0.530638 + 1.11852*I
  291. sech ws;
  292. 1 - I
  293. acsch(1-i);
  294. 0.530638 + 0.452278*I
  295. csch ws;
  296. 1 - I
  297. expt(1+i,1-i);
  298. 2.80788 + 1.31787*I
  299. logb(ws,1+i);
  300. 1 - I
  301. end;
  302. 4: 4:
  303. Quitting
  304. Sat Jun 29 13:38:31 PDT 1991