Manuscript Offprint
arXiv:2611.12157FORM 5.0 and further developments
Ana Costa Pereira and Joshua Davies
Department of Mathematical Sciences, University of Liverpool Liverpool, L69 3BX, UK
E-mail: Ana.Costa-Pereira@liverpool.ac.uk, j.o.davies@liverpool.ac.uk
In these proceedings we review the features of the recently-released version 5.0 of the FORM computer algebra system, which is one of the core software packages for the large-scale symbolic manipulations required by calculations in theoretical high-energy physics. We also discuss developments since the release of version 5.0, focussing in particular on recent performance improvements.
23rd International Workshop on Advanced Computing and Analysis Techniques in Physics Research (ACAT2025) 8–12 September 2025 Hamburg, Germany
*Speaker
© Copyright owned by the author(s) under the terms of the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0). All rights for text and data mining, AI training, and similar technologies for commercial purposes, are reserved. ISSN 1824-8039. Published by SISSA Medialab.
Joshua Davies
1. Introduction
The FORM computer algebra system has been a key software package for multi-loop and multi-scale computations in perturbative quantum field theory for several decades [1–6]. Its design allows it to efficiently process expressions which are larger than computer memory, enabling computations which are not possible with other computer algebra systems. Although memory sizes have grown enormously over the years, so too has the scale of cutting-edge theory computations; thus FORM has had a large impact on the success of particle physics endeavours. Since version 4.0 (2012) [3], FORM has been released as free software (GPLv3), meaning that large-scale computations can be run across computing clusters without restrictions, for example due to license availability at user research institutions.
FORM 5.0 [7] has been released recently. In these proceedings we summarize the features of the new release, however we refer the reader to Ref. [7] for a much more detailed description. We also discuss recent performance improvements which are available in version 5.0.1, which can be obtained from FORM's development repository, hosted at:
https://github.com/form-dev/form
2.1 Built-in graph generator
FORM 5.0 features a built-in Feynman graph generator, based on a C++ port of the generator from the GRACE system [9]. FORM-script syntax has been introduced to define a Lagrangian; between Model and EndModel statements, one may define Particle and Vertex types which define the content, interactions and coupling constants of the model, for example:
Model PHI3; Particle phi, +1; Vertex phi,phi,phi: g; EndModel;
Once a model has been defined, graphs may be generated using the diagrams_ function, which produces output as a sequence of FORM terms which can be further manipulated by the script, using the standard FORM features. The graphs which are generated may be filtered using a variety of
Joshua Davies
keywords, such as OnePI_ or NoTadpole_ etc, which are fully described in Ref. [7]. Including a generator directly in FORM removes the need to generate graphs in external software and convert the output to compatible syntax, and provides a framework for the user to extend the generator's functionality; its C++ code is covered by the same GPLv3 license as the rest of FORM's codebase.
2.2 Floating-point coefficients
The new pre-processor command #StartFloat Nd enables the new arbitrary-precision floating-point coefficient mode, with a precision of N digits. By using the GMP [10] and MPFR [11] libraries, this provides the ability to represent term coefficients as floating-point numbers as well as the numerical evaluation of a variety of built-in functions, including sqrt_, ln_, trigonometric functions, multiple zeta values (mzv_) and Euler sums (euler_). Rational numbers may be converted to floating-point values with the ToFloat statement, and floating-point values back to rational numbers with ToRational using an algorithm based on continued fractions.
2.3 FLINT interface
The FLINT library [12] provides high-performance routines for polynomial arithmetic. FORM 5.0 features an interface to FLINT; FORM's internal term representation is converted into FLINT polynomial types, the required computation is performed by the library, and the result is converted back. The use of FLINT is enabled by default, does not require any changes to user scripts, and provides a large performance improvement for computations which make use of div_, rem_, mul_, gcd_, and inverse_, as well as PolyRatFun, FactArg and FactDollar. Benchmarks involving univariate polynomials see run-time improvements from 1.2x to 2x, and heavier multivariate benchmarks up to 50x or more, depending on the number of variables. Computations involving many variables are much more common than they were historically; this interface makes FORM much faster for modern particle physics, “MaxTermSize”-related issues notwithstanding¹.
3. Performance improvements
Recently, we have started collecting a series of FORM codes which serve as performance benchmarks. One of the main aims has been for benchmark codes to represent realistic FORM workloads, thus many of the tests are based on public FORM packages including color [13], fmft [14], forcer [15], hyperform [16], mincer [17] and code from the Multiple Zeta Value data mine [18]. The repository containing the benchmarking suite is hosted at:
https://github.com/form-dev/form-bench
The benchmarking suite has enabled systematic performance profiling and improvement efforts, which we summarize here. Some improvements apply to features introduced in FORM 5.0 (in particular, further improvements to the FLINT interface), while others are changes to longstanding, widely-used code. The widespread use of FORM for demanding computations means that these improvements enable significant savings in the CPU time required by future computations.
¹Version 5.0.1 reduces FORM's large memory allocation size for larger values of MaxTermSize to some extent. Further improvements in this direction are ongoing.
Joshua Davies
Improvements come from the changes described below. The performance impact of each change depends strongly on which benchmark is considered; each stresses different parts of the FORM system. The impact also depends on the system running the benchmarks².
Improved data-copying loops: profiling reveals several running-time hotspots which copy data between memory buffers, for example when replacing sub-expression pointers with their expression data and when transferring term data between threads in TFORM. Optimizations involve hoisting conditionals out of hot loops, resulting in a 0-8% improvement.
Scratch area for term normalization: the frequently-called Normalize function is responsible for putting terms into their canonical form. Historically, in an effort to maintain good performance, it has used stack-allocated memory for its temporary scratch area used to construct the canonical term result. However, large stack allocations in frequently called functions can suffer due to security features implemented in modern compilers; here, stack clash protection. Moving the scratch area to a dynamically-allocated array stored in the global data produces a 0-33% performance improvement.
Improved parallel sorting: in TFORM, the “sortbot” mechanism is intended to parallelise the final merge of the sorted streams of terms from each worker thread. The worker and sortbot threads transfer data by means of ring-buffer data structures, accessed in parallel by data-writing and data-reading threads. Over the years, these buffers have grown in default size, resulting in inefficient, or a lack of, parallelization for small- to medium-scale computations. By having data-writing threads detect dynamically if a data-reading thread is stalled, waiting for data, they are able to yield the current ring-buffer slot to the data-reading thread as soon as possible, rather than continuing to completely fill the current slot. This results in a 0-35% improvement for TFORM.
Removed locking for dollar variables: previously, the use of dollar variables in TFORM with ModuleOption minimum/maximum modes involved mutex locks on read and write accesses. Making these dollar variable types thread-local and collecting their global minimum/maximum values at the end of the module results in a 2-25% improvement in some benchmarks, particularly when running TFORM with larger numbers of workers.
FLINT interface and polynomial arithmetic: in addition to the performance improvements due to the use of FLINT discussed above in Section 2.3, further improvements are made by using a lexicographic variable ordering such that input (output) term sequences to (from) FLINT functions can be used directly without intermediate sorts from (to) FORM’s canonical term ordering. Benchmarks which make heavy use of multivariate polynomial arithmetic see an improvement of 5-31%.
For the current set of tests contained in the benchmarking suite, the combined effect of the improvements w.r.t. version 5.0 described above is as follows, when run with TFORM and 12 worker threads, on the system described in the footnote. Running times and uncertainties are measured using hyperfine [19]. These performance improvements are contained in the version 5.0.1 patch release, available from FORM’s GitHub repository.
²Here, an AMD Ryzen 9 7900X with 32GB DDR5-6000. The CPU is configured for reliable benchmarking by limiting its maximum frequency to 5.1GHz. Benchmarks are run on an idle system at high priority, with temporary files stored in RAM to remove disk performance and page caching effects.
Joshua Davies
| Benchmark | Speedup |
|---|---|
| chromatic | |
| color | |
| fmft | |
| forcer | |
| forcer-exp | |
| hyperform | |
| ibp-box2l |
| Benchmark | Speedup |
|---|---|
| ibp-npbox2l | |
| ibp-mbox1l | |
| ibp-pent1l | |
| ibp-tri3l | |
| ibp-nptri3l | |
| minceex | |
| mincer |
| Benchmark | Speedup |
|---|---|
| mzv-dm | |
| sort-disk | |
| sort-large | |
| sort-small | |
| trace |
4. Conclusions and outlook
FORM 5.0 has provided a variety of new features, fixes of long-standing bugs, and performance improvements, enhancing its utility for modern high-precision computations in theoretical physics. Development has seen a large increase in momentum in recent years, driven primarily by the series of annual development workshops which started in 2023. These have provided opportunities to bring developers and users together to discuss the future of FORM, by providing technical information about its codebase and how it may be modified, and collecting information on the features desired by the user community; these include facilities for the reconstruction of expressions from finite-field samples, variable naming spacing to enable the development of more robust packages, further-improved rational polynomial systems, a p-adic coefficient mode, improved CI testing and reliability, easy-to-use software and package distribution via PyPI and an updated reference manual and tutorial. We strongly encourage readers with an interest in FORM's future to attend these workshops and participate actively in development efforts, ensuring its long-term availability as the high-performance computer algebra package that theoretical particle physics requires.
References
[1] J.A.M. Vermaseren, New features of FORM, math-ph/0010025.
[2] M. Tentyukov and J.A.M. Vermaseren, The Multithreaded version of FORM, Comput. Phys. Commun. 181 (2010) 1419 [hep-ph/0702279].
[3] J. Kuipers, T. Ueda, J.A.M. Vermaseren and J. Vollinga, FORM version 4.0, Comput. Phys. Commun. 184 (2013) 1453 [1203.6543].
[4] J. Kuipers, T. Ueda and J.A.M. Vermaseren, Code Optimization in FORM, Comput. Phys. Commun. 189 (2015) 1 [1310.7007].
[5] B. Ruijl, T. Ueda and J. Vermaseren, FORM version 4.2, 1707.06453.
[6] T. Ueda, T. Kaneko, B. Ruijl and J.A.M. Vermaseren, Further developments of FORM, J. Phys. Conf. Ser. 1525 (2020) 012013.
[7] J. Davies, T. Kaneko, C. Marinissen, T. Ueda and J.A.M. Vermaseren, FORM Version 5.0, 2601.19982.
Joshua Davies
[8] Y. Collet and M. Kucherawy, “Zstandard Compression and the ‘application/zstd’ Media Type.” RFC 8878, Feb., 2021. 10.17487/RFC8878.
[9] T. Kaneko, A Feynman graph generator for any order of coupling constants, Comput. Phys. Commun. 92 (1995) 127 [hep-th/9408107].
[10] T. Granlund and the GMP development team, GNU MP: The GNU Multiple Precision Arithmetic Library, 2023.
[11] GNU MPFR: The Multiple Precision Floating-Point Reliable Library, 2025.
[12] The FLINT team, FLINT: Fast Library for Number Theory, 2025.
[13] T. van Ritbergen, A.N. Schellekens and J.A.M. Vermaseren, Group theory factors for Feynman diagrams, Int. J. Mod. Phys. A 14 (1999) 41 [hep-ph/9802376].
[14] A. Pikelner, FMFT: Fully Massive Four-loop Tadpoles, Comput. Phys. Commun. 224 (2018) 282 [1707.01710].
[15] B. Ruijl, T. Ueda and J.A.M. Vermaseren, Forcer, a FORM program for the parametric reduction of four-loop massless propagator diagrams, Comput. Phys. Commun. 253 (2020) 107198 [1704.06650].
[16] A. Kardos, S.-O. Moch and O. Schnetz, HyperFORM: a FORM package for parametric integration with hyperlogarithms, Eur. Phys. J. C 86 (2026) 659 [2511.19992].
[17] S.A. Larin, F.V. Tkachov and J.A.M. Vermaseren, The FORM version of MINCER, .
[18] J. Blumlein, D.J. Broadhurst and J.A.M. Vermaseren, The Multiple Zeta Value Data Mine, Comput. Phys. Commun. 181 (2010) 582 [0907.2557].
[19] D. Peter, hyperfine, Mar., 2023.