[Date Index]
[Thread Index]
[Author Index]
Mathematica Precision
*To*: mathgroup at smc.vnet.net
*Subject*: [mg8489] Mathematica Precision
*From*: David Djajaputra <dd4b at virginia.edu>
*Date*: Tue, 2 Sep 1997 16:15:31 -0400
*Organization*: University of Virginia
*Sender*: owner-wri-mathgroup at wolfram.com
--------------E7F4C761F09A86D88F419661
To all Mathematica lovers out there,
I would really appreciate it if anyone can give me helpful comment on
this problem.
I need to work with the following equation:
Solve[a(x + y) + c (Sqrt[1 - x^2] + Sqrt[1 - y^2])== e, y]
It gives two roots. Fine. I then define one root as a new function:
Arguemin[x_, a_, c_, e_] :=
(a e -a^2 x - a c Sqrt[1 - x^2] -Sqrt[-c^2 e^2 + 2 a c^2 e x + c^4 x^2
+ 2 c^3 e Sqrt[1-x^2] - 2 a c^3 Sqrt[1-x^2]
+ a^2 c^2 (1 - x^2)])/(a^2 + c^2)
and plug it back into the original equation:
Checking[x_, a_, c_, e_]:=
a( x + Arguemin[x,a,c,e]) +
c (Sqrt[1 - x^2] + Sqrt[1 -(Arguemin[x,a,c,e])^2])
I set the precision to infinity:
$MaxExtraPrecision = Infinity
If I run Checking[x,a,c,e], it should give me result=e, right? (In my
problem, a=1-Cos(s) and c=Sin(s), and I choose s=0.1 here.)
Checking[Cos[0.4], 1-Cos[0.1], Sin[0.1], 0.1]
0.100252
It doesn't. For other values of s, it is even worse. Couldn't
Mathematica do better than
this?
Much thanks in advance,
David
--------------E7F4C761F09A86D88F419661
<HTML>
To all Mathematica lovers out there,
<P>I would really appreciate it if anyone can give me helpful comment on
this problem.
<BR>I need to work with the following equation:
<PRE>Solve[a(x + y) + c (Sqrt[1 - x^2] + Sqrt[1 - y^2])== e, y]</PRE>
It gives two roots. Fine. I then define one root as a new function:
<PRE>Arguemin[x_, a_, c_, e_] :=
(a e -a^2 x - a c Sqrt[1 - x^2] -Sqrt[-c^2 e^2 + 2 a c^2 e x + c^4 x^2
+ 2 c^3 e Sqrt[1-x^2] - 2 a c^3 Sqrt[1-x^2]
+ a^2 c^2 (1 - x^2)])/(a^2 + c^2)</PRE>
and plug it back into the original equation:
<PRE>Checking[x_, a_, c_, e_]:=
a( x + Arguemin[x,a,c,e]) +
c (Sqrt[1 - x^2] + Sqrt[1 -(Arguemin[x,a,c,e])^2])</PRE>
I set the precision to infinity:
<PRE>$MaxExtraPrecision = Infinity</PRE>
If I run Checking[x,a,c,e], it should give me result=e, right? (In my problem,
a=1-Cos(s) and c=Sin(s), and I choose s=0.1 here.)
<PRE>Checking[Cos[0.4], 1-Cos[0.1], Sin[0.1], 0.1]</PRE>
<PRE>0.100252</PRE>
It doesn't. For other values of s, it is even worse. Couldn't Mathematica
do better than
<BR>this?
<BR>
<P>Much thanks in advance,
<P>David</HTML>
--------------E7F4C761F09A86D88F419661--
Prev by Date:
**GraphicsData in Cell?**
Next by Date:
**Defining Real expressions**
Previous by thread:
**GraphicsData in Cell?**
Next by thread:
**Re: Mathematica Precision**
| |