The math library is one of the most commonly used libraries in python. With math being such a crucial aspect of coding everywhere and keeping the goal of VOC in mind, I am willing to devote my time to implement these two important libraries.
As of now, there are no implementations of these two libraries what so ever. I have planned to split the timeline into two; One-half for implementing cmath and the other for math.
Implementation
The math Library
In reference to the Python documentation, there is a total of 44 methods and 5 constants, out of which 22 methods and 3 constants do not translate directly to the java.lang.Math class.
Among the 23 methods and 3 constants, I have divided them into two parts,
Easy Ones:
Under the easy ones come the [fsum()](), [sum()](), [gcd()](), [isfinite()](), [ininf()](), [isnan()](), [fmod()](), [modf()](), [trunc()](), [acosh()](), [asinh()](), and [atanh()]() methods.
Implementing [fsum]() is straightforward, there is an implementation of it here. Implementations of fmod, acosh, asinh, and atanh are simple as well, as there are formulas for them.
Harder Ones:
Under this category come the, [isclose()](), [factorial()](), [frexp()](), [ldexp()](), [log()](), [log2()](), [erf()](), [erfc()](), [gamma()](), [lgamma()](). The reason that these come under the hard catergory is beacuse of the fact that these functions cannot be directly plugged into an equation. Some manipulation must be done with the values to arrive at the output.
The log() function will need some extra care because you can pass the base as an argument, this will have to be taken into consideration and the respective conversion must be done.
Implementing the gamma and lgamma methods will take some time as I will have to read up on how these equations can be implemented. I will have to learn Stirling's Approximation and Lanczos Approximation to implement the function the least time complexity. When gamma() is implemented, implementing the lgamma() method will be very easy.
The cmath Library
In reference to the python documentation of cmath, there is a total of 23 methods and 7 constants. Unfortunately, Java does not have a class for manipulating complex numbers. Therefore, all of the methods must be implemented from scratch.
The functions that have to be implemented are [phase()](), [polar()](), [rect()](), [exp()](), [log()](), [log10()](), [sqrt()](), [acos()](), [asin()](), [atan()](), [cos()](), [sin()](), [tan()](), [acosh()](), [asinh()](), [atanh()](), [cosh()](), [sinh()](), [tanh()](), [isfinite()](), [isinf()](), [isnan()](), and [isclose()]().
It is difficult to categorize these methods as they all require the same amount of work. They aren't too hard either; Most of them have direct formulas, other require a little bit more work.
Timeline
Community Bonding Period
Get to know my mentors and all the others
Learn the ins and outs of the code base
Learn about the gamma function, draft up an implementation
Learn about finding the logarithm of complex numbers, and come up with an implementation
I wouldn't be able to interact much during this period because of my end semester examinations
Week 1: May 30 - June 2
My summer holidays would have started, I would be able to work for longer hours
Start out with implementing the math library first
Implement the methods that directly translate to the java.lang.Math class.
Week 2: June 5 - 9
I will be able to finish most of the methods this week because of my holidays
Implement the fsum(), sum(), gcd(), isfinite(), isnan(), isinf() methods
Week 3: June 12 - 16
I will finish off the methods falling under the easy category
I will transition into implementing the harder methods this week
Implement isclose(), frexp(), ldexp()
ldexp() is essentially the inverse of frexp(), so this would be easy to implement
I won't be able to work long hours because my classes would have started
Week 5: June 26 - 30
Implement the log methods
Implement log(), and log2()
Implement factorial()
Week 6: July 3 - 7
Implement erf() and erfc()
Week 7: July 10 - 14
Implement gamma() and lgamma() methods
Wrap up the implementation of the math library
Week 8: July 17 - 21
Transition into the implementation of the cmath library
Implement phase(), polar(), and rect(), sqrt()
I would be able to implement all these with ease, as they are basic
Week 9: July 24 - 28
Implement the exp(), log(), log10()
Week 10: July 31 - August 4
Implement sin(), cos(), tan(), tanh(), cosh(), and sinh()
I will get help with implementing these functions from here, and here
These methods come after log() because, they are very much dependent on that
Week 11: August 7 - 11
Implement acosh(), asinh(), atanh(), isinf()
Week 12: August 14 - 18
Implement isfinite(), isnan(), and isclose()
This would mark the end of implementing the cmath library
About Me
I am an undergraduate student studying Computer Science, I have been coding from a very young age. I know Java very well, and I know the basics of Python. This is my first time applying for GSoC, honestly, I haven't dealt with open source organizations much. I see this as a great opportunity for me to get to know the world of python and open source. I come up with solutions fairly fast, maintaining my deadline wouldn't be much of a problem with me.
Complete Implementation of math and cmath
Project Goal
The math library is one of the most commonly used libraries in python. With math being such a crucial aspect of coding everywhere and keeping the goal of VOC in mind, I am willing to devote my time to implement these two important libraries.
As of now, there are no implementations of these two libraries what so ever. I have planned to split the timeline into two; One-half for implementing cmath and the other for math.
Implementation
The math Library
In reference to the Python documentation, there is a total of 44 methods and 5 constants, out of which 22 methods and 3 constants do not translate directly to the java.lang.Math class.
Among the 23 methods and 3 constants, I have divided them into two parts,
Easy Ones:
Under the easy ones come the [fsum()](), [sum()](), [gcd()](), [isfinite()](), [ininf()](), [isnan()](), [fmod()](), [modf()](), [trunc()](), [acosh()](), [asinh()](), and [atanh()]() methods. Implementing [fsum]() is straightforward, there is an implementation of it here. Implementations of fmod, acosh, asinh, and atanh are simple as well, as there are formulas for them.
Harder Ones:
Under this category come the, [isclose()](), [factorial()](), [frexp()](), [ldexp()](), [log()](), [log2()](), [erf()](), [erfc()](), [gamma()](), [lgamma()](). The reason that these come under the hard catergory is beacuse of the fact that these functions cannot be directly plugged into an equation. Some manipulation must be done with the values to arrive at the output.
The log() function will need some extra care because you can pass the base as an argument, this will have to be taken into consideration and the respective conversion must be done.
Implementing the gamma and lgamma methods will take some time as I will have to read up on how these equations can be implemented. I will have to learn Stirling's Approximation and Lanczos Approximation to implement the function the least time complexity. When gamma() is implemented, implementing the lgamma() method will be very easy.
The cmath Library
In reference to the python documentation of cmath, there is a total of 23 methods and 7 constants. Unfortunately, Java does not have a class for manipulating complex numbers. Therefore, all of the methods must be implemented from scratch.
The functions that have to be implemented are [phase()](), [polar()](), [rect()](), [exp()](), [log()](), [log10()](), [sqrt()](), [acos()](), [asin()](), [atan()](), [cos()](), [sin()](), [tan()](), [acosh()](), [asinh()](), [atanh()](), [cosh()](), [sinh()](), [tanh()](), [isfinite()](), [isinf()](), [isnan()](), and [isclose()]().
It is difficult to categorize these methods as they all require the same amount of work. They aren't too hard either; Most of them have direct formulas, other require a little bit more work.
Timeline
Community Bonding Period
Week 1: May 30 - June 2
Week 2: June 5 - 9
Week 3: June 12 - 16
Week 4: June 19 - 23
Week 5: June 26 - 30
Week 6: July 3 - 7
Week 7: July 10 - 14
Week 8: July 17 - 21
Week 9: July 24 - 28
Week 10: July 31 - August 4
Week 11: August 7 - 11
Week 12: August 14 - 18
About Me
I am an undergraduate student studying Computer Science, I have been coding from a very young age. I know Java very well, and I know the basics of Python. This is my first time applying for GSoC, honestly, I haven't dealt with open source organizations much. I see this as a great opportunity for me to get to know the world of python and open source. I come up with solutions fairly fast, maintaining my deadline wouldn't be much of a problem with me.
Contributions to VOC : PR #489
email - aakash3697@gmail.com