Ruud H.G. van Tol on Sat, 22 Oct 2022 17:25:24 +0200

 Re: expression normalization

• To: pari-users@pari.math.u-bordeaux.fr
• Subject: Re: expression normalization
• From: "Ruud H.G. van Tol" <rvtol@isolution.nl>
• Date: Sat, 22 Oct 2022 17:24:21 +0200
• Delivery-date: Sat, 22 Oct 2022 17:25:24 +0200
• Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=isolution.nl; s=soverin; t=1666452262; bh=mC/Pdqjfm4+HelGKnJ6rgrG7K/uXZKWCogrW5cpAV+o=; h=Date:Subject:From:To:References:In-Reply-To:From; b=EGemP7GxizMmNorWNDggi6talA8l/FcERTgO8T32rSOk7ogcSxsr818B79eT0W2o1 bf5EpiMhdkLsEJeyvzaBzvYWW0sASszk0oUbir/9c4Kzhhf7cw/jiYzC9CtvhlmoeE DUo9Tv7ZyTWWQ1C5AabHo/u5eAuyZ7waRLd94A/cwS4ml/On/xowg8nPO/9zttxFu3 mxfWBAS9UkbNNA/McWhxJ6pvgeADIUrBZjQbUmWawQWfvxu8gwHbrGsW5IV62TeKpV aZnrrnupu8DxpWfMtz9UCJofJ82NePkaBiJY5cEdAZ729Y02CQEzLMkFF/6M++3Dbb iV/Gu1M+Un2rA==
• References: <fe8dbd0a-d7b9-4ebb-3de8-1e46f80cf75e@isolution.nl>

```

On 2022-10-22 16:59, Ruud H.G. van Tol wrote:
```
```
? (a-b)/(c-d)
%1 = 1/(c - d)*a - 1/(c - d)*b
? ((a-b)/(c-d))
%2 = 1/(c - d)*a - 1/(c - d)*b

? (b-a)/(d-c)
%3 = -1/(-c + d)*a + 1/(-c + d)*b
? ((b-a)/(d-c))
%4 = -1/(-c + d)*a + 1/(-c + d)*b

I wondered why these don't all "normalize"
to the same internal (?) format.

And if there is no special reason for that:
if it is worth the effort to make it so.

-- Ruud

? a/b-c/d
%5 = 1/b*a - 1/d*c
? b/a-c/d
%6 = (c*a - d*b)/(-d*a)
? b/a-d/c
%7 = (-d*a + c*b)/(c*a)
```
```
? a/b-d/c
%8 = 1/b*a - d/c
? w/x-z/y
%9 = (-z*x + w*y)/(y*x)

Least multiplication/division steps, could be a goal?
And then alphabetical order preservation?

I'm really only guessing here, didn't benchmark anything,
```
and also didn't think through any commutativity and distributivity implications.
```
? type(a/b-c/d)
%16 = "t_POL"
? type(b/a-d/c)
%17 = "t_RFRAC"

-- Ruud

```