diff --git a/docs/api/constants_api.md b/docs/api/constants_api.md new file mode 100644 index 0000000..351674d --- /dev/null +++ b/docs/api/constants_api.md @@ -0,0 +1,150 @@ +# Constants Reference + +Pre-defined mathematical constants with quad precision accuracy. + +## Mathematical Constants + +```{eval-rst} +.. data:: numpy_quaddtype.pi + + The mathematical constant :math:`\pi` (pi). + + :value: 3.14159265358979323846264338327950288... + + :type: QuadPrecision + +.. data:: numpy_quaddtype.e + + Euler's number :math:`e`, the base of natural logarithms. + + :value: 2.71828182845904523536028747135266249... + + :type: QuadPrecision + +.. data:: numpy_quaddtype.log2e + + The base-2 logarithm of :math:`e`: :math:`\log_{2}{e}`. + + :value: 1.44269504088896340735992468100189213... + + :type: QuadPrecision + +.. data:: numpy_quaddtype.log10e + + The base-10 logarithm of :math:`e`: :math:`\log_{10}{e}`. + + :value: 0.43429448190325182765112891891660508... + + :type: QuadPrecision + +.. data:: numpy_quaddtype.ln2 + + The natural logarithm of 2: :math:`\log_{e}{2}`. + + :value: 0.69314718055994530941723212145817656... + + :type: QuadPrecision + +.. data:: numpy_quaddtype.ln10 + + The natural logarithm of 10: :math:`\log_{e}{10}`. + + :value: 2.30258509299404568401799145468436420... + + :type: QuadPrecision +``` + +## Type Limits + +```{eval-rst} +.. data:: numpy_quaddtype.epsilon + + Machine epsilon: the smallest positive number such that :math:`1.0 + \epsilon \neq 1.0`. + + :value: :math:`2^{-112}` or approximately :math:`1.93 \cdot 10^{-34}` + + :type: QuadPrecision + +.. data:: numpy_quaddtype.max_value + + The largest representable finite quad-precision value. + + The largest negative representable finite quad-precision value is ``-numpy_quaddtype.max_value``. + + :value: :math:`216383 \cdot (2 - 2^{-112})` or approximately :math:`1.19 \cdot 10^{4932}` + + :type: QuadPrecision + +.. data:: numpy_quaddtype.smallest_normal + + The smallest positive normal (normalized, mantissa has a leading 1 bit) quad-precision value. + + :value: :math:`2^{-16382} \cdot (1 - 2^{-112})` or approximately :math:`3.36 \cdot 10^{-4932}` + + :type: QuadPrecision + +.. data:: numpy_quaddtype.smallest_subnormal + + The smallest positive subnormal (denormalized, mantissa has a leading 0 bit) quad-precision value. + + :value: :math:`2^{-16494}` or approximately :math:`6.48 \cdot 10^{-4966}` + + :type: QuadPrecision + +.. data:: numpy_quaddtype.resolution + + The approximate decimal resolution of quad precision, i.e. `10 ** (-precision)`. + + :value: :math:`10^{-33}` + + :type: QuadPrecision +``` + +## Type Information + +```{eval-rst} +.. data:: numpy_quaddtype.bits + + The total number of bits in quad precision representation. + + :value: 128 + :type: int + +.. data:: numpy_quaddtype.precision + + The approximate number of significant decimal digits. + + :value: 33 + :type: int +``` + +## Example Usage + +```python +from numpy_quaddtype import ( + pi, e, log2e, log10e, ln2, ln10, + epsilon, max_value, smallest_normal, + bits, precision +) + +# Mathematical constants +print(f"ฯ€ = {pi}") +print(f"e = {e}") + +# Verify relationships +import numpy as np +from numpy_quaddtype import QuadPrecDType + +# e^(ln2) should equal 2 +two = np.exp(np.array(ln2)) +print(f"e^(ln2) = {two}") + +# log2(e) * ln(2) should equal 1 +one = log2e * ln2 +print(f"log2(e) ร— ln(2) = {one}") + +# Type limits +print(f"\nQuad precision uses {bits} bits") +print(f"Approximately {precision} decimal digits of precision") +print(f"Machine epsilon: {epsilon}") +``` diff --git a/docs/api/core.md b/docs/api/core.md new file mode 100644 index 0000000..8fa6107 --- /dev/null +++ b/docs/api/core.md @@ -0,0 +1,185 @@ +# Core Types + +The fundamental types provided by NumPy QuadDType. + +## Quad Precision Value + +```{eval-rst} +.. class:: numpy_quaddtype.QuadPrecision(value, backend="sleef") + + A quad-precision (128-bit) floating-point scalar. + + QuadPrecision is a NumPy scalar type that provides IEEE 754 binary128 + floating-point arithmetic. It can be used standalone or as elements + of NumPy arrays. + + :param value: The value to convert to quad precision. It can be: + + - ``float`` or ``int``: Python numeric types + - ``str``: String representation for maximum precision + - ``bytes``: Raw 16-byte representation + - ``numpy.floating`` or ``numpy.integer``: NumPy numeric types + - ``QuadPrecision``: Another QuadPrecision value + :type value: float, int, str, bytes, numpy scalar, or QuadPrecision + + :param backend: Computation backend to use. Either ``"sleef"`` (default) + or ``"longdouble"``. + :type backend: str, optional + + **Examples** + + Create from different input types:: + + >>> from numpy_quaddtype import QuadPrecision + >>> QuadPrecision(3.14) + QuadPrecision('3.14000000000000012434...') + >>> QuadPrecision("3.14159265358979323846264338327950288") + QuadPrecision('3.14159265358979323846264338327950288') + >>> QuadPrecision(42) + QuadPrecision('42.0') + + Arithmetic operations:: + + >>> x = QuadPrecision("1.5") + >>> y = QuadPrecision("2.5") + >>> x + y + QuadPrecision('4.0') + >>> x * y + QuadPrecision('3.75') + + .. attribute:: dtype + :type: QuadPrecDType + + The NumPy dtype for this scalar. + + .. attribute:: real + :type: QuadPrecision + + The real part (always self for QuadPrecision). + + .. attribute:: imag + :type: QuadPrecision + + The imaginary part (always zero for QuadPrecision). +``` + +## Quad Precision DType + +```{eval-rst} +.. class:: numpy_quaddtype.QuadPrecDType(backend="sleef") + + NumPy dtype for quad-precision floating-point arrays. + + QuadPrecDType is a custom NumPy dtype that enables the creation and + manipulation of arrays containing quad-precision values. + + :param backend: Computation backend. Either ``"sleef"`` (default) or + ``"longdouble"``. + :type backend: str, optional + + **Examples** + + Create arrays with QuadPrecDType:: + + >>> import numpy as np + >>> from numpy_quaddtype import QuadPrecDType + >>> arr = np.array([1, 2, 3], dtype=QuadPrecDType()) + >>> arr.dtype + QuadPrecDType128 + >>> np.zeros(5, dtype=QuadPrecDType()) + array([0.0, 0.0, 0.0, 0.0, 0.0], dtype=QuadPrecDType128) + + .. attribute:: backend + :type: QuadBackend + + The computation backend (``SLEEF`` or ``LONGDOUBLE``). + + .. attribute:: itemsize + :type: int + + The size of each element in bytes (always 16). + + .. attribute:: alignment + :type: int + + The memory alignment in bytes (always 16). + + .. attribute:: name + :type: str + + The string name of the dtype (``"QuadPrecDType128"``). +``` + +```{eval-rst} +.. class:: numpy_quaddtype.QuadBackend + + Enumeration of available computation backends. + + .. attribute:: SLEEF + :value: 0 + + SLEEF library backend (default). Provides true IEEE 754 binary128 + quad precision with SIMD optimization. + + .. attribute:: LONGDOUBLE + :value: 1 + + The platform's native long double backend. The precision varies by platform. + + **Example** + + :: + + >>> from numpy_quaddtype import QuadPrecDType, QuadBackend + >>> dtype = QuadPrecDType() + >>> dtype.backend == QuadBackend.SLEEF + True +``` + +## Convenience Functions + +```{eval-rst} +.. function:: numpy_quaddtype.SleefQuadPrecision(value) + + Create a QuadPrecision scalar using the SLEEF backend. + + Equivalent to ``QuadPrecision(value, backend="sleef")``. + + :param value: Value to convert to quad precision. + :return: Quad precision scalar using SLEEF backend. + :rtype: QuadPrecision +``` + +```{eval-rst} +.. function:: numpy_quaddtype.LongDoubleQuadPrecision(value) + + Create a QuadPrecision scalar using the longdouble backend. + + Equivalent to ``QuadPrecision(value, backend="longdouble")``. + + :param value: Value to convert to quad precision. + :return: Quad precision scalar using longdouble backend. + :rtype: QuadPrecision +``` + +```{eval-rst} +.. function:: numpy_quaddtype.SleefQuadPrecDType() + + Create a QuadPrecDType using the SLEEF backend. + + Equivalent to ``QuadPrecDType(backend="sleef")``. + + :return: Dtype for SLEEF-backed quad precision arrays. + :rtype: QuadPrecDType +``` + +```{eval-rst} +.. function:: numpy_quaddtype.LongDoubleQuadPrecDType() + + Create a QuadPrecDType using the longdouble backend. + + Equivalent to ``QuadPrecDType(backend="longdouble")``. + + :return: Dtype for longdouble-backed quad precision arrays. + :rtype: QuadPrecDType +``` diff --git a/docs/api/functions.md b/docs/api/functions.md new file mode 100644 index 0000000..c532955 --- /dev/null +++ b/docs/api/functions.md @@ -0,0 +1,208 @@ +# Supported NumPy Functions + +NumPy QuadDType supports a comprehensive set of NumPy universal functions (ufuncs) and array functions. + +## Element-wise Arithmetic Operations + +### Unary Arithmetic + +| Function | Operator | Description | +|----------|----------|-------------| +| `np.negative` | `-x` | Numerical negative | +| `np.positive` | `+x` | Numerical positive | +| `np.absolute` | `abs(x)` | Absolute value | + +### Binary Arithmetic + +| Function | Operator | Description | +|----------|----------|-------------| +| `np.add` | `+` | Addition | +| `np.subtract` | `-` | Subtraction | +| `np.multiply` | `*` | Multiplication | +| `np.divide` | `/` | Division | +| `np.true_divide` | `/` | True division | +| `np.floor_divide` | `//` | Floor division | +| `np.mod` | `%` | Modulo | +| `np.power` | `**` | Power | + +## Element-wise Sign Functions + +| Function | Description | +|----------|-------------| +| `np.sign` | Sign indicator | +| `np.signbit` | Test for negative sign bit (works with NaN) | +| `np.copysign` | Copy sign of second to first | + +## Element-wise Trigonometric Functions + +| Function | Description | +|----------|-------------| +| `np.sin` | Sine | +| `np.cos` | Cosine | +| `np.tan` | Tangent | +| `np.arcsin` | Inverse sine | +| `np.arccos` | Inverse cosine | +| `np.arctan` | Inverse tangent | +| `np.arctan2` | Two-argument inverse tangent | + +### Element-wise Hyperbolic Functions + +| Function | Description | +|----------|-------------| +| `np.sinh` | Hyperbolic sine | +| `np.cosh` | Hyperbolic cosine | +| `np.tanh` | Hyperbolic tangent | +| `np.arcsinh` | Inverse hyperbolic sine | +| `np.arccosh` | Inverse hyperbolic cosine | +| `np.arctanh` | Inverse hyperbolic tangent | + +## Element-wise Exponential Functions + +| Function | Description | +|----------|-------------| +| `np.exp` | Exponential ({math}`e^x`) | +| `np.exp2` | Base-2 exponential ({math}`2^x`) | +| `np.expm1` | `exp(x) - 1` (accurate for small x) | + +## Element-wise Logarithmic Functions + +| Function | Description | +|----------|-------------| +| `np.log` | Natural logarithm | +| `np.log2` | Base-2 logarithm | +| `np.log10` | Base-10 logarithm | +| `np.log1p` | `log(1 + x)` (accurate for small x) | + +## Element-wise Power and Root Functions + +| Function | Description | +|----------|-------------| +| `np.square` | Square ({math}`x^2`) | +| `np.sqrt` | Square root | +| `np.cbrt` | Cube root | +| `np.hypot` | Hypotenuse ({math}`\sqrt{x^2 + y^2}`) | + +## Element-wise Rounding Functions + +| Function | Description | +|----------|-------------| +| `np.floor` | Floor (round down) | +| `np.ceil` | Ceiling (round up) | +| `np.trunc` | Truncate toward zero | +| `np.rint` | Round to nearest integer (ties to even) | + +## Element-wise Classification Functions + +| Function | Description | +|----------|-------------| +| `np.isfinite` | Test for finite values | +| `np.isinf` | Test for infinity | +| `np.isnan` | Test for NaN | + +## Element-wise Comparison Functions + +| Function | Operator | Description | +|----------|----------|-------------| +| `np.equal` | `==` | Equal | +| `np.not_equal` | `!=` | Not equal | +| `np.less` | `<` | Less than | +| `np.less_equal` | `<=` | Less than or equal | +| `np.greater` | `>` | Greater than | +| `np.greater_equal` | `>=` | Greater than or equal | + +### Element-wise Minimum/Maximum + +| Function | Description | +|----------|-------------| +| `np.minimum` | Minimum | +| `np.maximum` | Maximum | +| `np.fmin` | Minimum (ignores NaN) | +| `np.fmax` | Maximum (ignores NaN) | + +## Reduction Functions + +| Function | Description | +|----------|-------------| +| `np.sum` | Sum of elements | +| `np.prod` | Product of elements | +| `np.mean` | Arithmetic mean | +| `np.min` / `np.amin` | Minimum value | +| `np.max` / `np.amax` | Maximum value | + +## Array Creation and Manipulation + +### Creation + +| Function | Description | +|----------|-------------| +| `np.zeros` | Array of zeros | +| `np.ones` | Array of ones | +| `np.empty` | Uninitialized array | +| `np.full` | Array filled with given value | +| `np.arange` | Range of values | +| `np.linspace` | Linearly spaced values | + +### Manipulation + +| Function | Description | +|----------|-------------| +| `np.reshape` | Reshape array | +| `np.transpose` | Transpose array | +| `np.concatenate` | Join arrays | +| `np.stack` | Stack arrays | +| `np.split` | Split array | + +## Linear Algebra (via QuadBLAS) + +When QuadBLAS is available (not on Windows): + +| Function | Description | +|----------|-------------| +| `np.dot` | Dot product | +| `np.matmul` / `@` | Matrix multiplication | + +## Type Conversion + +| Function | Description | +|----------|-------------| +| `np.astype` | Convert array dtype | +| `np.array` | Create array from data | + +## Usage Examples + +### Trigonometric + +```python +import numpy as np +from numpy_quaddtype import QuadPrecDType, pi + +x = np.array([0, pi/6, pi/4, pi/3, pi/2, pi], dtype=QuadPrecDType()) + +print("sin(x):", np.sin(x)) +print("cos(x):", np.cos(x)) +``` + +### Exponential and Logarithmic + +```python +import numpy as np +from numpy_quaddtype import QuadPrecDType + +x = np.array([1, 2, 3], dtype=QuadPrecDType()) + +print("exp(x):", np.exp(x)) +print("log(exp(x)):", np.log(np.exp(x))) # Should return x +``` + +### Reductions + +```python +import numpy as np +from numpy_quaddtype import QuadPrecDType + +arr = np.arange(1, 11, dtype=QuadPrecDType()) + +print("Sum:", np.sum(arr)) # 55 +print("Product:", np.prod(arr)) # 3628800 (10!) +print("Mean:", np.mean(arr)) # 5.5 +``` diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 0000000..2505f0f --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,12 @@ +# API Reference + +API documentation for NumPy QuadDType. + +```{toctree} +:maxdepth: 2 + +core +functions +constants_api +utilities +``` diff --git a/docs/api/utilities.md b/docs/api/utilities.md new file mode 100644 index 0000000..a744b93 --- /dev/null +++ b/docs/api/utilities.md @@ -0,0 +1,137 @@ +# Utility Functions + +Helper functions for platform precision detection and threading control. + +## Platform Precision Detection + +```{eval-rst} +.. function:: numpy_quaddtype.is_longdouble_128() + + Check if the platform's ``long double`` type is 128-bit. + + This is useful for determining whether the longdouble backend provides + true quad precision on the current platform. + + :return: ``True`` if ``long double`` is 128-bit, ``False`` otherwise. + :rtype: bool + + **Platform behavior:** + + - Linux x86_64: Returns ``False`` (80-bit extended precision) + - Linux aarch64: Returns ``True`` (128-bit quad precision) + - macOS (all): Returns ``False`` (64-bit double precision) + - Windows (all): Returns ``False`` (64-bit double precision) + + **Example** + + :: + + >>> from numpy_quaddtype import is_longdouble_128 + >>> if is_longdouble_128(): + ... print("Native quad precision available via longdouble") + ... else: + ... print("Use SLEEF backend for quad precision") +``` + +## Threading Control + +These functions control the number of threads used by QuadBLAS for parallel operations. + +```{eval-rst} +.. function:: numpy_quaddtype.set_num_threads(n) + + Set the number of threads used by QuadBLAS operations. + + :param n: Number of threads to use. Must be a positive integer. + :type n: int + :raises ValueError: If n is not a positive integer. + + **Example** + + :: + + >>> from numpy_quaddtype import set_num_threads, get_num_threads + >>> set_num_threads(4) + >>> get_num_threads() + 4 + + .. note:: + + This function has no effect if QuadBLAS is disabled (e.g., on Windows). + +.. function:: numpy_quaddtype.get_num_threads() + + Get the current number of threads used by QuadBLAS. + + :return: Current thread count for QuadBLAS operations. + :rtype: int + + **Example** + + :: + + >>> from numpy_quaddtype import get_num_threads + >>> get_num_threads() + 4 + +.. function:: numpy_quaddtype.get_quadblas_version() + + Get the QuadBLAS library version string. + + :return: Version string if QuadBLAS is available, ``None`` otherwise. + :rtype: str or None + + **Example** + + :: + + >>> from numpy_quaddtype import get_quadblas_version + >>> version = get_quadblas_version() + >>> if version: + ... print(f"QuadBLAS version: {version}") + ... else: + ... print("QuadBLAS not available") + + .. note:: + + QuadBLAS is automatically disabled on Windows builds due to MSVC + compatibility issues. In this case, the function returns ``None``. +``` + +## Example: Optimizing Thread Usage + +```python +import numpy as np +from numpy_quaddtype import ( + QuadPrecDType, + set_num_threads, + get_num_threads, + get_quadblas_version +) + +# Check QuadBLAS availability +version = get_quadblas_version() +if version: + print(f"QuadBLAS {version} available") + + # Get current threads + print(f"Default threads: {get_num_threads()}") + + # Create test array + arr = np.random.randn(100000).astype(QuadPrecDType()) + + # Benchmark with different thread counts + import time + + for threads in [1, 2, 4, 8]: + set_num_threads(threads) + + start = time.time() + for _ in range(10): + result = np.dot(arr, arr) + elapsed = time.time() - start + + print(f" {threads} threads: {elapsed:.3f}s") +else: + print("QuadBLAS not available - single-threaded operations only") +``` diff --git a/docs/api_docs.rst b/docs/api_docs.rst deleted file mode 100644 index b167a85..0000000 --- a/docs/api_docs.rst +++ /dev/null @@ -1,7 +0,0 @@ -NumPy QuadDType API Documentation -================================= - -.. automodule:: numpy_quaddtype - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/conf.py b/docs/conf.py index 2f6243a..03d11c7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,6 +9,8 @@ project = 'NumPy QuadDType' copyright = '2025, NumPy Community' author = 'NumPy Community' +release = '0.2.0' +version = '0.2.0' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -16,14 +18,80 @@ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', + 'sphinx.ext.viewcode', + 'sphinx.ext.intersphinx', 'myst_parser', + 'sphinx_design', + 'sphinx_copybutton', + 'sphinxcontrib.katex', ] templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +# -- MyST configuration ------------------------------------------------------ +myst_enable_extensions = [ + "colon_fence", + "deflist", + "fieldlist", +] + +# -- Intersphinx configuration ----------------------------------------------- +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), + 'numpy': ('https://numpy.org/doc/stable/', None), +} + # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = 'pydata_sphinx_theme' +html_theme_options = { + "github_url": "https://github.com/numpy/numpy-user-dtypes", + "show_toc_level": 2, + "navbar_align": "left", + "navbar_end": ["theme-switcher", "navbar-icon-links"], + "icon_links": [ + { + "name": "PyPI", + "url": "https://pypi.org/project/numpy-quaddtype/", + "icon": "fa-brands fa-python", + }, + ], + "logo": { + "text": "NumPy QuadDType", + }, + "footer_start": ["copyright"], + "footer_end": ["theme-version"], + "secondary_sidebar_items": ["page-toc", "edit-this-page"], + "pygments_light_style": "default", + "pygments_dark_style": "monokai", +} + +html_context = { + "github_user": "numpy", + "github_repo": "numpy-user-dtypes", + "github_version": "main", + "doc_path": "quaddtype/docs", +} + +html_sidebars = { + "**": ["sidebar-nav-bs", "sidebar-ethical-ads"], +} + +# -- Copy button configuration ----------------------------------------------- +copybutton_prompt_text = r">>> |\.\.\. |\$ " +copybutton_prompt_is_regexp = True + +# -- Autodoc configuration --------------------------------------------------- +autodoc_default_options = { + 'members': True, + 'undoc-members': True, + 'show-inheritance': True, +} + +# -- Napoleon configuration -------------------------------------------------- +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_init_with_doc = True diff --git a/docs/index.md b/docs/index.md index c19eba4..da9db02 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,8 +1,108 @@ -```{include} ../README.md +# NumPy QuadDType + +```{image} https://img.shields.io/pypi/v/numpy-quaddtype.svg +:target: https://pypi.org/project/numpy-quaddtype/ +:alt: PyPI version +``` +```{image} https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue.svg +:alt: Python versions +``` + +**A cross-platform 128-bit (quadruple precision) floating-point data type for NumPy.** + +NumPy QuadDType provides IEEE 754 quadruple-precision (binary128) floating-point arithmetic as a first-class NumPy dtype, enabling high-precision numerical computations that go beyond the standard 64-bit double precision. + +## Key Features + +::::{grid} 1 1 2 3 +:gutter: 2 + +:::{grid-item-card} ๐ŸŽฏ True Quad Precision + + +128-bit floating point with ~34 decimal digits of precision +::: + +:::{grid-item-card} ๐Ÿ”Œ NumPy Integration + + +Works seamlessly with NumPy arrays, ufuncs, and broadcasting. +::: + +:::{grid-item-card} โšก SIMD Optimized + + +Vectorization-friendly design that can leverage SIMD acceleration where supported. +::: + +:::{grid-item-card} ๐Ÿงฎ Mathematical Functions +:link: api/functions +:link-type: doc + +Full suite of math functions: trigonometric, exponential, logarithmic, and more. +::: + +:::{grid-item-card} ๐Ÿ”€ Dual Backend + + +Choose between SLEEF (default) or native longdouble backends. +::: + +:::{grid-item-card} ๐Ÿงต Thread-Safe + + +Full support for Python's free-threading (GIL-free) mode. +::: + +:::: + +## Quick Start + +### Installation + +```bash +pip install numpy-quaddtype ``` +### Basic Usage + +```python +import numpy as np +from numpy_quaddtype import QuadPrecision, QuadPrecDType + +# Create a quad-precision scalar +x = QuadPrecision("3.14159265358979323846264338327950288") + +# Create a quad-precision array +arr = np.array([1, 2, 3], dtype=QuadPrecDType()) + +# Use NumPy functions +result = np.sin(arr) +print(result) +``` + +### Why Quad Precision? + +Standard double precision (float64) provides approximately 15-16 significant decimal digits. While sufficient for most applications, some scenarios require higher precision: + +- **Numerical Analysis**: Ill-conditioned problems, iterative algorithms +- **Scientific Computing**: Astronomy, physics simulations requiring extreme accuracy +- **Financial Calculations**: High-precision arithmetic for regulatory compliance +- **Validation**: Checking accuracy of lower-precision implementations + ```{toctree} +:maxdepth: 2 :hidden: -api_docs.rst +api/index ``` + +## Indices and tables + +- {ref}`genindex` +- {ref}`search` diff --git a/pyproject.toml b/pyproject.toml index 5da7884..b35f4a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,9 @@ docs = [ "sphinx", "pydata-sphinx-theme", "myst-parser", + "sphinx-design", + "sphinx-copybutton", + "sphinxcontrib-katex", ] [project.urls]