English
Source / code snippets

Bernoulli-numbers to charge

 

p.specht

one the first programs the world employed itself with the Berechnung the undertow. Bernoulli-numbers  [...]  , The u.a. in höherdimensionalen Reihenformeln a large strain play. The Algorithmus stammt of 1843, a publication of Lady Ada Lovelace, the first Programmiererin the world, and was for first real (Turing-mighty) computer the world virtual, The "Analytical Engine" of charles Babbage (... unfortunately never completed).
Window Title "Die BERNOULLI-ZAHLEN To B_28 berechnen":Window Style 24:CLS
Set("decimals",17)
'*********************************************************************
'* Diese program computes Bernoulli number Bn using subroutine BERNOA *
'* ----------------------------------------------------------------- *
'* SAMPLE RUN:                                                       *
'*                                                                   *
'*  Compute Bernoulli number Bn for n = 0,1,...,10.                  *
'*                                                                   *
'*  Please enter Nmax: 10                                            *
'*                                                                   *
'*    n            Bn                                                *
'*  --------------------------                                       *
'*    0    0.100000000000D+01                                        *
'*    1   -0.500000000000D+00                                        *
'*    2    0.166666666667D+00                                        *
'*    4   -0.333333333333D-01                                        *
'*    6    0.238095238095D-01                                        *
'*    8   -0.333333333333D-01                                        *
'*   10    0.757575757576D-01                                        *
'*  --------------------------                                       *
'*                                                                   *
'* ----------------------------------------------------------------- *
'* REFERENCE: "Fortran Routines for Computation of Special Functions,*
'*             jin.ece.uiuc.edu/routines/routines.html".             *
'*                                 F90 Release By J-P Moreau, Paris. *
'*                                         (www.jpmoreau.fr)         *
'*                                                                   *
'* XProfan 11.2a-Version by P.woodpecker, Vienna/Austria                 *
'* No warranty whatsoever!                                           *
'*********************************************************************
'    PROGRAM MBERNOA
Declare B![200],n&,k&
Print
nochma:
Print "\n Please Nmax prompt: ";:Input N&

If n&>29:Print " To big!":goto "nochma":endif

    BERNOA(N&,B![])
    Print "\n  n            Bn    "
    Print "---------------------------"
    Print "  ";0,tab(11);stature$("%g",B![0])
    Print "  ";1,tab(11);stature$("%g",B![1])

    WhileLoop 2,N&,2:k&=&Loop

        Print "  ";k&,tab(11);stature$("%g",B![k&])

    EndWhile

    Print "---------------------------"
    WaitInput
    END

    Proc BERNOA :Parameters N&,BN![]

        ' ======================================
        '  Purpose: Compute Bernoulli number Bn
        '  Input :  n --- Serial number
        '  output:  BN(n) --- Bn
        ' ======================================
        '    IMPLICIT DOUBLE PRECISION (A-H,O-Z)
        Declare s!,R!,j&,k&,m&
        BN![0]=1
        BN![1]=-0.5

        WhileLoop 2,n&:m&=&Loop

            s!=-(1.0e0/(M&+1)-0.5)

            WhileLoop 2,M&-1:k&=&Loop

                R!=1

                WhileLoop 2,K&:j&=&Loop

                    R!=R!*(J&+M&-K&)/J&

                EndWhile

                s!=s!-R!*BN![K&]

            EndWhile

            BN![M&]=s!

        EndWhile

        WhileLoop 3,N&,2:m&=&Loop

            BN![M&]=0

        EndWhile

        Return

    ENDPROC

    ' end of file mbernoa.prf
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/24/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.453 Views

Untitledvor 0 min.
Erhard Wirth06/14/24
p.specht11/20/21
Uwe Lang11/20/21
Manfred Barei11/19/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie