[GiNaC-devel] Power laws
Vladimir V. Kisil
V.Kisil at leeds.ac.uk
Tue Jul 28 08:48:09 CEST 2020
Dear Developers,
I am resending actualised versions of my previous patches from
https://www.ginac.de/pipermail/ginac-devel/2020-June/002460.html
The first patch (the exponent power law) has added exam now.
Best wishes,
Vladimir
--
Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/
Book: Geometry of Mobius Maps https://doi.org/10.1142/p835
Soft: Geometry of cycles http://moebinv.sourceforge.net/
Jupyter notebooks: https://github.com/vvkisil/MoebInv-notebooks
>>>>> On Thu, 4 Jun 2020 16:45:56 +0100, "Vladimir V. Kisil" <V.Kisil at leeds.ac.uk> said:
VVK> Dear All,
VVK> Coming back to the previous discussion on exponent/power
VVK> functions I am sending the collection of three patches. The
VVK> first two are corrected/polished versions of two patches
VVK> described in my previous email (see forwarded below). Briefly:
VVK> 1. First patch adds the rule (e^a)^b = e^(ab) to automatic
VVK> evaluation in safe cases.
VVK> 2. Second improves normalisation method for exponents, it is
VVK> able to reduce (exp(2*x)-1)/(exp(x)-1) to exp(x)+1.
VVK> 3. Third patch add the similar functionality for powers, it
VVK> is able to reduce (x-1)/(sqrt(x)-1) to sqrt(x)+1.
VVK> Patches have check components which illustrate further
VVK> examples of normalisation.
VVK> Best wishes, Vladimir -- Vladimir V. Kisil
>>>>> On Fri, 10 Apr 2020 08:43:52 +0100, "Vladimir V. Kisil"
VVK> <V.Kisil at leeds.ac.uk> said:
VVK> Dear Richard,
VVK> Thank you for pointing out an issue with notmalisation of
VVK> expressions. What about the attached _draft_ of the patch? It
VVK> allows to reduce all suitable exponents with arguments
VVK> different by a rational numeric factor to monomials of the same
VVK> temporary variable. Thus it reduces
VVK> (exp(2*x)-1)/(exp(x)-1) to exp(x)+1
VVK> as well as other more complicated cases like
VVK> (exp(15*x)+exp(12*x)+2*exp(10*x)+2*exp(7*x))/(exp(5*x)+exp(2*x))
VVK> to exp(5*x)^2+2*exp(5*x)
VVK> The patch modifies some signatures of functions, which however
VVK> are not advertised as user interface. A footprint on the
VVK> performance with expressions without exponents shall not be
VVK> really noticeable.
VVK> If the approach is suitable I can add a similar behaviour for
VVK> powers, then the simplification
VVK> (a^(2x)-1)/(a^x-1) to a^x+1
VVK> will work as well.
VVK> Some tests shall be added for the final version of the patch.
VVK> Once this will be working, shall we add the automatic
VVK> simplification (a^b)^c=a^(b*c) for suitable cases as well?
VVK> Best wishes, Vladimir -- Vladimir V. Kisil
>>>>> On Thu, 9 Apr 2020 01:51:09 +0200, "Richard B. Kreckel"
VVK> <kreckel at in.terlu.de> said:
RK> Hi Vladimir!
RK> On 06.04.20 14:34, Vladimir V. Kisil wrote:
>>>> Coming back to our previous discussion (with a long history) on
>>>> the power law (e^x)^a=e^(x*a). I am attaching a patch which
>>>> does not break the automatic simplification exp(x)/exp(x)=1.
RK> Your new patch is much better since it doesn't break any
RK> existing test suite.
RK> Playing around with it, it still seems to raise some fundamental
RK> questions: What justifies treating exp(x)^a fundamentally
RK> different than any other (b^x)^a with a (positive) base b? With
RK> the patch, there seems to be this discrimination: exp(x)^5 is
RK> rewritten to exp(5*x) but (b^x)^5 is _not_ rewritten to b^(5*x).
RK> It's a nice pastime to fancy consequences of this. Let y=b^x,
RK> then normal((y^2-1)/(y+1)) returns b^x-1. But if y=exp(x), the
RK> patch prevents the normalization to exp(x)-1. Ugh.
RK> Or, consider this gedankenexperiment: If we didn't have exp(x)
RK> as a function but instead a symbol e, would it be justified to
RK> have special re-writing rules for (e^x)^a but not for (b^x)^a?
RK> I'm not sure...
RK> Best wishes, -richy. -- Richard B. Kreckel
RK> <https://in.terlu.de/~kreckel/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Automatic-evaluation-of-e-t-s-e-ts.patch
Type: text/x-diff
Size: 3123 bytes
Desc: Exponent power law patch
URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20200728/6980133b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Make-a-stronger-normalisation-for-expressions-with-e.patch
Type: text/x-diff
Size: 21253 bytes
Desc: Normalisation of exponent patch
URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20200728/6980133b/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Stronger-normalisation-method-for-powers.patch
Type: text/x-diff
Size: 7232 bytes
Desc: Normalisation for powers patch
URL: <http://www.ginac.de/pipermail/ginac-devel/attachments/20200728/6980133b/attachment-0002.bin>
More information about the GiNaC-devel
mailing list