Article View: comp.sys.super
Article #235Re: Generating Source Code out of Algebra
From: Steve Hamm
Date: Tue, 21 Aug 1990 13:23
Date: Tue, 21 Aug 1990 13:23
33 lines
2359 bytes
2359 bytes
-----On 17 Aug 90 22:16:48 GMT, usenet@nlm.nih.gov (David States) said:
David> Generation of standard Fortran or C code to evaluate an
David> algebraic expression has been a standard feature of symbolic
David> algebra programs such as MACSYMA for at least 15 years.
David> Mathmatica supports similar functionality. I have never seen
David> it used much. Anyone care to speculate on why this is?
Because they generate extremely inefficient code (at least Mathematica
does-- I have very little experience with Macsyma). For instance, I
periodically use Mathematica to generate partial derivatives. I then
output expressions in some human readable format and edit them
extensively to turn them into semi-efficent C code.
Part of the problem is that Mathematica's expression simplification
function doesn't work very well at all. And for generating code, some
techniques should be used, such as common subexpression elimination,
to turn a single algebraic expression into more than one line of code.
Another part of the problem is I dislike the coding style that
Mathematica outputs. The code requires use of a set of C macros
(supplied), but would make that section of code's style different from
anything else in our program, which is a distinct code maintenance
disadvantage.
Were I using FORTRAN, I'd be much better served by an automatic code
differentiation package, such as NETLIB's JAKEF.
--
Steve Hamm ----------- Motorola Inc. Semiconductor Sector CAD
3501 Ed Bluestein Blvd., MD-M2, Austin TX 78762
Ph: (512) 928-6612 Internet: hamm@austoto.sps.mot.com
UUCP: ...cs.utexas.edu!oakhill!austoto!hamm
Technical Details
Message-ID:
<HAMM.90Aug21082336@toto.austoto.sps.mot.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!oakhill!oakhill-gateway!hammReferences:
<1116@camme.UUCP> <MCCALPIN.90Aug17153325@pereland.cms.udel.edu> <1990Aug17.221648.5936@nlm.nih.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!oakhill!oakhill-gateway!hamm From: hamm@austoto.sps.mot.com (Steve Hamm) Newsgroups: comp.sys.super Subject: Re: Generating Source Code out of Algebra Message-ID: <HAMM.90Aug21082336@toto.austoto.sps.mot.com> Date: 21 Aug 90 13:23:36 GMT References: <1116@camme.UUCP> <MCCALPIN.90Aug17153325@pereland.cms.udel.edu> <1990Aug17.221648.5936@nlm.nih.gov> Sender: news@oakhill.UUCP Reply-To: hamm@austoto.sps.mot.com (Steve Hamm) Distribution: usa Organization: Motorola SPS, Austin, TX Lines: 33 In-reply-to: usenet@nlm.nih.gov's message of 17 Aug 90 22:16:48 GMT