In reply to https://github.com/grame-cncm/faustlibraries/pull/166#issuecomment-1767305470
Dario, I am not sure I understand you question, and I am not expert in this area... But. I'd guess that on the modern CPU multiplication is likely not slower than addition. Even if it is slower, the modern compilers are clever, -ffast-math can turn 2*v1 into v1+v1. Say, simply because this needs a single FPU register. So I don't think it makes sense to replace 2*v1 with v1+v1 in .dsp code, both faust and C++ compilers can (will) rewrite the whole expr. But even if you look into the generated assembly, I don't think it makes much sense to count MULs/DIVs/ADDs. Because the modern CPUs are smart too, they can execute several insns in parallel so the total number of operations is not a good metric in general. For example, please see the initial implementation of svf, https://sourceforge.net/p/faudiostream/mailman/message/36396618/ It does more operations, but it has less dependency chains and thus it can be faster on x86, v1/v2 do not depend on each other (see the paper for more details). But then I rewrote this code because faust destroys this (possible) optimization during normalization anyway. Heh, I wrote this code in 2018 but wasn't able to convince maintainers to take this code until 2020 ;) And if CF is time-variant, then you will possibly have more problems with tan(), that is why I tried to suggest this https://github.com/grame-cncm/faustlibraries/pull/166#issuecomment-1763398488 change. And no, I don't think that -fm is the proper solution, and I don't think this is hackish. To me this looks like a perfect usage of https://faustdoc.grame.fr/manual/syntax/#explicit-substitution And let me apologize in advance, most probably I won't be responsive in the near future, I am busy with my work. Oleg. _______________________________________________ Faudiostream-users mailing list Faudiostream-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-users