Bakul Shah wrote a particularly elegant Scheme program for Chudnovskys'
algorithm for pi based on the Common Lisp program here:
https://bitbucket.org/tarballs_are_good/numericl/src/5fe8fe7089f48ab1c8a388…
Nick Craig-Wood wrote a Python program using the GMP multiprecision
library that appears to use exactly the same algorithm here:
http://www.craig-wood.com/nick/articles/pi-chudnovsky/
I modified both programs a bit and include them here.
They time the calculation of $10^n$ digits of pi for $n=1,2,3,4,5,6,7$.
The results are
heine:~/programs/gambiteer/gambit> !py
python pi_chudnovsky_bs_gmpy.py
31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
('chudnovsky_gmpy_mpz_bs: digits', 10, 'time', 1.0967254638671875e-05)
('chudnovsky_gmpy_mpz_bs: digits', 100, 'time', 3.0040740966796875e-05)
Last 5 digits 70679 OK
('chudnovsky_gmpy_mpz_bs: digits', 1000, 'time', 0.00025582313537597656)
Last 5 digits 01989 OK
('chudnovsky_gmpy_mpz_bs: digits', 10000, 'time', 0.00386810302734375)
Last 5 digits 75678 OK
('chudnovsky_gmpy_mpz_bs: digits', 100000, 'time', 0.0834801197052002)
Last 5 digits 24646 OK
('chudnovsky_gmpy_mpz_bs: digits', 1000000, 'time', 1.655979871749878)
Last 5 digits 58151 OK
('chudnovsky_gmpy_mpz_bs: digits', 10000000, 'time', 30.67442488670349)
Last 5 digits 55897 OK
heine:~/programs/gambiteer/gambit> gsi chud1.scm
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
10, CPU time: 0..
Last 5 digits 26535.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
100, CPU time: 0..
Last 5 digits 70679.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
1000, CPU time: .004.
Last 5 digits 1989.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
10000, CPU time: .028.
Last 5 digits 75678.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
100000, CPU time: .472.
Last 5 digits 24646.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
1000000, CPU time: 6.448.
Last 5 digits 58151.
Chudnovsky's algorithm using binary splitting in Gambit Scheme: digits
10000000, CPU time: 98.612.
Last 5 digits 55897.
So it appears that for this algorithm applied to large integers, GMP's
bignum routines are about 3-4 times as fast as Gambit's bignum
routines. Not so bad. For smaller bignums, GMP has a bigger advantage.
The C program gmp-chudnovsky.c includes certain optimizations to this
basic algorithm:
http://gmplib.org/pi-with-gmp.htmlftp://ftp.gmplib.org/pub/misc/gmp-chudnovsky.c
On my machine, compiled with
gcc -O3 -march=native -o gmp-chudnovsky gmp-chudnovsky.c -lgmp -lm
the CPU times for 1,000,000 and 10,000,000 digits are 1.064 and 18.200
seconds, respectively.
This is with a somewhat older machine
model name : Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
running Ubuntu 13.04 with
heine:~/programs/gambiteer/gambit> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.7.3-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --enable-plugin --with-system-zlib
--enable-objc-gc --with-cloog --enable-cloog-backend=ppl
--disable-cloog-version-check --disable-ppl-version-check
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)
heine:~/programs/gambiteer/gambit> gsi -v
v4.6.9 20130607151908 x86_64-unknown-linux-gnu "./configure
'--enable-single-host' '--enable-multiple-versions' '--enable-shared'"
and the Ubuntu-provided GMP 5.0.5. (I'm sure the GMP folks have a
better way to build GMP on my machine than the "generic" 64-bit version
provided by Ubuntu.)
Brad
Hello,
Please, find below the 1st call for participation for IFL 2018.
Please forward these to anyone you think may be interested.
Apologies for any duplicates you may receive.
best regards,
Jurriaan Hage
Publicity Chair of IFL
---
CALL FOR PARTICIPATION:
================================================================================
IFL
2018
30th Symposium on Implementation and Application of Functional
Languages
University of Massachusetts Lowell, MA, USA
September 5th-7th, 2018
http://iflconference.org
September 5th: Haskell Mini-Course by Galois, Inc, see details below.
================================================================================
### Scope
The goal of the IFL symposia is to bring together researchers actively
engaged
in the implementation and application of functional and function-based
programming languages. IFL 2018 will be a venue for researchers to present
and
discuss new ideas and concepts, work in progress, and publication-ripe
results
related to the implementation and application of functional languages and
function-based programming.
### Keynote Speakers
* Adam Chlipala, Massachusetts Institute of Technology CSAIL
* Arjun Guha, University of Massachusetts Amherst
### Haskell Mini-Course (September 5th, 2018)
Mini-course on Haskell by Galois, Inc,
presented by David Thrane Christiansen and Jose Manuel Calderon Trilla.
Register: Attendance at the course is free, but you must RSVP.
(Link to RSVP form can be found at http://iflconference.org)
Course Description:
Recent versions of the GHC compiler for Haskell feature support for a
number of
advanced type system features, including pattern-matching functions in the
type
system (type families), indexed families (generalized algebraic datatypes,
or
GADTs), type-level data structures (data kinds), and general compile-time
metaprogramming (Template Haskell). At Galois, we use these features in a
number
of our projects, which allows us to build deep embeddings of programming
languages and have GHC enforce the target language's type system for us.
This
style of programming ensures that we only produce well-typed terms,
including
that we do not forget any of the run-time checks that are necessary to
preserve
our invariants when accepting input from untyped sources such as files.
In the course of developing these projects, some common problems and
programming
patterns emerged. We developed the `parameterized-utils` library to codify
solutions to these problems, and provide necessary generalizations of
interfaces
from the standard library (Eq, Applicative, Traversable, etc.)
We will expect that participants in the course have used Haskell before,
but we
will not expect everyone to be experts. We will introduce GADTs, type
families,
and data kinds, and then show how to use them together with the tools from
parameterized-utils with an implementation of the simply-typed lambda
calculus,
including basic AST definitions, evaluation, and parsing.
### Peter Landin Prize
The Peter Landin Prize is awarded to the best paper presented at the
symposium every year. The honored article is selected by the program
committee
based on the submissions received for the formal review process. The prize
carries a cash award equivalent to 150 Euros.
### Organization and Program committee
Chairs: Jay McCarthy & Matteo Cimini, University of Massachusetts Lowell,
USA
Program Committee:
* Arthur Chargueraud, Inria, FR
* Ben Delaware, Purdue University, USA
* Christos Dimoulas, Northwestern University, USA
* David Darais, University of Vermont, USA
* Dominic Orchard, University of Kent, UK
* Ekaterina Komendantskaya, Heriot-Watt University, UK
* Garrett Morris, University of Kansas, USA
* Heather Miller, EPFL & Northeastern University, CH & USA
* Jeremy Yallop, University of Cambridge, UK
* Keiko Nakata, SAP Innovation Center Potsdam, DE
* Laura Castro, University of A Coruna, ESP
* Magnus Myreen, Chalmers University of Technology, SWE
* Natalia Chechina, Bournemouth University, UK
* Peter Achten, Radboud Universiteit Nijmegen, NL
* Peter-Michael Osera, Grinnell College, USA
* Richard Eisenberg, Bryn Mawr College, USA
* Trevor McDonell, University of New South Wales, AUS
* Yukiyoshi Kameyama, University of Tsukuba, JAP
### Venue
The 30th IFL is organized by the University of Massachusetts Lowell.
The City of Lowell is located at the heart of the Merrimack Valley just 30
miles
northwest of Boston. Lowell can be easily reached by train or taxi.
See the website for more information on the venue.
Hi Marc,
Are Gambit's hash tables protected against double hash attacks?
E.g. by calculating a random number that's used as hash seed making it
impossible for an attacker to produce key hash collissions,
https://en.wikipedia.org/wiki/SipHash .
Adam
*** Early registration ends 27 August. ***
=====================================================================
Call for Participation
ICFP 2018
23rd ACM SIGPLAN International Conference on Functional Programming
and affiliated events
September 23 - September 29, 2018
St. Louis, Missouri, USA
http://icfp18.sigplan.org/
=====================================================================
ICFP provides a forum for researchers and developers to hear
about the latest work on the design, implementations, principles, and
uses of functional programming. The conference covers the entire
spectrum of work, from practice to theory, including its peripheries.
This year, ICFP is co-located with Strange Loop!
Considering attending ICFP for the first time? See our brief
explainer: https://icfp18.sigplan.org/attending/introduction-to-icfp
* Overview and affiliated events:
http://icfp18.sigplan.org/home
* Program:
http://icfp18.sigplan.org/program/program-icfp-2018
* Accepted papers:
http://icfp18.sigplan.org/track/icfp-2018-papers
* Registration is available via:
https://regmaster4.com/2018conf/ICFP18/register.php
Early registration ends 27 August, 2018.
* Programming contest results:
https://icfpcontest2018.github.io/
* Student Research Competition:
https://icfp18.sigplan.org/track/icfp-2018-Student-Research-Competition
* Follow us on Twitter for the latest news:
http://twitter.com/icfp_conference
In addition to Strange Loop (9/26-9/28), there are several events co-located with ICFP:
* Erlang Workshop (9/29)
* Functional Art, Music, Modeling and Design (9/29)
* Functional High-Performance Computing (9/29)
* Haskell Implementors' Workshop (9/23)
* Haskell Symposium (9/27-9/28)
* Higher-order Programming with Effects (9/23)
* ICFP Tutorials (9/27-9/29)
* ML Family Workshop (9/28)
* Numerical Programming in Functional Languages (9/27)
* OCaml Workshop (9/27)
* Programming Languages Mentoring Workshop (9/23)
* Scala Symposium (9/28)
* Scheme Workshop (9/28)
* Type-Driven Development (9/27)
Conference Organizers:
General Chair: Robby Findler (Northwestern University, USA)
Program Chair: Matthew Flatt (University of Utah, USA)
Accessibility Chair: Alan Jeffrey (Mozilla Research, USA)
Artefact Evaluation Co-Chair: Simon Marlow (Facebook, UK)
Industrial Relations Chair: Alan Jeffrey (Mozilla Research, USA)
PLMW Co-Chair: Dan Licata (Wesleyan University, USA)
PLMW Co-Chair: David Van Horn (University of Maryland, USA)
PLMW Co-Chair: Niki Vazou (University of Maryland, USA)
Programming Contest Organizer: Matthew Fluet (Rochester Institute of Technology, USA)
Publications Co-Chair: Alex Potanin (Victoria University of Wellington, New Zealand)
Publicity Chair: Lindsey Kuper (UC Santa Cruz, USA)
Student Research Competition Chair: Ravi Chugh (University of Chicago, USA)
Student Volunteer Co-Captain: Jakub Zalewski (University of Edinburgh, UK)
Student Volunteer Co-Captain: Spencer P. Florence (Northwestern University, USA)
Treasurer and Conference Manager: Annabel Satin (P.C.K., UK)
Video Co-Chair Jamie Willis (University of Bristol, UK)
Video Co-Chair: Jose Calderon (Galois, USA)
Workshops Co-Chair: Christophe Scholliers (Ghent University, Belgium)
Workshops Co-Chair: David Christiansen (Galois, USA)
Sponsors and industrial partners:
Platinum supporters:
Ahrefs
Jane Street
Standard Chartered
X
Gold supporters:
DFINITY
Facebook
Mozilla
McCormick School of Engineering, Northwestern University
Silver supporters:
Bloomberg
Cal Poly Computer Science & Software Engineering
Digital Asset
Galois
Microsoft Research
Oracle Labs
Tweag I/O
Bronze supporters:
Google
IntelliFactory
Kadena
Obsidian Systems
Systor Vest
Well-Typed