Hi again,
I've been working with expression trees for a few days now and I'm curious to know what Expression.Reduce() does. The msdn documentation is not very helpful as it only states that it "reduces" the expression. Just in case, I tried an example (see below) to check if this method included mathematical reduction, but this doesn't seem to be the case.
Does anyone know what this method does and is it possible to provide a quick example showing it in action? Any good resources out there?
Thanks a lot!
Edit: Replaced [x => x + x] by [x => (x + x + x) + Math.Exp(x + x + x)]
static void Main(string[] args)
{
Expression<Func<double, double>> func = x => (x + x + x) + Math.Exp(x + x + x);
Console.WriteLine(func);
Expression r_func = func.Reduce();
Console.WriteLine(r_func); // This prints out the same as Console.WriteLine(func)
{