simon-git: spigot (master): Simon Tatham
Commits to Tartarus CVS repository.
tartarus-commits at lists.tartarus.org
Wed Oct 28 23:55:36 GMT 2015
TL;DR:
654dd07 Replace monotone_constructor_t with a small class.
3734b2b Include a preliminary check in spigot_enforce().
88c8453 Pass through is_rational() from the Enforcer class.
cfa7971 New piece of infrastructure: HoleFiller.
018f2a6 New functions: exponential and logarithmic integrals.
e5e071c BinaryIntervalSource should compare exponents both ways round.
Repository: git://git.tartarus.org/simon/spigot.git
On the web: http://tartarus.org/~simon-git/gitweb/?p=spigot.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2015-10-28 23:55:36
commit 654dd07b52ec1b4d9eef133f99e5d3129e32b2ff
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=654dd07b52ec1b4d9eef133f99e5d3129e32b2ff;hp=d9e1e075c2d303131bc6aa0efcc0ac939047906f
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Oct 28 23:43:01 2015 +0000
Replace monotone_constructor_t with a small class.
So far, all the things for which I've used MonotoneHelper (and
MonotoneInverter) have been individual functions rather than families
of related functions, so there's never been a need to bind extra state
into the thing MonotoneHelper uses as its spigot-constructor.
But that's not going to last, so here's a refactoring which replaces
the plain function-pointer type monotone_constructor_t with an
abstract base class providing a construct() method. No functional
change in this commit, but future additions to the family will be able
to provide an implementation of that class which also has data in it.
erf.cpp | 29 +++++++++++++++------------
exp.cpp | 35 ++++++++++++++++++---------------
funcs.h | 10 +++++++---
gamma.cpp | 37 ++++++++++++++++++++---------------
lambertw.cpp | 46 +++++++++++++++++++++----------------------
monotone.cpp | 29 +++++++++++++++------------
trig.cpp | 62 ++++++++++++++++++++++++++++++++++------------------------
7 files changed, 138 insertions(+), 110 deletions(-)
commit 3734b2bef07d1c6ae4717c749f19d682068ae12a
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=3734b2bef07d1c6ae4717c749f19d682068ae12a;hp=654dd07b52ec1b4d9eef133f99e5d3129e32b2ff
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Oct 28 23:43:01 2015 +0000
Include a preliminary check in spigot_enforce().
Now we at least _try_ to report a range violation up front, and only
if that doesn't work do we put our Enforcer class in front so as to
report the same error if it comes to light later.
Also, we now handle the known-rational case exactly, which means we
actually do draw a distinction between ENFORCE_GT and ENFORCE_GE, and
likewise LT/LE.
enforce.cpp | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
commit 88c845352492bbdab6b78a82c09fa862ae19a2ad
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=88c845352492bbdab6b78a82c09fa862ae19a2ad;hp=3734b2bef07d1c6ae4717c749f19d682068ae12a
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Oct 28 23:43:02 2015 +0000
Pass through is_rational() from the Enforcer class.
Client code which passes a number to spigot_enforce might perfectly
well then hand it on to some other function which will check it for
rationality - so we don't want the Enforcer class in the pipeline to
intercept is_rational() and return false when whatever was behind it
would have liked to return true.
enforce.cpp | 5 +++++
1 file changed, 5 insertions(+)
commit cfa7971d4083f0b69cc9e928aa07905a19a0ee21
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=cfa7971d4083f0b69cc9e928aa07905a19a0ee21;hp=88c845352492bbdab6b78a82c09fa862ae19a2ad
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Oct 28 23:43:02 2015 +0000
New piece of infrastructure: HoleFiller.
Used for implementing a continuous function whose natural
implementation strategy includes one or more 'removable
singularities', as it were.
Makefile.am | 2 +-
holefiller.h | 309 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 310 insertions(+), 1 deletion(-)
commit 018f2a6bd206e65d167c177b4b23f1643ab2462e
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=018f2a6bd206e65d167c177b4b23f1643ab2462e;hp=cfa7971d4083f0b69cc9e928aa07905a19a0ee21
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Oct 28 23:43:02 2015 +0000
New functions: exponential and logarithmic integrals.
There's a family of several exponential integral functions, but
they're all basically derived from integration of e^x/x, once, or more
than once or with assorted tweaks and sign flips. Logarithmic
integrals are given by integrating 1/log(x).
Also, these functions come with a nice bonus: a not totally hopeless
way to compute the Euler-Mascheroni constant, which I've been wanting
to add to spigot for _ages_. Every series I'd previously found for it
converged hopelessly slowly (you'd be lucky to get 100 digits if you
waited a very long time). But computing an exponential integral in two
different ways and then subtracting the results turns out to be able
to give 1000 digits quite readily. (Which is still underpowered
compared to how far spigot can get with pi or e in the same length of
time, but it's at least _somewhat_ respectable, and a lot better than
all other approaches I've tried. So I'll take it, until someone shows
me a better approach still!)
Makefile.am | 4 +-
defs.but | 4 +
expint.cpp | 447 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
expr.cpp | 7 +
funcs.h | 9 ++
manpage.but | 16 +++
manual.but | 42 ++++++
test.sh | 35 +++++
8 files changed, 562 insertions(+), 2 deletions(-)
commit e5e071cd5b065c3b8d56b8c9b6c3fd57d51cd72e
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=e5e071cd5b065c3b8d56b8c9b6c3fd57d51cd72e;hp=018f2a6bd206e65d167c177b4b23f1643ab2462e
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Oct 28 23:43:02 2015 +0000
BinaryIntervalSource should compare exponents both ways round.
We were checking whether the new interval received from the subclass
had _increased_ the value of 'bits' since the last time we called it
(which is the common case, of course, done by more or less all
subclasses), but not whether it had decreased it. The latter is less
common, but it can happen in special cases where a subclass wants to
switch over to a new source of interval data part way through a run,
e.g. because it's finally decided that some special case is not
happening and will now switch to passing through data from the general
case.
Regression test is based on an example that came up in one of the new
exponential-integral functions, because the HoleFiller system is just
such a subclass which switches data sources part way through.
spigot.cpp | 5 +++++
test.sh | 1 +
2 files changed, 6 insertions(+)
More information about the tartarus-commits
mailing list