Library: | nummath |
See also: | nmbrackin |
Quantlet: | nmbrackout | |
Description: | brackets a root of a given scalar function by expanding the range |
Usage: | {a,b,fa,fb} = nmbrackout(fname {,a0,b0}) | |
Input: | ||
fname | string, name of a function which root should be bracketed. The function should have just one scalar parameter x. As a result, the function should return a scalar. | |
a0,b0 | optional scalars, distinct initial points for bracketing, default: a0 = 0, b0 = 1 | |
Output: | ||
a,b | scalars bracketing a root of the function; a < b | |
fa,fb | function values at points a and b |
library("nummath") proc(fval) = ftion(x) fval = x^2 - 16 endp bracket = nmbrackout("ftion") bracket
Contents of bracket.a [1,] 0 Contents of bracket.b [1,] 6.76 Contents of bracket.fa [1,] -16 Contents of bracket.fb [1,] 29.698