{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "45a36e9c",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "58205e95",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nimport scipy.special as sc",
            "outputs": []
        },
        {
            "id": "3c44459e",
            "cell_type": "markdown",
            "source": "Its domain is nonnegative n and x.\n",
            "metadata": {}
        },
        {
            "id": "338d7b32",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "sc.expn(-1, 1.0), sc.expn(1, -1.0)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(nan, nan)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "1af015c3",
            "cell_type": "markdown",
            "source": "It has a pole at ``x = 0`` for ``n = 1, 2``; for larger ``n`` it\nis equal to ``1 / (n - 1)``.\n",
            "metadata": {}
        },
        {
            "id": "d48467d4",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "sc.expn([0, 1, 2, 3, 4], 0)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([       inf,        inf, 1.        , 0.5       , 0.33333333])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d543b128",
            "cell_type": "markdown",
            "source": "For n equal to 0 it reduces to ``exp(-x) / x``.\n",
            "metadata": {}
        },
        {
            "id": "e633fbd1",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "x = np.array([1, 2, 3, 4])\nsc.expn(0, x)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.36787944, 0.06766764, 0.01659569, 0.00457891])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "4e8276b8",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "np.exp(-x) / x",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.36787944, 0.06766764, 0.01659569, 0.00457891])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "8254cddc",
            "cell_type": "markdown",
            "source": "For n equal to 1 it reduces to `exp1`.\n",
            "metadata": {}
        },
        {
            "id": "b1bb4f49",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "sc.expn(1, x)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.21938393, 0.04890051, 0.01304838, 0.00377935])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "0106f837",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "sc.exp1(x)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.21938393, 0.04890051, 0.01304838, 0.00377935])"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}