creates a managed library expression by applying f to a positive integer ID associated with a registered manager with name mname.
Load example LibraryFunction objects that implement a simple linear congruential random generator:
Set its parameters using the unique ID assigned by CreateManagedLibraryExpression:
The history expression Out will often keep references to an expression you may not be aware of. Extra references like this can be prevented by setting $HistoryLength=0 either in a session or inside of Block:
Note that the same does not work for g1 because it is referenced by Out: