https://github.com/khezen/rootfinding
root-finding library
https://github.com/khezen/rootfinding
brent go golang root-finding
Last synced: 7 days ago
JSON representation
root-finding library
- Host: GitHub
- URL: https://github.com/khezen/rootfinding
- Owner: khezen
- License: mit
- Created: 2018-10-30T22:31:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-22T09:14:10.000Z (about 5 years ago)
- Last Synced: 2024-07-31T20:52:49.581Z (9 months ago)
- Topics: brent, go, golang, root-finding
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 11
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - rootfinding - root-finding algorithms library for finding roots of quadratic functions. (Science and Data Analysis / HTTP Clients)
- zero-alloc-awesome-go - rootfinding - root-finding algorithms library for finding roots of quadratic functions. (Science and Data Analysis / HTTP Clients)
- awesome-go-extra - rootfinding - finding library|7|2|0|2018-10-30T22:31:48Z|2020-03-22T09:14:10Z| (Science and Data Analysis / HTTP Clients)
README
# rootfinding
[](https://godoc.org/github.com/khezen/rootfinding)
[](https://github.com/khezen/rootfinding/actions?query=workflow%3Abuild) [](https://codecov.io/gh/khezen/rootfinding)
[](https://goreportcard.com/report/github.com/khezen/rootfinding)`github.com/khezen/rootfinding`
* Brent's Method
## Example
```golang
package mainimport(
"fmt"
"github.com/khezen/rootfinding"
)func f(x float64) float64 {
return math.Pow(x, 4) - 2*math.Pow(x, 2) + 0.25
}const(
intervalStart = -100
intervalEnd = 100
precision = 6
)
func main(){
root, err := rootfinding.Brent(f, intervalStart, intervalEnd, precision)
if err != nil {
panic(err)
}
fmt.Println(root)
}
``````bash
0.366025403784438
```