MathGroup Archive 1994

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Solve--Solutions

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Re: Solve--Solutions
  • From: danl (Daniel Lichtblau)
  • Date: Wed, 9 Mar 1994 13:08:42 -0600

>Begin forwarded message:

>Date: Wed, 9 Mar 94 08:16:02 PST
>From: fateman at peoplesparc.Berkeley.EDU (Richard J Fateman)
>To: danl at wri.com, mathgroup at yoda.physics.unc.edu
>Subject: Re: Solve--Solutions

>Actually, I'd suggest that WRI's version of the cubic formula
>is defective and provides unnecessary "I" values.  This bug
>was corrected in Macsyma, as I recall, about 20 years ago.

----------------------------

   Malarkey.

  We start with Mathematica. I use the problem posted in the original  
note in all examples. Mathematica gives an answer that contains 10  
instnaces of Sqrt[-1].

In[1]:= sol = Solve[11*x^3 - 20*x^2 - 10*x + 22 == 0, x] // InputForm

Out[1]//InputForm= 

  {{x -> 20/33 + (730*2^(1/3))/(33*(-36074 + 66*I*58479^(1/2))^(1/3))  
+ 

      (-36074 + 66*I*58479^(1/2))^(1/3)/(33*2^(1/3))}, 

   {x -> 20/33 - (365*2^(1/3)*(1 + I*3^(1/2)))/
       (33*(-36074 + 66*I*58479^(1/2))^(1/3)) - 

      ((1 - I*3^(1/2))*(-36074 +  
66*I*58479^(1/2))^(1/3))/(66*2^(1/3))}, 

   {x -> 20/33 - (365*2^(1/3)*(1 - I*3^(1/2)))/
       (33*(-36074 + 66*I*58479^(1/2))^(1/3)) - 

      ((1 + I*3^(1/2))*(-36074 +  
66*I*58479^(1/2))^(1/3))/(66*2^(1/3))}}

In[2]:= N[sol]

Out[2]//InputForm= 

  {{x -> 1.61319327207777 + 4.440892098500627*10^-16*I}, 

   {x -> -1.015665880292489 - 5.551115123125783*10^-17*I}, 

   {x -> 1.220654426396537 - 4.440892098500627*10^-16*I}}


  Here is what macsyma has to say. This also contains 10 instances of  
Sqrt[-1]. Took me over an hour with the manual to get some rough  
equivalent to the N[] function.

mosquito [2] danl> macsyma
Starting MACSYMA without a window system...
This is Macsyma 417.100 for SPARC Series Computers.
Copyright (c) 1982 Massachusetts Institute of Technology.
All Rights Reserved.
Enhancements (c) 1982, 1991 Symbolics, Inc.  All Rights Reserved.
Type "DESCRIBE(TRADE_SECRET);" to see important legal notices.
Type "HELP();" for more information.

Checking password file:  
/usr-local/macsyma_417/system/passwd-50383386-417.text
(C1) display2d :  false;


(D1) FALSE
(C2) sol : solve(11*x^3 - 20*x^2 - 10*x + 22 = 0, x);


(D2) [X =  
(-SQRT(3)*%I/2-1/2)*(SQRT(19493)*%I/(363*SQRT(3))-18037/35937)^(1/3)+ 
730*
(SQRT(3)*%I/2-1/2)/(1089*(SQRT(19493)*%I/(363*SQRT(3))-18037/35937)^( 
1/3))
+20/33,X =  
(SQRT(3)*%I/2-1/2)*(SQRT(19493)*%I/(363*SQRT(3))-18037/35937)^(1/3)
+730*(-SQRT(3)*%I/2-1/2)/(1089*(SQRT(19493)*%I/(363*SQRT(3))-18037/35 
937)^(1/3
))+20/33,X =  
(SQRT(19493)*%I/(363*SQRT(3))-18037/35937)^(1/3)+730/(1089*(SQRT
(19493)*%I/(363*SQRT(3))-18037/35937)^(1/3))+20/33]
(C3) nsol : dfloat(sol);


(D3) [X =  
0.6703397612488522*(0.8660254037844386*%I-0.5)/(0.2220608965979688*%I
-0.5019061134763614)^(1/3)+(-0.8660254037844386*%I-0.5)*(0.2220608965 
979688*%I
-0.5019061134763614)^(1/3)+0.6060606060606061,X =  
(0.2220608965979688*%I
-0.5019061134763614)^(1/3)*(0.8660254037844386*%I-0.5)+0.670339761248 
8522*(
-0.8660254037844386*%I-0.5)/(0.2220608965979688*%I-0.5019061134763614 
)^(1/3)
+0.6060606060606061,X =  
(0.2220608965979688*%I-0.5019061134763614)^(1/3)
+0.6703397612488522/(0.2220608965979688*%I-0.5019061134763614)^(1/3)
+0.6060606060606061]
(C4) really_truly_nsol : maplist(rectform, nsol);


(D4) [X = 1.220654426396538,X =  
-2.775557561562891E-17*%I-1.01566588029249,X = 

1.61319327207777]
(C5) quit();

Bye.
mosquito [3] danl> 



  You want a third opinion? I count 12 instances of I this time.

elvis [3] danl> maple
    |\^/|     Maple V Release 2 (Wolfram Research Inc.)
._|\|   |/|_. Copyright (c) 1981-1992 by the University of Waterloo.
 \  MAPLE  /  All rights reserved. MAPLE is a registered trademark of
 <____ ____>  Waterloo Maple Software.
      |       Type ? for help.
> sol := solve(11*x^3 - 20*x^2 - 10*x + 22 = 0, x):
> lprint(sol);
(-18037/35937+1/1089*I*19493^(1/2)*3^(1/2))^(1/3)+730/1089/(-18037/35 
937+1/
1089*I*19493^(1/2)*3^(1/2))^(1/3)+20/33    
-1/2*(-18037/35937+1/1089*I*19493^(1/
2)*3^(1/2))^(1/3)-365/1089/(-18037/35937+1/1089*I*19493^(1/2)*3^(1/2) 
)^(1/3)+20
/33+1/2*I*3^(1/2)*((-18037/35937+1/1089*I*19493^(1/2)*3^(1/2))^(1/3)- 
730/1089/(
-18037/35937+1/1089*I*19493^(1/2)*3^(1/2))^(1/3))    
-1/2*(-18037/35937+1/1089*I
*19493^(1/2)*3^(1/2))^(1/3)-365/1089/(-18037/35937+1/1089*I*19493^(1/ 
2)*3^(1/2)
)^(1/3)+20/33-1/2*I*3^(1/2)*((-18037/35937+1/1089*I*19493^(1/2)*3^(1/ 
2))^(1/3)-
730/1089/(-18037/35937+1/1089*I*19493^(1/2)*3^(1/2))^(1/3))
> nsol := evalf(sol):
> lprint(nsol);
1.613193272+1.0E-10*I   -1.015665881   1.220654427-2.0E-10*I
> quit;
bytes used=502468, alloc=393144, time=1.63


  --Dan'L
  

  






  • Prev by Date: Addresses
  • Next by Date: What about visiting us in Grenoble ?
  • Previous by thread: Re: Solve--Solutions
  • Next by thread: Re: Nonlinear Discrete