• Keine Ergebnisse gefunden

ELEANOR KRAWITZ International Business Machines Corporatton

Im Dokument Com putation (Seite 51-56)

THE E F FIe I ENe Y with which punched card tables can be constructed and used is so powerful that each prob-lem should be examined for the extent to which tables can be used. Examples of tables commonly used in this manner are trigonometric and logarithmic tables. The cards are an ideal medium for mathematical tables; it is possible to look up millions of digits in a single day. In fact, the effi-ciency of the method increases as the number of cards mcreases.

An ordinary printed table has a tabular interval, argu-ments, function values, and it may have interpolating aids such as differences. The simplest table is a critical or turn-ing point table in which the arguments are so chosen that the value of the tabular function changes by one unit. For example, consider a section of the sine table:

TABLE I

% Sine %

2°.551

0.045 2°.608

0.046 2°.666

0.047 2°.723

0.048 2°.780

For values of the argument between 2° .608 and 2° .666, the value of the sine is 0.046. If the required value of the argu-ment may be one of the printed values, then the author must state which of the two adjacent function values corresponds to that argument. This is usually stated near the printed table. In this example, the lower of the two adjacent values is taken, that is, sin 2° .608 is 0.046. This critical table of the sine consists of 1001 cards for the first quadrant, and the error is 0.5 in the third decimal.

In most cases the number of necessary entries in a critical table is prohibitive; we may shorten the table by making use

52

of the differences of the function. Consider the following small section of the sine table:

TABLE II

%i Sine %i 8'i

2°.0 0.035

+17

3°.0 0.052

+18

4°.0 0.070

+17

5°.0 0.087

To compute the value of sin 3 ° .38 using linear interpol~­

tion, we have

sin 3° .38

=

0.052 +

0.~8

(0.018)

=

0.059 . The required argument serves two purposes in a table in-volving interpolation; it is used to enter the table, and it is used in the interpolating process. This sine table involves a linear interpolation, consists of 91 cards, and has the same accuracy as that of the critical table.

The number of entries in the table may be shortened still further by the introduction of higher order differences

(Table III).

TABLE III

%i sin %i 8i+1/2 8'! t ( 8i-l/2+8i+l/2) /2 B~'/2

0° 0.0000 0 1736 0

+1736

10° 0.1736 52 1710 26

1684

20° 0.3420 -104 1632 52

1580

30° 0.5000 -152 1504 76

1428

40° 0.6428 -196 1330 98

1232

TABLE III (Continued)

Using Stirling's interpolation formula, we have:

f - f·

u-~ + u [8£-1/2

+

2 8i+1/2

+

u

8~J

The necessary interpolation procedure involves three addi-tions, two multiplicaaddi-tions, and two divisions. In many prob-lems, however, it is more efficient to tabulate quantities other than the differences themselves. If the quantities (8£-1/2+ 8i+1/2) /2 and 8i' /2 are tabulated instead of the straight differences, the interpolation operation involves only two additions and two multiplications. This table con-tains ten entries~ requires second-order interpolation, and the maximum error is 4 in the fourth decimal. A punched card table may be key punched directly from a printed table, it may be constructed with the use of machines, or it may dis-tinguishing X is punched in some column for identification purposes.

Assume that we are given a set of detail cards, each of which carries a value of the argument to be used in consult-ing a table. The arguments in the detail cards are presum-ably the result of a previous calculation, The first step in consulting a punched card table is to merge the detail cards with the table cards in such a manner that each table card is followed by all the detail cards whose arguments are greater than or equal to the argument in the table card but less than the argument in the following table card. This may be done on the sorter (if the arguments in the detail and table cards are in the same columns) or on the collator.

If the sorter is used, the two sets of cards are arranged in ascending order of the argument, with the table cards enter-ing the machine first. If the collator is available, and each

set of cards is in ascending order of argument, then a simple run will accomplish the same purpose. The table cards are card from the primary feed alighting first. If the arguments are not equal, the card with the lower argument is ejected.

The control panel is wired to perform these operations.

In the case of the critical table it is only necessary to transfer the value of the function from a table card into the following detail cards with the use of the gang punch. The distinguishing X punch in the table card prevents punching from the last detail card of a group into the following table card. If the table is one in which interpolation is necessary, the cards may be passed through a calculating punch imme-diately after the merging operation. The values of the func-tion and the differences for a table card are stored in the machine and used for the following detail cards. The next table card signals the machine to reset the previous data and replace it with new values.

Some features of the IBM Type 602-A Calculating Punch will be discussed, and a description of the control panel wiring for second-order interpolation will follow. There are 30 counter positions divided into six counter groups, and six storage registers of 12 positions each. All storage regis-ters except the first one are divided into a right- and a left-hand group of six digits each. The first storage register is divided into an eight-digit right-hand group, which stores the multiplier and divisor, and a four-digit left-hand group.

Two of these storage registers are capable of punching re-sults. The counter groups are capable of adding and sub-tracting, and do not reset until they receive an impulse to do so. The storage units do not accumulate, and they auto-matically reset before a new number is accepted. There are

12 available program steps, which may be repeated or ex-tended. In multiplication, the multiplier is read into the right-hand part of storage register 1 (IR), and the multi-plicand is read out of any storage unit or counter into any other counter to accumulate the product.

The programming for the second-order interpolation, fu = fi

+

u [( 8i-1/2+8i+1/2) /2 + u (8~' /2)], is as follows

(Figure 1):

Table cards: Read fi (function) into storage unit 3R.

Read (8i-1/2+8,£+1/2) /2 (modified first dif-ference) into storage unit 2L.

Read 8;'/2 (modified second difference) into storage unit 2R.

Detail cards: Read u into storage unit lR.

V\

~X OR BALANCE PICKUP~#.4'dW~.4'dW#~'-DIGIT IMP o 0 glGI~ PI~KU~ 0 0 0 0 0 0 0 0 01 ~

-7-6-PUNCH EMITTER-l--0-11- 12

1

a

o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

FIGURE 1

Program step J: Multiply u 8r /2: Read out 8i' /2 from storage unit 2R, and develop the negative product in count-ers 5., 6.

Program step 2: Add (8i-l/2+8i+l/2)/2tou(8i')/2: Read out (8i-l/2-8i+l/2)/2 from storage unit 2L, and read posi-tively into counters 5,6.

The design of a punched card table for a particular prob-lem depends upon many factors. If the problem is of con-siderable magnitude, it is worthwhile to spend time and energy to prepare special tables. On the other hand, for a shorter problem a less refined table may be more efficient.

In general, the selection and design of the punched card table depends upon the problem, the machine operators, and the machines available. Each table should be constructed so that it will be most economical.

Usually, it is necessary to trade table size for length of computation. Consider, for example, Newton's formula

f

u=

f i+

U.6.i

' +

u (u 2 . 6 .-1)

"+

i . . .

If a critical table is desired, the effect of the first differences must be negligible; therefore, all possible function values are needed. If only first differences are permitted, the effect of second differences must be negligible; however, a larger interval than that in the critical table is permitted, and fewer entries will be necessary in the table. The computa-tion of the funccomputa-tion now involves an addicomputa-tion and a multi-plication. In the three tables we discussed previously, the critical table contained 1001 entries, and its accuracy was 0.5 X 10-3; the table with linear interpolation contained 91 entries and had the same accuracy; the table with second-order interpolation contained 10 entries, and its accuracy was 0.4 X 10-3This process of the reduction of table size throughout the table or varies by a power of 10. This choice of interval facilitates the interpolation process for the com-puter, and hence fewer errors result. In many problems it is desirable to use the largest tabular interval in which it is legitimate to interpolate with a given order of differences.

A table constructed on this principle is called an optimum interval table. The punched card method conveniently han-dles varying intervals, and thus makes possible a consider-able saving in the number of entries in the tconsider-able. Moreover, the formula used for nth order interpolation in the optimum interval method is equivalent to that used for a constant interval table.

Consider a linear optimum interval table of the exponen-tial function, y = eX, in the range %

=

0 to %

=

5, where

It is clear that a large interval may be chosen at the begin-ning of the table, but the interval must decrease sharply near the end of the table. To facilitate the interpolation operation, the formula for ordinary linear interpolation is transformed so that, that the machine operations are the same as those necessary for ordinary linear interpolation.

56

Consider the problem of determining the sines of cer-tain angles in the first quadrant with a given accuracy of 1 X 10-7The chart below gives the type of table, the order of interpolation, and the number of necessary cards.

Order of Number

Type of Table Interpolation of Cards

critical table first order 5,000,000

constant interval first order 9,000

optim,um interval first order 1,500

optimum interval second order 60

optimum interval third order 15

It is apparent that for different problems different tables are more efficient. The third-order optimum interval table containing 15 cards looks attractive at first glance, but if it is to be used only a few times, it would not be economical to construct.

REFERENCES

1. W. J. ECKERT, Punched Card Methods in Scientific Computa-tion. Revised edition in preparaComputa-tion.

2. H. R. J. GROSCH, "The Use of Optimum Interval Mathematical Tables," Proceedings, Scientific Computation Forum, 1948

(IBM), pp. 23-27.

DISCUSSION

Dr. Sherman: In the problem of inverse interpolation, can optimum interval tables be used?

Miss Krawitz: It is not possible to use the optimum in-terval table directly for inverse interpolation. The values of F and D must be modified.

Mr. Opler: There is an article in the July MTAC on maximum interval tables. They appeared to be differentiat-ing them from optimum interval tables.

Dr. Grosch: Stadler's article, which was the first sent to this country, is just an example of the confusion into which we are always getting. He prefers the term maximum inter-val, because if you apply the methods which he worked out independently of me for determining intervals, the calcula-tion of the maximum allowable interval is obtained, but when Clemmons and Herget coined the phrase optimum interval} they implied a little more than choosing the largest possible interval. They implied the possibility of, having found the maximum interval, abandoning it in favor of a more suitable interval, if something is to be gained by it.

In the list of tables of the Watson Laboratory there is a third-order uniform interval table of sines and cosines which is accurate to about

8Yz

decimal places. That is a uniform interval table of 25 lines per quadrant, because, both sine and cosine were present in the same line of the table, per-haps, the initial stage that you go through in arriving at an optimum table. We have many tables at the Watson Labo-ratory which started out to be extremely elaborate ones and finished in uniform interval form because we could use

f

instead of F and make the table more easily recognizable and usable.

As I see it, all phases of the problem, choosing the proper interpolation, forming the proper intervals of the table, and so forth, must be considered in order to make the table as economical as possible to use for the particular problem you are trying to solve.

Lt. Hastings: I would like to ask for some general com-ments on the extent to which it is no longer necessary to have tables of simple functions like sine and cosine, because of the program repeat on the CPC.

Dr. Grosch: There are certain mathematical functions that are very well adapted to the idea of direct mathematical handling. I think an example is the sine, cosine, where you be very careful about accumulation of errors. On the other hand if you have random lookups, evaluation of each func-tion, without the aid of a table, is more advantageous.

Dr. Hurd: I think what prompted Lt. Hastings' question is the fact that he has made a survey of computing facilities around the country. He noticed in many places where a CPC is available that such functions as trigonometric func-tions and square root, etc., were being calculated directly on the calculator as these functions were needed.

Im Dokument Com putation (Seite 51-56)