#399 Infinite loop in Taylor(asin(sqrt(1-x^2)/(1+eps))...)/workar

open
nobody
5
2006-04-09
2003-09-09
No

forwarded 198466 maxima@math.utexas.edu
tags 198466 +upstream
tags 198466 +confirmed
thanks

A Debian user submitted this report, which I'm also
registering at the
website. Any ideas on a fix?

Take care,

=============================================================================
When trying to do some complicated Taylor series
expansions, maxima
hangs; I believe it is in an infinite loop, as xload
shows the cpu
saturated.

An example is:

f\(x\):= asin\(sqrt\(1-x^2\)/\(1+eps\)\);

taylor\(f\(x\),x,0,2\);

which produces this condition. While trying to isolate
the bug, I tried:

g\(x\):=asin\(sqrt\(1-x^2\)\);

taylor\(g\(x\),x,0,2\);

which produces the error message:

"Taylor encountered an unfamiliar singularity in ABS\(X\)"

I am unable to find any documentation on this
"unfamiliar singularity"
error message. However, from looking at the second
derivative of G(x),
I think I can see what's causing the problem: the
sqrt() in the above
expression is symmetrical about x=0, but has a cusp
there. However, this
ought to cause taylor() to produce an error message in
the first example,
instead of looping; this is not very user-friendly.

What's the difference between a familiar singularity
and an unfamiliar
one, anyway?
=============================================================================
--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its
citizens." -- Baha'u'llah

Discussion

  • Stavros Macrakis

    Logged In: YES
    user_id=588346

    In the first problem, the bug appears to be in the default gcd;
    you can get around this by changing gcd routine:

    gcd:'spmod$

    The second case is a bug in Taylor. To get around it, first
    expand the inner expression, then plug it into asin:

    inner: taylor(sqrt(1-x^2)+err*x^6,x,0,6);
    taylor(asin(inner),x,0,5);

    In general, you have to be careful about the orders of
    expansion -- you may need more terms in the inner expression
    than the whole expression. That is the sort of thing Taylor is
    supposed to do for you, but obviously there is a problem in
    this case. That is why I have added an explicit error term --
    to be able to trace it through.

    The second derivative business is, I believe, a red herring --
    the absolute value has to do with returning the principal value
    of sqrt, but the Taylor expansion doesn't care about principal
    values, it cares about analytic continuation.

     
  • Stavros Macrakis

    • summary: maxima: maxima hangs (infinite loop?) --> Infinite loop in Taylor(asin(sqrt(1-x^2)/(1+eps))...)/workar
     
  • Robert Dodier

    Robert Dodier - 2006-04-09
    • labels: 460522 --> Lisp Core - Taylor
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks