approximate-0.3.1: Approximate discrete values and numbers

Copyright(c) Edward Kmett 2013
LicenseBSD3
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

Data.Approximate.Numerics

Description

These functions provide wildly inaccurate but very fast approximations to common transcendental functions.

The algorithms here are based on Martin Ankerl's optimized pow, http://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/ which is in turn based on http://nic.schraudolph.org/pubs/Schraudolph99.pdf

Synopsis

Documentation

class Floating a => Fast a where Source #

Minimal complete definition

flog, flog_lb, flog_ub, fexp, fexp_lb, fexp_ub, fpow, fpow_lb, fpow_ub

Methods

flog :: a -> a Source #

Calculate an approximate log.

flog_lb :: a -> a Source #

flog_ub :: a -> a Source #

fexp :: a -> a Source #

Calculate an approximate exp.

fexp_lb :: a -> a Source #

fexp_ub :: a -> a Source #

fpow :: a -> a -> a Source #

Calculate an approximate pow.

fpow_lb :: a -> a -> a Source #

fpow_ub :: a -> a -> a Source #

blog :: Floating a => a -> a Source #

Borchardt’s Algorithm from “Dead Reckoning: Calculating without instruments”.

This is a remarkably bad approximate logarithm.

flog had better outperform it! It is provided merely for comparison.