lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> Short summary: Differentiation is not hard, cleaning up afterwards
> (simplification) can be challenging.

Have a look at <http://www.lua.org/spe.html> in "Using fallbacks", where
we discuss global common sub-expression identification and generationn
of optimized code for arithmetic expressions. The code is for an old
version of Lua, but the same ideas can be just as easily implemented
with metamethods. (I have code for this somewhere. I can dig it if there
is interest.)

Also, have a look at automatic differentiation
	<http://en.wikipedia.org/wiki/Automatic_differentiation>
which is not symbolic differentiation but is just as good.