Symbolic Computation Library in pure C
Asked Answered
B

4

15

Does there exist a symbolic computation library written pure C? Symbolic computation as in manipulating mathematical equations in symbolic form.

I know there is Mathematica, and Sympy. But, I am interested in creating in a high performance pure C implementation of a symbolic computation library to bind to a scripting language, specifically Ruby to start.

It would seem that their is a need for a symbolic mathematics library such this. Over time, ideally the library could be built out in a similar manor to libgit2 where there is a central C implementation of the project and various implementations branched off for the purpose of creating bindings to other languages?

Bucko answered 30/7, 2012 at 3:44 Comment(3)
I'm not aware of any C-based symbolic math libraries. However, there are a number of them in C++, so you can always create a thin C layer around them.Stodder
@Stodder need a pure C implementation... That said, would you be able to direct me to resources which generalize symbolic computation algorithms?Bucko
"generalizes symbolic computation" huh - grab any bigger math textbook and try to extract math rules and put them into your math expression analyzer.Backfield
P
6

Have you taken a look at GAP? From its website:

GAP is a system for computational discrete algebra, with particular emphasis on Computational Group Theory. GAP provides a programming language, a library of thousands of functions implementing algebraic algorithms written in the GAP language as well as large data libraries of algebraic objects. See also the overview and the description of the mathematical capabilities. GAP is used in research and teaching for studying groups and their representations, rings, vector spaces, algebras, combinatorial structures, and more. The system, including source, is distributed freely. You can study and easily modify or extend it for your special use.

According to its Wikipedia page, GAP is implemented in C, and the source code is freely available.

Partan answered 11/8, 2012 at 15:12 Comment(3)
Here is a list of computer algebra systems I found linked the GAP website.Bucko
Gap even has a parallel implementation (ParGap) building off MPI.Bucko
The packages for GAP are amazing! and this is exactly what I have been looking for thank you!!Bucko
U
8

Mathomatic is implemented in C, and may suit your purposes.

Mathomatic™ is a portable, command-line, educational CAS and calculator software, written entirely in the C programming language. It is free and open source software (FOSS), published under the GNU Lesser General Public License (LGPL version 2.1), and has been under continual development since 1986. The software can symbolically solve, simplify, combine, and compare algebraic equations, simultaneously performing generalized standard, complex number, modular, and polynomial arithmetic, as needed. It does some calculus and is very easy to compile/install, learn, and use.

From the developer's manual:

The Mathomatic source code can also be compiled as a symbolic math library that is callable from any C compatible program and is mostly operating system independent.


Unfortunately, the author of this package has passed away, and the software is no longer being maintained. The latest version was archived in GitHub, and the links above have been updated.

Underworld answered 10/8, 2012 at 9:57 Comment(0)
P
6

Have you taken a look at GAP? From its website:

GAP is a system for computational discrete algebra, with particular emphasis on Computational Group Theory. GAP provides a programming language, a library of thousands of functions implementing algebraic algorithms written in the GAP language as well as large data libraries of algebraic objects. See also the overview and the description of the mathematical capabilities. GAP is used in research and teaching for studying groups and their representations, rings, vector spaces, algebras, combinatorial structures, and more. The system, including source, is distributed freely. You can study and easily modify or extend it for your special use.

According to its Wikipedia page, GAP is implemented in C, and the source code is freely available.

Partan answered 11/8, 2012 at 15:12 Comment(3)
Here is a list of computer algebra systems I found linked the GAP website.Bucko
Gap even has a parallel implementation (ParGap) building off MPI.Bucko
The packages for GAP are amazing! and this is exactly what I have been looking for thank you!!Bucko
G
4

Please look at Axiom -- a general purpose Computer Algebra system. Also you can use Giac -- Giac is a free (GPL) C++ library, it is the computation kernel, it may be used inside other C++ programs.

http://www.axiom-developer.org/

http://www-fourier.ujf-grenoble.fr/~parisse/giac.html

Genuine answered 30/7, 2012 at 3:59 Comment(1)
I voted you up, this is definitely good to know, but I'm looking for a pure C implementation and I can not accept your answer... That said, would you be able to direct me to resources which generalize symbolic computation algorithms?Bucko
B
3

You can start with Maxima and use GCL to translate it from Common Lisp to C.

GCL is the official Common Lisp for the GNU project. Its design makes use of the system's C compiler to compile to native object code

There is surely an option to preserve the intermediate C source files.

GCL currently compiles itself and the primary free software Lisp applications, Maxima , ACL2 and Axiom, on eleven GNU/Linux architectures (x86 powerpc s390 sparc arm alpha ia64 hppa m68k mips mipsel), Windows, Sparc Solaris, and FreeBSD.

Brundisium answered 9/8, 2012 at 19:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.