Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
codegen[prep2trans] - prepare a Maple procedure for translation
codegen[split] - prepare a Maple procedure for automatic differentiation
codegen[horner] - convert formulae in a procedure to horner form
Calling Sequence
prep2trans(f)
horner(f, x)
split(f)
split(f, x)
Parameters
f
-
Maple procedure
x
list or set of symbols
Description
The prep2trans function is used to transform certain symbolic expressions into forms suitable for translation into a target language such as C or Fortran. For example, piecewise expressions are translated into if statements, symbolic sums are translated into for loops.
The horner function takes as input a Maple procedure and a variable or list or set of variables, and converts all formulae in the procedure to Horner form in x.
The split function is used to break up certain symbolic expressions into computation sequences suitable for automatic differentiation. Long products and complicated compositions are broken up into computation sequences. If the second argument x is specified, it specifies the independent variables, the variables that the function f will be differentiated in.
The command with(codegen,prep2trans) allows the use of the abbreviated form of this command.
The command with(codegen,split) allows the use of the abbreviated form of this command.
The command with(codegen,horner) allows the use of the abbreviated form of this command.
Examples
f := proc(x) piecewise(x<0,0,x<1,x,x>1,2-x,0) end proc;
f := proc(x) local s; sum(x^i/i!,i=0..n) end proc;
f := proc(n,A) local i,j; sum(sum(A[i,j],i=1..n),j=1..n) end proc;
h := proc(x,y,z) 1-2*x*y-x*y^2*z*(1-x) end proc;
g := proc(x,y,t) 2*sin(x^2*y)*exp(-t^2) end proc;
See Also
codegen[C(deprecated)], codegen[fortran(deprecated)], codegen[GRADIENT], codegen[optimize]
Download Help Document