TCL is a scripting programming language that you can now use on your phone.
Try to define variables, do math calculations and create functions to accomplish a calculation quickly. Recursive funcions work however not all of the language's features are enabled. You will be shown an error message in case you try to use one of the unimplemented commands.
You can either write code in a bash like style command by command or you can use the editor to create your own file and run everything at once.
Save your script to a file and load it whenever you need to.
More info about the language can be found here: https://www.tcl.tk/about/language.html