3 ms·
> but I imagine it has some performance cost versus more traditional ways of writing Fortran code How traditional?
by qz_ 10y ago
> but I imagine it has some performance cost versus more traditional ways of writing Fortran code
How traditional?
- bmh100 10y agoTo use a simple example, one might need to transform an array of statistical samples into p-values. The traditional way would be to 1) create a new array of squared deviations to calculate standard deviation (also using intrinsic MAX) and 2) create a new array of p-values by iterating through the deviation array or the sample array. Using this library, one would 1) map the samples with a deviation function, 2) map the deviations with a square function, 3) foldl to get the average, 4) map the samples with a deviation function, and 5) map the deviations with a p-value function. The first approach would be significantly faster to compute, but also require a multiple times more lines of code than the second approach.
- MarisaKirisame 10y agoThe map can be combined together with short cut fusion, so a map to create new array, get the avg, and another map to get p value further 'combination' is theoretically possible but I dont know if they will be done.