Trailing-Edge
-
PDP-10 Archives
-
decuslib10-02
-
43,50242/pooexp.mac
There are no other files named pooexp.mac in the archive.
00010 TITLE POOEXP - POOMAS EXPONENTIAL AS OF 11/30/70.
00020 SUBTTL LIFTED FROM FORTRAN.
00030 ;
00040 ; MODIFIED TO BLISS CALLING SEQUENCE AND STACK.
00050 ; ASSUMES BLISS RUN-TIME REGISTERS TO BE 0,1,2,3.
00060 ;
00070 ;TITLE EXP V.021
00080 ;SUBTTL 8 AUGUST 1969 ED YOURDON/KK
00090
00100 ;FLOATING POINT SINGLE PRECISION EXPONENTIAL FUNCTION
00110 ;IF X<=-89.415..., THE PROGRAM RETURNS ZERO AS THE ANSWER
00120 ;IF X>=88.029..., THE PROGRAM RETURNS 377777777777 AS THE ANSWER
00130 ;THE RANGE OF THE ARGUMENT IS REDUCED AS FOLLOWS:
00140 ;EXP(X) = 2**(X*LOG(E)BASE2) = 2**(M+F)
00150 ;WHERE M IS AN INTEGER AND F IS A FRACTION
00160 ;2**M IS CALCULATED BY ALGEBRAICALLY ADDING M TO THE EXPONENT
00170 ;OF THE RESULT OF 2**F. 2**F IS CALCULATED AS
00180
00190 ;2**F = 2(0.5+F(A+B*F^2 - F-C(F^2 + D)**-1)**-1
00200
00210 ;THE ROUTINE HAS THE FOLLOWING CALLING SEQUENCE:
00220 ; PUSH 0,<ARGUMENT>
00230 ; PUSHJ 0,POOEXP
00240 ;THE ANSWER IS RETURNED IN THE VALUE REGISTER, ACC. 3.
00250
00260 A= 14;
00270 B= 15;
00280 C= 16;
00290 D= 17;
00300 SREG=0;
00310 FREG=2;
00320 VREG=3;
00330
00340 EXTERNAL BLIPPE;
00350 ENTRY POOEXP
00360
00370
00380
00390 POOEXP: PUSH SREG,FREG; STANDARD BLISS PROLOG.
00400 HRRZ FREG,SREG;
00410 PUSH SREG,A; SAVE WORKING REGISTERS.
00420 PUSH SREG,B;
00430 PUSH SREG,C;
00440 PUSH SREG,D;
00450 ADD SREG,[1000001]; SPACE FOR ONE LOCAL.
00460 SETZM ,5(FREG); AND ZERO IT.
00470 MOVE B, -2(FREG); PICK UP THE ARGUMENT IN B
00480 CAMGE B,E77 ;IS EXP. < -89.41...?
00490 JRST OUT2 ;YES, GO TO EXIT.
00500 CAMG B,E7 ;IS EXP. > +88.029...?
00510 JRST EXP1 ;GO TO STANDARD ALGORITHM.
00520 PUSH SREG,ERR; CALL BLIPPERROR FOR LARGE ARG.
00530 PUSHJ SREG,BLIPPE;
00540 SUB SREG,[1000001];
00550 HRLOI VREG, 377777 ;GET LARGEST FLOATING NUMBER
00560 JRST EXIT ;EXIT
00570 OUT2: PUSH SREG,ERR; CALL BLIPPERROR FOR SMALL ARG.
00580 PUSHJ SREG,BLIPPE;
00590 SUB SREG,[1000001];
00600 MOVEI VREG,0 ;ANSWER IS 0.
00610 JRST EXIT ;EXIT
00620
00630