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 - metrics - download
Index: B T

⟦9913c56b2⟧ TextFile

    Length: 1383 (0x567)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

-- a copy of the PI Benchmark Test program

with Instrument;
use Instrument;

procedure Piala2 is

    procedure Calc_Pie is

        Zero : constant := 0;
        One : constant := 1;

        Cn : Integer := One;
        N2 : Integer := Zero;
        Pi : Integer := Zero;
        Two : Integer := Zero;
        Three : Integer := Zero;
        Four : Integer := Zero;

    begin
        Two := One + One;
        Three := One + Two;
        Four := Two + Two;

        for Count in 1 .. 100 loop
            Cn := (Cn * (N2 + One) ** 2) / ((N2 + Two) * (N2 + Three) * Four);
            Pi := Pi + Cn;
            N2 := N2 + Two;
        end loop;


        -- this uses the following series:
        --
        --              X**3    1*3*X**5 1*3*5*X**7
        --  sin x = x + _____ + ______ + ________ + ...
        --              2*3     2*4*5    2*4*6*7
        --
        --  Let X=1/2
        --  pi/2=1/2 + (1/2)**3 * (1/2*3) + (1/2)**5 * ((1*3)/(2*4*5)) + ...
        --
        --
        -- pi = 3* (sum Cn ) +3          Cn-1*(2n+1)**2
        --                  Where    Cn=----------------
        --                              (2n+2)*(2n+3)*4
        --   with  Co=1 .


        Pi := Three + Three * Pi;

    end Calc_Pie;

begin

    Start ("PIALA2", "PI Algorithm (test)");
    for I in 1 .. 10000 loop

        Calc_Pie;

    end loop;
    Stop;
end Piala2;