| Applying science to business management |
  
root
Format: root( f(x), x, x1, x2 )
Arguments: (real) f(x) Function or expression to
be solved
(node) x Name of the input variable in f(x)
(real) x1 Initial guess for the value of x or
lower limit on x
(real) x2 Optional upper limit on x
Returns: (real) The value of x where f(x)
= 0
Description: Root finds the value of x such that
f(x) = 0. You must supply root with either a single
point guess for the value of x or a lower- and
upper-limit. Toot uses different methods to find the value of x
depending on which of these starting methods you provide. If you
provide a value for both x1 and x2, the values f(x1)
and f(x2) must be of different signs. If this condition is
met, root will always find a solution. If you provide a
value for x1 only, root will search for a solution by
adjusting x1 down hill until it finds a solution or
until a local minimum is encountered. If root fails to
converge on a solution, try another value for x1.
Root is an approximated function and is subject to the
tolerance set by precision. Root
creates a temporary variable named x. If a node with this
name already exists, it is replaced for all evaluations of f(x)
and is then restored to its original state.
Note: If the expression f(x) is a tree node
rather than a function based on x, the reset primitive must be used to
cause the tree to recalculate on each iteration. Constants retain
their value from the first evaluation and return this value on
all subsequent evaluations. To cause the constant to be
reevaluated, use an expression similar to
root({reset,f},x,x1,x2)
rather than
root(f,x,x1,x2))
Examples: root(x^2-25,x,0,10)
= 5
f(x):=x/3-4
root(f(x),x,10) = 12
See Also: precision,
solve, minimize
|