The following warnings occurred:
Warning [2] Undefined array key 108591 - 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 108603 - 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 108605 - 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 108652 - 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 108666 - 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 108720 - 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 108720 - 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 332 ThreadedMode::buildtree
/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





42S integration--what does the "uncertainty" quantity really mean?



#7

I have been in active dialogue with Thomas Okken about the innards of Free42 and understand what is reported in register Y when INTEG is executed. Basically it is the absolute value of the difference between the last two approximations to the integral. The algorithm is a brute force Romberg algorithm (i.e., the cycle of estimate-extrapolate-double the sample points-estimate, etc., until desired convergence) using the transformations to produce uneven spacing of the sample points a la Kahan.

But what does the value represent in the real calculator? I believe that the 42S uses a more subtle and sophisticated adaptive quadrature routine.

I think Karl Schneider has written on this but I can't find the link.

Grateful for insight.

Les


#8

Hi, Les --

Quote:

I think Karl Schneider has written on this but I can't find the link.

Indded I have; here's a quote from my MoHPC Article #556:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=556

Quote:
HP-42S:

"The HP-42S utilizes the approach introduced in the HP-71B Math ROM, in which the user must enter the uncertainty of the integrand as a relative "accuracy" parameter. This value, entered as the variable "ACC" in the HP-42S, is a multiplicative tolerance. The "true" value of the integrand is taken to lie within a band whose width is +/- "ACC" times the calculated value of the integrand.

Thus, the maximum estimated error of the calculated integral over the specified range will be "ACC" times the same integral of the absolute value of the integrand function over the same range.

This approach has definite advantages: The bandwidth of uncertainty is smooth -- directly proportional to the value of the integrand. Any value of "ACC" may be specified, including those that correspond directly to the accuracy of an integrand that best fits measured data. This approach is practical on the HP-42S, because the required accuracy factor "ACC" is a named variable that need not be placed on the stack, and is difficult to overlook on the integration menu."


Best regards,

-- KS


#9

Thanks Karl, I do remember seeing that.

I was actually more curious in the determination of this "band". I think I should take a closer look at the 1980 Kahan article, since I think it touches on it. One thing I know for sure--if the 42S uses a straightforward Romberg approach without adaptation, then the uncertainty result reported in register Y is most definitely not the simple difference between the the last two estimates. Indeed, Thomas and I have observed on Free42 that the nature of the Romberg algorithm is to generously overshoot the desired ACC, often by an order of magnitude or even two. The extrapolation step can be powerful, but the work taken to get there (doubling the number of function evaluations between cycles) can be considerable. Fortunately Free42 is fast so this is no impediment. A tough integral that can take an hour to compute to full display accuracy on the 42S can be computed in a few seconds in Free42 on my Palm, and almost instantaneously with Free42 run under Windows or GTK/Cygwin.

Les


#10

Hi again, Les --

Quote:
Thanks Karl, I do remember seeing (MoHPC Article #556).

I was actually more curious in the determination of this "band". I think I should take a closer look at the 1980 Kahan article, since I think it touches on it.


I stand by the excerpt from my article, with some minor wordsmithing that I just incorporated. The uncertainty "band" of the integrand (not the integral) is specified by the user in the variable "ACC". The estimated maximum error returned by the HP-42S should be less than "ACC" times the calculated integral of the absolute value of the integrand function. These differences diminish as the value of "ACC" is reduced toward zero. I reconfirmed this using the following integrands:

    f(x) = x2

    f(x) = |sin(x)|

    f(x) = [sqrt(x)/(x-1) - 1/ln(x)]

  • Values of "ACC" equal to 1.00 yielded the coarsest results; larger values did not worsen the accuracy any further.

  • Values of "ACC" less than or equal to zero or yielded the most-accurate results, but took a long time to run. (I assume that there is a positive minimum value of "ACC" for integration.)

  • Complex or alpha-string values of "ACC" were rejected with message at start integration. ("ACC" is not a reserved keyword, so the user may employ it for other purposes.)

The Kahan article discussed the "original" HP-34C implementation, which used fixed or stepwise-variable bands of integrand absolute uncertainty, not the HP-42S' relative uncertainty. While the philosophy of the approach is the same, the specific procedure is not quite identical.

So, what's the issue?

-- KS


Edited: 20 Feb 2007, 3:36 a.m.


#11

Of course you are right.

The question I have is how this band is actually computed. It seems on the 42S the algorithm proceeds in such a way so that (register Y/register X) is often pretty close to, but not the same as, the value of ACC supplied by the user.

In Thomas' Free42 implementation, the value returned in register Y is simply the difference between the last two estimates and is often much less than ACC*integral thanks to the convergence properties of the Romberg method.

The 42S computation of this uncertainty, if it is analogous to the 34C (and yes I know you specify integrand uncertainty on the latter with FIX, SCI,ENG etc.), is obviously a little different from just taking the difference of the last two estimates to the integral and returning that. (That is what Free42 does, and Thomas and I have had a lot of dialogue about where exactly in the source code this is done.) The Kahan article mentions something about computing this uncertainty at each step of the 34C's modified Romberg method and ultimately returning that. Basically, if I is the integrand, and deltaI = ACC*I, the routine will compute Integral(I+deltaI) and Integral(I-deltaI) and report that difference in register Y while Integral(I) is returned in register X. The ideas and some formulae are presented, and there is a graphical representation, but the concept isn't entirely developed in exhaustive detail. But I think I have a better idea of what is going on.

Hope this clarifies my question!

Les

I have actually encountered an example or two on the 42S where register Y/register X does NOT approximately equal the ACC provide by the user. It is usually of the same order of magnitude and usually better than ACC. I will try to generate an example and let you know.


#12

Hi, Les --

Quote:
The question I have is how this band is actually computed.

The uncertainty "band" of the integrand is specified by the user in the variable "ACC". Integrating the half-width of the band over the range of the integral would give the worst-case value of the error.

Now, the "estimate of maximum error" (as I call it) or the "uncertainty of computation" (as it is called in the HP-42S manual, p. 203) is calculated by different means -- quite likely based upon the difference between two successive approximations of the integral. When this difference is less than "ACC" times the estimated integral of the absolute value of the function, it may be reasonable for INTEG to stop -- specifically, if further iterations will not likely obtain additional accuracy that is not already surpassed in magnitude by the specified uncertainty of the integrand over the limits of integration.

This probably illustrates why the integral in the 1980 Kahan article:

f(x) = [sqrt(x)/(x-1) - 1/ln(x)] between 0 and 1 ~= 0.03649

is calculated with an incorrect result of about 0.03662 on the HP-34C (and other models) using FIX 5, but is correctly calculated using FIX 6. At FIX 5, the numerical quadrature proceeds until the difference between successive inaccurate estimates dips below the error estimated from function uncertainty, causing it to stop prematurely. At FIX 6, more samples are taken in order to obtain an extra digit of accuracy, until the "lovers' leap" near x = 0 is clearly identified. This extends the process until an accurate result is ultimately produced.

This problem can trick the HP-42S, too. Try it with "ACC" = 0.0001 (1E-4) and with "ACC" = 0.00001 (1E-5), comparing results and execution times.


More: The slope of the function,

df/dx = 1/[2*sqrt(x)*(x-1)] - sqrt(x)/(x-1)^2 + 1/[x(ln x)^2]

has a root at x = 0.00473774692726, for a peak function value f(x) = 0.117680329836

The slope approaches positive infinity near x = 0.

Best regards,

-- KS


Edited: 22 Feb 2007, 1:39 a.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Integration question and "RPN" mode comment Craig Thomas 16 5,713 12-05-2013, 02:32 AM
Last Post: Nick_S
  WP34s integration trapped in infinite loop Bernd Grubert 25 6,819 10-17-2013, 08:50 AM
Last Post: Dieter
  HP Prime integration Richard Berler 1 1,172 10-06-2013, 10:52 PM
Last Post: Helge Gabert
  integration on 39gII emulator Wes Loewer 29 6,774 06-07-2013, 05:58 PM
Last Post: Chris Smith
  WP-34S Integration Richard Berler 15 3,635 03-08-2013, 02:29 AM
Last Post: Walter B
  HP 34S integration Richard Berler 16 4,051 02-18-2013, 04:42 PM
Last Post: Marcus von Cube, Germany
  [WP34S] Speeding up the Romberg Integration Les Wright 14 3,936 05-31-2012, 03:39 PM
Last Post: Marcus von Cube, Germany
  New variant for the Romberg Integration Method Namir 8 2,443 04-18-2012, 07:47 AM
Last Post: Nick_S
  Romberg Integration for 33s, 35s Matt Agajanian 9 2,493 03-26-2012, 10:00 AM
Last Post: Nick_S
  HP 32sII Integration Error of Standard Normal Curve Anthony (USA) 4 1,602 03-14-2012, 03:18 AM
Last Post: Nick_S

Forum Jump: