Metadata-Version: 2.4
Name: ttapp
Version: 1.0.0
Summary: Tilewise Taylor approximation of analytic functions in the complex plane
Author-email: Joachim Wuttke <j.wuttke@fz-juelich.de>
License-Expression: GPL-3.0-or-later
Project-URL: Repository, https://jugit.fz-juelich.de/mlz/app/ttapp
Project-URL: Documentation, https://jugit.fz-juelich.de/mlz/app/ttapp/-/blob/main/userManual/userManual.pdf
Project-URL: Archive, https://doi.org/10.5281/zenodo.22277192
Keywords: taylor,approximation,complex-analysis,code-generation,faddeeva,numerical
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-flint>=0.4.0
Requires-Dist: numpy
Requires-Dist: scipy>=1.9
Requires-Dist: ortools
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Dynamic: license-file

# 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](https://jugit.fz-juelich.de/mlz/lib/cerf) 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](https://jugit.fz-juelich.de/mlz/app/ttapp/-/blob/main/userManual/userManual.pdf),
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](https://jugit.fz-juelich.de/mlz/app/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
