DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦084da03f8⟧ TextFile

    Length: 1147 (0x47b)
    Types: TextFile
    Names: »B«

Derivation

└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦1472c4407⟧ 
                └─⟦this⟧ 
└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦2e03b931c⟧ 
                └─⟦this⟧ 

TextFile

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;