Woah, this is very impressive! And now I can convince more people to use Racket!<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 7, 2012 at 9:33 PM, Neil Toronto <span dir="ltr"><<a href="mailto:neil.toronto@gmail.com" target="_blank">neil.toronto@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've just pushed the last commits that make the new math library ready for wider testing. Almost everything ready for use is documented, the tests keep passing, and everything *seems* to work.<br>
<br>
We (the Racket development team) need people to use the heck out of it, to find the majority of the remaining logic and design errors before the next release. This is a big chunk of new code - ~20k lines in ~100 nontrivial files - so the more eyes, the better.<br>
<br>
If all you have time for is checking documentation, we'll take it. The latest docs are here:<br>
<br>
<a href="http://pre.racket-lang.org/docs/html/math/" target="_blank">http://pre.racket-lang.org/<u></u>docs/html/math/</a><br>
<br>
The nightly builds are here:<br>
<br>
<a href="http://pre.racket-lang.org/installers/" target="_blank">http://pre.racket-lang.org/<u></u>installers/</a><br>
<br>
For Windows and Mac, the nightlies should include two new libraries used by `math/bigfloat': libgmp and libmpfr. Linux users almost certainly already have them; many packages (e.g. gcc) depend on libmpfr.<br>
<br>
If you prefer to build from source, clone the git repository here:<br>
<br>
<a href="https://github.com/plt/racket" target="_blank">https://github.com/plt/racket</a><br>
<br>
If you're building on Windows or Mac, you can download pre-built libgmp and libmpfr from here:<br>
<br>
<a href="http://download.racket-lang.org/libs/10/" target="_blank">http://download.racket-lang.<u></u>org/libs/10/</a><br>
<br>
************<br>
<br>
Once you have a pre-release build, do (require math), and away you go!<br>
<br>
Well, it's probably not obvious where to start. The following are the modules that `math' re-exports, and for some, what needs testing. Please feel free to skim. In decreasing order of attention they need:<br>
<br>
(require math/array)<br>
<br>
NumPy/SciPy/Repa-like arrays, Typed-Racket-style. Provides a<br>
covariant `Array' type and several mutable subtypes, array literals,<br>
functional constructors, pointwise operations with automatic<br>
broadcasting in SciPy/NumPy or permissive mode, slicing, indexing<br>
tricks, folds, easy arbitrary transformations, and parallel FFT.<br>
<br>
This one needs a lot of usability testing. In particular...<br>
<br>
We're trying something that's been done only once before, in<br>
Haskell's Repa: by default, arrays' elements are *non-strict*,<br>
meaning that they're recomputed when referenced. Cool things about<br>
this: pretty much everything can in principle be parallelized, and<br>
most intermediate arrays use almost no memory. But it requires more<br>
thought from users about when arrays should be made strict (computed<br>
and stored all at once). If it totally sucks, we can change it. If<br>
it's a worthwhile imposition, we'll leave it. If it's a wash, we<br>
could parameterize the default behavior.<br>
<br>
Also, I've been considering allowing negative axis numbers and row<br>
indexes. Need feedback on how helpful it would be vs. confusing and<br>
error-hiding.<br>
<br>
Lastly, I'm looking for a dual of `array-axis-reduce' (a kind of<br>
fold) that makes it easy to write `list-array->array', the inverse of<br>
the existing `array->list-array'. If you're into functional design<br>
puzzles, give this one a shot.<br>
<br>
(require math/bigfloat)<br>
<br>
Floating-point numbers with arbitrarily large precision and<br>
large exponents. Also elementary and special functions, whose results<br>
are proved to be correct in many theses and dissertations. This is a<br>
Racket interface to MPFR (<a href="http://www.mpfr.org" target="_blank">www.mpfr.org</a>).<br>
<br>
This module needs platform-specific testing.<br>
<br>
I think we've verified that `math/bigfloat' works on all the<br>
supported 64-bit platforms, but not whether it works on supported<br>
32-bit platforms. It should. ;)<br>
<br>
There's an error in the current nightly build, which causes an<br>
infinite loop when libmpfr isn't installed and a bigfloat function is<br>
applied. I just pushed a fix; it should fail properly tomorrow.<br>
<br>
(require math/distributions)<br>
<br>
Probability distributions: discrete, integer-valued and real-valued.<br>
Distribution objects can compute pdfs, cdfs and inverse cdfs,<br>
optionally in log space, and for cdfs and inverse cdfs, optionally<br>
for upper tails. They can also generate samples.<br>
<br>
Design ideas are welcome. More distributions are planned. Let me know<br>
which you need, and I'll concentrate on those first.<br>
<br>
Watch out, R. Our gamma cdf is more accurate.<br>
<br>
(require math/special-functions)<br>
<br>
Non-elementary functions like gamma, erf, zeta, Lambert W, and<br>
incomplete gamma and beta integrals. Most of these should be fairly<br>
accurate; i.e. they compute answers with apparently < 5 ulps error<br>
for the majority of their domains. But floating-point domains are<br>
huge, so the more use, the better.<br>
<br>
(require math/number-theory)<br>
<br>
Number theory! Chinese Remainder solutions, coprimality and primality<br>
testing, factorization, congruence arithmetic parameterized on a<br>
current modulus, integer nth roots, multiplicative functions, common<br>
number sequences (Bernoulli, Eulerian, tangent, etc.), combinatorics,<br>
primitive roots, and more.<br>
<br>
Please thank Jens Axel Søgaard, who wrote this module, for his<br>
excellent work.<br>
<br>
(require math/statistics)<br>
<br>
Functions to compute summary values for collections of data, and to<br>
manage weighted samples. Every function for which it makes sense<br>
accepts weighted values, including the O(1)-space running statistics<br>
update.<br>
<br>
I'm in the middle of documenting this. I'll get around to documenting<br>
correlation, kth-value order statistics (via quickselect), and<br>
counting/binning at least by Dec. 18.<br>
<br>
(require math/flonum)<br>
<br>
Re-exports `racket/flonum' along with many more floating-point<br>
goodies. If you're a floating-point nut, you'll love it. If you're<br>
not, at least check out `flsum'. If you're doing statistics, look<br>
into log-space arithmetic (`lg+' and friends).<br>
<br>
(require math/base)<br>
<br>
Re-exports `racket/math'; also exports some more constants like<br>
gamma.0 (Euler-Mascheroni), a bit more float-complex support, inverse<br>
hyperbolic functions, large random numbers, error measurement.<br>
<br>
Lastly, there's `math/matrix', which is currently not re-exported by `math' because I haven't reviewed it yet. This is more from Jens Axel, and if it's like his other fine work, it's correct and well-tested. I'll probably get to it by Christmas.<br>
<br>
To sum up, there are 8 modules that need pounding on, and we need YOU to do some pounding. If you're not terribly busy, please pick one that looks interesting/fun/useful, and try it out.<br>
<br>
Thanks!<br>
<br>
Neil ⊥<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
</blockquote></div><br></div>