File: maxima_9.html

package info (click to toggle)
maxima 5.6-17
  • links: PTS
  • area: main
  • in suites: woody
  • size: 30,572 kB
  • ctags: 47,715
  • sloc: ansic: 154,079; lisp: 147,553; asm: 45,843; tcl: 16,744; sh: 11,057; makefile: 7,198; perl: 1,842; sed: 334; fortran: 24; awk: 5
file content (246 lines) | stat: -rw-r--r-- 6,325 bytes parent folder | download
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from maxima.texi on 25 April 2001 -->

<TITLE>Maxima Manual - Floating Point</TITLE>
<link href="maxima_10.html" rel=Next>
<link href="maxima_8.html" rel=Previous>
<link href="maxima_toc.html" rel=ToC>

</HEAD>
<BODY>
<p>Go to the <A HREF="maxima_1.html">first</A>, <A HREF="maxima_8.html">previous</A>, <A HREF="maxima_10.html">next</A>, <A HREF="maxima_41.html">last</A> section, <A HREF="maxima_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC34" HREF="maxima_toc.html#TOC34">Floating Point</A></H1>



<H2><A NAME="SEC35" HREF="maxima_toc.html#TOC35">Definitions for Floating Point</A></H2>

<P>
<DL>
<DT><U>Function:</U> <B>BFFAC</B> <I>(exp,n)</I>
<DD><A NAME="IDX275"></A>
BFLOAT version of the Factorial (shifted Gamma)
function.  The 2nd argument is how many digits to retain and return,
it's a good idea to request a couple of extra.  This function is
available by doing LOAD(BFFAC); .
</DL>

</P>
<P>
<DL>
<DT><U>Variable:</U> <B>ALGEPSILON</B>
<DD><A NAME="IDX276"></A>
The default value is 10^-8.  The value of ALGEPSILON is used by ALGSYS.
</DL>

</P>
<P>
<DL>
<DT><U>Function:</U> <B>BFLOAT</B> <I>(X)</I>
<DD><A NAME="IDX277"></A>
converts all numbers and functions of numbers to bigfloat
numbers.  Setting FPPREC[16] to N, sets the bigfloat precision to N
digits.  If FLOAT2BF[FALSE] is FALSE a warning message is printed when
a floating point number is converted into a bigfloat number (since
this may lead to loss of precision).

</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>BFLOATP</B> <I>(exp)</I>
<DD><A NAME="IDX278"></A>
is TRUE if exp is a bigfloat number else FALSE.

</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>BFPSI</B> <I>(n,z,fpprec)</I>
<DD><A NAME="IDX279"></A>
gives polygammas of real arg and integer order.
For digamma, BFPSI0(z,fpprec) is more direct.  Note -BFPSI0(1,fpprec)
provides BFLOATed %GAMMA.  To use this do LOAD(BFFAC);

</P>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>BFTORAT</B>
<DD><A NAME="IDX280"></A>
 default: [FALSE] controls the conversion of bfloats to
rational numbers.  If

<PRE>
BFTORAT:FALSE
</PRE>

<P>
RATEPSILON will be used to
control the conversion (this results in relatively small rational
numbers).  If

<PRE>
BFTORAT:TRUE
</PRE>

<P>
, the rational number generated will
accurately represent the bfloat.

</P>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>BFTRUNC</B>
<DD><A NAME="IDX281"></A>
 default: [TRUE] causes trailing zeroes in non-zero bigfloat
numbers not to be displayed.  Thus, if BFTRUNC:FALSE, BFLOAT(1);
displays as 1.000000000000000B0. Otherwise, this is displayed as
1.0B0.

</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>CBFAC</B> <I>(z,fpprec)</I>
<DD><A NAME="IDX282"></A>
a factorial for complex bfloats.  It may be used by
doing LOAD(BFAC); For more details see share2/bfac.usg.

</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>FLOAT</B> <I>(exp)</I>
<DD><A NAME="IDX283"></A>
converts integers, rational numbers and bigfloats in exp
to floating point numbers.  It is also an EVFLAG, FLOAT causes
non-integral rational numbers and bigfloat numbers to be converted to
floating point.

</P>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>FLOAT2BF</B>
<DD><A NAME="IDX284"></A>
 default: [FALSE] if FALSE, a warning message is printed when
a floating point number is converted into a bigfloat number (since
this may lead to loss of precision).

</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>FLOATDEFUNK</B>
<DD><A NAME="IDX285"></A>
 - is a utility for making floating point functions from
mathematical expression. It will take the input expression and FLOAT it,
then OPTIMIZE it, and then insert MODE_DECLAREations for all the variables.
This is THE way to use ROMBERG, PLOT2, INTERPOLATE, etc. e.g.
EXP:some-hairy-macsyma-expression;

</P>

<PRE>
FLOATDEFUNK('F,['X],EXP);
</PRE>

<P>
will define the function F(X) for you.
(Do PRINTFILE(MCOMPI,DOC,MAXDOC); for more details.)

</P>
</DL>
<P>
<DL>
<DT><U>Function:</U> <B>FLOATNUMP</B> <I>(exp)</I>
<DD><A NAME="IDX286"></A>
is TRUE if exp is a floating point number else FALSE.

</P>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>FPPREC</B>
<DD><A NAME="IDX287"></A>
 default: [16] - Floating Point PRECision.  Can be set to an
integer representing the desired precision.

</P>
</DL>
<P>
<DL>
<DT><U>Variable:</U> <B>FPPRINTPREC</B>
<DD><A NAME="IDX288"></A>
 default: [0] - The number of digits to print when
printing a bigfloat number, making it possible to compute with a large
number of digits of precision, but have the answer printed out with a
smaller number of digits.  If FPPRINTPREC is 0 (the default), or &#62;=
FPPREC, then the value of FPPREC controls the number of digits used
for printing.  However, if FPPRINTPREC has a value between 2 and
FPPREC-1, then it controls the number of digits used.  (The minimal
number of digits used is 2, one to the left of the point and one to
the right.  The value 1 for FPPRINTPREC is illegal.)
</DL>

</P>
<P>
<DL>
<DT><U>Function:</U> <B>?ROUND</B> <I>(x,&#38;optional-divisor)</I>
<DD><A NAME="IDX289"></A>
round the floating point X to the nearest integer.   The argument
must be a regular system float, not a bigfloat.   The ? beginning the name
indicates this is normal common lisp function.

</P>


<PRE>
(C3) ?round(-2.8);
(D3) 				      - 3
</PRE>

</DL>

<P>
<DL>
<DT><U>Function:</U> <B>?TRUNCATE</B> <I>(x,&#38;optional-divisor)</I>
<DD><A NAME="IDX290"></A>
truncate the floating point X towards 0, to become an integer.   The argument
must be a regular system float, not a bigfloat.  The ? beginning the name
indicates this is normal common lisp function.
</DL>

<PRE>
(C4) ?truncate(-2.8);
(D4) 				      - 2
(C5) ?truncate(2.4);
(D5) 				       2
(C6) ?truncate(2.8);
(D6) 				       2
</PRE>

<P>
<DL>
<DT><U>Variable:</U> <B>ZUNDERFLOW</B>
<DD><A NAME="IDX291"></A>
 default: [TRUE] - if FALSE, an error will be signaled if
floating point underflow occurs.
Currently in NIL Macsyma, all floating-point underflow, floating-point
overflow, and division-by-zero errors signal errors, and this switch
is ignored.

</P>
</DL>

<P><HR><P>
<p>Go to the <A HREF="maxima_1.html">first</A>, <A HREF="maxima_8.html">previous</A>, <A HREF="maxima_10.html">next</A>, <A HREF="maxima_41.html">last</A> section, <A HREF="maxima_toc.html">table of contents</A>.
</BODY>
</HTML>