{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "1ab43e47",
            "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": "3115f35f",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import numpy as np\nfrom scipy.special import wrightomega, lambertw",
            "outputs": []
        },
        {
            "id": "e21a75db",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "wrightomega([-2, -1, 0, 1, 2])",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([0.12002824, 0.27846454, 0.56714329, 1.        , 1.5571456 ])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "d5244f44",
            "cell_type": "markdown",
            "source": "Complex input:\n",
            "metadata": {}
        },
        {
            "id": "d5358661",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "wrightomega(3 + 5j)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(1.5804428632097158+3.8213626783287937j)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "dad6baa9",
            "cell_type": "markdown",
            "source": "Verify that ``wrightomega(z)`` satisfies ``w + log(w) = z``:\n",
            "metadata": {}
        },
        {
            "id": "c7fb69d2",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "w = -5 + 4j\nwrightomega(w + np.log(w))",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(-5+4j)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "5afbd075",
            "cell_type": "markdown",
            "source": "Verify the connection to ``lambertw``:\n",
            "metadata": {}
        },
        {
            "id": "3389de20",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "z = 0.5 + 3j\nwrightomega(z)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(0.0966015889280649+1.4937828458191993j)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "e267e767",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "lambertw(np.exp(z))",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(0.09660158892806493+1.4937828458191993j)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "6767f1b3",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "z = 0.5 + 4j\nwrightomega(z)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(-0.3362123489037213+2.282986001579032j)"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "05fe7fb0",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "lambertw(np.exp(z), k=1)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "(-0.33621234890372115+2.282986001579032j)"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}