FORM v5.0.0-35-g6318119
Macros | Functions
float.c File Reference
#include "form3.h"
#include <math.h>
#include <gmp.h>
Include dependency graph for float.c:

Go to the source code of this file.

Macros

#define WITHCUTOFF
 
#define GMPSPREAD   (GMP_LIMB_BITS/BITSINWORD)
 

Functions

void Form_mpf_init (mpf_t t)
 
void Form_mpf_clear (mpf_t t)
 
void Form_mpf_set_prec_raw (mpf_t t, ULONG newprec)
 
void FormtoZ (mpz_t z, UWORD *a, WORD na)
 
void ZtoForm (UWORD *a, WORD *na, mpz_t z)
 
long FloatToInteger (UWORD *out, mpf_t floatin, long *bitsused)
 
void IntegerToFloat (mpf_t result, UWORD *formlong, int longsize)
 
int FloatToRat (UWORD *ratout, WORD *nratout, mpf_t floatin)
 
int AddFloats (PHEAD WORD *fun3, WORD *fun1, WORD *fun2)
 
int MulFloats (PHEAD WORD *fun3, WORD *fun1, WORD *fun2)
 
int DivFloats (PHEAD WORD *fun3, WORD *fun1, WORD *fun2)
 
int AddRatToFloat (PHEAD WORD *outfun, WORD *infun, UWORD *formrat, WORD nrat)
 
int MulRatToFloat (PHEAD WORD *outfun, WORD *infun, UWORD *formrat, WORD nrat)
 
void SimpleDelta (mpf_t sum, int m)
 
void SimpleDeltaC (mpf_t sum, int m)
 
void SingleTable (mpf_t *tabl, int N, int m, int pow)
 
void DoubleTable (mpf_t *tabout, mpf_t *tabin, int N, int m, int pow)
 
void EndTable (mpf_t sum, mpf_t *tabin, int N, int m, int pow)
 
void deltaMZV (mpf_t, WORD *, int)
 
void deltaEuler (mpf_t, WORD *, int)
 
void deltaEulerC (mpf_t, WORD *, int)
 
void CalculateMZVhalf (mpf_t, WORD *, int)
 
void CalculateMZV (mpf_t, WORD *, int)
 
void CalculateEuler (mpf_t, WORD *, int)
 
int ExpandMZV (WORD *term, WORD level)
 
int ExpandEuler (WORD *term, WORD level)
 
int PackFloat (WORD *, mpf_t)
 
int UnpackFloat (mpf_t, WORD *)
 
void RatToFloat (mpf_t result, UWORD *formrat, int ratsize)
 
void Form_mpf_empty (mpf_t t)
 
int TestFloat (WORD *fun)
 
WORD FloatFunToRat (PHEAD UWORD *ratout, WORD *in)
 
void ZeroTable (mpf_t *tab, int N)
 
SBYTE * ReadFloat (SBYTE *s)
 
UBYTE * CheckFloat (UBYTE *ss, int *spec)
 
int SetFloatPrecision (WORD prec)
 
int PrintFloat (WORD *fun, int numdigits)
 
void SetupMZVTables (void)
 
void SetupMPFTables (void)
 
void ClearMZVTables (void)
 
int CoToFloat (UBYTE *s)
 
int CoToRat (UBYTE *s)
 
int CoStrictRounding (UBYTE *s)
 
int CoChop (UBYTE *s)
 
int ToFloat (PHEAD WORD *term, WORD level)
 
int ToRat (PHEAD WORD *term, WORD level)
 
int StrictRounding (PHEAD WORD *term, WORD level, WORD prec, WORD base)
 
int Chop (PHEAD WORD *term, WORD level)
 
int AddWithFloat (PHEAD WORD **ps1, WORD **ps2)
 
int MergeWithFloat (PHEAD WORD **interm1, WORD **interm2)
 
int EvaluateEuler (PHEAD WORD *term, WORD level, WORD par)
 
int CoEvaluate (UBYTE *s)
 

Detailed Description

This file contains numerical routines that deal with floating point numbers. We use the GMP for arbitrary precision floating point arithmetic. The functions of the type sin, cos, ln, sqrt etc are handled by the mpfr library. The reason that for MZV's and the general notation we use the GMP (mpf_) is because the contents of the structs have been frozen and can be used for storage in a Form function float_. With mpfr_ this is not safely possible. All mpfr_ related code is in the file evaluate.c.

Definition in file float.c.

Macro Definition Documentation

◆ WITHCUTOFF

#define WITHCUTOFF

Definition at line 45 of file float.c.

◆ GMPSPREAD

#define GMPSPREAD   (GMP_LIMB_BITS/BITSINWORD)

Definition at line 47 of file float.c.

Function Documentation

◆ Form_mpf_init()

void Form_mpf_init ( mpf_t  t)

Definition at line 177 of file float.c.

◆ Form_mpf_clear()

void Form_mpf_clear ( mpf_t  t)

Definition at line 201 of file float.c.

◆ Form_mpf_set_prec_raw()

void Form_mpf_set_prec_raw ( mpf_t  t,
ULONG  newprec 
)

Definition at line 227 of file float.c.

◆ FormtoZ()

void FormtoZ ( mpz_t  z,
UWORD *  a,
WORD  na 
)

Definition at line 515 of file float.c.

◆ ZtoForm()

void ZtoForm ( UWORD *  a,
WORD *  na,
mpz_t  z 
)

Definition at line 559 of file float.c.

◆ FloatToInteger()

long FloatToInteger ( UWORD *  out,
mpf_t  floatin,
long *  bitsused 
)

Definition at line 585 of file float.c.

◆ IntegerToFloat()

void IntegerToFloat ( mpf_t  result,
UWORD *  formlong,
int  longsize 
)

Definition at line 608 of file float.c.

◆ FloatToRat()

int FloatToRat ( UWORD *  ratout,
WORD *  nratout,
mpf_t  floatin 
)

Definition at line 672 of file float.c.

◆ AddFloats()

int AddFloats ( PHEAD WORD *  fun3,
WORD *  fun1,
WORD *  fun2 
)

Definition at line 995 of file float.c.

◆ MulFloats()

int MulFloats ( PHEAD WORD *  fun3,
WORD *  fun1,
WORD *  fun2 
)

Definition at line 1011 of file float.c.

◆ DivFloats()

int DivFloats ( PHEAD WORD *  fun3,
WORD *  fun1,
WORD *  fun2 
)

Definition at line 1027 of file float.c.

◆ AddRatToFloat()

int AddRatToFloat ( PHEAD WORD *  outfun,
WORD *  infun,
UWORD *  formrat,
WORD  nrat 
)

Definition at line 1045 of file float.c.

◆ MulRatToFloat()

int MulRatToFloat ( PHEAD WORD *  outfun,
WORD *  infun,
UWORD *  formrat,
WORD  nrat 
)

Definition at line 1064 of file float.c.

◆ SimpleDelta()

void SimpleDelta ( mpf_t  sum,
int  m 
)

Definition at line 1880 of file float.c.

◆ SimpleDeltaC()

void SimpleDeltaC ( mpf_t  sum,
int  m 
)

Definition at line 1939 of file float.c.

◆ SingleTable()

void SingleTable ( mpf_t *  tabl,
int  N,
int  m,
int  pow 
)

Definition at line 1998 of file float.c.

◆ DoubleTable()

void DoubleTable ( mpf_t *  tabout,
mpf_t *  tabin,
int  N,
int  m,
int  pow 
)

Definition at line 2052 of file float.c.

◆ EndTable()

void EndTable ( mpf_t  sum,
mpf_t *  tabin,
int  N,
int  m,
int  pow 
)

Definition at line 2105 of file float.c.

◆ deltaMZV()

void deltaMZV ( mpf_t  result,
WORD *  indexes,
int  depth 
)

Definition at line 2152 of file float.c.

◆ deltaEuler()

void deltaEuler ( mpf_t  result,
WORD *  indexes,
int  depth 
)

Definition at line 2219 of file float.c.

◆ deltaEulerC()

void deltaEulerC ( mpf_t  result,
WORD *  indexes,
int  depth 
)

Definition at line 2275 of file float.c.

◆ CalculateMZVhalf()

void CalculateMZVhalf ( mpf_t  result,
WORD *  indexes,
int  depth 
)

Definition at line 2351 of file float.c.

◆ CalculateMZV()

void CalculateMZV ( mpf_t  result,
WORD *  indexes,
int  depth 
)

Definition at line 2376 of file float.c.

◆ CalculateEuler()

void CalculateEuler ( mpf_t  result,
WORD *  Zindexes,
int  depth 
)

Definition at line 2447 of file float.c.

◆ ExpandMZV()

int ExpandMZV ( WORD *  term,
WORD  level 
)

Definition at line 2529 of file float.c.

◆ ExpandEuler()

int ExpandEuler ( WORD *  term,
WORD  level 
)

Definition at line 2541 of file float.c.

◆ PackFloat()

int PackFloat ( WORD *  fun,
mpf_t  infloat 
)

Definition at line 271 of file float.c.

◆ UnpackFloat()

int UnpackFloat ( mpf_t  outfloat,
WORD *  fun 
)

Definition at line 366 of file float.c.

◆ RatToFloat()

void RatToFloat ( mpf_t  result,
UWORD *  formrat,
int  ratsize 
)

Definition at line 624 of file float.c.

◆ Form_mpf_empty()

void Form_mpf_empty ( mpf_t  t)

Definition at line 214 of file float.c.

◆ TestFloat()

int TestFloat ( WORD *  fun)

Definition at line 456 of file float.c.

◆ FloatFunToRat()

WORD FloatFunToRat ( PHEAD UWORD *  ratout,
WORD *  in 
)

Definition at line 646 of file float.c.

◆ ZeroTable()

void ZeroTable ( mpf_t *  tab,
int  N 
)

Definition at line 813 of file float.c.

◆ ReadFloat()

SBYTE * ReadFloat ( SBYTE *  s)

Definition at line 831 of file float.c.

◆ CheckFloat()

UBYTE * CheckFloat ( UBYTE *  ss,
int *  spec 
)

Definition at line 857 of file float.c.

◆ SetFloatPrecision()

int SetFloatPrecision ( WORD  prec)

Definition at line 910 of file float.c.

◆ PrintFloat()

int PrintFloat ( WORD *  fun,
int  numdigits 
)

Definition at line 939 of file float.c.

◆ SetupMZVTables()

void SetupMZVTables ( void  )

Definition at line 1081 of file float.c.

◆ SetupMPFTables()

void SetupMPFTables ( void  )

Definition at line 1145 of file float.c.

◆ ClearMZVTables()

void ClearMZVTables ( void  )

Definition at line 1179 of file float.c.

◆ CoToFloat()

int CoToFloat ( UBYTE *  s)

Definition at line 1256 of file float.c.

◆ CoToRat()

int CoToRat ( UBYTE *  s)

Definition at line 1278 of file float.c.

◆ CoStrictRounding()

int CoStrictRounding ( UBYTE *  s)

Definition at line 1305 of file float.c.

◆ CoChop()

int CoChop ( UBYTE *  s)

Definition at line 1352 of file float.c.

◆ ToFloat()

int ToFloat ( PHEAD WORD *  term,
WORD  level 
)

Definition at line 1448 of file float.c.

◆ ToRat()

int ToRat ( PHEAD WORD *  term,
WORD  level 
)

Definition at line 1480 of file float.c.

◆ StrictRounding()

int StrictRounding ( PHEAD WORD *  term,
WORD  level,
WORD  prec,
WORD  base 
)

Definition at line 1520 of file float.c.

◆ Chop()

int Chop ( PHEAD WORD *  term,
WORD  level 
)

Definition at line 1582 of file float.c.

◆ AddWithFloat()

int AddWithFloat ( PHEAD WORD **  ps1,
WORD **  ps2 
)

Definition at line 1651 of file float.c.

◆ MergeWithFloat()

int MergeWithFloat ( PHEAD WORD **  interm1,
WORD **  interm2 
)

Definition at line 1769 of file float.c.

◆ EvaluateEuler()

int EvaluateEuler ( PHEAD WORD *  term,
WORD  level,
WORD  par 
)

Definition at line 2569 of file float.c.

◆ CoEvaluate()

int CoEvaluate ( UBYTE *  s)

Definition at line 2689 of file float.c.