This file is indexed.

/usr/share/doc/libghc-math-functions-doc/html/Numeric-SpecFunctions.html is in libghc-math-functions-doc 0.2.1.0-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Numeric.SpecFunctions</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Numeric-SpecFunctions.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Numeric-SpecFunctions.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">math-functions-0.2.1.0: Special functions and Chebyshev polynomials</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>(c) 2009 2011 2012 Bryan O'Sullivan</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>bos@serpentine.com</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Numeric.SpecFunctions</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Error function</a></li><li><a href="#g:2">Gamma function</a></li><li><a href="#g:3">Beta function</a></li><li><a href="#g:4">Sinc</a></li><li><a href="#g:5">Logarithm</a></li><li><a href="#g:6">Exponent</a></li><li><a href="#g:7">Factorial</a></li><li><a href="#g:8">Combinatorics</a></li><li><a href="#g:9">References</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Special functions and factorials.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:erf">erf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:erfc">erfc</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:invErf">invErf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:invErfc">invErfc</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:logGamma">logGamma</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:logGammaL">logGammaL</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:incompleteGamma">incompleteGamma</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:invIncompleteGamma">invIncompleteGamma</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:digamma">digamma</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:logBeta">logBeta</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:incompleteBeta">incompleteBeta</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:incompleteBeta_">incompleteBeta_</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:invIncompleteBeta">invIncompleteBeta</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:sinc">sinc</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:log1p">log1p</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Numeric.html#t:Floating">Floating</a> a =&gt; a -&gt; a</li><li class="src short"><a href="#v:log1pmx">log1pmx</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:log2">log2</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:expm1">expm1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Numeric.html#t:Floating">Floating</a> a =&gt; a -&gt; a</li><li class="src short"><a href="#v:factorial">factorial</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:logFactorial">logFactorial</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integral">Integral</a> a =&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:stirlingError">stirlingError</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:choose">choose</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li><li class="src short"><a href="#v:logChoose">logChoose</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></li></ul></div><div id="interface"><h1 id="g:1">Error function</h1><div class="top"><p class="src"><a id="v:erf" class="def">erf</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#erf" class="link">Source</a> <a href="#v:erf" class="selflink">#</a></p><div class="doc"><p>Error function.</p><p>\[
 \operatorname{erf}(x) = \frac{2}{\sqrt{\pi}} \int_{0}^{x} \exp(-t^2) dt
 \]</p><p>Function limits are:</p><p>[
 begin{aligned}
  &amp;operatorname{erf}(-infty) &amp;=&amp; -1 --  &amp;operatorname{erf}(0)       &amp;=&amp; phantom{-},0 --  &amp;operatorname{erf}(+infty) &amp;=&amp; phantom{-},1 -- end{aligned}</p></div></div><div class="top"><p class="src"><a id="v:erfc" class="def">erfc</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#erfc" class="link">Source</a> <a href="#v:erfc" class="selflink">#</a></p><div class="doc"><p>Complementary error function.</p><p>\[
 \operatorname{erfc}(x) = 1 - \operatorname{erf}(x)
 \]</p><p>Function limits are:</p><p>[
 begin{aligned}
  &amp;operatorname{erf}(-infty) &amp;=&amp;, 2 --  &amp;operatorname{erf}(0)       &amp;=&amp;, 1 --  &amp;operatorname{erf}(+infty) &amp;=&amp;, 0 -- end{aligned}</p></div></div><div class="top"><p class="src"><a id="v:invErf" class="def">invErf</a> <a href="src/Numeric-SpecFunctions-Internal.html#invErf" class="link">Source</a> <a href="#v:invErf" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>p</em> &#8712; [-1,1]</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Inverse of <code><a href="Numeric-SpecFunctions.html#v:erf">erf</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:invErfc" class="def">invErfc</a> <a href="src/Numeric-SpecFunctions-Internal.html#invErfc" class="link">Source</a> <a href="#v:invErfc" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>p</em> &#8712; [0,2]</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Inverse of <code><a href="Numeric-SpecFunctions.html#v:erfc">erfc</a></code>.</p></div></div><h1 id="g:2">Gamma function</h1><div class="top"><p class="src"><a id="v:logGamma" class="def">logGamma</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#logGamma" class="link">Source</a> <a href="#v:logGamma" class="selflink">#</a></p><div class="doc"><p>Compute the logarithm of the gamma function, &#915;(<em>x</em>).</p><p>\[
 \Gamma(x) = \int_0^{\infty}t^{x-1}e^{-t}\,dt = (x - 1)!
 \]</p><p>This implementation uses Lanczos approximation. It gives 14 or more
 significant decimal digits, except around <em>x</em> = 1 and <em>x</em> = 2,
 where the function goes to zero.</p><p>Returns &#8734; if the input is outside of the range (0 &lt; <em>x</em>
 &#8804; 1e305).</p></div></div><div class="top"><p class="src"><a id="v:logGammaL" class="def">logGammaL</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#logGammaL" class="link">Source</a> <a href="#v:logGammaL" class="selflink">#</a></p><div class="doc"><p>Synonym for <code><a href="Numeric-SpecFunctions.html#v:logGamma">logGamma</a></code>. Retained for compatibility</p></div></div><div class="top"><p class="src"><a id="v:incompleteGamma" class="def">incompleteGamma</a> <a href="src/Numeric-SpecFunctions-Internal.html#incompleteGamma" class="link">Source</a> <a href="#v:incompleteGamma" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>z</em> &#8712; (0,&#8734;)</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>x</em> &#8712; (0,&#8734;)</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Compute the normalized lower incomplete gamma function
 &#947;(<em>z</em>,<em>x</em>). Normalization means that &#947;(<em>z</em>,&#8734;)=1</p><p>\[
 \gamma(z,x) = \frac{1}{\Gamma(z)}\int_0^{x}t^{z-1}e^{-t}\,dt
 \]</p><p>Uses Algorithm AS 239 by Shea.</p></div></div><div class="top"><p class="src"><a id="v:invIncompleteGamma" class="def">invIncompleteGamma</a> <a href="src/Numeric-SpecFunctions-Internal.html#invIncompleteGamma" class="link">Source</a> <a href="#v:invIncompleteGamma" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>z</em> &#8712; (0,&#8734;)</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>p</em> &#8712; [0,1]</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Inverse incomplete gamma function. It's approximately inverse of
   <code><a href="Numeric-SpecFunctions.html#v:incompleteGamma">incompleteGamma</a></code> for the same <em>z</em>. So following equality
   approximately holds:</p><pre>invIncompleteGamma z . incompleteGamma z &#8776; id</pre></div></div><div class="top"><p class="src"><a id="v:digamma" class="def">digamma</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#digamma" class="link">Source</a> <a href="#v:digamma" class="selflink">#</a></p><div class="doc"><p>Compute &#968;(<em>x</em>), the first logarithmic derivative of the gamma
   function.</p><p>\[
 \psi(x) = \frac{d}{dx} \ln \left(\Gamma(x)\right) = \frac{\Gamma'(x)}{\Gamma(x)}
 \]</p><p>Uses Algorithm AS 103 by Bernardo, based on Minka's C implementation.</p></div></div><h1 id="g:3">Beta function</h1><div class="top"><p class="src"><a id="v:logBeta" class="def">logBeta</a> <a href="src/Numeric-SpecFunctions-Internal.html#logBeta" class="link">Source</a> <a href="#v:logBeta" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>a</em> &gt; 0</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>b</em> &gt; 0</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Compute the natural logarithm of the beta function.</p><p>\[
 B(a,b) = \int_0^1 t^{a-1}(1-t)^{1-b}\,dt = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}
 \]</p></div></div><div class="top"><p class="src"><a id="v:incompleteBeta" class="def">incompleteBeta</a> <a href="src/Numeric-SpecFunctions-Internal.html#incompleteBeta" class="link">Source</a> <a href="#v:incompleteBeta" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>a</em> &gt; 0</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>b</em> &gt; 0</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>x</em>, must lie in [0,1] range</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Regularized incomplete beta function.</p><p>\[
 I(x;a,b) = \frac{1}{B(a,b)} \int_0^x t^{a-1}(1-t)^{1-b}\,dt
 \]</p><p>Uses algorithm AS63 by Majumder and Bhattachrjee and quadrature
 approximation for large <em>p</em> and <em>q</em>.</p></div></div><div class="top"><p class="src"><a id="v:incompleteBeta_" class="def">incompleteBeta_</a> <a href="src/Numeric-SpecFunctions-Internal.html#incompleteBeta_" class="link">Source</a> <a href="#v:incompleteBeta_" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p>logarithm of beta function for given <em>p</em> and <em>q</em></p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>a</em> &gt; 0</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>b</em> &gt; 0</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>x</em>, must lie in [0,1] range</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Regularized incomplete beta function. Same as <code><a href="Numeric-SpecFunctions.html#v:incompleteBeta">incompleteBeta</a></code>
 but also takes logarithm of beta function as parameter.</p></div></div><div class="top"><p class="src"><a id="v:invIncompleteBeta" class="def">invIncompleteBeta</a> <a href="src/Numeric-SpecFunctions-Internal.html#invIncompleteBeta" class="link">Source</a> <a href="#v:invIncompleteBeta" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>a</em> &gt; 0</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>b</em> &gt; 0</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc"><p><em>x</em> &#8712; [0,1]</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>Compute inverse of regularized incomplete beta function. Uses
 initial approximation from AS109, AS64 and Halley method to solve
 equation.</p></div></div><h1 id="g:4">Sinc</h1><div class="top"><p class="src"><a id="v:sinc" class="def">sinc</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#sinc" class="link">Source</a> <a href="#v:sinc" class="selflink">#</a></p><div class="doc"><p>Compute sinc function <code>sin(x)/x</code></p></div></div><h1 id="g:5">Logarithm</h1><div class="doc"><p>Base starting from <code>4.9.0</code> (GHC 8.0) provides <code><a href="Numeric-SpecFunctions.html#v:log1p">log1p</a></code> and <code><a href="Numeric-SpecFunctions.html#v:expm1">expm1</a></code>
 as method of class <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Numeric.html#t:Floating">Floating</a></code>. In this case we simply reexport
 these function. Otherwise we provide our own with more restrictive
 signature <code>Double &#8594; Double</code>.</p></div><div class="top"><p class="src"><a id="v:log1p" class="def">log1p</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Numeric.html#t:Floating">Floating</a> a =&gt; a -&gt; a <a href="#v:log1p" class="selflink">#</a></p><div class="doc"><p><code><code><a href="Numeric-SpecFunctions.html#v:log1p">log1p</a></code> x</code> computes <code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Numeric.html#v:log">log</a></code> (1 + x)</code>, but provides more precise
 results for small (absolute) values of <code>x</code> if possible.</p><p><em>Since: 4.9.0.0</em></p></div></div><div class="top"><p class="src"><a id="v:log1pmx" class="def">log1pmx</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#log1pmx" class="link">Source</a> <a href="#v:log1pmx" class="selflink">#</a></p><div class="doc"><p>Compute log(1+x)-x:</p></div></div><div class="top"><p class="src"><a id="v:log2" class="def">log2</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Numeric-SpecFunctions-Internal.html#log2" class="link">Source</a> <a href="#v:log2" class="selflink">#</a></p><div class="doc"><p><em>O(log n)</em> Compute the logarithm in base 2 of the given value.</p></div></div><h1 id="g:6">Exponent</h1><div class="top"><p class="src"><a id="v:expm1" class="def">expm1</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Numeric.html#t:Floating">Floating</a> a =&gt; a -&gt; a <a href="#v:expm1" class="selflink">#</a></p><div class="doc"><p><code><code><a href="Numeric-SpecFunctions.html#v:expm1">expm1</a></code> x</code> computes <code><code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Numeric.html#v:exp">exp</a></code> x - 1</code>, but provides more precise
 results for small (absolute) values of <code>x</code> if possible.</p><p><em>Since: 4.9.0.0</em></p></div></div><h1 id="g:7">Factorial</h1><div class="top"><p class="src"><a id="v:factorial" class="def">factorial</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#factorial" class="link">Source</a> <a href="#v:factorial" class="selflink">#</a></p><div class="doc"><p>Compute the factorial function <em>n</em>!.  Returns +&#8734; if the
 input is above 170 (above which the result cannot be represented by
 a 64-bit <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a></code>).</p></div></div><div class="top"><p class="src"><a id="v:logFactorial" class="def">logFactorial</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Integral">Integral</a> a =&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#logFactorial" class="link">Source</a> <a href="#v:logFactorial" class="selflink">#</a></p><div class="doc"><p>Compute the natural logarithm of the factorial function.  Gives
 16 decimal digits of precision.</p></div></div><div class="top"><p class="src"><a id="v:stirlingError" class="def">stirlingError</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#stirlingError" class="link">Source</a> <a href="#v:stirlingError" class="selflink">#</a></p><div class="doc"><p>Calculate the error term of the Stirling approximation.  This is
 only defined for non-negative values.</p><p>\[
 \operatorname{stirlingError}(n) = \log(n!) - \log(\sqrt{2\pi n}\frac{n}{e}^n)
 \]</p></div></div><h1 id="g:8">Combinatorics</h1><div class="top"><p class="src"><a id="v:choose" class="def">choose</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#choose" class="link">Source</a> <a href="#v:choose" class="selflink">#</a></p><div class="doc"><p>Compute the binomial coefficient <em>n</em> <code>`<code><a href="Numeric-SpecFunctions.html#v:choose">choose</a></code>`</code> <em>k</em>. For
 values of <em>k</em> &gt; 50, this uses an approximation for performance
 reasons.  The approximation is accurate to 12 decimal places in the
 worst case</p><p>Example:</p><pre>7 `choose` 3 == 35</pre></div></div><div class="top"><p class="src"><a id="v:logChoose" class="def">logChoose</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Prelude.html#t:Double">Double</a> <a href="src/Numeric-SpecFunctions-Internal.html#logChoose" class="link">Source</a> <a href="#v:logChoose" class="selflink">#</a></p><div class="doc"><p>Compute logarithm of the binomial coefficient.</p></div></div><h1 id="g:9">References</h1><div class="doc"><ul><li>Bernardo, J. (1976) Algorithm AS 103: Psi (digamma)
   function. /Journal of the Royal Statistical Society. Series C
   (Applied Statistics)/ 25(3):315-317.
   <a href="http://www.jstor.org/stable/2347257">http://www.jstor.org/stable/2347257</a></li><li>Cran, G.W., Martin, K.J., Thomas, G.E. (1977) Remark AS R19
   and Algorithm AS 109: A Remark on Algorithms: AS 63: The
   Incomplete Beta Integral AS 64: Inverse of the Incomplete Beta
   Function Ratio. /Journal of the Royal Statistical Society. Series
   C (Applied Statistics)/ Vol. 26, No. 1 (1977), pp. 111-114
   <a href="http://www.jstor.org/pss/2346887">http://www.jstor.org/pss/2346887</a></li><li>Lanczos, C. (1964) A precision approximation of the gamma
   function.  <em>SIAM Journal on Numerical Analysis B</em>
   1:86&#8211;96. <a href="http://www.jstor.org/stable/2949767">http://www.jstor.org/stable/2949767</a></li><li>Loader, C. (2000) Fast and Accurate Computation of Binomial
   Probabilities. <a href="http://projects.scipy.org/scipy/raw-attachment/ticket/620/loader2000Fast.pdf">http://projects.scipy.org/scipy/raw-attachment/ticket/620/loader2000Fast.pdf</a></li><li>Macleod, A.J. (1989) Algorithm AS 245: A robust and reliable
   algorithm for the logarithm of the gamma function.
   <em>Journal of the Royal Statistical Society, Series C (Applied Statistics)</em>
   38(2):397&#8211;402. <a href="http://www.jstor.org/stable/2348078">http://www.jstor.org/stable/2348078</a></li><li>Majumder, K.L., Bhattacharjee, G.P. (1973) Algorithm AS 63: The
   Incomplete Beta Integral. /Journal of the Royal Statistical
   Society. Series C (Applied Statistics)/ Vol. 22, No. 3 (1973),
   pp. 409-411. <a href="http://www.jstor.org/pss/2346797">http://www.jstor.org/pss/2346797</a></li><li>Majumder, K.L., Bhattacharjee, G.P. (1973) Algorithm AS 64:
   Inverse of the Incomplete Beta Function Ratio. /Journal of the
   Royal Statistical Society. Series C (Applied Statistics)/
   Vol. 22, No. 3 (1973), pp. 411-414
   <a href="http://www.jstor.org/pss/2346798">http://www.jstor.org/pss/2346798</a></li><li>Temme, N.M. (1992) Asymptotic inversion of the incomplete beta
   function. /Journal of Computational and Applied Mathematics
   41(1992) 145-157.</li><li>Temme, N.M. (1994) A set of algorithms for the incomplete gamma
   functions. /Probability in the Engineering and Informational
   Sciences/, 8, 1994, 291-307. Printed in the U.S.A.</li></ul></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>