Skip to content

Add Gauss hypergeometric function #216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 30 commits into from

Conversation

jrreed83
Copy link
Contributor

@jrreed83 jrreed83 commented Oct 10, 2018

Resolves #122 .

Checklist

Please ensure the following tasks are completed before submitting this pull request.

  • Read, understood, and followed the contributing guidelines, including the relevant style guides.
  • Read and understand the Code of Conduct.
  • Read and understood the licensing terms.
  • Searched for existing issues and pull requests before submitting this pull request.
  • Filed an issue (or an issue already existed) prior to submitting this pull request.
  • Rebased onto latest develop.
  • Submitted against develop branch.

Description

What is the purpose of this pull request?

This pull request:

  • Add support for evaluating the Gauss hypergeometric function.

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.


@stdlib-js/reviewers

@jrreed83
Copy link
Contributor Author

There is still more work to do on testing and documentation, just wanted to get the pull request started.

@kgryte
Copy link
Member

kgryte commented Oct 10, 2018

@jrreed83 Awesome!!!!!!!!!! Thank you so much for working on this!

@kgryte kgryte added Feature Issue or pull request for adding a new feature. Math Issue or pull request specific to math functionality. labels Oct 10, 2018
Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrreed83 Wow! This is great work! Appears some minor work is still left to do, but this is looking great!

If you have not already, you can use the make test-cov TESTS_FILTER=.*/hyp2f1/.* command to generate a test coverage report which can be viewed using make view-cov in order to help write test cases that hit various code paths.

Thanks again for working on this!


<!-- <equation class="equation" label="eq:gaussian_hypergeometric_function" align="center" raw="hyp2f1(a,b,c,z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n}{(c)_n} \frac{z^n}{n!}" alt="Equation for Gaussian hypergeometric function."> -->

<div class="equation" align="center" data-raw-text="hyp2f1(a,b,c,z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n}{(c)_n} \frac{z^n}{n!}" data-equation="eq:gaussian_hypergeometric_function">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div class="equation" align="center" data-raw-text="hyp2f1(a,b,c,z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n}{(c)_n} \frac{z^n}{n!}" data-equation="eq:gaussian_hypergeometric_function">
<div class="equation" align="center" data-raw-text="\operatorname{hyp2f1}(a,b,c,z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n}{(c)_n} \frac{z^n}{n!}" data-equation="eq:gaussian_hypergeometric_function">

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Thanks for looking at it so far. There are definitely some implementation issues to work out because I have a lot of failing tests. I probably just forgot to transfer something over from the C code or something. Thanks for the heads up on the testing command too!


The Gaussian hypergeometric function is defined as

<!-- <equation class="equation" label="eq:gaussian_hypergeometric_function" align="center" raw="hyp2f1(a,b,c,z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n}{(c)_n} \frac{z^n}{n!}" alt="Equation for Gaussian hypergeometric function."> -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<!-- <equation class="equation" label="eq:gaussian_hypergeometric_function" align="center" raw="hyp2f1(a,b,c,z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n}{(c)_n} \frac{z^n}{n!}" alt="Equation for Gaussian hypergeometric function."> -->
<!-- <equation class="equation" label="eq:gaussian_hypergeometric_function" align="center" raw="\operatorname{hyp2f1}(a,b,c,z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n}{(c)_n} \frac{z^n}{n!}" alt="Equation for Gaussian hypergeometric function."> -->


#### hyp2f1( a, b, c, z )

Evaluates the Gaussian hypergeometric function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Evaluates the Gaussian hypergeometric function
Evaluates the Gaussian hypergeometric function.

<!-- eslint no-undef: "error" -->

```javascript
var hyp2f1 = require( '@stdlib/math/base/special/hyp2f1' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated once the examples/index.js file is complete.

b.fail( 'something went wrong' );
}
}
b.pass( 'benchmark finished' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a b.toc(); statement (needed for timing) and an ending assertion (needed to prevent certain compiler optimizations).

# Examples

``` python
python> x = linspace(-1000, 1000, 2001)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example needs to be updated.



def main():

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This empty line can be removed, I believe.

# Basic values:
n = 1000
a = 2*np.ones(n)
b = np.ones(n )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
b = np.ones(n )
b = np.ones(n)

# Basic values:
n = 1000
a = np.ones(n)
b = 2*np.ones(n )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
b = 2*np.ones(n )
b = 2*np.ones(n)

# Basic values:
n = 1000
a = np.ones(n)
b = np.ones(n )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
b = np.ones(n )
b = np.ones(n)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Issue or pull request for adding a new feature. Math Issue or pull request specific to math functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: evaluate the Gauss hypergeometric function
2 participants