help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: firls.m, part 2


From: Dmitri A. Sergatskov
Subject: Re: firls.m, part 2
Date: Mon, 19 Jun 2017 11:34:08 -0500

On Mon, Jun 19, 2017 at 11:23 AM, je suis <address@hidden> wrote:
> I suspect that it might, depending on what you mean by "adapted from".
> You may want to take down your code wherever it is hosted publicly. Take
> a look at http://numerical.recipes/licenses/redistribute.html.

I see, but the underlying mathematics is based on Abramowitx & Stegun.
If I modify the code, it should be safe then, shouldn't it?

Vlad


​expint() is in C++17, so gcc7+ supports it:

​cat c_expint.cc
#include <cmath>
#include <iostream>
int main()
{
    std::cout << "Ei(0) = " << std::expint(0) << '\n'
              << "Ei(1) = " << std::expint(1) << '\n'
              << "Gompetz constant = " << -std::exp(1)*std::expint(-1) << '\n';
}

g++ -std=c++1z c_expint.cc
./a.out
Ei(0) = -inf
Ei(1) = 1.89512
Gompetz constant = 0.596347

Also there is a free implementation in e.g. GSL:
https://github.com/ampl/gsl/blob/master/specfunc/expint.c

Dmitri.
--





reply via email to

[Prev in Thread] Current Thread [Next in Thread]