This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Security.Cryptography | |
open System.Diagnostics | |
let bench (digest: HashAlgorithm) (input: byte[]) = | |
use digest = digest | |
let sw = Stopwatch.StartNew() | |
for _ in 1..100 do | |
digest.ComputeHash input |> ignore | |
sw.Stop() | |
printfn "%s elapsed %O" (digest.GetType().Name) sw.Elapsed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Original code: https://gist.github.com/taumuon/11302896 | |
// This implementation optimized by Jack Pappas (https://github.com/jack-pappas) | |
open MathNet.Numerics.Distributions | |
open MathNet.Numerics.Statistics | |
open MathNet.Numerics.Random | |
open LanguagePrimitives | |
let inline callPayoff strike price = | |
max (price - strike) GenericZero |