rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

continued fractions, bugs #1884

Open rtoy opened 3 weeks ago

rtoy commented 3 weeks ago

Imported from SourceForge on 2024-07-05 10:22:51 Created by gekirchner on 2020-03-22 09:00:28 Original: https://sourceforge.net/p/maxima/bugs/3620


Attachments:

rtoy commented 3 weeks ago

Imported from SourceForge on 2024-07-05 10:22:52 Created by gekirchner on 2020-03-22 09:03:46 Original: https://sourceforge.net/p/maxima/bugs/3620/#abb2


The function cf(sqrt(n)) does not work properly. cf(sqrt(72)) returns [8,2,2] instead of [8,2,16] cf(sqrt(108)) returns [10,2,1,1,4,2] instead of [10,2,1,1,4,1,1,2,20] cf(sqrt(200)) returns 14 instead of [14,7,28] cf(sqrt(288)) returns [16,1,31] instead of [16,1,32]

Example: (%i1) cf(sqrt(108)); (%o1) [10,2,1,1,4,2]

rtoy commented 3 weeks ago

Imported from SourceForge on 2024-07-05 10:22:55 Created by robert_dodier on 2020-04-07 18:59:35 Original: https://sourceforge.net/p/maxima/bugs/3620/#83fd


I see that these are all of the form cf(sqrt(4*foo)). Since sqrt(4*foo) simplifies to 2*sqrt(foo), then the call to cf is cf(2*sqrt(foo)), and apparently that product 2*sqrt(foo) isn't being handled correctly. I'll ask about it on the mailing list.