-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.template
116 lines (89 loc) · 2.95 KB
/
index.template
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<html>
<head>
<title>picomath</title>
</head>
<body>
<h1>picomath</h1>
<p>
Picomath is a collection of small math functions inspired by John D. Cook's <a href="http://www.johndcook.com/stand_alone_code.html">Stand-alone code for numerical computing</a>.
It is not compiled into a <em>library</em> in the usual sense (that is, something you can link to).
Rather, the functions are presented as standalone snippets of code.
</p>
<h2>License</h2>
<p>
The picomath library is in the <strong>public domain</strong>.
Do whatever you want with it, no strings attached.
Use at your own risk.
</p>
<h2>Features</h2>
<p>
Picomath provides the following functions:
</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Error_function">Error function</a></li>
<li><a href="http://en.wikipedia.org/wiki/Cumulative_distribution_function">Phi (standard normal CDF)</a></li>
<li>Phi inverse</li>
<li><a href="http://en.wikipedia.org/wiki/Gamma_function">Gamma</a></li>
<li>Log Gamma</li>
<li>exp(x) - 1 (for small x)</li>
<li>log(n!)</li>
</ul>
<h2>Languages</h2>
<p>
The functions are implemented in the following languages:
</p>
<ul>
@iter languages@
<li><a href="$dir/index.html">$name</a></li>
@end@
</ul>
<h2>Usage</h2>
<p>
The picomath library is organised into subdirectories, with each language in a subdirectory.
Each function (or group of interrelated functions such as Gamma and Log Gamma) are implemented in one source file.
Each source file is designed with minimal dependencies, so it can be included directly into a project as is, or copy and pasted into other code.
</p>
<h2>Test Suite</h2>
<p>
The test suite consists of two parts:
</p>
<ul>
<li>an <tt>SConstruct</tt> file (for <a href="http://scons.org">SCons</a>, a command line build system) to build the test code as needed</li>
<li>a Python <tt>test.py</tt> driver at the top level, and a corresponding <tt>test.*</tt> for each language</li>
</ul>
<p>
To build the tests:
</p>
<pre>
$$ scons
</pre>
<p>
To run the tests:
</p>
<pre>
$$ python test.py
</pre>
<p>
The expected output is:
</p>
<pre>
@iter languages@
Checking $dir... ok
@end@
</pre>
<p>
The top level <tt>test.py</tt> runs each language-specific <tt>test.*</tt> in turn, communicating with the implementation using standard input and output.
A simple text-based protocol is used to execute functions and return results.
</p>
<h2>Source Download</h2>
<p>
The source code is on <a href="https://github.com/ghewgill/picomath">GitHub</a>, and can be cloned, forked, or downloaded from there.
</p>
<h2>About</h2>
<ul>
<li><a href="http://www.johndcook.com">John D. Cook</a> is the original author of most of the functions themselves.</li>
<li><a href="http://hewgill.com">Greg Hewgill</a> implemented the test framework and translated the functions to many of the included languages.</li>
<li><a href="https://github.com/holdenk">Holden Karau</a> contributed the Scala implementation.</li>
</ul>
</body>
</html>