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, unpublished manuscript, available upon request.

The software itself: ttapp, archived at Zenodo, https://doi.org/10.5281/zenodo.22277190 (all versions).

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.1.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.1.0
File Size Uploaded
ttapp-1.1.0.tar.gz 323.1 kB Details

Built distribution (wheel)

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

Total release size: 494.5 kB

Release files / ttapp-1.1.0.tar.gz

Download URL ttapp-1.1.0.tar.gz
Size 323.1 kB
Tags Source
SHA-256 checksum
How to use checksums
429348d0d7933f47a30c3ba0062bb8ddd7cb905e6ecede56877f91146b599c9f
BLAKE2b-256 checksum
How to use checksums
69fd7c434afa9e4e79619fa919b726308fbfa81aed1e30c2305e23bd448d9ba0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

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

Download URL ttapp-1.1.0-py3-none-any.whl
Size 171.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b73c76d25f2a4e2fdf33e22ad464c1a2a1914de3fbc663bd8f8ab0bea421fbd
BLAKE2b-256 checksum
How to use checksums
6570b80ed7b0f91135db8f709d1b79d07f9acc9751b9cb6def920de0316f1e04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.0

Release history Release notifications | RSS feed

1.1.1

2 release files

This release

1.1.0 This release

2 release files

1.0.0

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