File: Floating.texi

package info (click to toggle)
maxima 5.21.1-2squeeze
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 94,928 kB
  • ctags: 43,849
  • sloc: lisp: 298,974; fortran: 14,666; perl: 14,325; tcl: 10,494; sh: 4,052; makefile: 2,975; ansic: 471; awk: 24; sed: 7
file content (238 lines) | stat: -rw-r--r-- 7,048 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
@c ITEMS IN THIS FILE ARE IN NEED OF EXPANSION, CLARIFICATION, AND EXAMPLES

@menu
* Functions and Variables for Floating Point::  
@end menu

@node Functions and Variables for Floating Point,  , Floating Point, Floating Point
@section Functions and Variables for Floating Point

@c FOLLOWING FUNCTIONS IN bffac.mac ARE NOT DESCRIBED IN .texi FILES: !!!
@c obfac, azetb, vonschtoonk, divrlst, obzeta, bfhzeta, bfpsi0 !!!
@c DON'T KNOW WHICH ONES ARE INTENDED FOR GENERAL USE !!!

@c FOLLOWING FUNCTIONS IN bffac.mac ARE DESCRIBED IN Number.texi: !!!
@c burn, bzeta, bfzeta !!!

@c FOLLOWING FUNCTIONS IN bffac.mac ARE DESCRIBED HERE: !!!
@c bfpsi, bffac, cbffac !!!

@deffn {Function} bffac (@var{expr}, @var{n})
Bigfloat version of the factorial (shifted gamma)
function.  The second argument is how many digits to retain and return,
it's a good idea to request a couple of extra.

@opencatbox
@category{Gamma and factorial functions} @category{Numerical evaluation}
@closecatbox
@end deffn

@defvr {Option variable} algepsilon
Default value: 10^8

@c WHAT IS algepsilon, EXACTLY ??? describe ("algsys") IS NOT VERY INFORMATIVE !!!
@code{algepsilon} is used by @code{algsys}.

@opencatbox
@category{Algebraic equations}
@closecatbox

@end defvr

@deffn {Function} bfloat (@var{expr})
Converts all numbers and functions of numbers in @var{expr} to bigfloat numbers.
The number of significant digits in the resulting bigfloats is specified by the global variable @code{fpprec}.

When @code{float2bf} is @code{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).

@opencatbox
@category{Numerical evaluation}
@closecatbox
@end deffn

@deffn {Function} bfloatp (@var{expr})
Returns @code{true} if @var{expr} is a bigfloat number, otherwise @code{false}.

@opencatbox
@category{Numerical evaluation} @category{Predicate functions}
@closecatbox

@end deffn

@deffn {Function} bfpsi (@var{n}, @var{z}, @var{fpprec})
@deffnx {Function} bfpsi0 (@var{z}, @var{fpprec})
@code{bfpsi} is the polygamma function of real argument @var{z} and integer order @var{n}.
@code{bfpsi0} is the digamma function. 
@code{bfpsi0 (@var{z}, @var{fpprec})} is equivalent to @code{bfpsi (0, @var{z}, @var{fpprec})}.

These functions return bigfloat values.
@var{fpprec} is the bigfloat precision of the return value.

@c psi0(1) = -%gamma IS AN INTERESTING PROPERTY BUT IN THE ABSENCE OF ANY OTHER
@c DISCUSSION OF THE PROPERTIES OF THIS FUNCTION, THIS STATEMENT SEEMS OUT OF PLACE.
@c Note @code{-bfpsi0 (1, fpprec)} provides @code{%gamma} (Euler's constant) as a bigfloat.

@opencatbox
@category{Gamma and factorial functions} @category{Numerical evaluation}
@closecatbox
@end deffn

@defvr {Option variable} bftorat
Default value: @code{false}

@code{bftorat} controls the conversion of bfloats to
rational numbers. 
When @code{bftorat} is @code{false},
@code{ratepsilon} will be used to
control the conversion (this results in relatively small rational
numbers).
When @code{bftorat} is @code{true},
the rational number generated will
accurately represent the bfloat.

@opencatbox
@category{Numerical evaluation}
@closecatbox

@end defvr

@defvr {Option variable} bftrunc
Default value: @code{true}

@code{bftrunc} causes trailing zeroes in non-zero bigfloat
numbers not to be displayed.  Thus, if @code{bftrunc} is @code{false}, @code{bfloat (1)}
displays as @code{1.000000000000000B0}. Otherwise, this is displayed as
@code{1.0B0}.

@opencatbox
@category{Numerical evaluation}
@closecatbox

@end defvr

@deffn {Function} cbffac (@var{z}, @var{fpprec})
Complex bigfloat factorial.

@code{load ("bffac")} loads this function.

@opencatbox
@category{Gamma and factorial functions} @category{Complex variables} @category{Numerical evaluation}
@closecatbox
@end deffn

@deffn {Function} float (@var{expr})
Converts integers, rational numbers and bigfloats in @var{expr}
to floating point numbers.  It is also an @code{evflag}, @code{float} causes
non-integral rational numbers and bigfloat numbers to be converted to
floating point.

@opencatbox
@category{Numerical evaluation} @category{Evaluation flags}
@closecatbox
@end deffn

@defvr {Option variable} float2bf
Default value: @code{false}
 
When @code{float2bf} is @code{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).

@opencatbox
@category{Numerical evaluation}
@closecatbox

@end defvr

@deffn {Function} floatnump (@var{expr})
Returns @code{true} if @var{expr} is a floating point number, otherwise @code{false}.

@opencatbox
@category{Numerical evaluation} @category{Predicate functions}
@closecatbox

@end deffn

@defvr {Option variable} fpprec
Default value: 16

@code{fpprec} is the number of significant digits for arithmetic on bigfloat numbers.
@code{fpprec} does not affect computations on ordinary floating point numbers.

See also @code{bfloat} and @code{fpprintprec}.

@opencatbox
@category{Numerical evaluation}
@closecatbox

@end defvr

@defvr {Option variable} fpprintprec
Default value: 0

@code{fpprintprec} is the number of digits to print when printing an ordinary float or bigfloat number.

For ordinary floating point numbers,
when @code{fpprintprec} has a value between 2 and 16 (inclusive),
the number of digits printed is equal to @code{fpprintprec}.
Otherwise, @code{fpprintprec} is 0, or greater than 16,
and the number of digits printed is 16.

For bigfloat numbers,
when @code{fpprintprec} has a value between 2 and @code{fpprec} (inclusive),
the number of digits printed is equal to @code{fpprintprec}.
Otherwise, @code{fpprintprec} is 0, or greater than @code{fpprec},
and the number of digits printed is equal to @code{fpprec}.

@code{fpprintprec} cannot be 1.

@opencatbox
@category{Numerical evaluation} @category{Display flags and variables}
@closecatbox

@end defvr

@c -----------------------------------------------------------------------------
@defvr {Option variable} numer_pbranch
Default value: @code{false}

The option variable @code{numer_pbranch} controls the numerical evaluation of 
the power of a negative integer, rational, or floating point number. When
@code{numer_pbranch} is @code{true} and the exponent is a floating point number
or the option variable @code{numer} is @code{true} too, Maxima evaluates
the numerical result using the principal branch. Otherwise a simplified, but not
an evaluated result is returned.

Examples:

@c ===beg===
@c (-2)^0.75;
@c (-2)^0.75,numer_pbranch:true;
@c (-2)^(3/4);
@c (-2)^(3/4),numer;
@c (-2)^(3/4),numer,numer_pbranch:true;
@c ===end===
@example
(%i1) (-2)^0.75;
(%o1) (-2)^0.75

(%i2) (-2)^0.75,numer_pbranch:true;
(%o2) 1.189207115002721*%i-1.189207115002721

(%i3) (-2)^(3/4);
(%o3) (-1)^(3/4)*2^(3/4)

(%i4) (-2)^(3/4),numer;
(%o4) 1.681792830507429*(-1)^0.75

(%i5) (-2)^(3/4),numer,numer_pbranch:true;
(%o5) 1.189207115002721*%i-1.189207115002721
@end example

@opencatbox
@category{Numerical evaluation}
@closecatbox
@end defvr