Calling the Quo function of the Gaussian(Z) domain causes a mistake I can't quite reproduce










0














I am implementing the Extended Euclides Algorithm in Maple for arbitrary domains.



In the main loop of the program I have that code:



# Loop
while r_1 <> 0 do;
print("All is fine before the Quo");
print(r_0); print(r_1);
q := ED[Quo](r_0, r_1);
print("All is fine after the Quo");

r_aux := r_0 - q * r_1;
r_0 := r_1; r_1 := r_aux;

s_aux := s_0 - q * s_1;
s_0 := s_1; s_1 := s_aux;

t_aux := t_0 - q * t_1;
t_0 := t_1; t_1 := t_aux;
od;


Where ED is a Domain object passed as a parameter to the function.



When I call the function with certain arguments, it goes once through the loop and then in the second iteration crashes between the second and third print statement.



Concretely, it produces this output:



 "All is fine before the Quo"
-87 + 47 _i
-90 + 43 _i
"All is fine after the Quo"
"All is fine before the Quo"
-90 + 43 _i
3 + 4 _i
Error, (in E[Domains:-Rem]) cannot determine if this expression is true or false: 0 <= -90*`domains/Gaussian/badge0`(-87, 47)-43*`domains/Gaussian/badge0`(1, 0)*`domains/Gaussian/badge0`(-90, 43)


From this we should infer that calling Gaussian(Z)[Quo] on arguments -90 + 43 _i and 3 + 4 _i should produce this error, right?



Well, think again, because when I try reproducing that from the notebook it decides to stop crashing. Calling:



GI:=Gaussians(Z): a := GI[Input](-90+43*I); b := GI[Input](3+4*I); GI[Quo](a, b);


Produces the output:



 a := -90 + 43 _i
b := 3 + 4 _i
-4 + 20 _i


What is going on? Why does it crash inside the function but not in the workbook?










share|improve this question




























    0














    I am implementing the Extended Euclides Algorithm in Maple for arbitrary domains.



    In the main loop of the program I have that code:



    # Loop
    while r_1 <> 0 do;
    print("All is fine before the Quo");
    print(r_0); print(r_1);
    q := ED[Quo](r_0, r_1);
    print("All is fine after the Quo");

    r_aux := r_0 - q * r_1;
    r_0 := r_1; r_1 := r_aux;

    s_aux := s_0 - q * s_1;
    s_0 := s_1; s_1 := s_aux;

    t_aux := t_0 - q * t_1;
    t_0 := t_1; t_1 := t_aux;
    od;


    Where ED is a Domain object passed as a parameter to the function.



    When I call the function with certain arguments, it goes once through the loop and then in the second iteration crashes between the second and third print statement.



    Concretely, it produces this output:



     "All is fine before the Quo"
    -87 + 47 _i
    -90 + 43 _i
    "All is fine after the Quo"
    "All is fine before the Quo"
    -90 + 43 _i
    3 + 4 _i
    Error, (in E[Domains:-Rem]) cannot determine if this expression is true or false: 0 <= -90*`domains/Gaussian/badge0`(-87, 47)-43*`domains/Gaussian/badge0`(1, 0)*`domains/Gaussian/badge0`(-90, 43)


    From this we should infer that calling Gaussian(Z)[Quo] on arguments -90 + 43 _i and 3 + 4 _i should produce this error, right?



    Well, think again, because when I try reproducing that from the notebook it decides to stop crashing. Calling:



    GI:=Gaussians(Z): a := GI[Input](-90+43*I); b := GI[Input](3+4*I); GI[Quo](a, b);


    Produces the output:



     a := -90 + 43 _i
    b := 3 + 4 _i
    -4 + 20 _i


    What is going on? Why does it crash inside the function but not in the workbook?










    share|improve this question


























      0












      0








      0







      I am implementing the Extended Euclides Algorithm in Maple for arbitrary domains.



      In the main loop of the program I have that code:



      # Loop
      while r_1 <> 0 do;
      print("All is fine before the Quo");
      print(r_0); print(r_1);
      q := ED[Quo](r_0, r_1);
      print("All is fine after the Quo");

      r_aux := r_0 - q * r_1;
      r_0 := r_1; r_1 := r_aux;

      s_aux := s_0 - q * s_1;
      s_0 := s_1; s_1 := s_aux;

      t_aux := t_0 - q * t_1;
      t_0 := t_1; t_1 := t_aux;
      od;


      Where ED is a Domain object passed as a parameter to the function.



      When I call the function with certain arguments, it goes once through the loop and then in the second iteration crashes between the second and third print statement.



      Concretely, it produces this output:



       "All is fine before the Quo"
      -87 + 47 _i
      -90 + 43 _i
      "All is fine after the Quo"
      "All is fine before the Quo"
      -90 + 43 _i
      3 + 4 _i
      Error, (in E[Domains:-Rem]) cannot determine if this expression is true or false: 0 <= -90*`domains/Gaussian/badge0`(-87, 47)-43*`domains/Gaussian/badge0`(1, 0)*`domains/Gaussian/badge0`(-90, 43)


      From this we should infer that calling Gaussian(Z)[Quo] on arguments -90 + 43 _i and 3 + 4 _i should produce this error, right?



      Well, think again, because when I try reproducing that from the notebook it decides to stop crashing. Calling:



      GI:=Gaussians(Z): a := GI[Input](-90+43*I); b := GI[Input](3+4*I); GI[Quo](a, b);


      Produces the output:



       a := -90 + 43 _i
      b := 3 + 4 _i
      -4 + 20 _i


      What is going on? Why does it crash inside the function but not in the workbook?










      share|improve this question















      I am implementing the Extended Euclides Algorithm in Maple for arbitrary domains.



      In the main loop of the program I have that code:



      # Loop
      while r_1 <> 0 do;
      print("All is fine before the Quo");
      print(r_0); print(r_1);
      q := ED[Quo](r_0, r_1);
      print("All is fine after the Quo");

      r_aux := r_0 - q * r_1;
      r_0 := r_1; r_1 := r_aux;

      s_aux := s_0 - q * s_1;
      s_0 := s_1; s_1 := s_aux;

      t_aux := t_0 - q * t_1;
      t_0 := t_1; t_1 := t_aux;
      od;


      Where ED is a Domain object passed as a parameter to the function.



      When I call the function with certain arguments, it goes once through the loop and then in the second iteration crashes between the second and third print statement.



      Concretely, it produces this output:



       "All is fine before the Quo"
      -87 + 47 _i
      -90 + 43 _i
      "All is fine after the Quo"
      "All is fine before the Quo"
      -90 + 43 _i
      3 + 4 _i
      Error, (in E[Domains:-Rem]) cannot determine if this expression is true or false: 0 <= -90*`domains/Gaussian/badge0`(-87, 47)-43*`domains/Gaussian/badge0`(1, 0)*`domains/Gaussian/badge0`(-90, 43)


      From this we should infer that calling Gaussian(Z)[Quo] on arguments -90 + 43 _i and 3 + 4 _i should produce this error, right?



      Well, think again, because when I try reproducing that from the notebook it decides to stop crashing. Calling:



      GI:=Gaussians(Z): a := GI[Input](-90+43*I); b := GI[Input](3+4*I); GI[Quo](a, b);


      Produces the output:



       a := -90 + 43 _i
      b := 3 + 4 _i
      -4 + 20 _i


      What is going on? Why does it crash inside the function but not in the workbook?







      symbolic-math maple






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 12 at 10:20

























      asked Nov 12 at 10:05









      Jsevillamol

      596517




      596517



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53259844%2fcalling-the-quo-function-of-the-gaussianz-domain-causes-a-mistake-i-cant-quit%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53259844%2fcalling-the-quo-function-of-the-gaussianz-domain-causes-a-mistake-i-cant-quit%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          政党

          天津地下鉄3号線