[Sollya-users] information, features regarding remez and fplll

JonT jtid4576 at uni.sydney.edu.au
Fri Jun 15 08:46:21 CEST 2018


Thank you Sylvain for your response.

I will try to give some motivation for my thinking about rational 
approximations and caching.

There is a result deriving an O(14,14) rational polynomial with a 
transform of $log_e(x)$ for a non-analytic function. I believe the 
published coefficients are simply round-to-nearest. The paper asserts 
that a simple polynomial of O(53) was found, but even using high 
precision division its obviously much cheaper to compute the rational 
polynomial.

This function is then evaluated many times in a numerical computation, 
so some effort to optimise it seems worthwhile.

But thats a large piece of work, as an example that can be added to a 
repository of examples ...

How about the natural logarithm itself, targeting single precision (few 
terms, simple, quick) ?

thanks,
  - JonT



On 14/6/18 8:06 pm, Sylvain CHEVILLARD wrote:
> Hi.
>
> I am answering your questions sequentially below.
>
>> I have a number of approximations to make, many of which I have 
>> explorerd in Mathematica and the results look promising. I now have 
>> several variations for which I'd like (semi) optimised floating point 
>> coefficients not just arbitrary precision coefficients.
>>
>> It seems like sollya should help me find the optimised coefficients, 
>> but from my perusal of the online documentation, I dont quite see how.
>>
> Yes indeed, Sollya is the perfectly appropriate tool for that.
>
>> I have three features I'd like to use that I cant see in the online 
>> documentation for sollya:
>>
>> 1) rational polynomial approximations, all the documentation suggests 
>> only simple polynomials
>>
>
> Unfortunately, Sollya does not handle yet rational approximation. 
> Nevertheless, if you computed a rational approximation to a function 
> from another tool, we still can try to manually trick Sollya and its 
> fpminimax function to get a good rational approximation with 
> floating-point coefficients, by handling separately the numerator and 
> denominator. I never did it, though, but I would be glad to help you 
> by looking together at an example if you wish.
>
>> 2) simple change-of-variable/transform
>
> What do you mean? If you have to functions f and g given by 
> expressions, you can construct the composition f o g of both functions 
> in Sollya by doing f(g). This should be enough to perform any change 
> of variable, isn't it?
>>
>> 3) separate control of precision for different coefficients (Im NOT 
>> expecting automatic handling of complexities of variable precision of 
>> double-double)
>>
> The fpminimax function allows you to look for a polynomial 
> approximation with machine-representable coefficients, with each 
> coefficient having its own format (they can be floating-point or 
> fixed-point coefficients of any precision; the only constraint is that 
> you cannot easily mix floating-point *and* fixed-point coefficients in 
> the same polynomial, though, again, we could do things by hand in such 
> a situation).
>
>> It may be that all are present, but not directly referred to in the 
>> documentation.
>>
>> I think a simple change of variable may be implemented by a list of 
>> terms like [| 1, h(x), h(x)^2, ... , h(x)^n |] but this will get 
>> tedious and messy with rational polynomials, and I'm not sure if the 
>> implementation caches the evaluation of h(x) in this scenario.
>
> This is indeed the way of doing it. You are right, we start reaching 
> the limit of Sollya's design here. We welcome any constructive remark 
> or feature request.
> About caching the evaluation of h(x), there is nothing like that, but 
> again, if this is an issue, we could think of more or less dirty 
> solutions.
>
>>
>> It may be that the best solution is not use remez in Sollya, but to 
>> import predetermined high precision coefficients and then use sollya 
>> (and indirectly fplll) to find (near) optimal floating point 
>> coefficients. But I also don't see documentation for this.
>>
>
> As I said above, if you want to deal with rational approximations, 
> this is definitely the way to do.
>
>> Or am I misinterpreting what sollya is intended to solve ?
>>
>
> No, no, you seem to perfectly interpret the purpose of Sollya. You 
> might simply overestimate a little bit its abilities :-)
> But again, I would be glad to help you handle one of your examples to 
> see if we can trick it (or improve Sollya by adding a new feature).
>
> Sylvain Chevillard



More information about the Sollya-users mailing list