Re: [Numbers] Towards a release?

2019-12-04 Thread Alex Herbert


> On 4 Dec 2019, at 19:06, Eric Barnhill  wrote:
> 
> NUMBERS-136 was a pretty simple fix, I don't think it will interfere with
> anything, so I submitted a PR anyway. Close it if you prefer but I think it
> will be easy to integrate.
> 
> Gilles, I saw no way to request you as reviewer, so only requested Alex.

Re: log10: I fixed it already when working on the C99 compliance. Your fix 
would have worked just as well. However with my fix the method calls Math.log10 
which seems to make more sense.

I have fixed Complex to have 100% coverage. However although we have 100% 
coverage a lot of this is from the test that runs the methods with random 
numbers to check the conjugate equalities. They do not assert the output 
results.

I would like to add a CReferenceTest to go alongside the CStandardTest that 
tests all the functions using a standard C implementation. Just a test using a 
standard non-edge case value such as complex(2, 3). This will test the main 
code path for all functions using non-edge case data. Then perhaps the same 
again using zero for either real or imaginary as this is a problem case that 
can occur (see below).

When looking at edge cases that are not hit I found a difference between the 
java implementation and GNU g++.

If you do this:

ONE.subtract(Complex.ofCartesian(3, 0)) = (-2, 0)

But g++ thinks the answer is (-2, -0).

The sign of the imaginary component of zero is very important for the output of 
some functions.

I added the previously mentioned subtractFromReal(double minuend). This 
computes:

Complex.ofCartesian(3, 0).subtractFromReal(1) = (-2, -0)

The zero is negated and the atanh function now produces the same results as g++.

I’ve not made this function public. But it was previously discussed as being 
part of the C reference. To add, multiply, divide, subtract using real or 
imaginary only components. For subtract this would be:

real - Complex
imaginary - Complex
Complex - real
Complex - imaginary

The subtractFromReal definitely has a use case.

I will have a look at what comes out of g++ for the entire all-vs-all 
combination matrix to see if some computations are not possible with the 
current API.


As for C99 compliance I have used g++ as a reference when in doubt. All the 
functions were previously tested for the listed edge cases with the exception 
of the cis(y) functionality which I have added. However all the functions (op) 
must implement the conjugate equality:

conj(op(z)) = op(conj(z))

So there are edge case not listed in the references we did not implement. For 
example:

atanh(inf, inf) = 0 + i pi/2

Therefore the conjugate is:

atanh(inf, -inf) = 0 + i -pi/2


I added all the cases to the tests for conjugates as well. I also enforced the 
conjugate equality for all computations when the imaginary is not NaN. So I 
think I have added too many cases as some are effectively doubled. I will look 
again tomorrow with fresh eyes and strip redundant tests.

I have only looked at the C99 functions. I have not looked at:

pow*
reciprocal
nthRoot

There is no reference for these. Although pow is in the reference it doesn’t 
have edge cases. I can check pow against g++ for all the edge cases. The 
reciprocal could be tested using 1 / z. So I’ll try that.

The only item from the C99 reference I have not tested is the odd / even of the 
functions, e.g:

‘ctanh is odd’ or ‘ccosh is even’

I think this means:

Even: f(z) = f(-z)
Odd: f(z) = -f(-z)

This relates to reflections of the function. A quick check using g++ shows that 
this is true. I will look at adding this test tomorrow.

So Complex is better than it was. But still needs some work.

Alex



-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [Numbers] Towards a release?

2019-12-04 Thread Eric Barnhill
NUMBERS-136 was a pretty simple fix, I don't think it will interfere with
anything, so I submitted a PR anyway. Close it if you prefer but I think it
will be easy to integrate.

Gilles, I saw no way to request you as reviewer, so only requested Alex.

On Tue, Dec 3, 2019 at 3:37 PM Alex Herbert 
wrote:

> On Tue, 3 Dec 2019, 17:58 Gilles Sadowski,  wrote:
>
> > Hello.
> >
> > Le mar. 3 déc. 2019 à 18:33, Eric Barnhill  a
> > écrit :
> > >
> > > It seems like we're pretty close.
> > >
> > > I can take a look at 136, 137 related to log. I have had trouble
> finding
> > > the space to launch the regression project. But I could work on some
> > > smaller things.
> >
> > Great. ;-)
> >
>
> Hi Eric,
>
> I have another bunch of changes to complex to push. I'll do this tomorrow
> and then I think the c99 standard is almost done. There are a few
> outstanding items that I was investigating today. I'll provide a status
> update with a bit more time tomorrow. I don't think any work on the log
> functions will clash with what I have done but it would be simpler if I
> push first as I have tweaked a lot of the c99 functions and it may affect
> the log function.
>
> Alex
>
>
>
> > >
> > > Regarding 70, the user guide, what do you think of submitting an
> > > application to Google Season of Docs?
> >
> > It would be nice, but probably low(er) priority; in effect, having split
> > off
> > several components out of Commons Math has the nice (IMO) side-effect
> > that any of them is easier to grasp, and figuring out what it does and
> how
> > to use it is in general relatively straightforward.
> > Moreover, most developers looking for such tools don't have to be told
> what
> > a complex number is, and (maven) modules make it easy to navigate the
> > code base.
> >
> > > I can initiate if you have had quite
> > > enough of that sort of thing.
> >
> > Indeed, delegating documentation tasks was often more work than it would
> > have been doing it! :-}
> >
> > However, a user guide for "Commons Geometry" is on the TODO list.[1]
> > You should then coordinate with Matt.
> >
> > Thanks,
> > Gilles
> >
> > [1] https://issues.apache.org/jira/browse/GEOMETRY-73
> >
> >
> > >
> > > Eric
> > >
> > >
> > > On Tue, Dec 3, 2019 at 7:41 AM Gilles Sadowski 
> > wrote:
> > >
> > > > Hello.
> > > >
> > > > What do you think of releasing "Commons Numbers"?
> > > > Please have a look at the list of pending issues.[1]
> > > >
> > > > Gilles
> > > >
> > > > [1]
> > > >
> >
> https://issues.apache.org/jira/issues/?jql=project%20%3D%20NUMBERS%20AND%20fixVersion%20%3D%201.0%20AND%20statusCategory%20%3D%20new
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >
>


Re: [Numbers] Towards a release?

2019-12-03 Thread Alex Herbert
On Tue, 3 Dec 2019, 17:58 Gilles Sadowski,  wrote:

> Hello.
>
> Le mar. 3 déc. 2019 à 18:33, Eric Barnhill  a
> écrit :
> >
> > It seems like we're pretty close.
> >
> > I can take a look at 136, 137 related to log. I have had trouble finding
> > the space to launch the regression project. But I could work on some
> > smaller things.
>
> Great. ;-)
>

Hi Eric,

I have another bunch of changes to complex to push. I'll do this tomorrow
and then I think the c99 standard is almost done. There are a few
outstanding items that I was investigating today. I'll provide a status
update with a bit more time tomorrow. I don't think any work on the log
functions will clash with what I have done but it would be simpler if I
push first as I have tweaked a lot of the c99 functions and it may affect
the log function.

Alex



> >
> > Regarding 70, the user guide, what do you think of submitting an
> > application to Google Season of Docs?
>
> It would be nice, but probably low(er) priority; in effect, having split
> off
> several components out of Commons Math has the nice (IMO) side-effect
> that any of them is easier to grasp, and figuring out what it does and how
> to use it is in general relatively straightforward.
> Moreover, most developers looking for such tools don't have to be told what
> a complex number is, and (maven) modules make it easy to navigate the
> code base.
>
> > I can initiate if you have had quite
> > enough of that sort of thing.
>
> Indeed, delegating documentation tasks was often more work than it would
> have been doing it! :-}
>
> However, a user guide for "Commons Geometry" is on the TODO list.[1]
> You should then coordinate with Matt.
>
> Thanks,
> Gilles
>
> [1] https://issues.apache.org/jira/browse/GEOMETRY-73
>
>
> >
> > Eric
> >
> >
> > On Tue, Dec 3, 2019 at 7:41 AM Gilles Sadowski 
> wrote:
> >
> > > Hello.
> > >
> > > What do you think of releasing "Commons Numbers"?
> > > Please have a look at the list of pending issues.[1]
> > >
> > > Gilles
> > >
> > > [1]
> > >
> https://issues.apache.org/jira/issues/?jql=project%20%3D%20NUMBERS%20AND%20fixVersion%20%3D%201.0%20AND%20statusCategory%20%3D%20new
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


Re: [Numbers] Towards a release?

2019-12-03 Thread Gilles Sadowski
Hello.

Le mar. 3 déc. 2019 à 18:33, Eric Barnhill  a écrit :
>
> It seems like we're pretty close.
>
> I can take a look at 136, 137 related to log. I have had trouble finding
> the space to launch the regression project. But I could work on some
> smaller things.

Great. ;-)

>
> Regarding 70, the user guide, what do you think of submitting an
> application to Google Season of Docs?

It would be nice, but probably low(er) priority; in effect, having split off
several components out of Commons Math has the nice (IMO) side-effect
that any of them is easier to grasp, and figuring out what it does and how
to use it is in general relatively straightforward.
Moreover, most developers looking for such tools don't have to be told what
a complex number is, and (maven) modules make it easy to navigate the
code base.

> I can initiate if you have had quite
> enough of that sort of thing.

Indeed, delegating documentation tasks was often more work than it would
have been doing it! :-}

However, a user guide for "Commons Geometry" is on the TODO list.[1]
You should then coordinate with Matt.

Thanks,
Gilles

[1] https://issues.apache.org/jira/browse/GEOMETRY-73


>
> Eric
>
>
> On Tue, Dec 3, 2019 at 7:41 AM Gilles Sadowski  wrote:
>
> > Hello.
> >
> > What do you think of releasing "Commons Numbers"?
> > Please have a look at the list of pending issues.[1]
> >
> > Gilles
> >
> > [1]
> > https://issues.apache.org/jira/issues/?jql=project%20%3D%20NUMBERS%20AND%20fixVersion%20%3D%201.0%20AND%20statusCategory%20%3D%20new

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [Numbers] Towards a release?

2019-12-03 Thread Eric Barnhill
It seems like we're pretty close.

I can take a look at 136, 137 related to log. I have had trouble finding
the space to launch the regression project. But I could work on some
smaller things.

Regarding 70, the user guide, what do you think of submitting an
application to Google Season of Docs? I can initiate if you have had quite
enough of that sort of thing.

Eric


On Tue, Dec 3, 2019 at 7:41 AM Gilles Sadowski  wrote:

> Hello.
>
> What do you think of releasing "Commons Numbers"?
> Please have a look at the list of pending issues.[1]
>
> Gilles
>
> [1]
> https://issues.apache.org/jira/issues/?jql=project%20%3D%20NUMBERS%20AND%20fixVersion%20%3D%201.0%20AND%20statusCategory%20%3D%20new
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


Re: [Numbers] Towards a release?

2019-12-03 Thread Alex Herbert

On 03/12/2019 15:41, Gilles Sadowski wrote:

Hello.

What do you think of releasing "Commons Numbers"?
Please have a look at the list of pending issues.[1]

I did not finish work on Complex.

I have some more tests to push from a local dev branch that increase the 
C99 compliance.


I have not yet written some standard coverage tests of the C99 reference 
methods.


I shall get back to working on this and at least push what I have done.

Alex



Gilles

[1] 
https://issues.apache.org/jira/issues/?jql=project%20%3D%20NUMBERS%20AND%20fixVersion%20%3D%201.0%20AND%20statusCategory%20%3D%20new

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



[Numbers] Towards a release?

2019-12-03 Thread Gilles Sadowski
Hello.

What do you think of releasing "Commons Numbers"?
Please have a look at the list of pending issues.[1]

Gilles

[1] 
https://issues.apache.org/jira/issues/?jql=project%20%3D%20NUMBERS%20AND%20fixVersion%20%3D%201.0%20AND%20statusCategory%20%3D%20new

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org