Skip to contents

Evaluates over the complex plane using R's principal-branch log. Inputs are coerced to complex so that log(-1), exp of a complex argument, and the extended-real values used by some catalog constructions (log(0) = -Inf, exp(-Inf) = 0) all resolve correctly.

Usage

eml(x, y)

Arguments

x, y

numeric or complex (length 1 or vectors of equal length).

Value

Complex.

See also

eml_real() for the real-valued wrapper, eml_eval() for evaluating an EML expression with variable bindings.

Examples

eml(1, 1) # exp(1) - log(1) = e
#> [1] 2.718282+0i
eml(0, -1) # 1 - i*pi    (principal-branch log)
#> [1] 1-3.141593i
Re(eml(-Inf, exp(1))) # -1, via extended-real semantics
#> [1] -1