[math] elementary functions.

2010-06-08 Thread Bill Rossi
Greetings, I have developed over the past year a set of elementary functions similar to those in java.lang.Math, but with the following characteristics: * Higher performance. * Better accuracy. Results are accurate to slightly more that +/- 0.5 ULP. * Pure Java. The standard Math class is i

Re: [math] elementary functions.

2010-06-08 Thread Ted Dunning
Bill, Which functions do you have? Anything more than the standard sin, cos, exp and log? On Tue, Jun 8, 2010 at 6:52 AM, Bill Rossi wrote: > I have developed over the past year a set of elementary functions similar > to those in java.lang.Math, but with the following characteristics: > > * H

Re: [math] elementary functions.

2010-06-08 Thread James Carman
Have you tried looking at StrictMath? On Tue, Jun 8, 2010 at 10:44 AM, Ted Dunning wrote: > Bill, > > Which functions do you have? > > Anything more than the standard sin, cos, exp and log? > > > On Tue, Jun 8, 2010 at 6:52 AM, Bill Rossi wrote: > >> I have developed over the past year a set of

Re: [math] elementary functions.

2010-06-08 Thread Bill Rossi
I've looked at StrictMath, generally Math appears to delegates to StrictMath. StrictMath is implemented by the C fdlibm library. This is what I've implemented to date, the code will compile and run on JDK 1.4 and later. It may work on older JDKs, but I don't have them available for testing.

Re: [math] elementary functions.

2010-06-08 Thread Ted Dunning
Bill, This looks like nice work. Have you considered contributing the code back to Java itself? On Tue, Jun 8, 2010 at 8:29 AM, Bill Rossi wrote: > > I've looked at StrictMath, generally Math appears to delegates to > StrictMath. StrictMath is implemented by the C fdlibm library. > > This is

Re: [math] elementary functions.

2010-06-08 Thread James Carman
That's what I was thinking. We could include it in Commons Math, but it'd be great to see it make it into the language itself (in about 10 years as these things work). On Tue, Jun 8, 2010 at 11:39 AM, Ted Dunning wrote: > Bill, > > This looks like nice work. > > Have you considered contributing

Re: [math] elementary functions.

2010-06-08 Thread Bill Rossi
Thank you, It would be nice to get it into Java, but I have no idea what the process for that is. I'll package up the code, test case, etc and post a link tonight. On Tue, 8 Jun 2010, James Carman wrote: That's what I was thinking. We could include it in Commons Math, but it'd be great

Re: [math] elementary functions.

2010-06-08 Thread James Carman
File a JIRA and attach a patch with test case. That's the best bet for getting your stuff included. On Tue, Jun 8, 2010 at 12:46 PM, Bill Rossi wrote: > > > Thank you, > > It would be nice to get it into Java, but I have no idea what the process > for that is. > > I'll package up the code, test

Re: [math] elementary functions.

2010-06-08 Thread Luc Maisonobe
Le 08/06/2010 17:29, Bill Rossi a écrit : > > I've looked at StrictMath, generally Math appears to delegates to > StrictMath. StrictMath is implemented by the C fdlibm library. > > This is what I've implemented to date, the code will compile and run > on JDK 1.4 and later. It may work on older

Re: [math] elementary functions.

2010-06-08 Thread James Carman
On Tue, Jun 8, 2010 at 2:58 PM, Luc Maisonobe wrote: > Also as you developed it outside of the project, if you want to > contribute it you would have to provide a Software Grant for it (see > from the IP owner, which may be > you or your employer depending

Re: [math] elementary functions.

2010-06-08 Thread Luc Maisonobe
Le 08/06/2010 21:03, James Carman a écrit : > On Tue, Jun 8, 2010 at 2:58 PM, Luc Maisonobe wrote: >> Also as you developed it outside of the project, if you want to >> contribute it you would have to provide a Software Grant for it (see >> from the IP owne

Re: [math] elementary functions.

2010-06-08 Thread James Carman
On Tue, Jun 8, 2010 at 3:14 PM, Luc Maisonobe wrote: > I would say it depends both on the size of the contribution and the fact > it is completely new or a patch on existing code. The examples I know of > are the mantissa library I contributed in 2006, the simplex solver Ben > contributed last yea

Re: [math] elementary functions.

2010-06-08 Thread Luc Maisonobe
Le 08/06/2010 21:16, James Carman a écrit : > On Tue, Jun 8, 2010 at 3:14 PM, Luc Maisonobe wrote: >> I would say it depends both on the size of the contribution and the fact >> it is completely new or a patch on existing code. The examples I know of >> are the mantissa library I contributed in 20

Re: [math] elementary functions.

2010-06-08 Thread Bill Rossi
Luc, I'm OK with providing an ICLA or SGA or both. A bit of history on the project to help you decide what is appropriate: While working for my employer some last year we noticed some of these functions were slow. I quickly wrote a couple of faster replacements. Seperately I decided to t

Re: [math] elementary functions.

2010-06-08 Thread Luc Maisonobe
Le 08/06/2010 23:07, Bill Rossi a écrit : > > Luc, > > I'm OK with providing an ICLA or SGA or both. A bit of history on the > project to help you decide what is appropriate: > > While working for my employer some last year we noticed some of these > functions were slow. I quickly wrote a coup

Re: [math] elementary functions.

2010-06-08 Thread Bill Rossi
Luc, Thanks for your help. I've created a JIRA with the archive attached as you suggest. I understand it will take some time to review this, and I'm willing to make changes if necessary. I will get a SGA and a ICLA over to the Foundation. Bill On Wed, 9 Jun 2010, Luc Maisonobe wrote:

Re: [math] elementary functions.

2010-06-09 Thread Phil Steitz
Luc Maisonobe wrote: > Le 08/06/2010 23:07, Bill Rossi a écrit : >> Luc, >> >> I'm OK with providing an ICLA or SGA or both. A bit of history on the >> project to help you decide what is appropriate: >> >> While working for my employer some last year we noticed some of these >> functions were slow

Re: [math] elementary functions.

2010-06-09 Thread Bill Rossi
This is my guess as to why this wasn't already done in the language. 1.) Only in recent years with advances in JIT technology and larger processor caches does my approach become feasible. Previously, Java code doing this wouldn't receive the same level of optimization. For example the perf

Re: [math] elementary functions.

2010-06-09 Thread James Carman
On Wed, Jun 9, 2010 at 7:55 AM, Bill Rossi wrote: > > 2.) I also think there there is the perception that the existing methods are > good enough, so its probably not a high priority. > Fair enough. Have you thought of approaching the folks at the OpenJDK project? ---

Re: [math] elementary functions.

2010-06-09 Thread Bill Rossi
No it had not occured to me. I can look into that. On Wed, 9 Jun 2010, James Carman wrote: On Wed, Jun 9, 2010 at 7:55 AM, Bill Rossi wrote: 2.) I also think there there is the perception that the existing methods are good enough, so its probably not a high priority. Fair enough. Have

Re: [math] elementary functions.

2010-06-09 Thread James Carman
It seems like Oracle might be a bit more receptive to stuff like this going forward. Good luck! On Wed, Jun 9, 2010 at 9:27 AM, Bill Rossi wrote: > > No it had not occured to me.  I can look into that. > > On Wed, 9 Jun 2010, James Carman wrote: > >> On Wed, Jun 9, 2010 at 7:55 AM, Bill Rossi w

Re: [math] elementary functions.

2010-06-09 Thread Bruce A Johnson
Joe Darcy at Oracle http://blogs.sun.com/darcy/category/Numerics might be a good contact as he has an interest and background in Java numerics and has been overseeing Project Coin which is about small additions to the Java language for JDK 7. Bruce On Jun 9, 2010, at 9:31 AM, James Carma