• Re: [fricas-devel] bug?: difficulty to extract imaginary part

    From nobody@nowhere.invalid@21:1/5 to clicliclic@freenet.de on Wed May 15 08:47:23 2024
    "clicliclic@freenet.de" schrieb:

    [this <sci.math.symbolic> response to a <fricas-devel> message tests
    cross-posting to <fricas-devel> as well.]

    "Ralf Hemmecke" schrieb:

    [...]


    Derive 6.10 also returns nice roots and nice factorizations:

    SOLUTIONS(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    x)

    [5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) + 482593381088000*SQRT(2) + 682490104577000,
    - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) + 482593381088000*SQRT(2) + 682490104577000,
    - 482593381088000*SQRT(2) + 682490104577000 + 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282),
    - 482593381088000*SQRT(2) + 682490104577000 - 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282)]

    FACTOR(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    Radical, x)

    (x + 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x^2 + x*(965186762176000*SQRT(2) - 1364980209154000) + 6284502086851625000*SQRT(2) - 8887628064558125000)

    FACTOR(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    Complex)

    (x + 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x + 482593381088000*SQRT(2) - 682490104577000 + 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282))*
    (x + 482593381088000*SQRT(2) - 682490104577000 - 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282))

    The weakness of FriCAS in determining the roots of degree-four
    polynomials like this in terms of radicals has also been pointed out
    for the simpler example of

    radicalSolve(64*z^4 + 64*z^3 + 32*z^2 - 8*z + 1)

    in the recent <sci.math.symbolic> thread "radicalSolve() in FriCAS is pathetic", which has been archived at <sci.math.symbolic.narkive.com/2ai15DJT/>.

    Related results of the algebraic integrator were improved in the latest version 3.1.10 of FriCAS, but the solutions returned by radicalSolve() involve unnecessary cube roots as before. The December post in <sci.math.symbolic> thread provides the formulae needed to avoid the
    cube roots.


    Here's the response I got from Google Groups:


    Hello ...

    We're writing to let you know that the group you tried to contact (fricas-devel) may not exist, or you may not have permission to post
    messages to the group. A few more details on why you weren't able to
    post:

    * You might have spelled or formatted the group name incorrectly.
    * The owner of the group may have removed this group.
    * You may need to join the group before receiving permission to post.
    * This group may not be open to posting.

    If you have questions related to this or any other Google Group,
    visit the Help Center at https://groups.google.com/support/.

    Thanks,

    Google Groups


    So if somebody with the appropriate permissions could forward my
    initial <sci.math.symbolic> post to <fricas-devel>, I would be
    grateful.

    Martin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nobody@nowhere.invalid@21:1/5 to Ralf Hemmecke on Wed May 15 08:32:11 2024
    Copy: fricas-devel@googlegroups.com

    [this <sci.math.symbolic> response to a <fricas-devel> message tests
    cross-posting to <fricas-devel> as well.]

    "Ralf Hemmecke" schrieb:

    Admittedly, it might be difficult to extract the imaginary part of a
    radical expression. But that seems to look like a bug.

    %%% (412) -> xx := (sqrt((((-12669586846893008563685878644359325*sqrt(3)+15974693204716576905254784724655502)*nthRoot(137198597903998437385921091448494025437519087343750000000000000*sqrt(3)+
    172989501261663064201623395407144143954141328843750000000000000, 3)^2+(-676159865925870354666914169665824080551250000*sqrt(3)+8217402890479177097807248979603419220411058375726750000)*nthRoot(137198597903998437385921091448494025437519087343750000000000000*
    sqrt(3)+172989501261663064201623395407144143954141328843750000000000000, 3)-45931279578807095346392460907109478385796132783696494926118495077505668392625000000000)*sqrt(((-5401066809391479730461765*sqrt(3)+6810039372933885991985941)*nthRoot(
    137198597903998437385921091448494025437519087343750000000000000*sqrt(3)+172989501261663064201623395407144143954141328843750000000000000, 3)^2+3503093079743488011787977136025306152751500000*nthRoot(
    137198597903998437385921091448494025437519087343750000000000000*sqrt(3)+172989501261663064201623395407144143954141328843750000000000000, 3)+19580584011451989397556080279474514673471759017621573422247980153750000000000)/138)+(
    75458077201551937891754164660043236993041255703201346421110021520000000*sqrt(3)-95142773619263899472829762733153800309338692262462996235137171088000000)*nthRoot(137198597903998437385921091448494025437519087343750000000000000*sqrt(3)+
    172989501261663064201623395407144143954141328843750000000000000, 3)^2-48941566061703353092027102734653684371144117066589419560010587508867726730881752000000000000*nthRoot(137198597903998437385921091448494025437519087343750000000000000*sqrt(3)+
    172989501261663064201623395407144143954141328843750000000000000, 3)+547119031158247887135235714889320242561133043433631241769109111538886308888911873326867936830640527579160000000000000000000)/32996199040131120862458002308760594)-7644000*sqrt(((-
    5401066809391479730461765*sqrt(3)+6810039372933885991985941)*nthRoot(137198597903998437385921091448494025437519087343750000000000000*sqrt(3)+172989501261663064201623395407144143954141328843750000000000000, 3)^2+
    3503093079743488011787977136025306152751500000*nthRoot(137198597903998437385921091448494025437519087343750000000000000*sqrt(3)+172989501261663064201623395407144143954141328843750000000000000, 3)+
    19580584011451989397556080279474514673471759017621573422247980153750000000000)/138)+91052936304600216411782349862348428000000000)/133412830008771839271564000000;

    Type: AlgebraicNumber

    %%% (413) -> ee := xx::Expression(INT);


    Type: Expression(Integer)

    %%% (414) -> imag(ee) $ TrigonometricManipulations(ZZ, EX(ZZ))

    (414) 0

    Type: Expression(Integer)

    %%% (415) -> imag ee

    (415) 0

    Type: Expression(Integer)

    %%% (416) -> ee::Complex(Float)

    (416) - 69137.1165280576_4221 + 123509.3125610854_8141 %i

    Type: Complex(Float)

    In fact, the value xx is one of radicalRoots(pp) where


    pp := x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000

    Interestingly, when I put xx into Mathematica, I get a much nicer expressions.

    In[15]:= p1 = Root[pp, 1] // ToRadicals

    Out[15]= 250 (2729960418308 + 1930373524352 Sqrt[2] -
    23569 Sqrt[2 (13416226688183641 + 9486704869150589 Sqrt[2])])

    In[25]:= p3 = Root[pp, 3] // ToRadicals

    Out[25]= 250 (2729960418308 - 1930373524352 Sqrt[2] -
    23569 I Sqrt[2 (-13416226688183641 + 9486704869150589 Sqrt[2])])


    Can I somehow "convince" FriCAS to return similarly "simple" radical expresssions?

    Thank you
    Ralf


    Derive 6.10 also returns nice roots and nice factorizations:

    SOLUTIONS(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    x)

    [5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) + 482593381088000*SQRT(2) + 682490104577000,
    - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) + 482593381088000*SQRT(2) + 682490104577000,
    - 482593381088000*SQRT(2) + 682490104577000 + 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282),
    - 482593381088000*SQRT(2) + 682490104577000 - 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282)]

    FACTOR(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    Radical, x)

    (x + 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x^2 + x*(965186762176000*SQRT(2) - 1364980209154000) + 6284502086851625000*SQRT(2) - 8887628064558125000)

    FACTOR(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    Complex)

    (x + 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x + 482593381088000*SQRT(2) - 682490104577000 + 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282))*
    (x + 482593381088000*SQRT(2) - 682490104577000 - 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282))

    The weakness of FriCAS in determining the roots of degree-four
    polynomials like this in terms of radicals has also been pointed out
    for the simpler example of

    radicalSolve(64*z^4 + 64*z^3 + 32*z^2 - 8*z + 1)

    in the recent <sci.math.symbolic> thread "radicalSolve() in FriCAS is pathetic", which has been archived at <sci.math.symbolic.narkive.com/2ai15DJT/>.

    Related results of the algebraic integrator were improved in the latest
    version 3.1.10 of FriCAS, but the solutions returned by radicalSolve()
    involve unnecessary cube roots as before. The December post in <sci.math.symbolic> thread provides the formulae needed to avoid the
    cube roots.

    Martin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nobody@nowhere.invalid@21:1/5 to clicliclic@freenet.de on Fri May 24 20:51:06 2024
    "clicliclic@freenet.de" schrieb:

    [this <sci.math.symbolic> response to a <fricas-devel> message tests
    cross-posting to <fricas-devel> as well.]

    "Ralf Hemmecke" schrieb:

    [...]


    Derive 6.10 also returns nice roots and nice factorizations:

    SOLUTIONS(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    x)

    [5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) + 482593381088000*SQRT(2) + 682490104577000,
    - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) + 482593381088000*SQRT(2) + 682490104577000,
    - 482593381088000*SQRT(2) + 682490104577000 + 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282),
    - 482593381088000*SQRT(2) + 682490104577000 - 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282)]

    FACTOR(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    Radical, x)

    (x + 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x^2 + x*(965186762176000*SQRT(2) - 1364980209154000) + 6284502086851625000*SQRT(2) - 8887628064558125000)

    FACTOR(x^4-2729960418308000*x^3-395258439243352250000*x^2-55499520947716391500000000*x-345363656226658026765625000000,
    Complex)

    (x + 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x - 5892250*SQRT(18973409738301178*SQRT(2) + 26832453376367282) - 482593381088000*SQRT(2) - 682490104577000)*
    (x + 482593381088000*SQRT(2) - 682490104577000 + 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282))*
    (x + 482593381088000*SQRT(2) - 682490104577000 - 5892250*#i*SQRT(18973409738301178*SQRT(2) - 26832453376367282))

    The weakness of FriCAS in determining the roots of degree-four
    polynomials like this in terms of radicals has also been pointed out
    for the simpler example of

    radicalSolve(64*z^4 + 64*z^3 + 32*z^2 - 8*z + 1)

    in the recent <sci.math.symbolic> thread "radicalSolve() in FriCAS is pathetic", which has been archived at <sci.math.symbolic.narkive.com/2ai15DJT/>.

    Related results of the algebraic integrator were improved in the latest version 3.1.10 of FriCAS, but the solutions returned by radicalSolve() involve unnecessary cube roots as before. The December post in <sci.math.symbolic> thread provides the formulae needed to avoid the
    cube roots.


    Recent <fricas-devel> posts indicate that radicalSolve() in future
    versions of FriCAS will suppress unnecessary cube roots in the zeros of
    quartic polynomials.

    So there's already one item to check when the new version appears!

    -

    I notice that the current <sci.math.symbolic> thread, though started 9
    days ago, has not yet appeared on <sci.math.symbolic.narkive.com> -
    either the site is not archiving all posts right away, or perhaps only archiving them selectively. It also appears that they do not show posts
    that haven't received an answer, though this may actually be intended
    to suppress spam messages - in fact, five spam messages were posted to <sci.math.symbolic> on May 22nd with the help of <dizum.com>, "The
    Internet Problem Provider".

    Of course, posts to the current thread could also have been lost in
    transit somewhere ...

    Martin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)