Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B(1) = +½ set 4: generalised Genocchi function #23989

Merged
merged 3 commits into from
Aug 30, 2022

Conversation

Parcly-Taxel
Copy link
Contributor

@Parcly-Taxel Parcly-Taxel commented Aug 29, 2022

References to other Issues or PRs

Part 4 of the changes formerly included in #23926, building upon #23984.

Brief description of what is fixed or changed

This PR generalises genocchi() to the generalised Genocchi function described in Luschny:
$$G(s,a)=2\left(B(s,a)-2^sB\left(s,\frac{a+1}2\right)\right)$$

Release Notes

  • functions
    • genocchi() now accepts two complex arguments, implementing the generalised Genocchi function described by Luschny.

Luschny defines the generalised Genocchi function in terms of the
generalised Bernoulli function (implemented in sympy#23984) as

G(s, a) = 2^s (B(s, a/2) - B(s, (a+1) / 2))

which can be rather easily rewritten as

G(s, a) = 2 (B(s, a) - 2^s B(s, (a+1) / 2))

which is the form used here. When s is a nonnegative integer this
function reproduces the (so-called) Genocchi polynomials, which have
integer coefficients; when in addition a = 1 the Genocchi numbers are
obtained, with G(1) = -1.

The second term in the rewritten expression (2^s B(s, (a+1)/2)) is what
Luschny calls the central Bernoulli function, which reduces to the
central Bernoulli numbers when a = 0.
@sympy-bot
Copy link

sympy-bot commented Aug 29, 2022

Hi, I am the SymPy bot (v167). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

  • functions
    • genocchi() now accepts two complex arguments, implementing the generalised Genocchi function described by Luschny. (#23989 by @Parcly-Taxel)

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.12.

Click here to see the pull request description that was parsed.
#### References to other Issues or PRs

Part 4 of the changes formerly included in #23926, building upon #23984.

#### Brief description of what is fixed or changed

This PR generalises `genocchi()` to the generalised Genocchi function described in Luschny:
$$G(s,a)=2\left(B(s,a)-2^sB\left(s,\frac{a+1}2\right)\right)$$

#### Release Notes

<!-- BEGIN RELEASE NOTES -->
* functions
    * `genocchi()` now accepts two complex arguments, implementing the generalised Genocchi function described by Luschny.
<!-- END RELEASE NOTES -->

Update

The release notes on the wiki have been updated.

@Parcly-Taxel Parcly-Taxel mentioned this pull request Aug 29, 2022
10 tasks
@github-actions
Copy link

github-actions bot commented Aug 29, 2022

Benchmark results from GitHub Actions

Lower numbers are good, higher numbers are bad. A ratio less than 1
means a speed up and greater than 1 means a slowdown. Green lines
beginning with + are slowdowns (the PR is slower then master or
master is slower than the previous release). Red lines beginning
with - are speedups.

Significantly changed benchmark results (PR vs master)

Significantly changed benchmark results (master vs previous release)

       before           after         ratio
     [41d90958]       [930eb707]
-         992±1μs          625±2μs     0.63  solve.TimeSparseSystem.time_linear_eq_to_matrix(10)
-        2.89±0ms         1.17±0ms     0.41  solve.TimeSparseSystem.time_linear_eq_to_matrix(20)
-     5.76±0.02ms         1.71±0ms     0.30  solve.TimeSparseSystem.time_linear_eq_to_matrix(30)

Full benchmark results can be found as artifacts in GitHub Actions
(click on checks at the top of the PR).

@Parcly-Taxel
Copy link
Contributor Author

As a note, the checklist at the top of #23926 includes not only my ideas for PRs, but also the ideas which have been suggested as important go-alongs, such as the moving of polynomial functionality to the polynomials module just above.

@oscarbenjamin
Copy link
Collaborator

Looks good.

@oscarbenjamin oscarbenjamin merged commit f88e9c1 into sympy:master Aug 30, 2022
@Parcly-Taxel Parcly-Taxel deleted the genocchi branch August 30, 2022 12:01
Parcly-Taxel added a commit to Parcly-Taxel/sympy that referenced this pull request Aug 30, 2022
Luschny defines the generalised Euler function in terms of the
generalised Genocchi function (implemented in sympy#23989) as

          ⎧   ⎛a⎞    ⎛a + 1⎞
          ⎪ -ψ⎜─⎟ + ψ⎜─────⎟  s = -1
          ⎪   ⎝2⎠    ⎝  2  ⎠
E(s, a) = ⎨
          ⎪   -G(s + 1, a)
          ⎪   ─────────────   s ≠ -1
          ⎩       s + 1

where the top expression is the limiting value of the bottom. When s is
a nonnegative integer the function reproduces the Euler polynomials, but
unlike the Bernoulli and Genocchi polynomials, a must be set to ½ *and*
the result must be multiplied by 2^s to obtain the Euler numbers. For
even more clarity Luschny disambiguates the latter with the designation
"secant", calling 2^s E(s, 1) the Euler tangent numbers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants