Mathomatic

Last updated

Mathomatic
Original author(s) George Gesslein II
Developer(s) George Gesslein II
Initial release1987;36 years ago (1987) [1]
Final release
16.0.5 / 21 October 2012;10 years ago (2012-10-21)
Written in C
Engine GitHub
Operating system Cross-platform, Unix-like
Platform Any computer architecture
Service nameMathomatic
Available inEnglish
Type Computer algebra/math system
License GNU Lesser General Public License version 2.1
Website github.com/mfillpot/mathomatic

Mathomatic [2] is a free, portable, general-purpose computer algebra system (CAS) that can symbolically solve, simplify, combine, and compare algebraic equations, and can perform complex number, modular, and polynomial arithmetic, along with standard arithmetic. It does some symbolic calculus (derivative, extrema, Taylor series, and polynomial integration and Laplace transforms), numerical integration, and handles all elementary algebra except logarithms. Trigonometric functions can be entered and manipulated using complex exponentials, with the GNU m4 preprocessor. Not currently implemented are general functions like f(x), arbitrary-precision and interval arithmetic, and matrices.

Contents

Features

Mathomatic is capable of solving, differentiating, simplifying, calculating, and visualizing elementary algebra. [3] It also can perform summations, 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 the session 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 a GUI except with the Mathomatic trademark authorized, versions for smartphones and tablets running iOS [4] or Android. [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 free software library, and as a free console mode application that uses a color command-line interface with pretty-print output that runs in a terminal 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-time ASCII text. By default, input is standard input and output is standard output. Mathomatic is typically compiled with editline or GNU readline for easier input.

There is no programming capability; the interpreter works like an algebraic calculator. Expressions and equations are entered in standard algebraic infix notation. Operations are performed on them by entering simple English commands.

Because all numeric arithmetic is double precision floating point, and round-off error is not tracked, Mathomatic is not suitable for applications requiring high precision, such as astronomical calculations. It is useful for symbolic-numeric calculations of about 14 decimal digits accuracy, although many results will be exact, if possible.

Mathomatic can be used as a floating point or integer arithmetic code generating tool, simplifying and converting equations into optimized assignment statements in the Python, C, and Java programming languages. The output can be made compatible with most other mathematics programs, except TeX and MathML 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 math library with a very simple API, which can be linked to C compatible programs that need to use the Mathomatic symbolic math engine.

Session examples

Another set of examples, from a screenshot Image-mathomatic snapshot.png
Another set of examples, from a screenshot

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 1 Success. 1-> solve for b level 1: x = (a + 1)*(b + 2) Subtracting "(a + 1)*(b + 2)" from both sides of the equation: level 1: x - ((a + 1)*(b + 2)) = 0 Subtracting "x" from both sides of the equation: level 1: -1*(a + 1)*(b + 2) = -1*x Dividing both sides of the equation by "-1": level 1: (a + 1)*(b + 2) = x Dividing 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)) - 2 Solve completed: level 1: b = (x/(a + 1)) - 2 Solve successful:             x #1: b = ------- - 2         (a + 1)  1-> code C ; output C programming language code b = ((x/(a + 1.0)) - 2.0); 1-> variables C ; define the variables for the C compiler double x; double a; double b; 1-> 

History

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 for MS-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 as shareware and then emailware, with a 2D equation graphing program. At the turn of the century, Mathomatic was ported to the GNU C Compiler under Linux and became free software. The graphing program was discontinued; 2D/3D graphing of equations is now accomplished with gnuplot.

The name "Mathomatic" is a portmanteau of "math" and "automatic", [3] and was inspired by the naming and automation of Rog-O-Matic , which was an early experiment in artificial intelligence.

Development appears to have ceased as a result of the death of the author on February 24, 2013. [9]

Available platforms

Mathomatic is available for almost all platforms, including Microsoft Windows using MinGW. [10] It is available for Mac OS X, [11] [12] for iOS, [4] for Android, [5] and for the Nintendo DS under DSLinux and stand-alone. [13] Fedora Linux, [14] Slackware, [15] Debian, [16] Ubuntu, [17] Gentoo Linux, [18] and all of the main BSD Unix distributions [19] [20] [21] include Mathomatic as an automatically installable package. There is a port to JavaScript using Emscripten, allowing Mathomatic to run in a web browser. [22] The ports are all maintained by separate individuals.

Requirements

Building from source requires a C compiler with the standard POSIX C libraries. If Mathomatic is compiled with the GCC C compiler or the Tiny C Compiler for a Unix-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 1 megabyte of free RAM. 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 size arrays that are allocated 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 new LLVM backend, which doesn't seem to like the standard C library function memmove(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.

See also

Related Research Articles

<span class="mw-page-title-main">GNU Compiler Collection</span> Free and open-source compiler for various programming languages

The GNU Compiler Collection (GCC) is an optimizing compiler produced by the GNU Project supporting various programming languages, hardware architectures and operating systems. The Free Software Foundation (FSF) distributes GCC as free software under the GNU General Public License. GCC is a key component of the GNU toolchain and the standard compiler for most projects related to GNU and the Linux kernel. With roughly 15 million lines of code in 2019, GCC is one of the biggest free programs in existence. It has played an important role in the growth of free software, as both a tool and an example.

<span class="mw-page-title-main">Wolfram Mathematica</span> Computational software program

Wolfram Mathematica is a software system with built-in libraries for several areas of technical computing that allow machine learning, statistics, symbolic computation, data manipulation, network analysis, time series analysis, NLP, optimization, plotting functions and various types of data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other programming languages. It was conceived by Stephen Wolfram, and is developed by Wolfram Research of Champaign, Illinois. The Wolfram Language is the programming language used in Mathematica. Mathematica 1.0 was released on June 23, 1988 in Champaign, Illinois and Santa Clara, California.

In software development, Make is a build automation tool that builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the target program. Though integrated development environments and language-specific compiler features can also be used to manage a build process, Make remains widely used, especially in Unix and Unix-like operating systems.

The GNU toolchain is a broad collection of programming tools produced by the GNU Project. These tools form a toolchain used for developing software applications and operating systems.

<span class="mw-page-title-main">Free Pascal</span> Free compiler and IDE for Pascal and ObjectPascal

Free Pascal Compiler (FPC) is a compiler for the closely related programming-language dialects Pascal and Object Pascal. It is free software released under the GNU General Public License, with exception clauses that allow static linking against its runtime libraries and packages for any purpose in combination with any other software license.

<span class="mw-page-title-main">LLVM</span> Compiler backend for multiple programming languages

LLVM is a set of compiler and toolchain technologies that can be used to develop a frontend for any programming language and a backend for any instruction set architecture. LLVM is designed around a language-independent intermediate representation (IR) that serves as a portable, high-level assembly language that can be optimized with a variety of transformations over multiple passes. The name LLVM originally stood for Low Level Virtual Machine, though the project has expanded and the name is no longer officially an initialism.

<span class="mw-page-title-main">FOSDEM</span> Annual event in Brussels centered on free and open source software development

Free and Open source Software Developers' European Meeting (FOSDEM) is a non-commercial, volunteer-organized European event centered on free and open-source software development. It is aimed at developers and anyone interested in the free and open-source software movement. It aims to enable developers to meet and to promote the awareness and use of free and open-source software.

Basic Linear Algebra Subprograms (BLAS) is a specification that prescribes a set of low-level routines for performing common linear algebra operations such as vector addition, scalar multiplication, dot products, linear combinations, and matrix multiplication. They are the de facto standard low-level routines for linear algebra libraries; the routines have bindings for both C and Fortran. Although the BLAS specification is general, BLAS implementations are often optimized for speed on a particular machine, so using them can bring substantial performance benefits. BLAS implementations will take advantage of special floating point hardware such as vector registers or SIMD instructions.

Mathematical software is software used to model, analyze or calculate numeric, symbolic or geometric data.

<span class="mw-page-title-main">GNU Data Language</span>

The GNU Data Language (GDL) is a free alternative to IDL, achieving full compatibility with IDL 7 and partial compatibility with IDL 8. Together with its library routines, GDL is developed to serve as a tool for data analysis and visualization in such disciplines as astronomy, geosciences, and medical imaging. GDL is licensed under the GPL. Other open-source numerical data analysis tools similar to GDL include Julia, Jupyter Notebook, GNU Octave, NCAR Command Language (NCL), Perl Data Language (PDL), R, Scilab, SciPy, and Yorick.

gtkmm is the official C++ interface for the popular GUI library GTK. gtkmm is free software distributed under the GNU Lesser General Public License (LGPL).

<span class="mw-page-title-main">Code::Blocks</span> Free and open source, cross-platform IDE

Code::Blocks is a free, open-source cross-platform IDE that supports multiple compilers including GCC, Clang and Visual C++. It is developed in C++ using wxWidgets as the GUI toolkit. Using a plugin architecture, its capabilities and features are defined by the provided plugins. Currently, Code::Blocks is oriented towards C, C++, and Fortran. It has a custom build system and optional Make support.

<span class="mw-page-title-main">SymPy</span>

SymPy is an open-source Python library for symbolic computation. It provides computer algebra capabilities either as a standalone application, as a library to other applications, or live on the web as SymPy Live or SymPy Gamma. SymPy is simple to install and to inspect because it is written entirely in Python with few dependencies. This ease of access combined with a simple and extensible code base in a well known language make SymPy a computer algebra system with a relatively low barrier to entry.

Clang is a compiler front end for the C, C++, Objective-C, and Objective-C++ programming languages, as well as the OpenMP, OpenCL, RenderScript, CUDA, SYCL, and HIP frameworks. It acts as a drop-in replacement for the GNU Compiler Collection (GCC), supporting most of its compilation flags and unofficial language extensions. It includes a static analyzer, and several code analysis tools.

Christopher Arthur Lattner is an American computer scientist, former Google and Tesla employee and co-founder of LLVM, Clang compiler, MLIR compiler infrastructure and the Swift programming language. As of 2023, he is the co-founder and CEO of Modular AI, an artificial intelligence platform for developers. Before founding Modular AI, he worked as the President of Platform Engineering, SiFive after two years at Google Brain. Prior to that, he briefly served as Vice President of Autopilot Software at Tesla, Inc. and worked at Apple Inc. as Senior Director of the Developer Tools department, leading the Xcode, Instruments, and compiler teams.

<span class="mw-page-title-main">Lis (linear algebra library)</span>

Lis is a scalable parallel software library for solving discretized linear equations and eigenvalue problems that mainly arise in the numerical solution of partial differential equations by using iterative methods. Although it is designed for parallel computers, the library can be used without being conscious of parallel processing.

<span class="mw-page-title-main">LLDB (debugger)</span> Software debugger

The LLDB Debugger (LLDB) is the debugger component of the LLVM project. It is built as a set of reusable components which extensively use existing libraries from LLVM, such as the Clang expression parser and LLVM disassembler. LLDB is free and open-source software under the University of Illinois/NCSA Open Source License, a BSD-style permissive software license. Since v9.0.0, it was relicensed to the Apache License 2.0 with LLVM Exceptions.

References

  1. 1 2 The Software catalog: Microcomputer. sGoogle Books (6 February 2007). Retrieved 29 November 2011.
  2. "Mathomatic - Free Software Directory". directory.fsf.org. Retrieved 28 February 2023.
  3. 1 2 3 George Gesslein II (29 June 2012). "Mathomatic User Guide". Official Mathomatic documentation. Archived from the original on 22 July 2012. Retrieved 13 July 2012.
  4. 1 2 Mathomatic for iOS. Itunes.apple.com. Retrieved 10 March 2012.
  5. 1 2 Mathomatic for Android. Play.google.com. Retrieved 13 July 2012.
  6. 1 2 Found on the Mathomatic website. Mathomatic.org. Retrieved 29 November 2011.
  7. George Gesslein II (29 June 2012). "Mathomatic User Guide". Official Mathomatic documentation (history). Archived from the original on 22 July 2012. Retrieved 13 July 2012.
  8. Intelligent instruments & computer. sGoogle Books. Retrieved 29 November 2011.
  9. "George John Gesslein II". Ithaca Journal. 26 February 2013. Retrieved 6 November 2021.
  10. Mathomatic MS-Windows port Archived 31 January 2016 at the Wayback Machine . Mathomatic.org (4 November 2011). Retrieved 29 November 2011.
  11. Mathomatic Mac OS X port Archived 31 January 2016 at the Wayback Machine . Mathomatic.org (4 November 2011). Retrieved 29 November 2011.
  12. Mathomatic Mac OS X port from MacPorts
  13. Mathomatic ported to the Nintendo DS Archived 28 October 2007 at the Wayback Machine . Blog.davr.org (22 February 1999). Retrieved 29 November 2011.
  14. The Mathomatic package in Fedora. Admin.fedoraproject.org. Retrieved 29 November 2011.
  15. Official Slackware port of Mathomatic in SlackBuilds. Slackbuilds.org. Retrieved 29 November 2011.
  16. All Mathomatic packages in Debian. Packages.debian.org. Retrieved 31 August 2012.
  17. All Mathomatic packages in Ubuntu Linux. Launchpad.net. Retrieved 29 November 2011.
  18. Gentoo Packages /package/sci-mathematics/mathomatic. Packages.gentoo.org (25 November 2011). Retrieved 29 November 2011.
  19. OpenBSD CVS tree for Mathomatic
  20. NetBSD pkgsrc CVS tree for Mathomatic
  21. FreeBSD CVS tree for Mathomatic
  22. "Mathomatic in JavaScript". Archived from the original on 14 January 2014. Retrieved 4 August 2013.
  23. George Gesslein II (29 June 2012). "Mathomatic User Guide". Official Mathomatic documentation (developer info). Archived from the original on 22 July 2012. Retrieved 13 July 2012.