> On 10 Jan 2020, at 18:12, Gilles Sadowski <gillese...@gmail.com> wrote:
> 
>> ...
> 
> IIUC, precision (without resorting to "BigDecimal") was the purpose of
> "LinearCombination".  +1 for making the appropriate changes to the
> existing "value" method.
> [I'd suggest to open a JIRA issue and mention the rest of the alternatives
> there, for future reference; but I wouldn't add them to the API until there
> is a need for it.]

OK. If the purpose is precision and to avoid BigDecimal then switching to dot3 
seems the best option as it performs one pass over the round-off errors to 
improve the summation in the case of badly conditioned dot products. This is an 
alternative to sorting the input products before (and during) summing and 
faster.

I’ll write the code to allow expansion to dot4, dot5, etc but not add this to 
the API.

Previously I used the timings from the summation only for the 2.2x slower 
estimate. The timings for the dot product are better. Dot2 to dot3 should be 
12.5 to 18.5 so about 50% slower (table 6.5 in Ogita’s paper).

I am going to set up a JMH module for numbers as I would like to benchmark the 
operations in Complex. This is for reference with regard to the idea to create 
the previously discussed ComplexList that stores the numbers as primitive 
arrays and then does operations by creating instances of Complex and then 
returning the results to the primitive arrays. I hope to show that for most 
operations the overhead of creating Complex objects is negligible. There may be 
cases where special implementations would be useful such as multiply or divide 
of two lists in a paired operation.

I was going to use the format from [rng] for the JMH module thus:

commons-numbers/commons-numbers-examples/examples-jmh

However I do not have any other examples. So perhaps just a single child module 
that is included via a profile as it need not be a distributed artifact:

commons-numbers/commons-numbers-mmh

WDYT?

I can build the new LinearCombination methods and put the old ones in the jmh 
project with a test of relative speed.

Then I’ll get back to Complex (which is nearing completion) and the ComplexList.

Alex


Reply via email to