Re: NSolve problem
- To: mathgroup at smc.vnet.net
- Subject: [mg27810] Re: NSolve problem
- From: BobHanlon at aol.com
- Date: Mon, 19 Mar 2001 01:29:01 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I think that you need to ensure that the function has higher precision than
NSolve to avoid the problem on a Mac.
coef={
56948086997945333979944420780869994640,
-410398690910611254706353259635396975000,
1438562129094179414396635651311443079894,
-3267975175700805824009526616434042764990,
5408604513390527799203743488644413596831,
-6950806520792700621314978752272893634603,
7219321171308545919834020175759542752800,
-6227602171254861022800069187941498698916,
4550488627005201158356170201262005359426,
-2858356540987341736071315091852197268914,
1561105298212051506376403179694366814908,
-747964023676923486311300650584136934167,
316623088476789267411001214031813664920,
-119092149085329990604796332906238009003,
39983125143255083338516711567117321554,
-12025273387738045949766927419057733779,
3249150512801263497674821800877444750,
-790386259690389861011499411484727356,
173372427244970231511243462159022530,
-34326439784958730341338590620522553,
6137577944863948353668001351379085,
-991008485501837267612722683739742,
144425378677250071307785407099514,
-18977700242148569406030260324295,
2244844544457248209076495840902,
-238516616444064255358326013794,
22698320261526730755198553574,
-1927635748101251322270468277,
145419622102662664506687100,
-9689635918166905495882851,
566216540434141788242036,
-28757943661703317295081,
1255110040775305672800,
-46379987523224586918,
1422785868781829532,
-35256637347077513,
678033800618890,
-9494410812843,
86108525122,
-379610373};
f[x_, n_Integer?Positive] :=
Module[{r = Rationalize[x, 10^(-n)]},
Fold[#1*r+#2&, 0, coef]];
Plot[f[x, 10], {x, 0.07, 0.3},
PlotRange -> {-0.2, 0.2},
Frame -> True,
Axes -> False];
$Version
"4.1 for Power Macintosh (November 2, 2000)"
soln[n_Integer?Positive] :=
NSolve[f[x, n+2] == 0, x, n];
soln[40]
{{x -> 0.091708830141284216611300718338731`19.4702}, {x ->
0.1104974690580543250922644165`11.2476},
{x -> 0.1105873420815579159995547312`11.2124}, {x ->
0.1159375392511005425478689904`11.1591},
{x -> 0.1236583455659158388708928991`8.936}, {x ->
0.1293265537217207399`5.927}, {x -> 0.129623393195697322`5.8156},
{x -> 0.1319667912920863781`6.1616}, {x -> 0.1349687561339759892`6.2469},
{x -> 0.142384485487523896`5.9727},
{x -> 0.15914888842593`0.9405}, {x -> 0.15962702427223`0.7091}, {x ->
0.16166699861575`0.718}, {x -> 0.16429234912329`0.6458},
{x -> 0.16795200596333`0.6536}, {x -> 0.17006072687201`3.5496 -
0.01271216354109`2.4232*I},
{x -> 0.17006072687201`3.5496 + 0.01271216354109`2.4232*I}, {x ->
0.17452263754768`0.6021}, {x -> 0.17572478144437`0.6021},
{x -> 0.18213053535748`0.6021}, {x -> 0.18466999394585`0.8245}, {x ->
0.21276062833504`0.6021}, {x -> 0.21537305189043`0.6021},
{x -> 0.21667300164505`0.6021}, {x -> 0.21813564609871`0.6021}, {x ->
0.2184316522117`0.6021}, {x -> 0.22139975315691`0.6021},
{x -> 0.22279244101398`0.6021}, {x -> 0.22322749819878`0.6021}, {x ->
0.22433690122262`0.6021}, {x -> 0.23212762586955`0.6021},
{x -> 0.23319584770714`0.6021}, {x -> 0.23430535006292`0.6021}, {x ->
0.23733771094056`0.6021}, {x -> 0.2392655206455`0.6021},
{x -> 0.240928788821`0.6021}, {x -> 0.24126406796542`0.6021}, {x ->
0.24206076730204`0.6021}, {x -> 0.24240799462008`0.6021}}
Bob Hanlon
In a message dated 2001/3/9 3:00:14 AM, mtpagesj at lg.ehu.es writes:
>My problem was that Mathematica crashed on an iMac and a G4 when
>evaluating NSolve[poly==0,x], where poly is given below. There have been
>several posts by Windows users saying that they found no problem. I would
>like to hear from MacIntosh users.
>
> Thanks,
>
> Julian Aguirre
> Universidad del Pais Vasco
>
>> > poly =
>> > -379610373 +
>> > 86108525122 x -
>> > 9494410812843 x^2 +
>> > 678033800618890 x^3 -
>> > 35256637347077513 x^4 +
>> > 1422785868781829532 x^5 -
>> > 46379987523224586918 x^6 +
>> > 1255110040775305672800 x^7 -
>> > 28757943661703317295081 x^8 +
>> > 566216540434141788242036 x^9 -
>> > 9689635918166905495882851 x^10 +
>> > 145419622102662664506687100 x^11 -
>> > 1927635748101251322270468277 x^12 +
>> > 22698320261526730755198553574 x^13 -
>> > 238516616444064255358326013794 x^14 +
>> > 2244844544457248209076495840902 x^15 -
>> > 18977700242148569406030260324295 x^16 +
>> > 144425378677250071307785407099514 x^17 -
>> > 991008485501837267612722683739742 x^18 +
>> > 6137577944863948353668001351379085 x^19 -
>> > 34326439784958730341338590620522553 x^20 +
>> > 173372427244970231511243462159022530 x^21 -
>> > 790386259690389861011499411484727356 x^22 +
>> > 3249150512801263497674821800877444750 x^23 -
>> > 12025273387738045949766927419057733779 x^24 +
>> > 39983125143255083338516711567117321554 x^25 -
>> > 119092149085329990604796332906238009003 x^26 +
>> > 316623088476789267411001214031813664920 x^27 -
>> > 747964023676923486311300650584136934167 x^28 +
>> > 1561105298212051506376403179694366814908 x^29 -
>> > 2858356540987341736071315091852197268914 x^30 +
>> > 4550488627005201158356170201262005359426 x^31 -
>> > 6227602171254861022800069187941498698916 x^32 +
>> > 7219321171308545919834020175759542752800 x^33 -
>> > 6950806520792700621314978752272893634603 x^34 +
>> > 5408604513390527799203743488644413596831 x^35 -
>> > 3267975175700805824009526616434042764990 x^36 +
>> > 1438562129094179414396635651311443079894 x^37 -
>> > 410398690910611254706353259635396975000 x^38 +
>> > 56948086997945333979944420780869994640 x^39;