Skip to content

Instantly share code, notes, and snippets.

View jack-pappas's full-sized avatar

Jack Pappas jack-pappas

  • Philadelphia, PA, USA
View GitHub Profile
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
// 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