Take me over?
NAME
Math::Expression::Evaluator::Optimizer - Optimize M::E::E ASTs
SYNOPSIS
use Math::Expression::Evaluator;
my $m = Math::Expression::Evaluator->new("2 + 4*f");
$m->optimize();
for (0..100){
print $m->val({f => $_}), "\n";
}
DESCRIPTION
Math::Expression::Evaluator::Optimizer performs simple optimizations on the abstract syntax tree from Math::Expression::Evaluator.
You should not use this module directly, but interface it via Math::Expression::Evaluator.
The following optimizations are implemented:
Constant sub expressions:
variable + 3 * 4is simplfied tovariable + 12.Joining of constants in mixed constant/variable expressions:
2 + var + 3is simplified tovar + 5. Works only with sums and products (but internally a2 - 3 + xis represented as2 + (-3) + x, so it actually works with differences and divisions as well).
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 28:
=over without closing =back