![]() | This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages) (Learn how and when to remove this message)
|
![]() | |
![]() Mathomatic on a terminal emulator | |
Original author(s) | George Gesslein II |
---|---|
Developer(s) | George Gesslein II |
Initial release | 1987; 38 years ago (1987)[1] |
Final release | 16.0.5 / 21 October 2012; 12 years ago (2012-10-21) |
Written in | C |
Operating system | Cross-platform,Unix-like |
Platform | Anycomputer architecture |
Service name | Mathomatic |
Available in | English |
Type | Computer algebra/math system |
License | GNU Lesser General Public License version 2.1 |
Website | github |
Mathomatic[2] is afree,portable,general-purposecomputer algebra system (CAS) that cansymbolicallysolve, simplify, combine and compare algebraicequations, and can performcomplex number,modular, andpolynomial arithmetic, along with standard arithmetic. It can perform symboliccalculus (derivative,extrema,Taylor series, and polynomialintegration andLaplace transforms),numerical integration, and can handle allelementary algebra exceptlogarithms.Trigonometric functions can be entered and manipulated usingcomplex exponentials, with theGNU m4 preprocessor. Not currently implemented are general functions such asf(x),arbitrary-precision andinterval arithmetic, as well asmatrices.
Mathomatic is capable of solving, differentiating, simplifying, calculating, and visualizing elementary algebra.[3] It also can performsummations,products, and automated display of calculations of any length by plugging sequential or test values into any formula, then approximating and simplifying before display.
Intermediate results (showing the work) may be displayed by previously typing "set debug 1" (see thesession example); this works for solving and almost every command in Mathomatic. "set debug 2" shows more details about the work done.
The software does not include aGUI except with the Mathomatic trademark authorized, versions for smartphones and tablets runningiOS[4] orAndroid.[5] The Mathomatic software, available on the official Mathomatic website,[6] is authorized for use in any other type of software, due to its permissive free software license (GNU LGPL). It is available as a freesoftware library, and as a free console mode application that uses a colorcommand-line interface withpretty-print output that runs in aterminal emulator under any operating system.[3] The console interface is simple and requires learning the basic algebra notation to start. All input and output is line-at-a-timeASCII text. By default, input isstandard input and output isstandard output. Mathomatic is typically compiled with editline orGNU readline for easier input.
There is no programming capability; the interpreter works like an algebraic calculator. Expressions and equations are entered in standard algebraicinfix notation. Operations are performed on them by entering simple Englishcommands.
Because all numeric arithmetic isdouble precisionfloating point, andround-off error is not tracked, Mathomatic is not suitable for applications requiring high precision, such as astronomical calculations. It is useful forsymbolic-numeric calculations of about 14 decimal digits accuracy, although many results will be exact, if possible.
Mathomatic can be used as afloating point orinteger arithmetic code generating tool, simplifying and converting equations intooptimizedassignment statements in thePython,C, andJava programming languages. The output can be made compatible with most other mathematics programs, exceptTeX andMathML format input/output are currently not available. The ASCII characters that are allowed in Mathomatic variable names is configurable, allowing TeX format variable names.
The Mathomatic source code can be compiled as a symbolic mathlibrary with anAPI, which can be linked to C compatible programs that need to use the Mathomatic symbolic math engine.
Solving and code generation example, where the work is shown:
1-> x = (a+1)*(b+2)#1: x = (a + 1)*(b + 2)1-> set debug 1Success.1-> solve for blevel 1: x = (a + 1)*(b + 2)Subtracting "(a + 1)*(b + 2)" from both sides of the equation:level 1: x - ((a + 1)*(b + 2)) = 0Subtracting "x" from both sides of the equation:level 1: -1*(a + 1)*(b + 2) = -1*xDividing both sides of the equation by "-1":level 1: (a + 1)*(b + 2) = xDividing both sides of the equation by "a + 1":level 1: b + 2 = x/(a + 1)Subtracting "2" from both sides of the equation:level 1: b = (x/(a + 1)) - 2Solve completed:level 1: b = (x/(a + 1)) - 2Solve successful: x#1: b = ------- - 2 (a + 1)1-> code C ; output C programming language codeb = ((x/(a + 1.0)) - 2.0);1-> variables C ; define the variables for the C compilerdouble x;double a;double b;1->
Development of Mathomatic was started in the year 1986 by George Gesslein II, as an experiment in computerized mathematics.[7] It was originally written in Microsoft C forMS-DOS. Versions 1 and 2 were published by Dynacomp of Rochester, New York in 1987[1] and 1988[8] as a scientific software product for DOS. Afterwards it was released asshareware and thenemailware, with a 2Dequation graphing program. At the turn of the century, Mathomatic was ported to theGNU C Compiler underLinux and becamefree software. The graphing program was discontinued;2D/3D graphing of equations is now accomplished withgnuplot.
The name "Mathomatic" is aportmanteau of "math" and "automatic",[3] and was inspired by the naming and automation ofRog-O-Matic, which was an early experiment inartificial intelligence.
Development has ceased as a result of the death of the author on February 24, 2013.[9]
Mathomatic is available for almost all platforms, includingMicrosoft Windows usingMinGW.[10] It is available forMac OS X,[11][12] foriOS,[4] forAndroid,[5] and for theNintendo DS under DSLinux and stand-alone.[13]Fedora Linux,[14]Slackware,[15]Debian,[16]Ubuntu,[17]Gentoo Linux,[18] and all of the mainBSD Unix distributions[19][20][21] include Mathomatic as an automatically installable package. There is a port toJavaScript usingEmscripten, allowing Mathomatic to run in aweb browser.[22] The ports are all maintained by separate individuals.
Building from source requires aC compiler with thestandard POSIX C libraries. If Mathomatic is compiled with theGCC C compiler or theTiny C Compiler for aUnix-like operating system, no changes need to be made to the source code. Mathomatic uses no compiler-specific code, so it will usually compile easily with any C compiler. Use of the Mathomatic Symbolic Math Library allows mixing programming languages and is operating system independent.[23]
Mathomatic can be ported to any computer with at least 1megabyte of freeRAM. The Mathomatic standard distribution[6] memory requirement defaults to a maximum of 400 megabytes, depending on the size of the equation spaces and how many expressions have been entered. Equation spaces are fixed sizearrays that areallocated as needed, the size of which is set during compilation or startup. Each algebraic expression or equation entered at the main prompt is stored in an equation space.
Mathomatic is written to do most symbolic manipulations with memory moves, like an assembly language program. This causes Mathomatic to crash when used with the newLLVM backend, which doesn't seem to like the standard C library functionmemmove(3). To use Mathomatic with a C compiler that uses an LLVM backend, disable all optimizations with "-O0" on the C compiler command line. Otherwise the regression tests will loop endlessly. This is most certainly an optimization bug in LLVM. To help those trying to debug this optimization error, Mathomatic will fail when LLVM optimizes the simplification of (32^.5) to 4*(2^.5), and the like, going into an endless loop every time.