npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

calculus-algorithms

v0.0.4

Published

A subset of Calculus algorithms

Downloads

24

Readme

Calculus Algorithms

This library includes various algorithms for calculus.

Currently it's in heavy development and only few are implemented.

Just wait many more algorithms are coming soon!

If you want, you can contribute too!

If you like this library don't forget to start the repository!

calculus-algorithms / Modules

calculus-algorithms

Table of contents

Modules

Module: differentiation

Functions

backwardDiff

backwardDiff(fx, x, h?): number

Remarks

This is a numerical method.

Example

backwardDiff(Math.log, 7)

backwardDiff(func1, 3, 0.0001)

const func1 = (arg0: number): number => {
  return 1 / (1 + arg0 * arg0)
}

Parameters

| Name | Type | Default value | Description | | :--- | :----------------------------- | :------------ | :------------------------------------- | | fx | (arg0: number) => number | undefined | Function to differentiate. | | x | number | undefined | Differentiate at this given value. | | h | number | 0.0001 | Optional parameter - step size to use. |

Returns

number

differentiation of given function at given value.

Defined in

differentiation/backwardDividedDifference.ts:22


centralDiff

centralDiff(fx, x, h?): number

Remarks

This is a numerical method.

Example

centralDiff(Math.log, 7)

centralDiff(func1, 3, 0.0001)

const func1 = (arg0: number): number => {
  return 1 / (1 + arg0 * arg0)
}

Parameters

| Name | Type | Default value | Description | | :--- | :----------------------------- | :------------ | :------------------------------------- | | fx | (arg0: number) => number | undefined | Function to differentiate. | | x | number | undefined | Differentiate at this given value. | | h | number | 0.0002 | Optional parameter - step size to use. |

Returns

number

differentiation of given function at given value.

Defined in

differentiation/centralDividedDifference.ts:22


differentiate

differentiate(expression): string

Remarks

This is a not a numerical method.

Example

diff("4x^3 - 3x^1 + 2x^2")

Parameters

| Name | Type | Description | | :----------- | :------- | :--------------------------- | | expression | string | Expression to differentiate. |

Returns

string

differentiation of given expression.

Defined in

differentiation/differentiate.ts:48


forwardDiff

forwardDiff(fx, x, h?): number

Remarks

This is a numerical method.

Example

forwardDiff(Math.log, 7)

forwardDiff(func1, 3, 0.0001)

const func1 = (arg0: number): number => {
  return 1 / (1 + arg0 * arg0)
}

Parameters

| Name | Type | Default value | Description | | :--- | :----------------------------- | :------------ | :------------------------------------- | | fx | (arg0: number) => number | undefined | Function to differentiate. | | x | number | undefined | Differentiate at this given value. | | h | number | 0.0001 | Optional parameter - step size to use. |

Returns

number

differentiation of given function at given value.

Defined in

differentiation/forwardDividedDifference.ts:22


Module: integration

Functions

simpsonOneThird

simpsonOneThird(func, lowerLimit, upperLimit): number

Example

simpsonOneThird(Math.log, 4, 5.2)

simpsonOneThird(func1, 0, 1)

const func1 = (arg0: number): number => {
  return 1 / (1 + arg0 * arg0)
}

Parameters

| Name | Type | Description | | :----------- | :----------------------------- | :------------------------------- | | func | (arg0: number) => number | Function to integrate | | lowerLimit | number | Lower limit to integrate within. | | upperLimit | number | Upper limit to integrate within. |

Returns

number

integration of given function within given limits.

Defined in

integration/simpsonOneThird.ts:19


simpsonThreeEighth

simpsonThreeEighth(func, lowerLimit, upperLimit): number

Example

simpsonThreeEighth(Math.log, 4, 5.2)

simpsonThreeEighth(func1, 0, 1)

const func1 = (arg0: number): number => {
  return 1 / (1 + arg0 * arg0)
}

Parameters

| Name | Type | Description | | :----------- | :----------------------------- | :------------------------------- | | func | (arg0: number) => number | Function to integrate | | lowerLimit | number | Lower limit to integrate within. | | upperLimit | number | Upper limit to integrate within. |

Returns

number

integration of given function within given limits.

Defined in

integration/simpsonThreeEighth.ts:19


trapezoidalRule

trapezoidalRule(func, lowerLimit, upperLimit): number

Example

trapezoidalRule(Math.log, 4, 5.2)

trapezoidalRule(func1, 0, 1)

const func1 = (arg0: number): number => {
  return 1 / (1 + arg0 * arg0)
}

Parameters

| Name | Type | Description | | :----------- | :----------------------------- | :------------------------------- | | func | (arg0: number) => number | Function to integrate | | lowerLimit | number | Lower limit to integrate within. | | upperLimit | number | Upper limit to integrate within. |

Returns

number

integration of given function within given limits.

Defined in

integration/trapezoidal.ts:19