       Re: How to parse result from Reduce[ ] function

• To: mathgroup at smc.vnet.net
• Subject: [mg73273] Re: How to parse result from Reduce[ ] function
• From: "dimitris" <dimmechan at yahoo.com>
• Date: Fri, 9 Feb 2007 02:24:10 -0500 (EST)
• References: <eqep0l\$5bs\$1@smc.vnet.net>

```On Feb 8, 11:03=C2=A0am, Anton Vrba <antonv... at yahoo.com> wrote:
> Hi,
>
> The output of a Reduce[...] function call is
>
> C(element)Integers &&
> x==358537039003+2964364736430689 C &&
> y==28744265823+237656026328741 C &&
> p==205319+1697566324 C
>
> but I want to use the values =C2=A0after the p== i.e. 205319 and 1697=
566324 for further calculation in my program
>
> How do I obtain these? other than by manual cut and paste.
>
> best regards
> Anton

Since you don't give your input I use a system of equations from the
Help Browser.

In:=
Reduce[x^2 - 2*y^2 == 1 && x >= 0 && y >= 0 &&
Element[Alternatives[x,y],Integers], {x, y}]
(Cases[#1, (x_) == (a_) :> x -> a, Infinity] & ) /@ %
List @@ %
Sin[x + y] /. %
N[% /. C -> 2]

Out=
(x == 1 && y == 0) || (C =E2=88=88 Integers && C >= 0 && x =
== (1/2)*((3
- 2*Sqrt)^C + (3 + 2*Sqrt)^C) &&
y == -(((3 - 2*Sqrt)^C - (3 + 2*Sqrt)^C)/(2*Sqrt)))

Out=
{x -> 1, y -> 0} || {x -> (1/2)*((3 - 2*Sqrt)^C + (3 +
2*Sqrt)^C),
y -> -(((3 - 2*Sqrt)^C - (3 + 2*Sqrt)^C)/(2*Sqrt))}

Out=
{{x -> 1, y -> 0}, {x -> (1/2)*((3 - 2*Sqrt)^C + (3 +
2*Sqrt)^C),
y -> -(((3 - 2*Sqrt)^C - (3 + 2*Sqrt)^C)/(2*Sqrt))}}

Out=
{Sin, -Sin[(1/2)*(-(3 - 2*Sqrt)^C - (3 + 2*Sqrt)^C) +
((3 - 2*Sqrt)^C - (3 + 2*Sqrt)^C)/(2*Sqrt)]}

Out=
{0.8414709848078965, -0.6636338842129649}

Regards
Dimitris

```

• Prev by Date: Re: Mathematica, Quad Core, Linux
• Next by Date: Re: Showing that a hypergeometric expression is 0?
• Previous by thread: Re: How to parse result from Reduce[ ] function
• Next by thread: Re: How to parse result from Reduce[ ] function