Ellip: An Elliptic Integral Library for Rust

Ellip: An Elliptic Integral Library for Rust - Published in JOSS (2026)

https://github.com/p-sira/ellip

Science Score: 87.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 9 DOI reference(s) in README and JOSS metadata
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

elliptic-integrals math rust special-functions
Last synced: 18 days ago · JSON representation

Repository

Elliptic integrals for Rust

Basic Info
  • Host: GitHub
  • Owner: p-sira
  • License: bsd-3-clause
  • Language: Rust
  • Default Branch: main
  • Homepage: https://docs.rs/ellip/
  • Size: 63.7 MB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 25
Topics
elliptic-integrals math rust special-functions
Created about 1 year ago · Last pushed about 2 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct

README.md

ELLIP

License Crate Total Downloads Documentation

Elliptic integrals for Rust

Ellip is a pure-Rust implementation of elliptic integrals. Ellip also provides less common functions like Bulirsch's cel and el. Some applications of the elliptic integrals include computing the lengths of plane curves, magnetism, astrophysics, and string theory.

Use Ellip-Rayon to parallelize and improve performance for large inputs. Ellip is also available for Python via EllipPy.

Quick Start

Start by installing Ellip. ```shell

cargo add ellip ```

Let's compute the circumference of an ellipse.

```rust use ellip::*;

fn ellipse_length(a: f64, b: f64) -> Result { Ok(8.0 * elliprg(0.0, a * a, b * b)?) }

let ans = ellipselength(5.0, 3.0).unwrap(); ellip::util::assertclose(ans, 25.526998863398124, 1e-15); ```

Learn more at doc.rs.

Features

  • Legendre's complete integrals
    • ellipk: Complete elliptic integral of the first kind (K).
    • ellipe: Complete elliptic integral of the second kind (E).
    • ellippi: Complete elliptic integral of the third kind (Π).
    • ellipd: Complete elliptic integral of Legendre's type (D).
  • Legendre's incomplete integrals
    • ellipf: Incomplete elliptic integral of the first kind (F).
    • ellipeinc: Incomplete elliptic integral of the second kind (E).
    • ellippiinc: Incomplete elliptic integral of the third kind (Π).
    • ellipdinc: Incomplete elliptic integral of Legendre's type (D).
  • Bulirsch's integrals
    • cel: General complete elliptic integral in Bulirsch's form.
    • cel1: Complete elliptic integral of the first kind in Bulirsch's form.
    • cel2: Complete elliptic integral of the second kind in Bulirsch's form.
    • el1: Incomplete elliptic integral of the first kind in Bulirsch's form.
    • el2: Incomplete elliptic integral of the second kind in Bulirsch's form.
    • el3: Incomplete elliptic integral of the third kind in Bulirsch's form.
  • Carlson's symmetric integrals
    • elliprf: Symmetric elliptic integral of the first kind (RF).
    • elliprg: Symmetric elliptic integral of the second kind (RG).
    • elliprj: Symmetric elliptic integral of the third kind (RJ).
    • elliprc: Degenerate elliptic integral of RF (RC).
    • elliprd: Degenerate elliptic integral of the third kind (RD).
  • Miscellaneous functions
    • jacobi_zeta: Jacobi Zeta function (Z).
    • heuman_lambda: Heuman Lambda function (Λ0).

Testing

In the unit tests, the functions are tested against the Boost Math and Wolfram test data. Since Ellip accepts the argument m (parameter) instead of k (modulus) to allow larger domain support, the full accuracy report uses exclusively the Wolfram data. The full accuracy report can be found here, along with the test data and test generation scripts. The performance benchmark is presented to provide comparison between functions in Ellip. Comparing performance with other libraries is non-trivial, since they accept different domains of input.

Benchmark on AMD Ryzen 5 4600H with Radeon Graphics @3.0 GHz running x86_64-unknown-linux-gnu rustc 1.90.0 using ellip v1.0.0 at f64 precision (ε=2.2204460492503131e-16).

Legendre's Elliptic Integrals

| Function | Median Error (ε) | Max Error (ε) | Mean Performance | |---------------------|------------------|---------------|------------------| | ellipk | 0.00 | 108.14 | 14.8 ns | | ellipe | 0.00 | 3.00 | 13.1 ns | | ellipf | 0.00 | 7.47 | 98.5 ns | | ellipeinc | 0.00 | 24.66 | 157.6 ns | | ellippi | 0.00 | 36.35 | 166.1 ns | | ellippiinc | 0.00 | 395.31 | 232.9 ns | | ellippiinc_bulirsch | 0.00 | 395.31 | 189.2 ns | | ellipd | 0.00 | 2.64 | 30.0 ns | | ellipdinc | 0.00 | 8.38 | 98.9 ns |

Bulirsch's Elliptic Integrals

| Function | Median Error (ε) | Max Error (ε) | Mean Performance | |----------|------------------|---------------|------------------| | cel | 0.62 | 36.94 | 32.8 ns | | cel1 | 0.00 | 8.68 | 11.2 ns | | cel2 | 0.00 | 3.47 | 21.6 ns | | el1 | 0.00 | 1.70 | 36.7 ns | | el2 | 0.00 | 74.60 | 52.0 ns | | el3 | 0.00 | 53.21 | 103.8 ns |

Carlson's Symmetric Integrals

| Function | Median Error (ε) | Max Error (ε) | Mean Performance | |----------|------------------|---------------|------------------| | elliprf | 0.00 | 1.57 | 46.1 ns | | elliprg | 0.00 | 5.25 | 99.1 ns | | elliprj | 0.56 | 136.97 | 165.5 ns | | elliprc | 0.00 | 2.82 | 22.5 ns | | elliprd | 0.00 | 6.25 | 75.9 ns |

Miscellaneous Functions

| Function | Median Error (ε) | Max Error (ε) | Mean Performance | |---------------|------------------|---------------|------------------| | jacobizeta | 0.00 | 8.66 | 207.7 ns | | heumanlambda | 0.00 | 2.86 | 333.8 ns |

Reproducibility

This section describes how to reproduce the accuracy reports, test datasets, benchmarks, figures, and tables.

Setup the project

First, clone the repository:

sh git clone https://github.com/p-sira/ellip.git cd ellip

Then, build the project:

sh cargo build --workspace

Run tests

For detailed information on tests, see tests/README.md.

Benchmark

Ellip's benchmark collects the test files associated with each function and reports the total execution time:

sh cargo bench

This produces raw benchmark output under target/criterion/. Note that the results shown in the README are normalized to per-function call averages. See the Generate tables section for details on generating the summary tables.

Generate tables

To generate the accuracy table in the test report:

sh cargo run --example generate_error_report

This compares Ellip's results against Wolfram test data and generates the accuracy report.

To generate the test and benchmark summary table as shown in the README, first run cargo bench to collect benchmark data. Then run:

sh cargo run --example generate_test_summary

This script compares results against Wolfram data, extracts benchmark results from target/criterion/, normalizes them to average time per function call, and summarizes everything in a single table.

Generate figures

To generate function plots:

sh cargo run -p ellip-plot-graph --bin [function-name]

See available plots in ellip-plot-graph/src/bin


Learn more at docs.rs.

Owner

  • Name: Sira Pornsiriprasert
  • Login: p-sira
  • Kind: user

JOSS Publication

Ellip: An Elliptic Integral Library for Rust
Published
February 03, 2026
Volume 11, Issue 118, Page 9386
Authors
Sira Pornsiriprasert ORCID
Faculty of Medicine Ramathibodi Hospital, Mahidol University, Thailand, Center for Biomedical and Robotics Technology (BART LAB), Department of Biomedical Engineering, Faculty of Engineering, Mahidol University, Thailand
Editor
Richard Littauer ORCID
Tags
elliptic integrals special functions mathematics numerical computation

GitHub Events

Total
  • Release event: 11
  • Delete event: 22
  • Pull request event: 91
  • Fork event: 1
  • Watch event: 1
  • Issue comment event: 18
  • Public event: 1
  • Push event: 270
  • Pull request review event: 1
  • Create event: 28
Last Year
  • Release event: 11
  • Delete event: 21
  • Pull request event: 85
  • Fork event: 1
  • Issue comment event: 18
  • Push event: 256
  • Pull request review event: 1
  • Create event: 27

Committers

Last synced: 3 months ago

All Time
  • Total Commits: 828
  • Total Committers: 2
  • Avg Commits per committer: 414.0
  • Development Distribution Score (DDS): 0.074
Past Year
  • Commits: 828
  • Committers: 2
  • Avg Commits per committer: 414.0
  • Development Distribution Score (DDS): 0.074
Top Committers
Name Email Commits
Sira Pornsiriprasert c****e@p****e 767
github-actions g****s@g****m 61
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 2 months ago

All Time
  • Total issues: 1
  • Total pull requests: 65
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 minutes
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.18
  • Merged pull requests: 49
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 1
  • Pull requests: 65
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 minutes
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.18
  • Merged pull requests: 49
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • p-sira (1)
Pull Request Authors
  • p-sira (64)
  • codecov-ai[bot] (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 4
  • Total downloads:
    • cargo 17,640 total
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 52
  • Total maintainers: 1
crates.io: ellip-rayon

Compute elliptic integrals in parallel

  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 3,184 Total
Rankings
Dependent repos count: 20.1%
Dependent packages count: 26.6%
Forks count: 39.2%
Average: 45.4%
Stargazers count: 46.5%
Downloads: 94.5%
Maintainers (1)
Last synced: about 2 months ago
crates.io: ellip-dev-utils

Development utilities for Ellip.

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 799 Total
Rankings
Dependent repos count: 20.2%
Dependent packages count: 26.8%
Average: 47.2%
Downloads: 94.6%
Maintainers (1)
Last synced: about 2 months ago
crates.io: ellip-plot-graph

Generate plots for Ellip crate

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 486 Total
Rankings
Dependent repos count: 20.6%
Dependent packages count: 27.3%
Average: 47.5%
Downloads: 94.6%
Maintainers (1)
Last synced: about 2 months ago
crates.io: ellip

Elliptic integrals for Rust

  • Versions: 26
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 13,171 Total
Rankings
Dependent repos count: 23.4%
Dependent packages count: 31.1%
Average: 50.0%
Downloads: 95.4%
Maintainers (1)
Last synced: about 2 months ago

Dependencies

.github/workflows/ellip-ci.yml actions
  • actions/checkout v4 composite
Cargo.lock cargo
Cargo.toml cargo