mpmath version on Sage 8.6 is 1.0.0, and later and now it is 1.1.0
This might explain the problem, which maybe should be reported upstream:
https://github.com/fredrik-johansson/mpmath
I have opened https://github.com/fredrik-johansson/mpmath/issues/503
to report this.
On Tue, Jan 14, 2020 at 10:59 AM Eric Gourgoulhon
<egourg...@gmail.com> wrote:
>
> PS: a similar error has been reported on ask.sagemath: https://ask.sagemath.org/question/49534/error-with-mpmathfindroot-on-89/
>
> Le mardi 14 janvier 2020 11:55:08 UTC+1, Eric Gourgoulhon a écrit :
>>
>> Le mardi 14 janvier 2020 11:36:44 UTC+1, Dima Pasechnik a écrit :
>>>
>>>
>>> mpmath version on Sage 8.6 is 1.0.0, and later and now it is 1.1.0
>>>
>>> This might explain the problem, which maybe should be reported upstream:
>>>
>>> https://github.com/fredrik-johansson/mpmath
>>>
>>
>>
>> It's OK with Sage 8.9, which has already mpmath 1.1.0. So the problem is not due to the version of mpmath. Maybe a Python 2 / Python 3 issue?
>> Another data point: the issue is there in Sage 9.0.beta5 (Python 3).
>>
>> Eric.
>>
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-s...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/2e9eea57-3558-426b-9dec-76c22a6547ea%40googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/e9324849-4998-4c91-a384-f3314f59ae46%40googlegroups.com.
A, B = divmod(n, base**half)
Now I constantly know, that problem was in usingdivmod(n, base**half)instead ofn // (base**half), n % (base**half)
On Tue, Jan 14, 2020 at 10:23 PM Nils Bruin <nbr...@sfu.ca> wrote:
>
> On Tuesday, January 14, 2020 at 5:36:27 AM UTC-8, Александр Ватузов wrote:
>>
>> Now I constantly know, that problem was in using
>>
>> divmod(n, base**half)
>>
>> instead of
>>
>> n // (base**half), n % (base**half)
>
>
> The second option yields a performance regression relative to the first, because you would end up doing an integer division twice rather than one (integer division yields both the quotient and the remainder, so throwing one away and then recomputing it to find it anyway is wasteful). You're also performing an exponentiation twice.
>
> I think it would be better to find/write a "divmod" that works in py3 as well.
>
it is a Sage-specfic bug, as simply installing mpmath into system
Python3 fails to reproduce the issue.
(or perhaps it's due to Cython, or a specific version of it)
Does Sage use a "custom" divmod in mpmath code?
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-s...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/596f9268-9a22-489a-9e18-fd049e9cee6c%40googlegroups.com.