Skip to content

Instantly share code, notes, and snippets.

@YetAnotherMinion
Created August 31, 2015 15:36
Show Gist options
  • Save YetAnotherMinion/f3895a31c57ea3b30ccd to your computer and use it in GitHub Desktop.
Save YetAnotherMinion/f3895a31c57ea3b30ccd to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(int argc, char* argv[])
{
/*shape function gradient copied right out of manual*/
double a = -0.04364916731037106478741094406359479762613773345947265625;
double b = 1.3745966692414821608281272347085177898406982421875;
double c1 = 5.0;
double d = a*b;
double e = b*a;
printf("(a * constant * b) - (b * constant * a) \n");
double k1 = a * c1 * b;
double k2 = b * c1 * a;
printf("diff = %17.17lg\n", k1-k2);
printf("Here's the kicker:\n (a * b * constant) - (b * a * constant) \n");
double k3 = a * b * c1;
double k4 = b * a * c1;
printf("diff = %15.15lg\n", k3-k4);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment