|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 3072 (0xc00) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, function Log, seg_0130e0, separate Generic_Elementary_Functions
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
separate (Generic_Elementary_Functions) function Log (X : Float_Type) return Float_Type is -- On input, X is a floating-point value in Float_Type; -- on output, the value of log(X) (natural log of X) is returned. -- The bulk of the computations are performed by the procedure -- KP_Log( Y, M, Z1, Z2 ) which returns log(Y) in M, Z1, and Z2 -- where -- log(Y) = M * log2 + Z1 + Z2, -- M of integer value, and Z1 only has at most 12 significant bits. Y, M, Z1, Z2, Result : Common_Float; Log2_Lead : constant Common_Float := 16#0.B17#; Log2_Trail : constant Common_Float := 16#0.000217F7D1CF79ABC9E3B39803F2F6AF40#; begin Y := Common_Float (X); if (Y = 0.0) then raise Constraint_Error; end if; if (Y < 0.0) then raise Argument_Error; end if; -- Get values of M, Z1, and Z2 so that the natural log of X -- can be calculated by log(X) = M*log(2) + Z1 + Z2 Kp_Log (Y, M, Z1, Z2); if (M = 0.0) then Result := Z1 + Z2; else Result := M * Log2_Trail + Z2; Result := (M * Log2_Lead + Z1) + Result; end if; return (Float_Type (Result)); end Log;
nblk1=2 nid=0 hdr6=4 [0x00] rec0=25 rec1=00 rec2=01 rec3=024 [0x01] rec0=0e rec1=00 rec2=02 rec3=000 tail 0x2150db62282b1522e0fb5 0x42a00066462061e03