| |
|
|
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 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 05/24/21 ▲ |
|
|
|