*************
NumPy Support
*************

This file contains a list of mathematical functions supported by rbc.
For a full list of NumPy supported functions by Numba, see: 

https://numba.pydata.org/numba-doc/dev/reference/numpysupported.html

Mathematical functions
----------------------

+-------------------------+-----------+
| Trigonometric Functions | Supported |
+=========================+===========+
| ``np.sin(x)``           | Yes       |
+-------------------------+-----------+
| ``np.cos(x)``           | Yes       |
+-------------------------+-----------+
| ``np.tan(x)``           | Yes       |
+-------------------------+-----------+
| ``np.arcsin(x)``        | Yes       |
+-------------------------+-----------+
| ``np.arccos(x)``        | Yes       |
+-------------------------+-----------+
| ``np.arctan(x)``        | Yes       |
+-------------------------+-----------+
| ``np.hypot(x, y)``      | Yes       |
+-------------------------+-----------+
| ``np.arctan2(x, y)``    | Yes       |
+-------------------------+-----------+

----

+----------------------+-----------+
| Hyperbolic Functions | Supported |
+======================+===========+
| ``np.sinh(x)``       | Yes*      |
+----------------------+-----------+
| ``np.cosh(x)``       | Yes*      |
+----------------------+-----------+
| ``np.tanh(x)``       | Yes*      |
+----------------------+-----------+
| ``np.arcsinh(x)``    | Yes       |
+----------------------+-----------+
| ``np.arccosh(x)``    | Yes       |
+----------------------+-----------+
| ``np.arctanh(x)``    | Yes       |
+----------------------+-----------+

\* Works if one adds a prefix to function name:

    .. highlight:: python
    .. code-block:: python
    
        # do this
        def _sinh(x):
            return np.sinh(x)
        
        # instead of this
        def sinh(x):
            return np.sinh(x)

-----

+--------------------+-----------+
| Rounding Functions | Supported |
+====================+===========+
| ``np.around(x)``   | Yes       |
+--------------------+-----------+
| ``np.round_(x)``   | Yes       |
+--------------------+-----------+
| ``np.rint(x)``     | Yes*      |
+--------------------+-----------+
| ``np.fix(x)``      | No**      |
+--------------------+-----------+
| ``np.floor(x)``    | Yes       |
+--------------------+-----------+
| ``np.ceil(x)``     | Yes       |
+--------------------+-----------+
| ``np.trunc(x)``    | Yes*      |
+--------------------+-----------+

\* Works if one adds a prefix to function name

\*\* ``np.fix`` is not supported by Numba at the moment.

-----

+-----------------------------------------+-----------+
| Sum, Products and Differences Functions | Supported |
+=========================================+===========+
| ``np.prod(a)``                          | Yes       |
+-----------------------------------------+-----------+
| ``np.sum(a)``                           | Yes       |
+-----------------------------------------+-----------+
| ``np.nanprod(a)``                       | No*       |
+-----------------------------------------+-----------+
| ``np.nansum(a)``                        | No*       |
+-----------------------------------------+-----------+
| ``np.cumprod(a)``                       | No*       |
+-----------------------------------------+-----------+
| ``np.cumsum(a)``                        | No*       |
+-----------------------------------------+-----------+
| ``np.nancumprod(a)``                    | No*       |
+-----------------------------------------+-----------+
| ``np.nancumsum(a)``                     | No*       |
+-----------------------------------------+-----------+
| ``np.diff(a)``                          | No*       |
+-----------------------------------------+-----------+
| ``np.ediff1d(ary)``                     | No*       |
+-----------------------------------------+-----------+
| ``np.gradient(f)``                      | No*       |
+-----------------------------------------+-----------+
| ``np.cross(a, b)``                      | No*       |
+-----------------------------------------+-----------+
| ``np.trapz(y)``                         | No*       |
+-----------------------------------------+-----------+

\* Needs OmniSci array support to work

-----

+-------------------------+-----------+
| Expoents and Logarithms | Supported |
+=========================+===========+
| ``np.exp(a)``           | Yes       |
+-------------------------+-----------+
| ``np.expm1(a)``         | Yes*      |
+-------------------------+-----------+
| ``np.exp2(a)``          | Yes*      |
+-------------------------+-----------+
| ``np.log(a)``           | Yes       |
+-------------------------+-----------+
| ``np.log10(a)``         | Yes       |
+-------------------------+-----------+
| ``np.log2(a)``          | Yes*      |
+-------------------------+-----------+
| ``np.log1p(a)``         | Yes*      |
+-------------------------+-----------+
| ``np.logaddexp(a)``     | Yes       |
+-------------------------+-----------+
| ``np.logaddexp2(a)``    | Yes       |
+-------------------------+-----------+

\* Works if one adds a prefix to function name

-----

+--------------------+-----------+
| Rational Routines  | Supported |
+====================+===========+
| ``np.lcm(x1, x2)`` | Yes       |
+--------------------+-----------+
| ``np.gcd(x1, x2)`` | Yes       |
+--------------------+-----------+

-----

+-----------------------------+-----------+
|    Arithmetic Functions     | Supported |
+=============================+===========+
| ``np.add(x1, x2)``          | Yes       |
+-----------------------------+-----------+
| ``np.reciprocal(x)``        | Yes       |
+-----------------------------+-----------+
| ``np.positive(x)``          | No*       |
+-----------------------------+-----------+
| ``np.negative(x)``          | Yes       |
+-----------------------------+-----------+
| ``np.multiply(x1, x2)``     | Yes       |
+-----------------------------+-----------+
| ``np.divide(x1, x2)``       | Yes       |
+-----------------------------+-----------+
| ``np.power(x1, x2)``        | Yes       |
+-----------------------------+-----------+
| ``np.subtract(x1, x2)``     | Yes       |
+-----------------------------+-----------+
| ``np.true_divide(x1, x2)``  | Yes       |
+-----------------------------+-----------+
| ``np.float_divide(x1, x2)`` | Yes       |
+-----------------------------+-----------+
| ``np.float_power(x1, x2)``  | No*       |
+-----------------------------+-----------+
| ``np.fmod(x1, x2)``         | No*       |
+-----------------------------+-----------+
| ``np.mod(x1, x2)``          | Yes       |
+-----------------------------+-----------+
| ``np.modf(x1, x2)``         | No*       |
+-----------------------------+-----------+
| ``np.remainder(x1, x2)``    | Yes       |
+-----------------------------+-----------+
| ``np.divmod(x1, x2)``       | No**      |
+-----------------------------+-----------+

\* Not supported by Numba

\*\* Needs tuple support

