98
98
99
99
import ChainRulesCore: rrule, frule, NoTangent, @thunk , rrule_via_ad, frule_via_ad
100
100
101
+ function blprice_diff_impl (S0, K, T, σ, price_d, FlagIsCall)
102
+ return price_d - blprice_impl (S0, K, T, σ, FlagIsCall)
103
+ end
104
+
101
105
function rrule (config:: RuleConfig{>:HasReverseMode} , :: typeof (blimpv), S0, K, T, price_d, FlagIsCall, xtol, n_iter_max)
102
106
σ = blimpv (S0, K, T, price_d, FlagIsCall, xtol, n_iter_max)
103
107
function update_pullback (slice)
@@ -109,10 +113,7 @@ function rrule(config::RuleConfig{>:HasReverseMode}, ::typeof(blimpv), S0, K, T,
109
113
return σ, update_pullback
110
114
end
111
115
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
+
116
117
function frule (config:: RuleConfig{>:HasForwardsMode} , (_, dS, dK, dT, dprice, _, _, _), :: typeof (blimpv), S0, K, T, price_d, FlagIsCall:: Bool , xtol, n_iter_max:: Integer )
117
118
σ = blimpv (S0, K, T, price_d, FlagIsCall, xtol, n_iter_max)
118
119
vega = blvega_impl (S0, K, T, σ)
0 commit comments