Jacques Gélinas on Sun, 17 Jun 2018 06:49:42 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Rational functions equal almost everywhere, but not for "subst"
|
- To: "pari-users@pari.math.u-bordeaux.fr" <pari-users@pari.math.u-bordeaux.fr>
- Subject: Rational functions equal almost everywhere, but not for "subst"
- From: Jacques Gélinas <jacquesg00@hotmail.com>
- Date: Sun, 17 Jun 2018 04:49:36 +0000
- Accept-language: fr-CA, en-US
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=jacquesg00@hotmail.com;
- Delivery-date: Sun, 17 Jun 2018 06:49:42 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mHIPgV47d/de8/WZQT9N0EjWI0QalY0jmtyXFDX8guo=; b=Xum3tQAoVyk0f8PGTH/8dCoqysproYMCsU2yw16ja7YrErnlshwCSFWuoirpPoB5FmVrBzk2g0uPkhNmwhQ75FJ683EcZKKmBUfGEhEub8PPHjGOiT8GfONstIbHglY1G9J7EVvUjYoFwd+sKfki4zWHuZLvqEfOUqPwveZ3msnYi/6MSO4bgZPyWodjl1onHxuuyvaAGoLstEvSEd2kSlOFmGAUksD90D0QwdEstDhWjux4oXMaKNdszZiIgKcuhsF1W5jghfs4DFMbA6jgDlnYl4Dy+aPdw1kDCLS1yQuN9tmB9aUkNi8ZyYN2NlQAzzcNDIM7UKAk7VxFL/Fggw==
- Thread-index: AQHUBer8vsJYC8EolkmE215EngQV4w==
- Thread-topic: Rational functions equal almost everywhere, but not for "subst"
A perplexing (bad) use of global variables.
g1(r,R) = R / (2*r+1 - R);
g2(r,R) = a + r;
F(r,a,b,R) = g1(r,a*b*R) / g1(r-1,a*R) * g2(r,a*b*R) / g2(r-1,a*b*R) ;
G(r,a,b,R) = b * (2*r-1-a*R) / (2*r+1-a*b*R) * g2(r,a*b*R) / g2(r-1,a*b*R) ;
G(r,a,b,R) == F(r,a,b,R) \\ identical !
1
G(r,0,b,R) == subst(F(r,a,b,R),a,0) \\ not equal ??? (:-(
0
G(r,0,b,R) == (2*b*r^2 + (2*b*a - b)*r - b*a)/(2*r^2 + (2*a - 1)*r + (a - 1))
1
subst(F(r,a,b,R),a,0) == (2*b*r^2 - b*r)/(2*r^2 - r - 1)
1
g2(r,R) = a + 1;
G(r,a,b,R) == F(r,a,b,R) \\ identical !
1
G(r,0,b,R) == subst(F(r,a,b,R),a,0) \\ equal (:-)
1
Could someone explain why the substitution fails with the first definition of "g2" ?
(This problem occurs with GP 2.9.4, but not with GP 2.4.1).
Jacques Gélinas