Condition Number of a Function - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Condition Number of a Function (/thread-14653.html) Condition Number of a Function - Eddie W. Shore - 03-16-2020 06:31 AM Condition number for a function f(x) is: Cond = abs( x * d/dx f(x) / f(x) ) If the condition number is low, then function is not sensitive to small changes. This is similar to the condition number for matrices, where a low number gives for a well-conditioned problem while a higher number gives for an ill-conditioned problem. HP Prime Program CONDFX Arguments: f(X) as a string, use the capital X as a variable; a: value Syntax: CONDFX(f, a) Code: ```EXPORT CONDFX(f,a) BEGIN // f(X) as a string, x0 // 2020-02-06 EWS X:=a; fx:=EXPR(f); X:=a+.0001; dx:=(EXPR(f)-fx)/.0001; c:=ABS(a*dx/fx);  RETURN c; END;``` Note: The derivative is calculated manually. Example: (in Radians mode) CONDFX("2*X*COS(X)",1.5) returns 20.15361502 CONDFX("e^-(.25*X)",1.5) returns 0.374995308312 Blog link: http://edspi31415.blogspot.com/2020/03/hp-prime-and-casio-fx-cg50-condition.html