123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802 |
- Sat Jun 29 13:38:22 PDT 1991
- REDUCE 3.4, 15-Jul-91 ...
- 1: 1:
- 2: 2:
- 3: 3: comment
- Integer functions that work in all domain modes, independent of switch
- NUMVAL, so long as their arguments evaluate to real numbers.
- Functions of one argument:
- FIX, SGN, ROUND, CEILING, FLOOR, ISQRT, ICBRT, ILOG2.
- Function of two arguments: IROOTN
- The second argument of IROOTN must evaluate to an integer;
- $
- fix a;
- FIX(A)
- % will be evaluated only if a evaluates to a real number.
- a := 27/4;
- 27
- A := ----
- 4
- fix a;
- 6
- fix 12.345;
- 12
- sgn (-15/2);
- -1
- round 12.5;
- 13
- ceiling 12.5;
- 13
- floor 12.5;
- 12
- isqrt 12.5;
- 3
- icbrt 12.5;
- 2
- ilog2 130.7;
- 7
- irootn(72,4);
- 2
- irootn(72,3/2);
- 3
- IROOTN(72,---)
- 2
- % this will not evaluate.
- comment Functions which require arguments which evaluate to integers:
- Function of one argument: FACTORIAL
- Fumction of two arguments: PERM, CHOOSE;
- $
- factorial 10;
- 3628800
- perm(5,10);
- 30240
- % permutations of 5 out of 10.
- choose(5,10);
- 252
- % choose 5 out of 10;
- comment
- These functions are evaluated in dmodes REALS and COMPLEX-VARIABLE
- (ON REALS,COMPLEX) so long as their arguments and values evaluate to
- real numbers and NUMVAL (normally ON) is ON.
- Variable treated as function of no arguments: E, PI.
- Functions of one argument:
- EXP, LOG, LN, LOG10, NORM, ARG, SQRT, CBRT,
- RAD2DEG, RAD2DMS, DEG2RAD, DEG2DMS, DMS2DEG, DMS2RAD,
- SIN, ASIN, COS, ACOS, TAN, ATAN, COT, ACOT, SEC, ASEC, CSC, ACSC,
- SINH, ASINH, COSH, ACOSH, TANH, ATANH, COTH, ACOTH, SECH, ASECH,
- CSCH, ACSCH,
- SIND, ASIND, COSD, ACOSD, TAND, ATAND, COTD, ACOTD, SECD, ASECD,
- CSCD, ACSCD.
- Functions of two arguments:
- EXPT, LOGB, HYPOT, ATAN2, ATAN2D.
- Function evaluation is carried out to the precision specified in the
- latest PRECISION statement.;
- $
- on rounded;
- precision 6;
- 12
- a := exp 3;
- A := 20.0855
- log a;
- 3.0
- ln a;
- 3.0
- log10 1000;
- 3.0
- norm (-12.345);
- 12.345
- % for real x, this is equivalent to ABS x.
- arg (-12.345);
- 3.14159
- % for real x, this -> if x<0 then pi else 0.0.
- sqrt 3;
- 1.73205
- ws**2;
- 3.0
- cbrt 3;
- 1.44225
- ws**3;
- 3.0
- deg2rad 30;
- 0.523599
- rad2deg ws;
- 30.0
- a := deg2dms 12.345;
- A := {12,20,42.0}
- % a will be a list.
- dms2deg ws;
- 12.345
- dms2rad a;
- 0.215461
- rad2deg ws;
- 12.345
- asin 0.5;
- 0.523599
- sin ws;
- 0.5
- acos 0.5;
- 1.0472
- cos ws;
- 0.5
- atan 0.5;
- 0.463648
- tan ws;
- 0.5
- acot 0.5;
- 1.10715
- cot ws;
- 0.5
- asec 3;
- 1.23096
- sec ws;
- 3.0
- acsc 3;
- 0.339837
- csc ws;
- 3.0
- asinh 0.5;
- 0.481212
- sinh ws;
- 0.5
- acosh 2;
- 1.31696
- cosh ws;
- 2.0
- atanh 0.5;
- 0.549306
- tanh ws;
- 0.5
- acoth 2;
- 0.549306
- coth ws;
- 2.0
- sech 1;
- 0.648054
- asech ws;
- 1
- csch 1;
- 0.850918
- acsch ws;
- 1
- sind 30;
- 0.5
- asind ws;
- 30.0
- cosd 30;
- 0.866025
- acosd ws;
- 30.0
- tand 30;
- 0.57735
- atand ws;
- 30.0
- cotd 30;
- 1.73205
- acotd ws;
- 30.0
- secd 30;
- 1.1547
- asecd ws;
- 30.0
- cscd 30;
- 2.0
- acscd ws;
- 30.0
- expt(2,1.234);
- 2.35218
- logb(ws,2);
- 1.234
- hypot(3,4);
- 5.0
- a := -3*pi/4;
- A := - 2.35619
- % any -pi<a<=pi should work.
- atan2(sin a,cos a);
- - 2.35619
- % this should = a.
- a := -135;
- A := -135
- atan2d(sind a,cosd a);
- - 135.0
- precision 20;
- 6
- % functions will be computed to 20 places.
- sind 60;
- 0.866 02540 37844 38646 76
- asind ws;
- 60.0
- precision 50;
- 20
- % fuctions computed to 50 places.
- sind 60;
- 0.866 02540 37844 38646 76372 31707 52936 18347 14026 26905 19
- asind ws;
- 60.0
- precision 6;
- 50
- comment If argument or value are complex, functions are not computed
- when dmode is REALS;
- $
- sin(1+i);
- SIN(I + 1)
- % complex argument.
- asin 2;
- ASIN(2)
- % value would be complex.
- on complex;
- *** Domain mode ROUNDED changed to COMPLEX-ROUNDED
- comment Complex functions of one argument:
- EXP, LOG, NORM, ARG, SQRT,
- SIN, ASIN, COS, ACOS, TAN, ATAN, COT, ACOT, SEC, ASEC, CSC, ACSC,
- SINH, ASINH, COSH. ACOSH, TANH, ATANH, COTH, ACOTH, SECH, ASECH,
- CSCH, ACSCH.
- Complex function of two variables: EXPT;
- $
- e**(pi*i);
- - 1
- log(1+i);
- 0.346574 + 0.785398*I
- exp ws;
- 1 + I
- norm(5*exp(2i));
- 5.0
- arg(5*exp(2i));
- 2.0
- sqrt(1+i);
- 1.09868 + 0.45509*I
- ws**2;
- 1 + I
- asin 2;
- 1.5708 - 1.31696*I
- sin ws;
- 2.0
- acos 2;
- 1.31696*I
- cos ws;
- 2.0
- atan(1+i);
- 1.01722 + 0.402359*I
- tan ws;
- 1 + I
- acot(1+i);
- 0.553574 - 0.402359*I
- cot ws;
- 1 + I
- asec 0.1;
- 2.99322*I
- sec ws;
- 0.1
- acsc 0.1;
- 1.5708 - 2.99322*I
- csc ws;
- 0.1
- sinh(1+i);
- 0.634964 + 1.29846*I
- asinh ws;
- 1 + I
- cosh(1+i);
- 0.83373 + 0.988898*I
- acosh ws;
- 1 + I
- atanh 2;
- 0.549306 + 1.5708*I
- tanh ws;
- 2.0
- acoth 0.3;
- 0.30952 + 1.5708*I
- coth ws;
- 0.3
- asech(1-i);
- 0.530638 + 1.11852*I
- sech ws;
- 1 - I
- acsch(1-i);
- 0.530638 + 0.452278*I
- csch ws;
- 1 - I
- expt(1+i,1-i);
- 2.80788 + 1.31787*I
- logb(ws,1+i);
- 1 - I
- end;
- 4: 4:
- Quitting
- Sat Jun 29 13:38:31 PDT 1991
|