campo-sirio/gfm/predx.c
alex ba237a9d91 Patch level : no patch
Files correlati     :
Ricompilazione Demo : [ ]
Commento            :
Aggiunti i sorgenti per Greenleaf Math Library (gfm.dll)


git-svn-id: svn://10.65.10.50/trunk@10079 c028cbd2-c16b-5b4b-a496-9718f37d4682
2002-02-26 12:19:02 +00:00

53 lines
1.0 KiB
C
Executable File

/* DEC *PredictX(pDst, pSrc)
*
* ARGUMENT
* DEC *pDst, *pSrc;
*
* DESCRIPTION
* Using the previous values of A & B of the least squares line
* Y = A + B * X, calculates the predicted value of X corresponding to
* a given value of Y. pSrc contains Y, and the predicted X is returned
* to pDst. The globals pGMStatA and pGMStatB should already contain
* the values of A and B as computed and stored by LinearEstimate.
* X = (Y - A) / B
*
* SIDE EFFECTS
* None.
*
* RETURNS
* pDst if successful, otherwise GM_NULL.
*
* POSSIBLE ERRORS
* GM_NULLPOINTER
* GM_OVERFLOW
* GM_UNDERFLOW
* GM_DIV0
*
* AUTHOR
* Jared Levy
* Copyright (C) 1987-1990 Greenleaf Software Inc. All rights reserved.
*
* MODIFICATIONS
*
*
*/
#include <stdio.h>
#include "gm.h"
#include "gmsystem.h"
DEC *PredictX(pDst, pSrc)
DEC *pDst, *pSrc;
{
DEC dTemp, *pTemp=&dTemp;
_MacStart(GM_PREDX);
_MacInVarD(pSrc);
_MacOutVarD(pDst);
(void) _SubDec80Bit(pTemp, pSrc, pGMStatA);
pDst = DivideDecimal(pDst, pTemp, pGMStatB);
_MacRet(pDst);
}