0
$\begingroup$

I have seen this message (Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result.) appear when trying to find when a function equals zero. However, I have no "inexact coefficients" - all my coefficients are exact. I looked into this problem, and the error for everyone else is that they used floating point numbers, but I didn't. Maybe the function is so complicated that this shows up. How can I fix this problem?

If it is not possible to fix, is it possible to get the "corresponding exact system" that Mathematica uses? If so, how can it be done?

The function for anyone interested is

g[s_] = -262144 + 229376 s + 4390912 s^2 - 4956160 s^3 - 24862720 s^4 + 
 29081600 s^5 + 67333120 s^6 - 80308224 s^7 - 98554368 s^8 + 
 120892160 s^9 + 80048000 s^10 - 102716096 s^11 - 33825728 s^12 + 
 47124296 s^13 + 5700652 s^14 - 9795666 s^15 + 486201 s^17 + 
 1245184 s Sqrt[-1 + s^2] - 1392640 s^2 Sqrt[-1 + s^2] - 
 11075584 s^3 Sqrt[-1 + s^2] + 12812288 s^4 Sqrt[-1 + s^2] + 
 39093248 s^5 Sqrt[-1 + s^2] - 46153728 s^6 Sqrt[-1 + s^2] - 
 69393408 s^7 Sqrt[-1 + s^2] + 84210176 s^8 Sqrt[-1 + s^2] + 
 65260928 s^9 Sqrt[-1 + s^2] - 82670016 s^10 Sqrt[-1 + s^2] - 
 30979392 s^11 Sqrt[-1 + s^2] + 42412512 s^12 Sqrt[-1 + s^2] + 
 5701556 s^13 Sqrt[-1 + s^2] - 9553152 s^14 Sqrt[-1 + s^2] + 
 486204 s^16 Sqrt[-1 + s^2] + 
 131072 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 114688 s Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 1916928 s^2 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] + 
 2158592 s^3 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] + 
 9879552 s^4 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 11588608 s^5 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 24290560 s^6 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] + 
 29032704 s^7 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] + 
 31443520 s^8 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 38716736 s^9 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 21446992 s^10 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] + 
 28044736 s^11 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] + 
 6775772 s^12 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 10132796 s^13 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 554458 s^14 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] + 
 1297852 s^15 Sqrt[4 - s^2 - 4 s Sqrt[-1 + s^2]] - 
 557056 s Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] + 
 638976 s^2 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] + 
 4579328 s^3 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] - 
 5326848 s^4 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] - 
 14688768 s^5 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] + 
 17385984 s^6 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] + 
 23093120 s^7 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] - 
 28069760 s^8 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] - 
 18266080 s^9 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] + 
 23458560 s^10 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] + 
 6499368 s^11 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] - 
 9483360 s^12 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] - 
 554648 s^13 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]] + 
 1297874 s^14 Sqrt[-4 + 5 s^2 - s^4 + 4 s Sqrt[-1 + s^2] - 
   4 s^3 Sqrt[-1 + s^2]]
$\endgroup$

closed as off-topic by Michael E2, Daniel Lichtblau, m_goldberg, MarcoB, garej Jun 23 at 10:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, Daniel Lichtblau, m_goldberg, garej
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ I'm not seeing that message. It's taking a long time, though. What, exactly, was your Solve expression? $\endgroup$ – John Doty Jun 18 at 0:26
  • $\begingroup$ Are you interested in all solutions, or just real solutions? $\endgroup$ – Carl Woll Jun 18 at 2:08
  • $\begingroup$ @JohnDoty, my Solve expression was Solve[g[s] == 0, s, Reals. $\endgroup$ – automaticallyGenerated Jun 18 at 2:14
  • $\begingroup$ @CarlWoll, just real solutions. $\endgroup$ – automaticallyGenerated Jun 18 at 2:14
  • 1
    $\begingroup$ When I use Solve[g[s] == 0, s, Reals] I get real solutions with no messages. What Mathematica version are you using? $\endgroup$ – Carl Woll Jun 18 at 2:17
1
$\begingroup$

First make sure that there are not any old definitions for g

Clear[g]

The definition for g can be shortened by defining common subexpressions.

g[s_] := Module[
   {sr1 = Sqrt[s^2 - 1], sr2, sr3},
   sr2 = Sqrt[4 - s^2 - 4 s sr1];
   sr3 = Sqrt[-4 + 5 s^2 - s^4 + 4 s sr1 - 4 s^3 sr1];
   -262144 + 229376 s + 4390912 s^2 - 4956160 s^3 - 24862720 s^4 + 
    29081600 s^5 + 67333120 s^6 - 80308224 s^7 - 98554368 s^8 + 
    120892160 s^9 + 80048000 s^10 - 102716096 s^11 - 33825728 s^12 + 
    47124296 s^13 + 5700652 s^14 - 9795666 s^15 + 486201 s^17 + 
    1245184 s sr1 - 1392640 s^2 sr1 - 11075584 s^3 sr1 + 12812288 s^4 sr1 + 
    39093248 s^5 sr1 - 46153728 s^6 sr1 - 69393408 s^7 sr1 + 
    84210176 s^8 sr1 + 65260928 s^9 sr1 - 82670016 s^10 sr1 - 
    30979392 s^11 sr1 + 42412512 s^12 sr1 + 5701556 s^13 sr1 - 
    9553152 s^14 sr1 + 486204 s^16 sr1 + 131072 sr2 - 114688 s sr2 - 
    1916928 s^2 sr2 + 2158592 s^3 sr2 + 9879552 s^4 sr2 - 11588608 s^5 sr2 - 
    24290560 s^6 sr2 + 29032704 s^7 sr2 + 31443520 s^8 sr2 - 
    38716736 s^9 sr2 - 21446992 s^10 sr2 + 28044736 s^11 sr2 + 
    6775772 s^12 sr2 - 10132796 s^13 sr2 - 554458 s^14 sr2 + 
    1297852 s^15 sr2 - 557056 s sr3 + 638976 s^2 sr3 + 4579328 s^3 sr3 - 
    5326848 s^4 sr3 - 14688768 s^5 sr3 + 17385984 s^6 sr3 + 
    23093120 s^7 sr3 - 28069760 s^8 sr3 - 18266080 s^9 sr3 + 
    23458560 s^10 sr3 + 6499368 s^11 sr3 - 9483360 s^12 sr3 - 
    554648 s^13 sr3 + 1297874 s^14 sr3];

The real roots are confined to

FunctionDomain[g[s], s]

(* s <= -1 || 1 <= s <= 2/Sqrt[3] *)

There are six real roots

soln = Solve[g[s] == 0, s, Reals] // SortBy[#, N[#] &] &

enter image description here

Only four of these roots are distinct

soln2 = DeleteDuplicates[soln]

enter image description here

soln2 // N

(*b{{s -> -3.09518}, {s -> -1.60486}, {s -> 1.1473}, {s -> 1.15185}} *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.