simon-git: spigot (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Sun Nov 1 09:38:20 GMT 2015


TL;DR:
  7a415c2 New functions: trigonometric and Fresnel integrals.

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-11-01 09:38:20

commit 7a415c22c4b24e397b1973e1359e746536cf6dda
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=7a415c22c4b24e397b1973e1359e746536cf6dda;hp=c82a33a36903482eeb822eae6bf8509faef93775
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 1 09:19:30 2015 +0000

    New functions: trigonometric and Fresnel integrals.
    
    These are integrals of things like sin(x)/x and sin(x^2). As usual at
    this level of special-function obscurity, there are several
    definitions all slightly different: two integrals of sin(x)/x
    differing by a constant, two integrals of cos(x)/x differing by the
    first couple of terms of the power series (so that one actually has
    derivative cos(x)/x while the other is well defined everywhere), and
    two integrals of {sin,cos}(x^2) because for some reason most people
    like to stick a factor of pi/2 on the trig argument.
    
    The evaluation strategy isn't much to speak of - in particular, I have
    no clever way to evaluate these functions efficiently at unlimited
    precision for _large_ x, even though they mostly have finite limits so
    you'd obviously like that to be possible. All I know how to do with
    these functions is evaluate the power series, and if you want them for
    really large x then you just have to wait a million years for
    convergence :-( But even so, I think these are worth committing, since
    I expect that they're more often needed for small than large
    arguments.
    
    One thing I am quite pleased with is my strategy for handling the
    turning points, avoiding the problem we had with cos(0) in commit
    bd40ce7cf where we passed a non-monotonic function to spigot_monotone
    and it returned an actually wrong answer. I simply tweak the power
    series so that it computes a function like f(x)-x which I've chosen so
    that it _is_ monotonic, and then I add x back on afterwards once
    spigot_monotone has finished processing. If I'd thought of that last
    year, I might have used that strategy for cos too!

 Makefile.am |    6 +-
 expr.cpp    |    8 ++
 funcs.h     |   10 ++
 manpage.but |   18 +++
 manual.but  |   25 +++++
 test.sh     |  105 +++++++++++++++++
 trigint.cpp |  361 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 530 insertions(+), 3 deletions(-)



More information about the tartarus-commits mailing list