I needed to optimize a function for my neural network. How hard could it be? It’s only one function, and it’s <5 lines at that…

After spawning a huge thread, I’m left to wonder: why didn’t I continue learning ML after my functional languages class? Blargh!

Benchmarks after the break…

C#:

Max deviation is 0.001663983
10^7 iterations using Sigmoid1() took 1646.613 ms
10^7 iterations using Sigmoid2() took 237.352 ms

C:

Max deviation is 0.001664
10^7 iterations using sigmoid1: 628 ms
10^7 iterations using sigmoid2: 157 ms

F#:

Max deviation is 0.001664
10^7 iterations using sigmoid1: 588.843700 ms
10^7 iterations using sigmoid2: 156.626700 ms