View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
shg[_11_] shg[_11_] is offline
external usenet poster
 
Posts: 1
Default related to error function


You can use these, with a reference to atpvbaen.

Code:
--------------------
' The worksheet ERF and ERFC functions only allow non-negative
' arguments less than about 27.334, although the mathematical functions are valid
' across the domain of Reals. The ERF function reaches its asymptotic limit of 1
' (to double precision accuracy) by 5.8

' The functions myERF and myERFC are identical in interface to the worksheet
' functions, but work for any value of the arguments.

Function myERF(a As Double, Optional b As Variant)
myERF = myERF1(a)
If Not IsMissing(b) Then myERF = myERF1(CDbl(b)) - myERF
End Function

Function myERFC(x As Double) As Double
myERFC = 1# - myERF(x)
End Function

Private Function myERF1(x As Double) As Double
If Abs(x) 5.8 Then
myERF1 = Sgn(x)
ElseIf x < 0 Then
myERF1 = Sgn(x) * Application.Run("ATPVBAEN.XLA!ERF", Abs(x))
End If
End Function

--------------------


--
shg
------------------------------------------------------------------------
shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=26920