Re: Eliminating Annoying Minus Signs
- To: mathgroup at smc.vnet.net
- Subject: [mg58760] Re: [mg58756] Eliminating Annoying Minus Signs
- From: yehuda ben-shimol <bsyehuda at gmail.com>
- Date: Sun, 17 Jul 2005 13:03:07 -0400 (EDT)
- References: <200507170704.DAA02676@smc.vnet.net>
- Reply-to: yehuda ben-shimol <bsyehuda at gmail.com>
- Sender: owner-wri-mathgroup at wolfram.com
Hi David,
How about
(- Numerator /@ test)/(- Denominator /@ test)
this is not error prone.
I'm almost certaint that there is more efficient way of doing this.
I'll try to find it later
regards
yehuda
On 7/17/05, David Park <djmp at earthlink.net> wrote:
> Here is an expression that has annoying minus signs in it.
>
> test = {-((2*x)/(-1 + z)), -((2*y)/(-1 + z)), -1};
>
> We can get rid of them with the following operation.
>
> MapAt[Minus, test, {{1, 1}, {1, 3, 1}, {2, 1}, {2, 3, 1}}]
> {(2*x)/(1 - z), (2*y)/(1 - z), -1}
>
> But it involves ferreting out the two positions at which we want to change signs and so is a little tedious and error prone.
>
> Does someone have a simpler method for simplifying such expressions, which occur quite often with Mathematica?
>
> David Park
> djmp at earthlink.net
> http://home.earthlink.net/~djmp/
>
>
- References:
- Eliminating Annoying Minus Signs
- From: "David Park" <djmp@earthlink.net>
- Eliminating Annoying Minus Signs