Created
May 23, 2015 23:02
-
-
Save Diggsey/43428b29c03681c0c021 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float acc[N]; | |
acc[0] = S::identity(); | |
for (int i = 0; i < (N-1); ++i) { | |
acc[i + 1] = S::op(acc[i], x[i]); | |
} | |
float dacc0[N]; | |
dacc0[N - 1] = 1.0f; | |
for (int i = (N - 1); i > 0; --i) { | |
dacc0[i - 1] = S::dop0(acc[i], x[i]); | |
} | |
float y[N]; | |
for (int i = 0; i < N; ++i) { | |
float dacc1 = S::dop1(acc[i], x[i]); | |
y[i] = dacc1*dacc0[i]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment