The following warnings occurred:
Warning [2] Undefined array key 144283 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 144309 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 144316 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 144316 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Vieta Accelerated



#4

Hello Pi Enthusiasts,

In last June's Mathematics Magazine there was a great article about accelerating Vieta's formula. My first thought was to try this on my 50g and compare it to my other 50g Pi programs. Whether you're a C programmer or not you may still find my implementation, comments, and results interesting: Vieta Accelerated. NOTE: This is a small part of a much larger document (my HPGCC tutorial).

I wrote 90% of this in early July. My intent was to release on the "other Pi day", 22/7, but I got busy with life.

Edited: 1 Dec 2008, 1:49 a.m.


#5

Hello Egan,

Thanks for posting your interesting article on Viète acceleration. Your Pi shootout is excellent and the HPGCC tutorial is well worth reading for anyone interested in native code development for the 50g. Incidentally, do you know if there is now a way to perform the “S->EXE” transform on the PC rather than the calculator? This was always a problem for me since larger lumps of code would run out of memory for this transformation.

Also, I claim you only need k+1 numbers to calculate V(k,n). What you do, is fill out a k+1 array with V(0,n) .. V(0,n+k) and reduce this “row” k times with the recurrence relation until finally the first slot of the array is the value of V(k,n).

Take a look at this code which illustrates what im talking about. Im only using native doubles here in place of bignums, but the calculation should be the same.

double kreminski(int k, int n)
{
// create array of k+1 values
double* kc = new double[k+1];
int i;
int m;

double r = 0;
double t = 1;

// fill out V(0,n) for n to n+k
m = n + k;
for (i = 1; i <= m; ++i)
{
r = sqrt(r + 2);
t *= 2/r;
if (i >= n)
kc[i-n] = t;
}

// reduce table row by row until top
int j;
double k4 = 1;
m = k;
for (j = 0; j < k; ++j)
{
k4 *= 4;
for (i = 0; i < m; ++i)
kc[i] = (k4*kc[i+1] - kc[i])/(k4-1);

--m; // one shorter each time
}

t = kc[0]; // top left is answer!
delete [] kc;
return t;
}

is this a winner?

cheers,
-- hugh.


#6

Quote:
Thanks for posting your interesting article on Viète acceleration. Your Pi shootout is excellent and the HPGCC tutorial is well worth reading for anyone interested in native code development for the 50g.

Thanks.

Quote:
Incidentally, do you know if there is now a way to perform the “S->EXE” transform on the PC rather than the calculator? This was always a problem for me since larger lumps of code would run out of memory for this transformation.

No. I have looked into it, but not very hard, since this is not required with HPGCC3, I never really finished investigating it.
Quote:
Also, I claim you only need k+1 numbers to calculate V(k,n). What you do, is fill out a k+1 array with V(0,n) .. V(0,n+k) and reduce this “row” k times with the recurrence relation until finally the first slot of the array is the value of V(k,n).

Brilliant. I'll give it a go with decNumber and let you know the results (probably very late tonight). I do not expect it to be much faster because of the time spent computing V(0,n) .. V(0,n+k), but it will use a lot less memory. It'll still max out at k = 108, but I will not need to use the SD card, but then that was the whole point of the example, how to use libfsystem for large arrays. :-)
Quote:
is this a winner?

Probably. I'll post vieta4.c soon. Thanks again.

Forum Jump: