From: Alan B. <ala...@gm...> - 2025-03-17 11:51:07
|
I note that using alternative power-series package tps, one gets: 1: ps(sqrt((x-y)^2), z,0); |x - y| which is an improvement, but of course this is only correct if x-y is real. However, after on precise_complex; both power-series packages produce (sqrt(x^2-2x*y+y^2) as the first term which is correct, but somewhat messy if x-y is real . I think main problem lies with the simplication of sqrt((x-y)^2) not with the power series packages themselves, although at first sight the differnce in the behaviours of ps and taylor is somewhat puzzling. Note by default sqrt((x-y)^2); produces |x - y| but with precise_complex ON one gets (sqrt(x^2-2x*y+y^2). One might think that the declaration realvalued x,y; should cure the problem, but with precise_complex ON one still gets (sqrt(x^2-2x*y+y^2). Regards Alan On 17/03/2025 03:48, Andrey Ignatenko via Reduce-algebra-developers wrote: > Hello, > > It appears that square root of full square of an expression > under the taylor operator is replaced by the expression and > not its absolute value as it should, > > 1: taylor(sqrt((x-y)^2), s, 0, 1); > 2 > x - y + O(s ) > > Is it a bug or a feature? > > In deciding which sign of the expression to choose taylor seems > to rely on internal order of kernels > > 2: korder y, x; > 3: taylor(sqrt((x-y)^2), s, 0, 1); > 2 > - x + y + O(s ) > > But what should I do in the following case if I have (1-z)>0, > > 4: taylor(sqrt((1-z)^2), s, 0, 1); > 2 > z - 1 + O(s ) > > Is it possible to tell Reduce to put a kernel z after a > literal constants 1? Is there a workaround? > > Thanks in advance. > > Best regards, > Andrey > > > > > > > > _______________________________________________ > Reduce-algebra-developers mailing list > Red...@li... > https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers |