diff --git a/README.md b/README.md index 25fa2ae..73af9a4 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,9 @@ TaylorDiff.jl is fast! See our dedicated [benchmarks](https://benchmark.tansongc using TaylorDiff x = 0.1 -derivative(sin, x, 10) # scalar derivative +derivative(sin, x, Val(10)) # scalar derivative v, direction = [3.0, 4.0], [1.0, 0.0] -derivative(x -> sum(exp.(x)), v, direction, 2) # directional derivative +derivative(x -> sum(exp.(x)), v, direction, Val(2)) # directional derivative ``` Please see our [documentation](https://juliadiff.org/TaylorDiff.jl) for more details. diff --git a/docs/src/index.md b/docs/src/index.md index a1ea97c..891d2ba 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -31,9 +31,9 @@ TaylorDiff.jl is fast! See our dedicated [benchmarks](https://benchmark.tansongc using TaylorDiff x = 0.1 -derivative(sin, x, 10) # scalar derivative +derivative(sin, x, Val(10)) # scalar derivative v, direction = [3.0, 4.0], [1.0, 0.0] -derivative(x -> sum(exp.(x)), v, direction, 2) # directional derivative +derivative(x -> sum(exp.(x)), v, direction, Val(2)) # directional derivative ``` Please see our [documentation](https://juliadiff.org/TaylorDiff.jl) for more details. diff --git a/examples/ode.jl b/examples/ode.jl index 86ca42e..5ad2240 100644 --- a/examples/ode.jl +++ b/examples/ode.jl @@ -37,7 +37,7 @@ display(different_time(ic, p_true, 2e-5)) display(just_t(0.5)) #display(ForwardDiff.derivative(just_t,1.0)) -display(TaylorDiff.derivative(just_t, 1.0, 1)) #isnan error +display(TaylorDiff.derivative(just_t, 1.0, Val(1))) #isnan error #display(value_and_gradient(just_t, AutoForwardDiff(), 1.0)) #display(value_and_gradient(just_t, AutoReverseDiff(), 1.0)) #display(value_and_gradient(just_t, AutoEnzyme(Enzyme.Reverse), 1.0))