list fldot - part-cw/lambdanative GitHub Wiki

(list-fldot lst1 lst2)

list-fldot returns the dot product (inner product) of two lists of floats. Note: requires every element in both lists to be a floating point number.

Parameter Description
lst1 First list of floats operated on
lst2 Second list of floats operated on

Example

Example 1: Calculate the dot product of two lists using both the regular and optimized forms.

> (list-dot (list 1 2 3 4) (list 1 2 3 4))
30
> (list-fldot (list 1. 2. 3.) (list 1. 2. 3.))
14.