dynamic evaluate(EvaluationType type, ContextModel context)

Evaluates this expression according to given type and context.

Source

evaluate(EvaluationType type, ContextModel context) {
  if (type == EvaluationType.REAL) {
    // Be lazy, convert to Ln.
    return asNaturalLogarithm().evaluate(type, context);
  }

  if (type == EvaluationType.INTERVAL) {
    // log_a([x, y]) = [log_a(x), log_a(y)] for [x, y] positive and a > 1
    return asNaturalLogarithm().evaluate(type, context);
  }

  throw new UnimplementedError('Can not evaluate log on ${type} yet.');
}