|
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 - metrics - download
Length: 3072 (0xc00) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, function Exp, seg_0130c7, separate Generic_Elementary_Functions
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
separate (Generic_Elementary_Functions) function Exp (X : Float_Type) return Float_Type is -- On input, X is a floating-point value in Float_Type; -- On output, the value of exp(X) (the natural exponential of X) is returned. -- The bulk of the computations are performed by the procedure -- KP_Exp (Y, M, Z1, Z2) which returns exp(Y) in M, Z1, and Z2 -- where -- exp(Y) = 2**M * ( Z1 + Z2 ) -- M of integer value, and Z1 only has at most 12 significant bits. Result : Float_Type; Y, Z1, Z2 : Common_Float; M, J : Common_Int; Two_To : constant array (Common_Int range -3 .. 3) of Common_Float := (0.125, 0.25, 0.5, 1.0, 2.0, 4.0, 8.0); Large_Threshold : constant Common_Float := 4.0 * Common_Float (Float_Type'Safe_Emax) * 6.931471806E-1; Small_Threshold : constant Common_Float := Float_Type'Base'Epsilon; begin -- Filter out exceptional cases. Y := Common_Float (X); if abs (Y) >= Large_Threshold then if (Y > 0.0) then -- Y := Common_Float (Common_Float'Machine_Radix ** -- Common_Float'Machine_Emax); -- return (Float_Type (Y * Y * Y)); raise Constraint_Error; --pbk else return (Float_Type (0.0)); end if; elsif abs (Y) <= Small_Threshold then return (Float_Type (1.0 + Y)); end if; -- Get the values of M, Z1, and Z2 so that the natural exponential of Y -- can be calculated by Exp(Y) = 2**M * (Z1 + Z2) Kp_Exp (Y, M, Z1, Z2); case Common_Float'Machine_Radix is when 2 => Y := Z1 + Z2; when others => J := M rem 4; M := (M - J) / 4; Z1 := Z1 * Two_To (J); Z2 := Z2 * Two_To (J); Y := Z1 + Z2; end case; Result := Float_Type (Scale (Y, M)); return (Result); end Exp;
nblk1=2 nid=0 hdr6=4 [0x00] rec0=23 rec1=00 rec2=01 rec3=020 [0x01] rec0=28 rec1=00 rec2=02 rec3=000 tail 0x2170e742a82b15179974e 0x42a00066462061e03