bad performance of Reduce (5.2)
- To: mathgroup at smc.vnet.net
- Subject: [mg77773] bad performance of Reduce (5.2)
- From: dimitris <dimmechan at yahoo.com>
- Date: Sat, 16 Jun 2007 03:34:05 -0400 (EDT)
Hello.
$VersionNumer
5.2
o=Sin[ArcTan[z] + ArcTan[2*z]] -1/Sqrt[2] ;
The equation o=0 has two roots in the real positive axis
Plot[Sin[ArcTan[z] + ArcTan[2*z]] - 1/Sqrt[2], {z, 0, 5}]
In[1]:=
Needs["NumericalMath`IntervalRoots`"]
In[21]:=
IntervalBisection[Sin[ArcTan[z] + ArcTan[2*z]] - 1/Sqrt[2], z,
Interval[{0, 5}], 0.1]
List @@ %
(FindRoot[Sin[ArcTan[z] + ArcTan[2*z]] - 1/Sqrt[2] == 0, {z, #1[[1]],
#1[[2]]}, WorkingPrecision -> 30,
PrecisionGoal -> 20] & ) /@ %
Out[21]=
Interval[{0.23437500000000014, 0.31250000000000033}, {1.71875,
1.7968750000000009}]
Out[22]=
{{0.23437500000000014, 0.31250000000000033}, {1.71875,
1.7968750000000009}}
Out[23]=
{{z -> 0.28077640640441513745535298432248087547755357014`30.}, {z ->
1.780776406404415137455352463993519256286808059355`30.}}
Solve returns the correct roots.
In[21]:=
Off[N::meprec]
In[22]:=
Solve[Sin[ArcTan[z] + ArcTan[2*z]] == 1/Sqrt[2], z]
FullSimplify[Sin[ArcTan[z] + ArcTan[2*z]] == 1/Sqrt[2] /. %]
Out[22]=
{{z -> (1/4)*(-3 + Sqrt[17])}, {z -> (1/4)*(3 + Sqrt[17])}}
Out[23]=
{True, True}
However, it is well known that Solve is not proper for equations like
o=0.
Let's use Reduce
In[24]:=
Reduce[Sin[ArcTan[z] + ArcTan[2*z]] == 1/Sqrt[2], z, Reals]
(*ommited output*)
Let's be more specifically!
In[25]:=
Reduce[Sin[ArcTan[z] + ArcTan[2*z]] == 1/Sqrt[2] && z > 0, z, Reals]
Out[25]=
((-Pi + 4*ArcTan[(1/4)*(-3 + Sqrt[17])] + 4*ArcTan[(1/2)*(-3 +
Sqrt[17])])/(8*Pi) Integers && z == (1/4)*(-3 + Sqrt[17])) ||
((-3*Pi + 4*ArcTan[(1/4)*(3 + Sqrt[17])] + 4*ArcTan[(1/2)*(3 +
Sqrt[17])])/(8*Pi) Integers && z == (1/4)*(3 + Sqrt[17]))
The roots are correct but it appears a strange condition
((-Pi + 4*ArcTan[(1/4)*(-3 + Sqrt[17])] + 4*ArcTan[(1/2)*(-3 +
Sqrt[17])])/(8*Pi) Integers
Any comments?
Dimitris
- Follow-Ups:
- Re: bad performance of Reduce (5.2)
- From: m.r@inbox.ru
- Re: bad performance of Reduce (5.2)
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: bad performance of Reduce (5.2)