# some curve fitting functions, Copyright (C) 2007-2010 Dennis Furey
#
# chord_fit                                   (4594)
# mp_chord_fit                                (4771)
# mp_one_piece_polynomial                     (2717)
# mp_sinusoid                                 (6101)
# multivariate                                (1431)
# one_piece_polynomial                        (2181)
# plin                                         (973)
# poly_dif                                   (20205)
# sinusoid                                    (5784)
#
# compressed with granularity 116
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
#
{gvkviIvhJsfwOKvhifbsfrsHtozfruWkfx{faOowG{jaeivg_tcWf[awvhtwZfpyR?Omd[EzjvRzhw
zfNfIE?Ri=VMzgggs{ggKivkffRex\`jCvgfv?j[cvXjovivkr_uosHb<T[jgvj{Nd[H[eVX`cfgzgP
mEHahqVD<Mz]ftVjnIG<RBAvzaiGvfc{fuLe>x`eLhcvBg]fwe@bTEzerkeFSjg>jsfrj]ce>D@CvBg
=gnEnFeCw]PerdMznwFjgzg=qd]on\SDVdW>sn<jCwJ_]P`jj`ndf{EKvfBplwL^J]fCvKp\BCvSGJ_
<Aj^NjgfF{qfsnFHrhVB\RGo<\Mz\tap]Kv_dVjgEZjzgoLeWXi>BDowgEx_DJDLKfn]ftje[FgZwrj
Gwad^<_SId@CidoPjgPBggwEzggkvfSEN\rxz^gAaF\NZrgAvdDVjenjLzFNp_{hgq@k@zErfFrN^_F
Z`ZZf]fvuF<mzdhjkIvocu_lkQ\pgwNFkFHe=WvfBggzEL[fggfjwZn^BvOsf_ODgHuDftKN\NXf=fv
{zfH[jeNoFbfwZhlmFp[Vf`FiBmDhg\\ef]fvcuxX\@[dg^VgB\pw[pdekoONK\f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