Post Reply 
MCODE: Fastest way to multiply
04-16-2019, 10:29 PM
Post: #9
RE: MCODE: Fastest way to multiply
Language of Mathematics - very droll!
I meant this stuff:-
Do you know what programming language this is?

#include "m_apm.h"
#include "mapm_np2.c" // next powers of 2
/*
* FFT_MUL = 0 -> div-and-conq ONLY
* FFT_MUL = 1 -> fft mul ONLY, fatal if overflow
* FFT_MUL = 2 -> fft mul AND div-and-conq
*/
/*
* MAX_FFT_BYTES *must* be an exact power of 2
*
* **WORST** case input numbers (all 9's) has shown that
* the FFT math will overflow if the MAX_FFT_BYTES >= 1048576
*
* the define below allows the FFT algorithm to multiply two
* 524,288 digit numbers yielding a 1,048,576 digit result.
*/
#if FFT_MUL
#define MAX_FFT_BYTES 524288
void M_fast_mul_fft(UCHAR *, UCHAR *, UCHAR *, int);
#else
#define MAX_FFT_BYTES 8 /* NOT using FFT */
#define M_fast_mul_fft(r,a,b,sz) M_4_byte_mul(r, a, b)
static void M_4_byte_mul(UCHAR *, UCHAR *, UCHAR *);
#endif
#define DATA(r) r->m_apm_data
#if FFT_MUL != 1
void M_fmul_div_conq(UCHAR *, UCHAR *, UCHAR *, int);
static void M_fmul_dc2(UCHAR *, UCHAR *, UCHAR *, UCHAR *, int);
static void M_fmul_add(UCHAR *, UCHAR *, UCHAR *, UCHAR *, int);
static int M_fmul_sub(UCHAR *, UCHAR *, UCHAR *, int);
#endif

Leave the Planet (tlalticpac) in a better shape than when you first found it.

Denny Tuckerman
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
MCODE: Fastest way to multiply - PeterP - 04-15-2019, 03:58 PM
RE: MCODE: Fastest way to multiply - Leviset - 04-16-2019 10:29 PM



User(s) browsing this thread: 1 Guest(s)