Problem
function.hpp offers integer powers, roots and pi. Test methods also use natural logarithm, decimal logarithm and exponential of a dimensionless expression — to linearise a measured quantity, to state a model curve, or to express a result on a logarithmic axis. Today a consumer has to declare each of them as an opaque operation, so the page renders them as a call and the trace marks them [inside not shown], although they are ordinary functions a method writes out.
Wanted
formula::ln(expr), formula::log10(expr), formula::exp(expr) as function nodes, rendered in every dialect (ln x, \ln, \log_{10}, e^{x} / \exp) and traced step by step like sqrt.
- The operand must be dimensionless — a dimensioned argument is a compile error in the library's own words, as for addends that disagree.
- A general real power
pow(base, exponentExpr) with both dimensionless, or a note on why it is out of scope.
Open points
- Exact evaluation. The results are irrational almost everywhere. Should
checked_evaluate (always exact) refuse a formula that contains one, or round it at a declared precision, as rounded_sqrt does? checked_evaluate_si<double> can answer directly.
- Domain.
ln/log10 of zero or a negative value should be DomainError, never NaN or -inf, under both representations.
- Absence. An absent operand stays absent, like every other node.
Problem
function.hppoffers integer powers, roots andpi. Test methods also use natural logarithm, decimal logarithm and exponential of a dimensionless expression — to linearise a measured quantity, to state a model curve, or to express a result on a logarithmic axis. Today a consumer has to declare each of them as an opaque operation, so the page renders them as a call and the trace marks them[inside not shown], although they are ordinary functions a method writes out.Wanted
formula::ln(expr),formula::log10(expr),formula::exp(expr)as function nodes, rendered in every dialect (ln x,\ln,\log_{10},e^{x}/\exp) and traced step by step likesqrt.pow(base, exponentExpr)with both dimensionless, or a note on why it is out of scope.Open points
checked_evaluate(always exact) refuse a formula that contains one, or round it at a declared precision, asrounded_sqrtdoes?checked_evaluate_si<double>can answer directly.ln/log10of zero or a negative value should beDomainError, never NaN or-inf, under both representations.