+----------------------------------------------+
			|Library Estack_Lib by Florent Weber (FpgForce)|
			+----------------------------------------------+


--------------------------------------------------------------------------------------------------------------------------


I) What is Estack_Lib?
----------------------

Estack_Lib is a static library wich allows you to perform a lot of algebraic calculus.
It simplifies the manipulation of the estack.

--------------------------------------------------------------------------------------------------------------------------

II) How could I use Estack_Lib?
-------------------------------

1) First of all copy the files: estack_lib.h and estack_lib.a to your project folder.

	You must include the header (estack_lib.h) in your source code:

	#include "estack_lib.h"

2) Then for the compilation,

	If you usually use the command line:

	tigcc mysource.c estack_lib.a

	Or if you use the IDE just add the estack_lib.a to the archive file folder of your project.

Now you can access in your source code to every function of Estack_Lib.

--------------------------------------------------------------------------------------------------------------------------

III) Estack_Lib's functions
---------------------------

Important: the variable of the expression must be x ! (the VAR_X_TAG quantum)

1) Algebraic calculus:


a) integrate :
	
	void integrate (ESI function, float lower_bound, float upper_bound) ;
	
	This function integrates the function given as "function" between "lower_bound" and "upper_bound".
	The result is pushed onto the estack and is pointed by "top_estack".


b) differentiate_nth :

	void differentiate_nth (ESI function, float order) ;

	This function evaluates the differentiate of the function "function" at the order "order".
	The result is pushed onto the estack and is pointed by "top_estack".

	Example to calculate the differentiate second:
	differentiate_nth (function, 2) ;


c) anti_deriv:

	short anti_deriv (ESI function) ;

	This function evaluate the anti-derivative of the function "function".
	The result is pushed onto the estack.
	The function returns TRUE if the anti-derivative can be evaluate else the function return FALSE.


d) expand :

	void expand (ESI function) ;

	This function expands the expression "function".
	The result is pushed onto the estack and is pointed by "top_estack".


c) factor :

	void factor (ESI function) ;

	This function factors the expression "function".
	The result is pushed onto the estack and is pointed by "top_estack".


d) solve :

	void solve (ESI expr1, ESI expr2) ;

	This function solves the equation: expr1 = expr2 with respect of the variable x.
	The result is pushed onto the estack and is pointed by "top_estack".


e) zeros :

	void zeros (ESI function) ;

	This function solves the equation: function = 0.
	The result is pushed onto the estack as a list and is pointed by "top_estack".


f) czeros :

	void czeros (ESI function) ;

	This function solves in the complex domain the equation: function = 0.
	The result is pushed onto the estack as a list and is pointed by "top_estack".


g) limit :

	void limit (ESI function, float point, float direction, short infinity) ;

	This function searches the limit of the function "function" at the point "point" and at the direction "direction".

	"direction" can take these values:

	+-----------+------------------------------------------------+
	| direction |                   action                       |
	+-----------+------------------------------------------------+
	|    -1     | Search the limit on the left of the "point"    |
	|     0     | Search the limit on the given "point"          |
	|     1     | Search the limit on the right of the "point"   |
	+-----------+------------------------------------------------+

	for example if you want the limit on 3 on the left you should do:

	limit (function, 3, -1, 0) ;

	"infinity" can take these values:

	+-----------+------------------------------------------------+
	| infinity  |                   action                       |
	+-----------+------------------------------------------------+
	|    -1     | Search the limit on the negative infinity (-oo)|
	|     0     | Search the limit on the given "point"          |
	|     1     | Search the limit on the infinity          (+oo)|
	+-----------+------------------------------------------------+

	For example if you want the limit in +oo you should do that:

	limit (function, 0, 0, 1) ;


h) desolve :

	void desolve (ESI function, float ,float, short) ;	

	This function solves the differentiate equation of the function "function". (not finished)


i) comdenom :

	void comdenom (ESI expr1, ESI expr2) ;

	This function gives the common denominator of the both expressions: expr1 and expr2
	The result is pushed onto the estack and is pointed by "top_estack".


j) propfrac :

	void propfrac (ESI function) ;

	This function transforms if possible the function "function" in a fraction.
	The result is pushed onto the estack and is pointed by "top_estack".


k) getdenom :

	void getdenom (ESI function) ;

	This function gets the denominator of the given function "function".
	The result is pushed onto the estack and is pointed by "top_estack".


l) texpand :

	void texpand (ESI function) ;

	This function expands the function if the given function "function" is trigonometric.
	The result is pushed onto the estack and is pointed by "top_estack".


m) tcollect :

	void tcollect (ESI function) ;

	This function collects the function if the given function "function" is trigonometric.
	The result is pushed onto the estack and is pointed by "top_estack".

n) taylor :

	void taylor (ESI function, float order) ;

	This function gives the taylor expansion of the given function "function" at the order "order".
	The result is pushed onto the estack and is pointed by "top_estack".


2) Advanced calculus :

	void tangent (ESI function, float point) ;

	This function evaluates the tangent of the function "function" at the point "point".
	The result is pushed onto the estack and is pointed by "top_estack".


3) io functions :


a) output_expr_xy :

	void output_expr_xy (int x, int y, ESI expression) ;

	This function displays the expression "expression" at the coordinates (x, y).
	This function acts on the IO screen who could be cleared using clear_io.


b) disp_str :

	void disp_str (char * str) ;

	This function is an equivalent of the TI-Basic's "disp" function, but only in order to display a string,
	you can't dispay an expression with it.
	See your calculator's guide for precisions about the "disp" function.
	This function acts on the IO screen who could be cleared using clear_io.


c) output_2d_expression :

	void output_2d_expr (ESI expression, short approx)

	This function is an equivalent of the TI-Basic's "pause" function used with an expression as argument.
	The expression is diplayed in pretty print and could be scrolled.
	If approx is TRUE, the expression is displayed in APPROX mode, if approx is FALSE, the expression is displayed
	in EXACT mode.
	This function acts on the IO screen who could be cleared using clear_io.

d) clear :

	void clear_io (void) ;

	This function clears the IO screen, it's an equivalent with the TI-Basic's "clrio" function.


4) Other :


a) str2ESI :

	void str2ESI (char * str) ;

	This function converts the string "str" into an ESI expression.
	Warning! The string "str" must contains a correct expression 
	The result is pushed onto the estack and is pointed by "top_estack".


5) Global Variables:

	ESTACK_LIB_VERSION_STR contains the version of the library.
	ESTACK_LIB_AUTHOR_STR contains the name of the author.

--------------------------------------------------------------------------------------------------------------------------

VI) Credits:
------------

Thanks to Onur Celebi, Spectras, Squale92, Kevin_Kofler for their help.