public override double Solve(IDictionary <Variable, Operation> values = null) { values = values ?? new Dictionary <Variable, Operation>(); if (!TermVariables.All(p => values.ContainsKey(p.Key))) { throw new InvalidOperationException("All variables must be present for a numeric solution."); } return(Coefficient.Value * TermVariables.Aggregate <KeyValuePair <Variable, Operation>, double>(0.0, (d, pair) => d * Math.Pow(values[pair.Key].Solve(values), pair.Value.Solve(values))) * (EulerPower != null ? Math.Pow(Math.E, EulerPower.Solve(TermVariables)) : 1)); }