Log1p
=================

逐元素计算 log(1 + x) 的值，其中 x 是输入元素。该函数在 x 的值接近于零时，比直接计算 log(1 + x) 能够提供更高的精度。

.. math::

    output_i = \ln(1 + Input_i)

输入：
    - **Input** - 输入数据地址。
    - **length** - 计算长度。
    - **core_mask** - 核掩码（仅共享存储版本需要）。

输出：
    - **Output** - 计算结果地址。

支持平台：
    ``FT78NE``
    ``MT7004``

.. note::
    - FT78NE 支持int8, int16, int32, fp32, fp64
    - MT7004 支持fp16, fp32, int16, int32

**共享存储版本:**

.. c:function:: void i8_log1p_s(int8_t* Input, float* output, int length, int core_mask)
.. c:function:: void i16_log1p_s(int16_t* Input, float* output, int length, int core_mask)
.. c:function:: void i32_log1p_s(int32_t* Input, float* output, int length, int core_mask)
.. c:function:: void hp_log1p_s(half* Input, half* output, int length, int core_mask)
.. c:function:: void fp_log1p_s(float* Input, float* output, int length, int core_mask)
.. c:function:: void dp_log1p_s(double* Input, double* output, int length, int core_mask)

**C调用示例：**

.. code-block:: c
    :linenos:
    :emphasize-lines: 9

    //FT78NE示例
    #include <stdio.h>
    #include <log1p.h> // 假设头文件名为 log1p.h
    int main(int argc, char* argv[]) {
        float *input = (float *)0xA0000000;   //input在DDR空间
        float *output = (float *)0xC0000000;
        int length = 1000;
        int core_mask = 0xff;
        fp_log1p_s(input, output, length, core_mask);
        return 0;
    }

**私有存储版本:**

.. c:function:: void i8_log1p_p(int8_t* Input, float* output, int length)
.. c:function:: void i16_log1p_p(int16_t* Input, float* output, int length)
.. c:function:: void i32_log1p_p(int32_t* Input, float* output, int length)
.. c:function:: void hp_log1p_p(half* Input, half* output, int length)
.. c:function:: void fp_log1p_p(float* Input, float* output, int length)
.. c:function:: void dp_log1p_p(double* Input, double* output, int length)

    
**C调用示例：**

.. code-block:: c
    :linenos:
    :emphasize-lines: 8

    //FT78NE示例
    #include <stdio.h>
    #include <log1p.h> // 假设头文件名为 log1p.h
    int main(int argc, char* argv[]) {
        float *input = (float *)0x10000000;   //input在L2空间
        float *output = (float *)0x10001000;
        int length = 1000;
        fp_log1p_p(input, output, length);
        return 0;
    }