Skip to content

Commit 32c8a0b

Browse files
committed
update tests
1 parent 258026a commit 32c8a0b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/financial_implied_volatility.jl

+5-4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ end
9898

9999
import ChainRulesCore: rrule, frule, NoTangent, @thunk, rrule_via_ad, frule_via_ad
100100

101+
function blprice_diff_impl(S0, K, T, σ, price_d, FlagIsCall)
102+
return price_d - blprice_impl(S0, K, T, σ, FlagIsCall)
103+
end
104+
101105
function rrule(config::RuleConfig{>:HasReverseMode}, ::typeof(blimpv), S0, K, T, price_d, FlagIsCall, xtol, n_iter_max)
102106
σ = blimpv(S0, K, T, price_d, FlagIsCall, xtol, n_iter_max)
103107
function update_pullback(slice)
@@ -109,10 +113,7 @@ function rrule(config::RuleConfig{>:HasReverseMode}, ::typeof(blimpv), S0, K, T,
109113
return σ, update_pullback
110114
end
111115

112-
function blprice_diff_impl(S0, K, T, σ, price_d, FlagIsCall)
113-
return price_d - blprice_impl(S0, K, T, σ, FlagIsCall)
114-
end
115-
#TODO: Test the following function
116+
116117
function frule(config::RuleConfig{>:HasForwardsMode}, (_, dS, dK, dT, dprice, _, _, _), ::typeof(blimpv), S0, K, T, price_d, FlagIsCall::Bool, xtol, n_iter_max::Integer)
117118
σ = blimpv(S0, K, T, price_d, FlagIsCall, xtol, n_iter_max)
118119
vega = blvega_impl(S0, K, T, σ)

test/Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1212
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
1313

1414
[compat]
15-
Diffractor = "0.2.4"
15+
Diffractor = "0.2"
1616
DualNumbers = "0.5, 0.6"
1717
ForwardDiff = "0.10"
1818
HyperDualNumbers = "4"

0 commit comments

Comments
 (0)