/* Recursive Method!
==========================================
Topic:
Hermite function: Enter N, x, HN (x)?
H0 (x) = 1;
H1 (x) =2*x;
Hn (x) =2*x*hn-1 (x) -2* (n-1) Hn-2 (x);
==========================================
*/
#include <stdio.h>
float H (int n,int x)
{
if (n==0) return 1;
if (n==1) return 2*x;
Else
Return 2*x*h (n-1,x) -2* (n-1) *h (n-2,x);
}
void Main ()
{
int n,x,flag=1;
float Hn;
while (flag)
{
printf ("n=");
scanf ("%d", &n);
if (n>0)
flag=0;
else printf ("Please confirm n>0!!! \ n \ nthe re-entry: \ n ");
}
printf ("x=");
scanf ("%d", &x);
Hn=h (N,X);
printf ("H (%d) =%.2f\n", N,HN);
}
/*
====================================================
Evaluation:
The recursive expression of the Hermite function is written again! First, there are parameter n,x; second,
There are three expressions representing n=0,n=1,n= others, and finally recursion to n=1 or
n=0; Third, note that n is a positive integer! Then enter the parameters to call it!
====================================================
*/
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
function Call of C language 11-recursive method to find Hermite function