[ 
https://issues.apache.org/jira/browse/ARROW-13096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17367085#comment-17367085
 ] 

Eduardo Ponce commented on ARROW-13096:
---------------------------------------

I consider having (1) *ln*, (2) *log10*, and (3) *log2* is a good starting 
point, and the missing variants are:
 (4) *log\(x, base)* = *log\(x)* / *log(base)*, note that *log(base)* is a 
constant w.r.t. to Datum *x* so optimizations can be made
 (5) *log1p\(x)* = *log(1+x)*

Note that (4) is the most general variant as it can represent any of the other 
variants, so it might be worthwhile to consider adding it to Arrow.

As additional context, here is the partial landscape of log functions across 
library/languages:
 * [C++ math library|https://www.cplusplus.com/reference/cmath/log] supports 
(1,2,3,5)
 * [Python *math* module|https://docs.python.org/3/library/math.html#math.log] 
supports (1-5)
 * [Python 
*numpy*|https://numpy.org/doc/stable/reference/generated/numpy.log.html#numpy.log]
 supports (1,2,3,5)
 * [R|https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/log] 
supports (1-5)
 * [Rust math|https://docs.rs/numeric/0.1.4/numeric/math/fn.log.html] support 
(1-5)
 * [MySQL|https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html] 
supports (1-4)
 * [PostgreSQL|https://www.postgresql.org/docs/9.1/functions-math.html] 
supports (1,2,4)

> [C++] Implement logarithm compute functions
> -------------------------------------------
>
>                 Key: ARROW-13096
>                 URL: https://issues.apache.org/jira/browse/ARROW-13096
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: David Li
>            Assignee: David Li
>            Priority: Major
>              Labels: beginner, pull-request-available
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> ln, log, log2?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to