P5-math-symbolic-custom-ccompiler

Jul 20, 2023

Compile Math::Symbolic trees to C

This module extends the functionality of MathSymbolic by offering facilities to compile symbolic math trees formulas to C code. It also uses InlineC to compile and link the generated C code at run-time, thus allowing the user to do symbolic calculations in Perl with MathSymbolic and then use the results in a fast numeric environment.

This software generates code. Code generators are difficult to test, but the first release of the module is now 1.5 years old and I haven’t received any bug reports, so I consider it somewhat stable now.

Please read the manpage of MathSymbolicCompiler which comes with the MathSymbolic distribution. Most of the gotchas involved with compiling the functions to Perl subroutines also apply to this module which compiles to C instead.

Alternatively, you can use the module not for faster calculations from your Perl program, but to generate C code for you. I have used it to generate an implementation for many! Zernike Polynomials for work in C.



Checkout these related ports:
  • Zn_poly - C library for polynomial arithmetic
  • Zimpl - Language to translate the LP models into .lp or .mps
  • Zegrapher - Software for plotting mathematical objects
  • Zarray - Dynamically typed N-D expression system based on xtensor
  • Z3 - Z3 Theorem Prover
  • Yices - SMT solver
  • Yacas - Yet Another Computer Algebra System
  • Xtensor - Multi-dimensional arrays with broadcasting and lazy computing
  • Xtensor-python - Python bindings for xtensor
  • Xtensor-io - Xtensor plugin to read/write images, audio files, numpy npz and HDF5
  • Xtensor-blas - BLAS extension to xtensor
  • Xspread - Spreadsheet program for X and terminals
  • Xppaut - Graphical tool for solving differential equations, etc
  • Xplot - X11 plotting package
  • Xlife++ - XLiFE++ eXtended Library of Finite Elements in C++