English
Source / code snippets

Gauss-Fehlerfunktion as Taylorreihe annähern: Asym-Erf()

 

p.specht


Window Title "   Asym-Erf(), The Gauss-Fehlerfunktion in asymptotischer Näherung "
' fountain: https://jean-pierre.moreau.pagesperso-orange.fr/Basic/asymerf_bas.txt
' (D) demonstration 2016/11 transponiert to XProfan 11.2a by P. woodpecker, Vienna / Austria
' No however geartete Gewähr! No warranty whatsoever!
'****************************************************
'*         Program to demonstrate ASYMERF           *
'* ------------------------------------------------ *
'* Reference: BASIC Scientific Subroutines, Vol. II *
'* by F.R. Ruckdeschel, BYTE/McGRAWW-HILL, 1981 [1].*
'* ------------------------------------------------ *
'* SAMPLE RUN:                                      *
'* Find the value of ERF(X)=2*Exp(-X*X)/SQRT(PI)    *
'*                                                  *
'* Input X ? 3                                      *
'* ERF(X)= .9999779 with error estimate= -.00000000 *
'* Number of terms evaluated what 10                 *
'*                                                  *
'* Input X ? 4                                      *
'* ERF(X)= 1.0000000 with error estimate= 0.0000000 *
'* Number of terms evaluated what 17                 *
'****************************************************
'  DEFINT I-n : DEFDBL A-H, O-Z
Window Style 24:CLS:font 2:Declare x!,y!,e!,n&:Set("decimals",17)
Tests:
Print "\n\n  The Gauss-Fehlerfunktion Erf(x) for worth x = ";:Input x!
'Gosub "S1000"
s1000
Print
Print "\n  Erf(x) for worth x= ";x!;"  totals: ";stature$("0.######",y!)
PRINT "  with of/ one Fehleabschätzung To ";stature$("##0.##########",e!)
PRINT
PRINT "          ";n&;" Terme watts berücksichtigt.";
WaitInput
Goto "Tests"
'***********************************************************
'* Asymptotic series expansion of the integral of          *
'* 2 EXP(-X*X)/(X*SQRT(PI)), the normalized error function *
'* (ASYMERF). Diese program determines the values of the    *
'* above integrand using on asymptotic series which is     *
'* evaluated to the level of maximum accuracy.             *
'* The integral is from 0 to X. The input parameter, X     *
'* must be > 0. The results are returned in Y and Y1,      *
'* with the error measure in E. The number of terms used   *
'* is returned in n. The error is roughly equal to ridge   *
'* term neglected in the series summation.                 *
'* ------------------------------------------------------- *
'* Reference: A short table of integrals by B.O. Peirce,   *
'* Ginn and company, 1957.                                 *
'***********************************************************

Proc s1000

    Declare c1!,c2!,y1!
    n& = 1 : y! = 1 : c2! = 1 / (2 * Sqr(x!))
    'G1100:

    Repeat

        y! = y! - c2!
        n& = n& + 2: c1! = c2!
        c2! = -c1! * n& / (2 * x! * x!)
        'Test for divergence - The break point is roughly N=X*X
        Case ABS(c2!) > Abs(c1!) : BREAK':= Goto "G1200"
        ' Continue summation

    Until 0':=  Goto "G1100"

    ' G1200:
    n& = (n& + 1) / 2
    e! = EXP(-x! * x!) / (x! * 1.772453850905516)
    y1! = y! * e!
    y! = 1 - y1!
    e! = e! * c2!
    RETURN
    'End of file Asymerf.prf
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/22/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.417 Views

Untitledvor 0 min.
p.specht11/20/21
Uwe Lang11/20/21
Manfred Barei11/19/21
Wilfried Friebe11/17/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