fast-arithmetic: Fast functions on integers.

[ algorithms, ats, bsd3, combinatorics, ffi, math, number-theory, numerics ] [ Propose Tags ]

Fast functions for number theory and combinatorics with a high level of safety guaranteed by ATS.


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5, 0.1.0.6, 0.1.0.7, 0.1.1.0, 0.1.1.1, 0.1.1.2, 0.1.1.3, 0.1.1.4, 0.1.1.5, 0.2.0.0, 0.2.0.1, 0.2.1.0, 0.2.2.0, 0.2.2.1, 0.2.2.2, 0.2.2.3, 0.2.3.0, 0.2.3.1, 0.2.3.2, 0.3.0.0, 0.3.0.1, 0.3.0.2, 0.3.0.3, 0.3.1.0, 0.3.2.0, 0.3.2.1, 0.3.2.4, 0.3.2.5, 0.3.2.6, 0.3.3.0, 0.3.3.1, 0.3.3.2, 0.3.3.3, 0.3.3.4, 0.3.3.5, 0.3.3.6, 0.3.3.7, 0.4.0.0, 0.5.0.0, 0.6.0.1, 0.6.0.2, 0.6.0.3, 0.6.0.4, 0.6.0.5, 0.6.0.6, 0.6.0.7, 0.6.0.8, 0.6.0.9, 0.6.1.1, 0.6.2.0, 0.6.2.2, 0.6.2.3, 0.6.3.0, 0.6.4.0, 0.6.4.1, 0.6.4.2
Change log CHANGELOG.md
Dependencies base (>=4.3 && <5), composition-prelude (>=1.2.0.0), gmpint [details]
License BSD-3-Clause
Copyright Copyright: (c) 2018 Vanessa McHale
Author Vanessa McHale
Maintainer vamchale@gmail.com
Category Numerics, Math, Algorithms, Number Theory, Combinatorics, FFI, ATS
Bug tracker https://github.com/vmchale/hs-ats/issues
Source repo head: git clone git@github.com:vmchale/hs-ats.git
Uploaded by vmchale at Thu Oct 4 22:05:41 UTC 2018
Distributions NixOS:0.6.4.2
Downloads 6475 total (1256 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-10-04 [all 1 reports]

Modules

[Index] [Quick Jump]

Flags

NameDescriptionDefaultType
no-integer-gmp

Disable functions relying on GMP

DisabledAutomatic
development

Enable -Werror.

DisabledManual

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for fast-arithmetic-0.6.2.0

[back to package description]

fast-arithmetic

Build Status Hackage Dependencies of latest version on Hackage

This is a library for fast arithmetical functions using ATS, with a Haskell wrapper.

It is intended to supplement (but not replace) arithmoi and combinat where speed is important. In particular, this library provides a fast primality check and fast computation of basic combinatorial functions.

Benchmarks

| Computation | Version (ATS/Haskell) | Time | | ----------- | --------------------- | ---- | | isPrime 2017 | ATS | 117.1 ns | | isPrime 2017 | Haskell | 426.4 ns | | φ(2016) | ATS | 190.9 ns | | φ(2016) | Haskell | 356.9 ns | | τ(3018) | ATS | 340.8 ns | | τ(3018) | Haskell | 659.0 ns | | σ(115) | ATS | 41.27 ns | | σ(115) | Haskell | 314.1 ns | | ω(91) | ATS | 64.67 ns | | ω(91) | Haskell | 332.0 ns | | 160! | ATS | 4.303 μs | | 160! | Haskell | 5.659 μs | | 79!! | ATS | 941.2 ns | | 79!! | Haskell | 1.267 μs | | 322 `choose` 16 | ATS | 557.5 ns | | 322 `choose` 16 | Haskell | 996.3 ns | | catalan 300 | ATS | 18.15 μs | | catalan 300 | Haskell | 29.08 μs | | permutations 20 10 | ATS | 198.6 ns | | permutations 20 10 | Haskell | 392.3 ns |

Building

The Haskell library comes with the C bundled, however you will likely want to build from source if you are hacking on the library. To that end, you can install atspkg and build with

atspkg build --pkg-args "./source.dhall"
cabal new-build

Documentation

You can find documentation for the Haskell library on Hackage. Unfortunately, there is no documentation for the ATS library, however, the bundled source code is commented.