Skip to contents

The operator

The single binary operator at the heart of the package.

eml()
The EML operator: eml(x, y) = exp(x) - log(y)
eml_real()
Real-valued EML, with imaginary-residue check

Constructors

Build EML expressions as native R call objects.

eml_const()
Construct a literal EML constant
eml_var()
Construct an EML variable reference
eml_node()
Construct an EML node
as_eml_expr()
Coerce an arbitrary input to an EML expression

Predicates

Type checks for EML expressions.

is_eml_expr()
Is the object an EML expression?
is_eml_call()
Is the object an eml(l, r) call?
is_eml_const()
Is the object an EML constant literal?
is_eml_var()
Is the object an EML variable reference (a name)?

Inspection

Structural metrics on EML expressions.

eml_K()
Total node count K of an EML expression (paper definition)
eml_leafcount()
Leaf count of an EML expression (v1 semantics)
eml_depth()
Depth of an EML expression
eml_rpn()
Reverse Polish Notation (RPN) serialisation

Evaluation

Two evaluators — eml_eval for one-off, bytecode for vectorised hot paths.

eml_eval()
Evaluate an EML expression at variable bindings
compile_eml()
Compile an EML expression to bytecode
run_bytecode()
Run compiled EML bytecode at variable bindings

Simplification

Two-mode rewriter — stays in EML, or collapses to base R primitives.

simplify_eml()
Simplify an EML expression, keeping the EML grammar intact
simplify_native()
Simplify by collapsing recognised EML patterns to base-R primitives

Identity catalog

Canonical EML expressions for every elementary primitive.

tree_e() tree_one() tree_exp() tree_ln() tree_log() tree_sub() tree_zero() tree_neg_one() tree_minus() tree_add() tree_mul() tree_div() tree_pow() tree_two() tree_i() tree_pi() tree_sqrt() tree_sin() tree_cos()
EML expressions for the elementary functions and constants implemented in this release
eml_catalog()
All catalog identities as a named list
verify_catalog()
Verify the catalog: every entry evaluates to its known value

Master formula and symbolic regression

Depth-n parameterised expression with L-BFGS-B fitter and analytic gradients via Deriv. Recovers closed-form expressions from data.

build_master()
Build a depth-n master-formula expression
master_n_params()
Number of free parameters in a depth-n master formula
unpack_master_params()
Pack a flat parameter vector into a named list keyed by the symbol names
snap_master_params()
Snap continuous master parameters to one-hot vertices
theta_for_exp()
Selector parameter vector for the exp(x) master at depth 1
theta_for_log()
Selector parameter vector for the log(x) master at depth 3
eml_fit()
Fit a depth-n master formula to data (symbolic regression)

Package

emlR emlR-package
emlR: All Elementary Functions From a Single Binary Operator