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
Bernoulli(1) = +½ #1179
Bernoulli(1) = +½ #1179
Conversation
I concur. |
This should not be merged, at any prize. This is breaking the standard convention. It is not because somebody has tricked sympy to change that that you should be tricked here too. |
Copying my reply to sage-devel.
|
Can you cross link the relevant discussion(s) on the Sage mailing list and/or issue tracker? |
https://groups.google.com/g/sage-devel/c/G4sbKoibXK4 These have also been edited into the first post here. |
I agree with @edgarcosta. Too much code churn for so-called "consistency with mathematical truth" (aka an arbitrary choice of sign). flint2 is quite defensive when it comes to breaking changes (there are usually none). So maybe this is something for flint 3.0 Maybe someone will write another "manifesto" and suddenly -1/2 is again the "mathematical truth". |
The choice of sign is not arbitrary – it is how Jakob Bernoulli originally defined his numbers. The second part of Luschny's manifesto notes that the real arbitrary choice, setting Also, I managed to not break the tests by changing only 4 lines of code. It can hardly be called code churn.
There can only be one truth, and the truth is that |
It is irrelevant how Bernoulli defined them originally. Or what Knuth thinks. We can take their opinion, but they are word is not the "truth".
Mathematical truth is about what logical statements one can deduce from a set of axioms. How you define things along the way is irrelevant. Some definitions provide shorter statements, but in the end, definitions are just shortcuts. For example, I could define primes to be negative instead of positive, and that wouldn't change any "mathematical truth", would just introduce annoying negative signs whenever we referred to concrete primes... |
What churn exactly? The question I keep coming up against as I said here (sympy/sympy#23866 (comment)) is whether |
The churn is in the code of all the people who use FLINT in their own projects, which may have to adopt their code to the new behavior. Worse than this is that they may not even notice the change, and end up with silently broken code. |
I realise that is what is being referred to but do you know of any concrete examples where this would affect anything? I asked that question because I wanted to know if anyone could point to a place where some code depends on this but no examples have so far been given. All examples I've seen that use the Bernoulli numbers do not care about |
As I said in various places some time ago, any software that assumes B(1) = -½ is already broken. The mathematical results obtained after fixing this bug will speak for themselves as to whether any FLINT-using software needs to be changed, and how. |
I agree with Max and I think we should close this. |
There was a discussion in SymPy at sympy/sympy#23866 on changing its value of$B_1$ (the first Bernoulli number) to $+\frac12$ from the old value of $-\frac12$ . Using $+\frac12$ allows interpolating the Bernoulli numbers and polynomials with the entire Bernoulli function $B(s,a)=-s\zeta(1-s,a)$ and confers several other advantages – in short, when considering the many appearances of the Bernoulli numbers across mathematics, $+\frac12$ is the most logical choice for $B_1$ .
That discussion has been closed because I have got PRs merged into SymPy changing its$B_1$ to $+\frac12$ ; cf. sympy/sympy#23926. I thought that also changed the value in SageMath (which SymPy includes), but @oscarbenjamin corrected me, pointing out the ability of SageMath to use other libraries' Bernoulli number implementations, all of which still have $B_1=-\frac12$ . I dug through Sage's code and found that it uses FLINT for the smaller arguments; in order to ensure consistency with mathematical truth as soon as possible, I have opened this PR.
The associated sage-devel mailing list thread is
https://groups.google.com/g/sage-devel/c/G4sbKoibXK4
The corresponding trac ticket is
https://trac.sagemath.org/ticket/34521