DIFFT(1) | OpenBSD Reference Manual | DIFFT(1) |
difft | [-nv] [-d variables] [-f function] [-o order] [-x variables] [file] |
The arguments to difft are as follows:
The difft utility accepts a simple mathematical language for specifying functions. It accepts binary and unary relations along with several functions. A formal grammar for the language follows, with comments in parentheses:
exp <- - exp (negate) sin exp (sine) cos exp (cosine) tan exp (tangent) arcsin exp (inverse sine) arccos exp (inverse cosine) arctan exp (inverse tangent) ln exp (natural log) erf exp (error function) integral exp exp exp exp (integral) (binary) (binary) (exp) (sub-expression) value (value) binary <- exp + exp (sum) exp - exp (subtract) exp * exp (product) exp / exp (quotient) exp ^ exp (exponent) value <- num ident ident <- [[:alpha:]][[:alnum:]]* num <- [[:digit:]]*[.[[:digit:]]*]?[eE][[:digit:]]+
All white-space is discarded (including newlines).
The following mathematical functions are understood by difft:
The following Greek letters are recognised and as a single Greek symbol (in applicable output modes): alpha, theta, omicron, tau, beta, pi, upsilon, gamma, phi, delta, kappa, rho, epsilon, lambda, chi, mu, sigma, psi, zeta, nu, omega, eta, xi, Gamma, Delta, Theta, Pi, Phi, Lambda, Sigma, Psi, Xi, Upsilon, and Omega.
The -v flag is ignored in this mode.
If -v is specified, The display is broken into three columns: the equation being differentiated (only printed on the first row of output), the current stage of differentiation, and the rule of reduction or differentiation. Possible reduction and differentiation rules are noted in Differentiation Rules and Reduction Rules. Differentiated sub-expressions are highlighted in red, while reductions are highlighted in blue. Differentiated sub-expressions are also parenthesised and noted with the Lagrange derivative mark.
If -v is not specified, the function is printed as an assignment on a single line of output.
Greek letters are formatted as the LaTeX Greek symbol corresponding to the input name.
Expressions are enclosed within a well-formed XHTML document body. Output is broken into rows consisting of a series of expressions.
Printing of expressions follows as specified in LaTeX Output.
Greek letters are formatted as the HTML Greek symbol corresponding to the input name.
By default, the output is formatted as a standalone Gnuplot document creating a colour PNG file difft.png. One-variable functions use plot, while two-variable functions use splot.
The -v flag is ignored with Gnuplot output; only the fully derived (or initial, if -n is specified) equation is printed. Furthermore, if the function has more than two arguments, -Ofragment is implied.
Greek letter symbols are ignored and printed verbatim.
echo "(e^-(e^-x))" | difft | latex
To produce an XHTML/MathML file with CSS stylesheet style.css of a differentiation with all rules:
echo "(e^-(e^-x))" | difft -v -Tmathml -Ostyle=style.css
January 28, 2012 | OpenBSD 5.0 |