The function may be called by the names: c05zdc, nag_roots_sys_deriv_check or nag_check_derivs.
c05zdc is based on the MINPACK routine CHKDER (see Moré et al. (1980)). It checks the th gradient for consistency with the th function by computing a forward-difference approximation along a suitably chosen direction and comparing this approximation with the user-supplied gradient along the same direction. The principal characteristic of c05zdc is its invariance under changes in scale of the variables or functions.
Moré J J, Garbow B S and Hillstrom K E (1980) User guide for MINPACK-1 Technical Report ANL-80-74 Argonne National Laboratory
1: – IntegerInput
On entry: the value on the first call and the value on the second call of c05zdc.
On entry: the components of a point , at which the consistency check is to be made. (See Section 7.)
5: – const doubleInput
On entry: if , fvec must contain the value of the functions evaluated at . If , fvec is not referenced.
6: – const doubleInput
Note: the th element of the matrix is stored in .
On entry: if , fjac must contain the value of
at the point , for and . If , fjac is not referenced.
7: – doubleOutput
On exit: if , xp is set to a point neighbouring x. If , xp is undefined.
8: – const doubleInput
On entry: if , fvecp must contain the value of the functions evaluated at xp (as output by a preceding call to c05zdc with ). If , fvecp is not referenced.
9: – doubleOutput
On exit: if , err contains measures of correctness of the respective gradients. If , err is undefined. If there is no loss of significance (see Section 7), if is the th user-supplied gradient
, for is correct, whilst if is the th gradient is incorrect. For values of between and the categorisation is less certain. In general, a value of indicates that the th gradient is probably correct.
10: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument had an illegal value.
On entry, .
On entry, .
Constraint: or .
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
c05zdc does not perform reliably if cancellation or rounding errors cause a severe loss of significance in the evaluation of a function. Therefore, none of the components of should be unusually small (in particular, zero) or any other value which may cause loss of significance. The relative differences between corresponding elements of fvecp and fvec should be at least two orders of magnitude greater than the machine precision returned by X02AJC.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
c05zdc is not threaded in any implementation.
The time required by c05zdc increases with m and n.
This example checks the Jacobian matrix for a problem with functions of variables (sometimes referred to as the Bard problem).