-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8b54f2
commit 0cacf4c
Showing
16 changed files
with
1,857 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
base/tools/evalpoly-compile/lib/templates/evalpoly.float32.js.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
|
||
// MODULES // | ||
|
||
var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' ); | ||
|
||
|
||
// MAIN // | ||
|
||
/** | ||
* Evaluates a polynomial. | ||
* | ||
* ## Notes | ||
* | ||
* - The implementation uses [Horner's rule][horners-method] for efficient computation. | ||
* | ||
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method | ||
* | ||
* @private | ||
* @param {number} x - value at which to evaluate the polynomial | ||
* @returns {number} evaluated polynomial | ||
*/ | ||
function evalpoly( x ) { | ||
if ( x === 0.0 ) { | ||
return {{coefficient}}; | ||
} | ||
return {{horner}};{{eslint}} | ||
} | ||
|
||
|
||
// EXPORTS // | ||
|
||
module.exports = evalpoly; |
Oops, something went wrong.