rtoy / maxima

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

Segmentation fault when calculating the taylor series of a specific function #814

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-03 11:35:10 Created by frcl on 2021-02-16 13:55:22 Original: https://sourceforge.net/p/maxima/bugs/3716


The following code evaluated in Maxima 5.44.0 leads to a segmentation fault

taylor(sin(atan(1/(sqrt(3) + 2)) - x), x, 0, 1);

I first reported this in the sage bug tracker where Github user DaveWitteMorris pointed out that more generally

taylor(sin(atan(1/(sqrt(a) + b)) - x), x, 0, 1);

crashes for all integers a and b where a < b^2 and a is not a square number.

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-03 11:35:11 Created by robert_dodier on 2021-02-19 16:35:40 Original: https://sourceforge.net/p/maxima/bugs/3716/#70ce


Looks like a stack overflow. Looks like it gets into a loop, EXPAND -> TRY-EXPANSION -> TRIG-CONST -> PSCOSA+B -> EXPAND ... . I guess the first place to look is what PSCOSA+B is trying to do.