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

⟦4f5c3f232⟧ TextFile

    Length: 6515 (0x1973)
    Types: TextFile
    Names: »B«

Derivation

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

TextFile

with Float_Operations;
package body Long_Elementary_Functions is

    package Mc68881 renames Float_Operations.Double;

    Pi : constant :=  
       3.1415926535897932384626433832795028841971693993750990042;

    Pi_Over_2 : constant := Pi / 2.0;
    Two_Pi : constant := Pi * 2.0;
    One_Over_Two_Pi : constant := 1.0 / Two_Pi;


    function Sqrt (X : Long_Float) return Long_Float is
    begin
        if X < 0.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Sqrt (X);
    end Sqrt;


    function Log (X : Long_Float) return Long_Float is
    begin
        if X < 0.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Log_E (X);
    end Log;


    function Log (X, Base : Long_Float) return Long_Float is
    begin
        if X < 0.0 or Base <= 0.0 or Base = 1.0 then
            raise Argument_Error;
        end if;
        if Base = 10.0 then
            return Mc68881.Log_10 (X);
        elsif Base = 2.0 then
            return Mc68881.Log_2 (X);
        else
            return Mc68881.Log_E (X) / Mc68881.Log_E (Base);
        end if;
    end Log;


    function Exp (X : Long_Float) return Long_Float is
    begin  
        return Mc68881.E_To_X (X);
    end Exp;


    function "**" (X, Y : Long_Float) return Long_Float is
    begin
        if X = 10.0 then
            return Mc68881.Ten_To_X (Y);
        elsif X = 2.0 then
            return Mc68881.Two_To_X (Y);
        else
            return Mc68881.E_To_X (Y * Mc68881.Log_E (X));
        end if;
    end "**";


    function Sin (X : Long_Float) return Long_Float is
    begin
        return Mc68881.Sin (X);
    end Sin;


    function Sin (X, Cycle : Long_Float) return Long_Float is
    begin
        if Cycle <= 0.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Sin ((Two_Pi * X) / Cycle);
    end Sin;


    function Cos (X : Long_Float) return Long_Float is
    begin
        return Mc68881.Cos (X);
    end Cos;


    function Cos (X, Cycle : Long_Float) return Long_Float is
    begin
        if Cycle <= 0.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Cos ((Two_Pi * X) / Cycle);
    end Cos;


    function Tan (X : Long_Float) return Long_Float is
    begin
        return Mc68881.Tan (X);
    end Tan;


    function Tan (X, Cycle : Long_Float) return Long_Float is
    begin
        if Cycle <= 0.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Tan ((Two_Pi * X) / Cycle);
    end Tan;


    function Cot (X : Long_Float) return Long_Float is
    begin
        return 1.0 / Mc68881.Tan (X);
    end Cot;


    function Cot (X, Cycle : Long_Float) return Long_Float is
    begin
        if Cycle <= 0.0 then
            raise Argument_Error;
        end if;
        return 1.0 / Mc68881.Tan ((Two_Pi * X) / Cycle);
    end Cot;


    function Arcsin (X : Long_Float) return Long_Float is
    begin
        if abs X > 1.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Asin (X);
    end Arcsin;


    function Arcsin (X, Cycle : Long_Float) return Long_Float is
    begin
        if Cycle <= 0.0 or else abs X > 1.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Asin (X) * Cycle * One_Over_Two_Pi;
    end Arcsin;


    function Arccos (X : Long_Float) return Long_Float is
    begin
        if abs X > 1.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Acos (X);
    end Arccos;


    function Arccos (X, Cycle : Long_Float) return Long_Float is
    begin
        if Cycle <= 0.0 or else abs X > 1.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Acos (X) * Cycle * One_Over_Two_Pi;
    end Arccos;


    function Arctan (Y : Long_Float;  
                     X : Long_Float := 1.0) return Long_Float is
    begin
        if X = 0.0 then
            if Y = 0.0 then
                raise Argument_Error;
            elsif Y > 0.0 then
                return Pi_Over_2;
            else
                return -Pi_Over_2;
            end if;
        end if;

        if Y = 0.0 then
            if X > 0.0 then
                return 0.0;
            else
                return Pi;
            end if;
        end if;

        if X = 1.0 then
            return Mc68881.Atan (Y);
        else
            return Mc68881.Atan (Y / X);
        end if;

    end Arctan;


    function Arctan (Y : Long_Float;  
                     X : Long_Float := 1.0;  
                     Cycle : Long_Float) return Long_Float is
    begin
        if Cycle <= 0.0 then
            raise Argument_Error;
        end if;
        return Arctan (Y, X) * Cycle * One_Over_Two_Pi;
    end Arctan;


    function Arccot (X : Long_Float;  
                     Y : Long_Float := 1.0) return Long_Float is
    begin
        return Arctan (X => X, Y => Y);
    end Arccot;


    function Arccot (X : Long_Float;  
                     Y : Long_Float := 1.0;  
                     Cycle : Long_Float) return Long_Float is
    begin
        if Cycle <= 0.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Acos (X) * Cycle * One_Over_Two_Pi;
    end Arccot;


    function Sinh (X : Long_Float) return Long_Float is
    begin
        return Mc68881.Sinh (X);
    end Sinh;


    function Cosh (X : Long_Float) return Long_Float is
    begin
        return Mc68881.Cosh (X);
    end Cosh;


    function Tanh (X : Long_Float) return Long_Float is
    begin
        return Mc68881.Tanh (X);
    end Tanh;


    function Coth (X : Long_Float) return Long_Float is
    begin
        return 1.0 / Mc68881.Tanh (X);
    end Coth;


    function Arcsinh (X : Long_Float) return Long_Float is
    begin  
        return Mc68881.Log_E (X + Mc68881.Sqrt (X * X + 1.0));
    end Arcsinh;


    function Arccosh (X : Long_Float) return Long_Float is
    begin
        if X < 1.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Log_E (X + Mc68881.Sqrt (X * X - 1.0));
    end Arccosh;


    function Arctanh (X : Long_Float) return Long_Float is
    begin
        if abs X > 1.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Atanh (X);
    end Arctanh;


    function Arccoth (X : Long_Float) return Long_Float is
    begin
        if abs X < 1.0 then
            raise Argument_Error;
        end if;
        return Mc68881.Atanh (1.0 / X);
    end Arccoth;

end Long_Elementary_Functions;