X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Finifcns.h;h=05043819e9deeceb6a42d54cc03c5140238399e9;hp=9ce66942b9556cd524395d40a28667693cc32de1;hb=4d59c02d51fbf50ff24d616b00296aa4cbb1ea5e;hpb=6adfb9102305c7adc340b4c25beb43e18c48751b;ds=sidebyside diff --git a/ginac/inifcns.h b/ginac/inifcns.h index 9ce66942..05043819 100644 --- a/ginac/inifcns.h +++ b/ginac/inifcns.h @@ -23,6 +23,7 @@ #ifndef __GINAC_INIFCNS_H__ #define __GINAC_INIFCNS_H__ +#include "numeric.h" #include "function.h" #include "ex.h" @@ -178,6 +179,17 @@ DECLARE_FUNCTION_1P(Order) ex lsolve(const ex &eqns, const ex &symbols, unsigned options = solve_algo::automatic); +/** Find a real root of real-valued function f(x) numerically within a given + * interval. The function must change sign across interval. Uses Newton- + * Raphson method combined with bisection in order to guarantee convergence. + * + * @param f Function f(x) + * @param x Symbol f(x) + * @param x1 lower interval limit + * @param x2 upper interval limit + * @exception runtime_error (if interval is invalid). */ +const numeric fsolve(const ex& f, const symbol& x, const numeric& x1, const numeric& x2); + /** Check whether a function is the Order (O(n)) function. */ inline bool is_order_function(const ex & e) {