Skip to content

Optimized Compiler

Latest
Compare
Choose a tag to compare
@patrickroberts patrickroberts released this 25 Apr 02:24
· 36 commits to master since this release

This update has improved the performance of functions generated by Complex.parseFunction() by attempting to compile sub-groups as constant expressions. For example:

(cos(0)+5i)*x

used to compile to the JavaScript

Complex.cos(Complex.ZERO).add(Complex(5,0).mult(Complex.I)).mult(x)

It now compiles simply to:

Complex(1,5).mult(x)

The compiler is now also case-sensitive, allowing differentiation between the variables a and A in an expression.

One minor update is the imaginary component of the Complex() constructor is now optional.