MyNixOS website logo
Description

Fast functions on integers.

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

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

ComputationVersion (ATS/Haskell)Time
isPrime 2017ATS117.2 ns
isPrime 2017Haskell425.0 ns
φ(2016)ATS191.5 ns
φ(2016)Haskell384.8 ns
τ(3018)ATS337.0 ns
τ(3018)Haskell660.2 ns
σ(115)ATS45.41 ns
σ(115)Haskell322.4 ns
ω(91)ATS65.52 ns
ω(91)Haskell345.2 ns
160!ATS2.363 μs
160!Haskell6.134μs
79!!ATS556.2 ns
79!!Haskell1.355 μs
322 `choose` 16ATS467.6 ns
322 `choose` 16Haskell956.7 ns
catalan 300ATS13.74 μs
catalan 300Haskell28.76 μs
permutations 20 10ATS202.8 ns
permutations 20 10Haskell362.6 ns
maxRegions 45000ATS624.1 ns
maxRegions 45000Haskell1.064 μs
stirling2 25 8ATS3.108 μs
stirling2 25 8Haskell9.494 μs

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 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.

Metadata

Version

0.6.7.0

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows