Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fmin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fmin

Unconstrained funcion minimization in Javascript

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
144K
decreased by-0.31%
Maintainers
1
Weekly downloads
 
Created

What is fmin?

The fmin npm package is a JavaScript library for function minimization. It provides tools to find the minimum value of a function, which is useful in various optimization problems.

What are fmin's main functionalities?

Unconstrained Minimization

This feature allows you to find the minimum of an unconstrained function using the Nelder-Mead algorithm. In this example, the function (x - 3)^2 is minimized, and the result should be close to x = 3.

const fmin = require('fmin');

function quadratic(x) {
  return (x - 3) * (x - 3);
}

const result = fmin.nelderMead(quadratic, [0]);
console.log(result);

Multidimensional Minimization

This feature allows you to minimize functions of multiple variables. The example uses the Rosenbrock function, a common test problem for optimization algorithms, and finds the minimum in a 2D space.

const fmin = require('fmin');

function rosenbrock(x) {
  return 100 * (x[1] - x[0] * x[0]) * (x[1] - x[0] * x[0]) + (1 - x[0]) * (1 - x[0]);
}

const result = fmin.nelderMead(rosenbrock, [-1, 1]);
console.log(result);

Other packages similar to fmin

Keywords

FAQs

Package last updated on 29 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc