blob: aed43ac53f11f11c56abdd21422e67aecae91d47 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input elemfun.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1991.
@
<<*>>=
<<license>>
-- Manipulations of ElementaryFunction Integer
)clear all
-- some values of trig functions will simplify on application
cos 0
sin 0
exp 0
log 1
sin(%pi/2)
simplify %
-- same goes with the usual relations
sin(3)**2 + cos(3)**2
simplify %
a := atan 1
t := cos(a)*sin(a)*tan(a)*sec(a)*csc(a)*cot(a)
simplify t
-- we can remove selected operations
cot2tan t
cot2trig t
tan2cot t
tan2trig t
cos2sec t
-- given such a trig expression not involving any variables,
-- we can get a numeric approximation
t := sin(7)**2 - sec(7)/(1 - cot(7) + csc(7)**3)
simplify t
numeric %
-- we really didn't need to have simplified
numeric t
-- we can get more digits by giving a precision
numeric(t, 100)
-- if we do have an expression involving variables, we can use eval
-- to give them values
u := exp(sin(x-1)**2 - cos(x-1)/sec(x-1))
eval(u,x=1)
-- here is another technique using rewrite rules
v(x) == exp(sin(x-1)**2 - cos(x-1)/sec(x-1))
v x
v 1
v(%pi/3)
numeric %
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}
|