Skip to main content

ttapp — Tilewise Taylor approximation in a complex domain

ttapp is a code generator, written in Python, that writes C tables for computing an analytic function of a complex variable in a finite domain with near machine precision, by Taylor expansions around a small set of centers, each serving a polyomino of square tiles. Centers, truncation orders and coefficients are chosen so that a guaranteed relative error bound holds on every tile.

ttapp is not yet fully generic. Its proven use case, the Faddeeva function w(z), relies on specific properties of w, in particular on the monotonic decrease of |w(z)| in the first quadrant, which bounds the relative error. Applying ttapp to another function f(z) requires more than a new function module; see the subsection "Software ppapp/ttapp for real/complex functions" of the paper cited below.

Output

The generated tables ship with the C library libcerf as of release 3.6, as files lib/auto_taylor_wofz_tiles.c and lib/auto_taylor_wofz_coeffs.c; the generated test cases as test/auto_test_taylor_wofz.c. Every generated file opens with a header that names the generator version, the full command line and all parameters.

Install

pip install ttapp installs the released package from PyPI, with the demo function modules and the tests inside. From a clone of this repository, pip install -e . installs the command ttapp; alternatively, run python3 -m ttapp from the project root without installing.

Dependencies: python-flint for arbitrary-precision interval arithmetic; numpy and scipy, whose HiGHS solver serves cover algorithm p; OR-tools, needed only for cover algorithm s. The measurement modes e and H load the C library under test through ctypes, from the path in the environment variable LIBCERF_PATH or from the system library search.

Quick start

The production tables of libcerf were made by

ttapp d wofz 23 3 7 63 0
ttapp c wofz wofz_candidates.dat s 0 0

Mode d writes the candidate expansion centers to wofz_candidates.dat (Taylor order 23, error bound 3 eps, tile edge 1/7, recentering parameter M = 63, one worker per core). Mode c solves the set cover problem with CP-SAT (algorithm s, no time limit, one worker per core) and writes auto_taylor_wofz_tiles.c, auto_taylor_wofz_coeffs.c, and two .tab files for inspection. Both modes write into the current working directory. Running ttapp without arguments lists all modes; the user manual explains them.

Other functions

A function module provides high-precision values of f and of its Taylor coefficients. ttapp/demo_function/wofz.py is the reference example, ttapp/function_interface.py the specification. The manual's section "Function module" says what else must be adapted.

Tests

python3 -m pytest

from the project root, or ttapp u, which also works for an installed package, since the tests ship inside it.

Documentation

User manual, PDF in this repository.

Citation

Joachim Wuttke, Code generation for computing an analytic function with near machine precision on square tiles, with application to the Faddeeva function, in preparation.

The software itself: ttapp 1.0, archived at Zenodo, https://doi.org/10.5281/zenodo.22277192.

The real-line sibling of ttapp is ppapp: Joachim Wuttke and Alexander Kleinsorge, Algorithm 1062: Code Generation for Piecewise Chebyshev Approximation, ACM Trans. Math. Softw. 52(2), 13 (2026), https://doi.org/10.1145/3805698.

Author: Joachim Wuttke

License: GPL-3.0 or later

Copyright: Forschungszentrum Jülich GmbH 2026

Metadata

Release files for ttapp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ttapp 1.0.0
File Size Uploaded
ttapp-1.0.0.tar.gz 278.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ttapp 1.0.0
File Interpreter ABI Platform
ttapp-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 450.0 kB

Release files / ttapp-1.0.0.tar.gz

Download URL ttapp-1.0.0.tar.gz
Size 278.3 kB
Tags Source
SHA-256 checksum
How to use checksums
eb6c11653e9422e8d8d8a3aed14a17f43e79835690ec0125ad4878b2bcc91218
BLAKE2b-256 checksum
How to use checksums
08e2bbaa57c260d2c18200213d105168b7435c86cb3bd092efb8bb51f34cf348
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release files / ttapp-1.0.0-py3-none-any.whl

Download URL ttapp-1.0.0-py3-none-any.whl
Size 171.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef4b779429964921b06346be252effbb2d03d671737d4f33ddf33f0221ebed4b
BLAKE2b-256 checksum
How to use checksums
0b09554f03c97135643c75753cfcdcc443465a09386da21530fbd8e13b6c44f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.3

Release history Release notifications | RSS feed

1.1.1

2 release files

1.1.0

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page