{"id":18847792,"url":"https://github.com/jacobwilliams/fmin","last_synced_at":"2026-01-27T05:05:08.409Z","repository":{"id":40310130,"uuid":"431550685","full_name":"jacobwilliams/fmin","owner":"jacobwilliams","description":"Derivative free 1D function minimizer in modern Fortran","archived":false,"fork":false,"pushed_at":"2024-01-23T18:09:57.000Z","size":643,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-30T13:57:09.833Z","etag":null,"topics":["brent","fortran-package-manager","minimization"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobwilliams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-11-24T16:13:18.000Z","updated_at":"2022-10-19T01:18:54.000Z","dependencies_parsed_at":"2023-12-09T17:26:17.561Z","dependency_job_id":"758be19c-4c06-4e91-b78a-6961651fc086","html_url":"https://github.com/jacobwilliams/fmin","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Ffmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobwilliams","download_url":"https://codeload.github.com/jacobwilliams/fmin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239783786,"owners_count":19696442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brent","fortran-package-manager","minimization"],"created_at":"2024-11-08T03:09:42.215Z","updated_at":"2026-01-27T05:05:03.383Z","avatar_url":"https://github.com/jacobwilliams.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"![stl-fortran](media/logo.png)\n============\n\nDerivative free 1D function minimizer in modern Fortran\n\n### Status\n\n[![Language](https://img.shields.io/badge/-Fortran-734f96?logo=fortran\u0026logoColor=white)](https://github.com/topics/fortran)\n[![GitHub release](https://img.shields.io/github/release/jacobwilliams/fmin.svg)](https://github.com/jacobwilliams/fmin/releases/latest)\n[![Build Status](https://github.com/jacobwilliams/fmin/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/fmin/actions)\n[![codecov](https://codecov.io/gh/jacobwilliams/fmin/branch/master/graph/badge.svg)](https://codecov.io/gh/jacobwilliams/fmin)\n[![last-commit](https://img.shields.io/github/last-commit/jacobwilliams/fmin)](https://github.com/jacobwilliams/fmin/commits/master)\n\n### Compiling\n\nA [Fortran Package Manager](https://github.com/fortran-lang/fpm) manifest file is included, so that the library and test cases can be compiled with FPM. For example:\n\n```\nfpm build --profile release\nfpm test --profile release\n```\n\nBy default, the library is built with double precision (`real64`) real values. Explicitly specifying the real kind can be done using the following preprocessor flags:\n\nPreprocessor flag | Kind  | Number of bytes\n----------------- | ----- | ---------------\n`REAL32`  | `real(kind=real32)`  | 4\n`REAL64`  | `real(kind=real64)`  | 8\n`REAL128` | `real(kind=real128)` | 16\n\nFor example, to build a single precision version of the library, use:\n\n```\nfpm build --profile release --flag \"-DREAL32\"\n```\n\nTo use `fmin` within your fpm project, add the following to your `fpm.toml` file:\n```toml\n[dependencies]\nfmin = { git=\"https://github.com/jacobwilliams/fmin.git\" }\n```\n\n### Example\n\n```fortran\nprogram test\n\nuse fmin_module\nuse iso_fortran_env, only: wp =\u003e real64 ! double precision\n\nreal(wp) :: xmin, xerr\n\nreal(wp),parameter :: ax  = -4.0_wp       ! lower bound\nreal(wp),parameter :: bx  = 0.0_wp        ! upper bound\nreal(wp),parameter :: tol = 1.0e-8_wp     ! tolerance\nreal(wp),parameter :: pi  = acos(-1.0_wp) ! pi\nreal(wp),parameter :: x  = -pi/2.0_wp     ! true answer\n\nxmin = fmin(func,ax,bx,tol) ! compute the minimum\n\nxerr = xmin - x  ! difference from true value\n\nwrite(*,*) 'xmin       = ', xmin\nwrite(*,*) 'xmin exact = ', x\nwrite(*,*) 'xmin error = ', xerr\n\ncontains\n\n    function func(x) result(f)\n\n    implicit none\n\n    real(wp),intent(in) :: x  !! indep. variable\n    real(wp)            :: f  !! function value `f(x)`\n\n    f = sin(x)\n\n    end function func\n\nend program test\n```\n\nThe output is:\n\n```text\n xmin       =   -1.5707963254967554\n xmin exact =   -1.5707963267948966\n xmin error =    1.2981411501300499E-009\n```\n\n### Documentation\n\n * The API documentation for the current ```master``` branch can be found [here](https://jacobwilliams.github.io/fmin/).  This is generated by processing the source files with [FORD](https://github.com/Fortran-FOSS-Programmers/ford).\n\n### License\n\n * The Fmin source code and related files and documentation are distributed under a permissive free software [license](https://github.com/jacobwilliams/fmin/blob/master/LICENSE) (BSD-3).\n\n### See also\n\n  * Richard Brent, \"[Algorithms for Minimization Without Derivatives](https://maths-people.anu.edu.au/~brent/pub/pub011.html)\",\n    Prentice - Hall, Inc. (1973)\n  * [fmin from Netlib](http://www.netlib.org/fmm/fmin.f)\n  * [roots-fortran](https://github.com/jacobwilliams/roots-fortran) (1D derivative-free roots solvers)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Ffmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobwilliams%2Ffmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Ffmin/lists"}