Skip to content

Commit

Permalink
Correct some typos (#361)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Seiler <[email protected]>
  • Loading branch information
goggle authored Apr 7, 2023
1 parent cb24c79 commit 9deede6
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CHANGES in v0.7.4
* change find_zeros to identify zeros on [a,b], not (a,b). Closes #141.
* bug fix: issue with quad step after a truncated M-step in find_zero(M,N,...)
* bug fix: verbose argument for Bisection method (#139)
* bug fix: unintentional widening of types in intial secant step (#139)
* bug fix: unintentional widening of types in initial secant step (#139)

CHANGES in v0.7.3

Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Documentation for [Roots.jl](https://github.com/JuliaMath/Roots.jl)
## About

`Roots` is a `Julia` package for finding zeros of continuous
scalar functions of a single real variable using floating point numbers. That is solving ``f(x)=0`` for ``x`` adjusting for floating-point idiosyncracies.
scalar functions of a single real variable using floating point numbers. That is solving ``f(x)=0`` for ``x`` adjusting for floating-point idiosyncrasies.

The `find_zero` function provides the
primary interface. It supports various algorithms through the
Expand Down
4 changes: 2 additions & 2 deletions src/Bracketing/bisection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ length is less than or equal to the tolerance `max(δₐ, 2abs(u)δᵣ)` with `u
`max(tol, min(abs(a), abs(b)) * rtol)`. The latter is used only if the default
tolerances (`atol` or `rtol`) are adjusted.
When solving ``f(x,p) = 0`` for ``x^*(p)`` using `Bisection` one can not take the derivative directly via automatatic differentiation, as the algorithm is not differentiable. See [Sensitivity](https://juliamath.github.io/Roots.jl/stable/roots/#Sensitivity) in the documenation for alternatives.
When solving ``f(x,p) = 0`` for ``x^*(p)`` using `Bisection` one can not take the derivative directly via automatatic differentiation, as the algorithm is not differentiable. See [Sensitivity](https://juliamath.github.io/Roots.jl/stable/roots/#Sensitivity) in the documentation for alternatives.
"""
Expand Down Expand Up @@ -223,7 +223,7 @@ function solve!(
ctr += 1
end

# val, stopped = assess_convergence(M, state, options) # udpate val flag
# val, stopped = assess_convergence(M, state, options) # update val flag
α = decide_convergence(M, F, state, options, val)

log_convergence(l, val)
Expand Down
6 changes: 3 additions & 3 deletions src/Derivative/lith.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ julia> find_zero((sin,cos, x->-sin(x)), 3, Roots.LithBoonkkampIJzerman(1,2)) ≈
true
```
The method can be more robust to the intial condition. This example is from the paper (p13). Newton's method (the `S=1`, `D=1` case) fails if `|x₀| ≥ 1.089` but methods with more memory succeed.
The method can be more robust to the initial condition. This example is from the paper (p13). Newton's method (the `S=1`, `D=1` case) fails if `|x₀| ≥ 1.089` but methods with more memory succeed.
```jldoctest lith
julia> fx = ZeroProblem((tanh,x->sech(x)^2), 1.239); # zero at 0.0
Expand Down Expand Up @@ -217,7 +217,7 @@ end

# manufacture initial xs, ys
# use lower memory terms to boot strap up. Secant uses initial default step
#D=0, geneate [x0].x1,...,xs
#D=0, generate [x0].x1,...,xs
function init_lith(
L::LithBoonkkampIJzerman{S,0},
F::Callable_Function{Si,Tup,𝑭,P},
Expand Down Expand Up @@ -407,7 +407,7 @@ function update_state(
d₀ = b - sign(Δ₀) * δ
end

# compare to bisection step; extra function evalution
# compare to bisection step; extra function evaluation
d₁ = a + (b - a) * (0.5) #_middle(a, b)
f₀, f₁ = evalf(F, d₀, 1), evalf(F, d₁, 1)

Expand Down
2 changes: 1 addition & 1 deletion src/Derivative/thukralb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ find_zero((f, f', f'', f'''), big(x0), Roots.Thukral3B()) # 2 iterations; ≈ 8
```
## Refrence
## Reference
*Introduction to a family of Thukral ``k``-order method for finding multiple zeros of nonlinear equations*,
R. Thukral, JOURNAL OF ADVANCES IN MATHEMATICS 13(3):7230-7237, DOI: [10.24297/jam.v13i3.6146](https://doi.org/10.24297/jam.v13i3.6146).
Expand Down
2 changes: 1 addition & 1 deletion src/abstract_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ abstract type AbstractNewtonLikeMethod <: AbstractDerivativeMethod end
abstract type AbstractHalleyLikeMethod <: AbstractDerivativeMethod end
abstract type AbstractΔMethod <: AbstractHalleyLikeMethod end

# deprecated but not clear way to do so, hence these defintions not to be used
# deprecated but not clear way to do so, hence these definitions not to be used
const AbstractBracketing = AbstractBracketingMethod
const AbstractBisection = AbstractBisectionMethod
const AbstractNonBracketing = AbstractNonBracketingMethod
Expand Down
8 changes: 4 additions & 4 deletions src/alternative_interfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Arguments:
* `x0::Number` -- initial guess. For Newton's method this may be complex.
With the `FowardDiff` package derivatives may be computed automatically. For example, defining
With the `ForwardDiff` package derivatives may be computed automatically. For example, defining
`D(f) = x -> ForwardDiff.derivative(f, float(x))` allows `D(f)` to be used for the first derivative.
Keyword arguments are passed to `find_zero` using the `Roots.Newton()` method.
Expand All @@ -42,7 +42,7 @@ Arguments:
* `x0::Number` -- initial guess
With the `FowardDiff` package derivatives may be computed automatically. For example, defining
With the `ForwardDiff` package derivatives may be computed automatically. For example, defining
`D(f) = x -> ForwardDiff.derivative(f, float(x))` allows `D(f)` and `D(D(f))` to be used for the first and second
derivatives, respectively.
Expand All @@ -67,7 +67,7 @@ Arguments:
* `x0::Number` -- initial guess
With the `FowardDiff` package derivatives may be computed automatically. For example, defining
With the `ForwardDiff` package derivatives may be computed automatically. For example, defining
`D(f) = x -> ForwardDiff.derivative(f, float(x))` allows `D(f)` and `D(D(f))` to be used for the first and second
derivatives, respectively.
Expand All @@ -86,7 +86,7 @@ chebyshev_like(f, fp, fpp, x0; kwargs...) =

## --------------------------------------------------

## MATLAB interfcae to find_zero
## MATLAB interface to find_zero
## Main functions are
## * fzero(f, ...) to find _a_ zero of f, a univariate function
## * fzeros(f, ...) to attempt to find all zeros of f, a univariate function
Expand Down
2 changes: 1 addition & 1 deletion src/convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Assess if algorithm has converged.
Return a convergence flag and a Boolean indicating if algorithm has terminated (converged or not converged)
If algrithm hasn't converged this returns `(:not_converged, false)`.
If algorithm hasn't converged this returns `(:not_converged, false)`.
If algorithm has stopped or converged, return flag and `true`. Flags are:
Expand Down
12 changes: 6 additions & 6 deletions src/find_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Interface to one of several methods for finding zeros of a univariate function,
* `x0`: the initial condition (a value, initial values, or bracketing interval)
* `M`: some `AbstractUnivariateZeroMethod` specifying the solver
* `N`: some bracketing method, when specified creates a hybrid method
* `p`: for specifying a paramter to `f`. Also can be a keyword, but a positional argument is helpful with broadcasting.
* `p`: for specifying a parameter to `f`. Also can be a keyword, but a positional argument is helpful with broadcasting.
## Keyword arguments
* `xatol`, `xrtol`: absolute and relatative tolerance to decide if `xₙ₊₁ ≈ xₙ`
* `atol`, `rtol`: absolute and relatative tolerance to decide if `f(xₙ) ≈ 0`
* `xatol`, `xrtol`: absolute and relative tolerance to decide if `xₙ₊₁ ≈ xₙ`
* `atol`, `rtol`: absolute and relative tolerance to decide if `f(xₙ) ≈ 0`
* `maxiters`: specify the maximum number of iterations the algorithm can take.
* `verbose::Bool`: specifies if details about algorithm should be shown
* `tracks`: allows specification of `Tracks` objecs
* `tracks`: allows specification of `Tracks` objects
# Extended help
Expand All @@ -36,7 +36,7 @@ or any iterable with `extrema` defined. A bracketing interval,
# Return value
If the algorithm suceeds, the approximate root identified is
If the algorithm succeeds, the approximate root identified is
returned. A `ConvergenceFailed` error is thrown if the algorithm
fails. The alternate form `solve(ZeroProblem(f,x0), M)` returns `NaN`
in case of failure.
Expand Down Expand Up @@ -458,7 +458,7 @@ function solve!(P::ZeroProblemIterator; verbose=false)
ctr += 1
end

val, stopped = assess_convergence(M, state, options) # udpate val flag
val, stopped = assess_convergence(M, state, options) # update val flag
α = decide_convergence(M, F, state, options, val)

log_convergence(l, val)
Expand Down
10 changes: 5 additions & 5 deletions src/simple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The secant method is an iterative method with update step
given by `b - fb/m` where `m` is the slope of the secant line between
`(a,fa)` and `(b,fb)`.
The inital values can be specified as a pair of 2, as in `(x₀, x₁)` or
The initial values can be specified as a pair of 2, as in `(x₀, x₁)` or
`[x₀, x₁]`, or as a single value, `x₁` in which case a value of `x₀` is chosen.
The algorithm returns m when `abs(fm) <= max(atol, abs(m) * rtol)`.
Expand All @@ -122,7 +122,7 @@ Roots.secant_method(x -> x^5 -x - 1, 1.1)
```
!!! note "Specialization"
This function will specialize on the function `f`, so that the inital
This function will specialize on the function `f`, so that the initial
call can take more time than a call to the `Order1()` method, though
subsequent calls will be much faster. Using `FunctionWrappers.jl` can
ensure that the initial call is also equally as fast as subsequent
Expand Down Expand Up @@ -201,7 +201,7 @@ which both default to `eps(one(typeof(abs(xᵢ))))^4/5` in the appropriate units
Each iteration performs three evaluations of `f`.
The first method picks two remaining points at random in relative proximity of `xᵢ`.
Note that the method may return complex result even for real intial values
Note that the method may return complex result even for real initial values
as this depends on the function.
Examples:
Expand Down Expand Up @@ -352,13 +352,13 @@ end
A more robust secant method implementation
Solve for `f(x) = 0` using an alogorithm from *Personal Calculator Has Key
Solve for `f(x) = 0` using an algorithm from *Personal Calculator Has Key
to Solve Any Equation f(x) = 0*, the SOLVE button from the
[HP-34C](http://www.hpl.hp.com/hpjournal/pdfs/IssuePDFs/1979-12.pdf).
This is also implemented as the `Order0` method for `find_zero`.
The inital values can be specified as a pair of two values, as in
The initial values can be specified as a pair of two values, as in
`(a,b)` or `[a,b]`, or as a single value, in which case a value of `b`
is computed, possibly from `fb`. The basic idea is to follow the
secant method to convergence unless:
Expand Down
2 changes: 1 addition & 1 deletion src/trace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ format. Internally either a tuple of `(x,f(x))` pairs or `(aₙ, bₙ)`
pairs are stored, the latter for bracketing methods. (These
implementation details may change without notice.) The methods
`empty!`, to reset the `Tracks` object; `get`, to get the tracks;
`last`, to get the value convered to, may be of interest.
`last`, to get the value converted to, may be of interest.
If you only want to print the information, but you don't need it later, this can conveniently be
done by passing `verbose=true` to the root-finding function. This will not
Expand Down
6 changes: 3 additions & 3 deletions src/utils.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##################################################

# type to throw on succesful convergence
# type to throw on successful convergence
mutable struct StateConverged
x0::Number
end
Expand Down Expand Up @@ -92,15 +92,15 @@ end
steff_step(M, x, fx)
Return first Steffensen step x + fx (with proper units).
May be overriden to provide a guard when fx is too large.
May be overridden to provide a guard when fx is too large.
"""
function steff_step(M::Any, x::T, fx::S) where {T,S}
x + fx * oneunit(T) / oneunit(S)
end

# return vertex of parabola through (a,fa),(b,fb),(c,fc)
# first time trhough, we have picture of a > b > c; |fa|, |fc| > |fb|, all same sign
# first time through, we have picture of a > b > c; |fa|, |fc| > |fb|, all same sign
function quad_vertex(c, fc, b, fb, a, fa)
fba = (fb - fa) / (b - a)
fbc = (fb - fc) / (b - c)
Expand Down
2 changes: 1 addition & 1 deletion test/test_bracketing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Test
using Printf

## testing bracketing methods
## Orignially by John Travers
## Originally by John Travers
#
#
## This set of tests is very useful for benchmarking the number of function
Expand Down

0 comments on commit 9deede6

Please sign in to comment.