c05ad Method
関数リスト一覧   NagLibrary Namespaceへ  ライブラリイントロダクション  本ヘルプドキュメントのchm形式版

c05ad locates a zero of a continuous function in a given interval by a combination of the methods of nonlinear interpolation, extrapolation and bisection.

Syntax

C#
public static void c05ad(
	double a,
	double b,
	double eps,
	double eta,
	C05..::.C05AD_F f,
	out double x,
	out int ifail
)
Visual Basic (Declaration)
Public Shared Sub c05ad ( _
	a As Double, _
	b As Double, _
	eps As Double, _
	eta As Double, _
	f As C05..::.C05AD_F, _
	<OutAttribute> ByRef x As Double, _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void c05ad(
	double a, 
	double b, 
	double eps, 
	double eta, 
	C05..::.C05AD_F^ f, 
	[OutAttribute] double% x, 
	[OutAttribute] int% ifail
)
F#
static member c05ad : 
        a:float * 
        b:float * 
        eps:float * 
        eta:float * 
        f:C05..::.C05AD_F * 
        x:float byref * 
        ifail:int byref -> unit 

Parameters

a
Type: System..::.Double
On entry: a, the lower bound of the interval.
b
Type: System..::.Double
On entry: b, the upper bound of the interval.
Constraint: ba .
eps
Type: System..::.Double
On entry: the termination tolerance on x (see [Description]).
Constraint: eps>0.0 .
eta
Type: System..::.Double
On entry: a value such that if fxeta , x is accepted as the zero. eta may be specified as 0.0 (see [Accuracy]).
f
Type: NagLibrary..::.C05..::.C05AD_F
f must evaluate the function f whose zero is to be determined.

A delegate of type C05AD_F.

x
Type: System..::.Double %
On exit: the approximation to the zero.
ifail
Type: System..::.Int32 %
On exit: ifail=0 unless the method detects an error (see [Error Indicators and Warnings]).

Description

c05ad attempts to obtain an approximation to a simple zero of the function fx  given an initial interval a,b  such that fa × fb 0 . The same core algorithm is used by c05az whose specification should be consulted for details of the method used.
The approximation x to the zero α is determined so that at least one of the following criteria is satisfied:
(i) x-α 4×eps× maxx,1 ,
(ii) fxeta .

References

Error Indicators and Warnings

Accuracy

The levels of accuracy depend on the values of eps and eta. If full machine accuracy is required, they may be set very small, resulting in an exit with ifail=2, although this may involve many more iterations than a lesser accuracy. You are recommended to set eta=0.0  and to use eps to control the accuracy, unless you have considerable knowledge of the size of fx  for values of x near the zero.

Further Comments

The time taken by c05ad depends primarily on the time spent evaluating f (see [Parameters]).
If it is important to determine an interval of relative length less than 2×eps containing the zero, or if f is expensive to evaluate and the number of calls to f is to be restricted, then use of c05az is recommended. Use of c05az is also recommended when the structure of the problem to be solved does not permit a simple f to be written: the reverse communication facilities of c05az are more flexible than the direct communication of f required by c05ad.

Example

See Also