20.04.2015 Views

The Resource Magazine For Apple, Atari, and Commodore ...

The Resource Magazine For Apple, Atari, and Commodore ...

The Resource Magazine For Apple, Atari, and Commodore ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

36 COMPUTE! September/October. 198O. Issue 6<br />

pose you are paying on a loan whose balance is BAL,<br />

using equal monthly payments called PMT, <strong>and</strong> you<br />

have N payments yet to make. What is the<br />

equivalent simple interest rate, called the APR, of<br />

your loan? <strong>The</strong> equation relating these quantities is<br />

BAL = PMT((1 - (1 +I)-N)/I) (9)<br />

.<br />

Table 5. Results of the program in Listing 4.<br />

XL = 0.3, XR = 0.4 XL m 2.0. XR = 2.2<br />

XM<br />

0.35<br />

0.375<br />

0.3625<br />

0.35625<br />

0.359375<br />

0.3578125<br />

O.357O3125<br />

0.357421875<br />

0.357226563<br />

0.357324219<br />

0.357373047<br />

0.357397461<br />

0.357409668<br />

0.357403565<br />

0.357400513<br />

0.357402039<br />

0.357402802<br />

0.357403183<br />

0.357402993<br />

0.357402897<br />

XM<br />

2.1<br />

2.15<br />

2.175<br />

2.1625<br />

2.15625<br />

2.153125<br />

2.1546875<br />

15:390625<br />

15351563<br />

15332032<br />

15322266<br />

15327149<br />

2.15329590<br />

2.15328369<br />

2.15328980<br />

2.15329285<br />

2.15329132<br />

2.15329209<br />

2.15329247<br />

2.15329228<br />

Appendix B.<br />

<strong>The</strong> method of interval halving will not work in the<br />

SOmewhal unusual case of a double root to a polynomial<br />

equation. <strong>For</strong> example, il ;i factor nl a polynomial equation<br />

is<br />

(x - 1)2 = X2 - 2x + 1 = 0)<br />

then the solution at x = i cannot be found with interval<br />

halving.<br />

Appendix C.<br />

One nl the most popular iterative techniques is known<br />

as Newton's method or the Newton-Raphson method. It<br />

wits not mentioned here because ii requires a knowledge<br />

of calculus. <strong>The</strong> iterative formula is;<br />

xj + 1 = x{ - F(x)/Fl(ii)<br />

where ii is assumed thai the equation is initially in the<br />

form F(x) = 0.<br />

Note that in Equation (9), I is the monthly interest<br />

rale, <strong>and</strong> it must be multiplied by 1200 to convert it<br />

to an annual rate expressed in a percent form. In<br />

any case, I challenge you to solve Equation (9) by<br />

straightforward, direct techniques. Refer to the<br />

July/August issue of COMPUTE, for a solution of this<br />

equation by interval halving.<br />

I would like to conclude this article by saying<br />

that you have only seen the tip of the iceberg as far<br />

as numerical analysis is concerned. One of the best<br />

elementary texts on this subject is Peter A. Stark's<br />

INTRODUCTION TO NUMERICAL<br />

METHODS, Macmillian. 1970. Note that many<br />

techniques require a knowledge of calculus. You may<br />

want to check your library for textbooks on the sub<br />

ject. One last plea: if you are a high school student<br />

who is planning a career in computer science, please<br />

get all of the courses in mathematics that your school<br />

offers. Although you do not have to be a<br />

mathematical genius to work in the computer field,<br />

every tool in the old toolbag will be helpful.<br />

PET <strong>and</strong> APPLE II Users<br />

PASCAL<br />

ABACUS Software makes available its version of TINY PASCAL for<br />

the users of two of the most popular personal computers.<br />

TINY PASCAL is a subset of the st<strong>and</strong>ard PASCAL as defined by<br />

Jensen <strong>and</strong> Wirth. It includes the structured programming<br />

features: IF-THEN-ELSE. REPEAT-UNTIL, FOR TC"'DOWN TO-DO.<br />

WHILE-DO, CASE-OF-ELSE, FUNC <strong>and</strong> PROC. Now you can learn the<br />

language that is slated to become the successor to BASIC.<br />

TINY PASCAL is a complete package that allows you to create,<br />

compile <strong>and</strong> execute progams written in the PASCAL language.<br />

You can save source <strong>and</strong> object code on diskette or cassette (PET<br />

version only). Comprehensive user's manual included. <strong>The</strong> manual<br />

can be examined for $10 (refundable with software order).<br />

REQUIREMENTS<br />

PET 16K/32K New ROMS cassette $40<br />

PET 16K/32K New ROMS diskette $35<br />

<strong>Apple</strong> II 32K <strong>Apple</strong>soft ROM w/DOS $35<br />

<strong>Apple</strong> II 48K <strong>Apple</strong>soft RAM w/DOS $35<br />

TINY PASCAL User's Manual $10<br />

6502 Interpreter Listing $20<br />

master charge<br />

FREE postage in U.S. <strong>and</strong> CANADA<br />

All orders prepaid or COO<br />

Appendix A.<br />

<strong>The</strong> method of successive substitutions is guaranteed to<br />

converge to an answer if<br />

lF'(x)M

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!