Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple numerical methods for root finding and differentiation #451

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

sharkdp
Copy link
Owner

@sharkdp sharkdp commented Jun 4, 2024

This PR adds three functions:

  • fn root_bisect<A: Dim, B: Dim>(f: Fn[(A) -> B], x1: A, x2: A, x_tolerance: A, y_tolerance: B) -> A
  • fn root_newton<A: Dim, B: Dim>(f: Fn[(A) -> B], f_prime: Fn[(A) -> B/A], x0: A, y_tolerance: B) -> A
  • fn diff<X: Dim, Y: Dim>(f: Fn[(X) -> Y], x: X) -> Y / X

for simple numerical tasks

image

image

@sharkdp sharkdp merged commit 8540b79 into master Jun 4, 2024
15 checks passed
@sharkdp sharkdp deleted the basic-numerics branch June 4, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant