{VERSION 2 3 "IBM INTEL NT" "2.3" }
{USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0
1 0 0 0 0 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }
{CSTYLE "" -1 257 "" 0 1 4 0 200 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1
258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0
0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 100 32 112 0 0 1 0 0 0
0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 188 0 1 0 0 1 0 0 0 0 0 0 0 }
{CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal"
-1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1
-1 0 0 0 0 0 0 -1 0 }}
{SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "This worksheet contains th
e Maple commands from Chapter 2 of " }{TEXT 262 38 "Introduction to Sc
ientific Programming" }{TEXT -1 22 " by Joseph L. Zachary." }}}{EXCHG
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 78 "(2.1) Th
e simplest kind of a expression is a number. It evaluates to itself.
" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "
57.8;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 ""
{TEXT -1 121 "(2.2) This ill-formed number is an example of a syntax \+
error. Since Maple cannot make sense of it, it reports an error." }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "5.7.
8;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 135 "(2.3) Here we compute the
quotient of two rational numbers. Notice that the answer is expresse
d as an exact fraction in lowest terms." }}{PARA 0 "" 0 "" {TEXT -1 0
"" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "57800000 / 5761000000;" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 242 "(
2.4) We do the same computation as in (2.3), but this time using floa
ting-point numbers. We know these are floating-point numbers because \+
they contain decimal points. The answer is rounded off to ten digits,
not counting the leading zero." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "57800000. / 5761000000.;" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 139 "(
2.5) We do the computation from (2.3) and (2.4) one more time, this t
ime using scientific notation to write the floating-point numbers. "
}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "5
7.8e6 / 5.761e9;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 217 "(2.6) We illustrate that floating-point arithmet
ic is not exact by multiplying the quotient from the previous example \+
by the divisor. The number that we get back is almost, but not exactl
y, the same as the dividend." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA
0 "> " 0 "" {MPLTEXT 1 0 23 ".01003298039 * 5.761e9;" }}}{EXCHG {PARA
0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 77 "(2.7) Here we \+
square a rational number by using the exponentiation operator." }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "5280
^2;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT
-1 211 "(2.8) This example shows how more than one arithmetic operati
on can be carried out in a single expression. Because all of the numb
ers involved are floating-points, the result is expressed as a rationa
l number." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 ""
{MPLTEXT 1 0 25 ".01003298039 * 27878400.;" }}}{EXCHG {PARA 0 "" 0 ""
{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "(2.9) We repeat the comp
utation from (2.8) using rational numbers." }}{PARA 0 "" 0 "" {TEXT
-1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "289/28805 * 27878400;" }}
}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 376 "
(2.10) Here we divide two floating-point numbers (obtaining an interm
ediate floating-point result), square a rational number (obtaining an \+
intermediate rational result), and then multiply the two intermediate \+
results. Because the final multiplication involves both a floating-po
int number and a rational number, the rational number is first convert
ed to floating-point form." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0
"> " 0 "" {MPLTEXT 1 0 30 "(57.8e6 / 5.761e9) * (5280^2);" }}}{EXCHG
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 45 "(2.11) T
his is an example of the use of the " }{TEXT 256 4 "sqrt" }{TEXT -1
65 " built-in function. It returns the square root of its parameter.
" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18
"sqrt(279703.4405);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA
0 "" 0 "" {TEXT -1 25 "(2.12) The parameter to " }{TEXT 257 5 "sqrt \+
" }{TEXT -1 151 "can be an arbitrary expression. Here we take the squ
are root of the value of an expression that involves division, exponen
tiation, and multiplication." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA
0 "> " 0 "" {MPLTEXT 1 0 37 "sqrt((57.8e6 / 5.761e9) * (5280.^2));" }}
}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 127 "
(2.13) Here we take the same square root as in (2.12), but we use rat
ional numbers. An exact result is given using a radical." }}{PARA 0 "
" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "sqrt((578000
00 / 5761000000) * (5280^2));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "
" }}{PARA 0 "" 0 "" {TEXT -1 12 "(2.14) The " }{TEXT 258 6 "evalf " }
{TEXT -1 70 "built-in function converts a rational number into floatin
g-point form." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 ""
{MPLTEXT 1 0 32 "evalf(17952/5761 * sqrt(28805));" }}}{EXCHG {PARA 0 "
" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 198 "(2.15) There is \+
a limit on the sizes of rational numbers that can be computed. Althou
gh the limit varies from computer to computer, this expression will pr
obably exceed the limit on your computer." }}{PARA 0 "" 0 "" {TEXT -1
0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "10^600000;" }}}{EXCHG {PARA
0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 11 "(2.16) If " }
{TEXT 259 9 "10e300000" }{TEXT -1 5 " and " }{TEXT 260 12 "10e(-300000
)" }{TEXT -1 86 " are acceptable rational numbers on your computer, th
is expression will evaluate to 1." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "10^300000 * 10^(-300000);" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "(2
.17) This expression, however, should cause an overflow." }}{PARA 0 "
" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "10^(-300000)
* 10^(-300000);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 47 "(2.18) This one should cause an overflow also." }
}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "10
^300000 * 10^300000;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA
0 "" 0 "" {TEXT -1 158 "(2.19) A compound expression will cause an ov
erflow if any of the intermediate results cause an overflow. For exam
ple, this will probably cause an overflow." }}{PARA 0 "" 0 "" {TEXT
-1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "(10^524279 * 2) * 10^(-52
4279);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 ""
{TEXT -1 120 "(2.20) Depending on the limits imposed on rational numb
ers on your computer, this expression may not cause an overflow." }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "10^
524279 * (2 * 10^(-524279));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 ""
}}{PARA 0 "" 0 "" {TEXT -1 142 "(2.21) The limits on floating-point n
umbers are less restrictive than the limits on rational numbers. This
probably won't cause an overflow." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "10.^600000000.;" }}}{EXCHG {PARA 0
"" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 49 "(2.22) But this \+
probably will cause an overflow." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "10.^6000000000.;" }}}{EXCHG {PARA
0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 102 "(2.23) The ex
act answer to this calculation should be 15241383936, but Maple rounds
it to ten digits." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "
" {MPLTEXT 1 0 11 "123456.^2.;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "
" }}{PARA 0 "" 0 "" {TEXT -1 12 "(2.24) The " }{TEXT 261 5 "evalf" }
{TEXT -1 116 " function takes an optional second parameter, which is t
he number of digits to include in the floating-point result." }}{PARA
0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "evalf(179
52/5761 * sqrt(28805), 15);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
0 "" }}}}{MARK "1 3 0" 5 }{VIEWOPTS 1 1 0 1 1 1803 }