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


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

expression normalization



? (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)