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
Closed
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0943177
create directory
jrreed83 Jul 24, 2018
cbba8a7
initial commit
jrreed83 Jul 30, 2018
8f4c48c
initial commit
jrreed83 Jul 30, 2018
4458d51
add content
jrreed83 Aug 6, 2018
bbe6702
changed long function from dash to underscore
jrreed83 Aug 6, 2018
3da1a52
jrr
jrreed83 Aug 7, 2018
48fe866
merge functions
jrreed83 Aug 8, 2018
b810b92
merge functions
jrreed83 Aug 8, 2018
ab374bf
remove the local files
jrreed83 Aug 8, 2018
4f8f86c
adding more support
jrreed83 Aug 14, 2018
d589fd2
start another support function
jrreed83 Aug 16, 2018
4cfec44
another support function
jrreed83 Aug 18, 2018
41d646b
update
jrreed83 Sep 7, 2018
c4724d5
starting to test
jrreed83 Oct 6, 2018
411d675
jrr
jrreed83 Oct 9, 2018
3a12c6f
adding tests
jrreed83 Oct 9, 2018
e8e5bba
need to fix tests
jrreed83 Oct 10, 2018
35f0078
got rid of destructuring in main.js
jrreed83 Oct 22, 2018
c1606c3
modifying README.md
jrreed83 Oct 28, 2018
6f08939
added toc to benchmark
jrreed83 Oct 28, 2018
04d8520
moved some early return statement above some other operations
jrreed83 Oct 28, 2018
752030a
moved some early return statement above some other operations
jrreed83 Oct 28, 2018
4051c70
unwrapped multiline comment
jrreed83 Oct 28, 2018
4d90da7
disabled max-len eslint rule for single line
jrreed83 Oct 29, 2018
6b93501
simplifying negative int check
jrreed83 Oct 29, 2018
2e3c32a
simplified if/else statement
jrreed83 Oct 29, 2018
8bbe6f7
forgot to initialize sum variable in hyp2f1NegCEqualBC
jrreed83 Oct 29, 2018
3de7c47
forgot return statement
jrreed83 Oct 29, 2018
a5d9ebe
switched some testing to see if something changes
jrreed83 Oct 29, 2018
eae5660
switched some testing to see if something changes
jrreed83 Oct 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions lib/node_modules/@stdlib/math/base/special/hyp2f1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!--
@license Apache-2.0
Copyright (c) 2018 The Stdlib Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# hyp2f1

> Evaluate Gaussian hypergeometric function
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

The Gaussian hypergeometric function is defined as

<!-- <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."> -->

<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">
<img src="https://cdn.rawgit.com/stdlib-js/stdlib/65a72b6be80b988ebfa5e581849691524b01a533/lib/node_modules/@stdlib/math/base/special/hyp2f1/docs/img/equationgaussian_hypergeometric_function.svg" alt="Equation for Gaussian hypergeometric function.">
<br>
</div>

<!-- </equation> -->

</section>

<!-- /.intro -->

<!-- Package usage documentation. -->

<section class="usage">

## Usage

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

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

Evaluates the Gaussian hypergeometric function.

```javascript
var v = hyp2f1( 1.0, 1.0, 1.0, 0.0 );
// returns 1.0
```

</section>

<!-- /.usage -->

<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- Package usage examples. -->

<section class="examples">

## Examples

<!-- 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.

```

</section>

<!-- /.examples -->

<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="references">

</section>

<!-- /.references -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

</section>

<!-- /.links -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var isnan = require( '@stdlib/random/base/randu' );
var pkg = require( './../package.json' ).name;
var hyp2f1 = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
var i;
var y;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
y = hyp2f1( 1.0, 1.0, 1.0, 0.0 );
if ( isnan( y ) ) {
b.fail( 'something went wrong' );
}
}
b.toc();
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).

b.end();
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions lib/node_modules/@stdlib/math/base/special/hyp2f1/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

{{alias}}( a, b, c, x )
TODO: short desc.
Copy link
Member

Choose a reason for hiding this comment

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

File needs updating.


TODO: longer desc/bkgd.

List:

- item 1
- item 2

Parameters
----------
a: number
TODO: desc
b: number
c: number
x: number

Returns
-------
y: number
TODO: desc

Examples
--------
> var TODO = {{alias}}()
TODO: abbrev output

References
----------
- TODO: only include reference(s) if usage requires citation(s)

See Also
--------

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

var hyp2f1 = require( './../lib' );

var y;

y = hyp2f1( 1.0, 1.0, 1.0, 0.0 );
Copy link
Member

Choose a reason for hiding this comment

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

I believe this file is currently being used to check that the implementation works. I'll leave this comment here as a TODO that this file needs updating (e.g., random values, etc).

console.log( 'hyp2f1( 1.0, 1.0, 1.0, 0.0) = %d', y );
40 changes: 40 additions & 0 deletions lib/node_modules/@stdlib/math/base/special/hyp2f1/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

/**
* Evaulation of Gaussian hypergoemetric function.
*
* @module @stdlib/math/base/special/hyp2f1
*
* @example
* var hyp2f1 = require( '@stdlib/math/base/special/hyp2f1' );
*
* var v = hyp2f1( 1.0, 1.0, 1.0, 0.0 );
* // returns 1.0
*/

// MODULES //

var hyp2f1 = require( './main.js' );


// EXPORTS //

module.exports = hyp2f1;
Loading