UP | HOME

free42 Repeated Measurements

Author: Mitch Richling
Updated: 2024-02-12 12:55:51

Copyright 2024 Mitch Richling. All rights reserved.

Table of Contents

1. Metadata

The home for this HTML file is: https://richmit.github.io/hp42/meas.html

A PDF version of this file may be found here: https://richmit.github.io/hp42/meas.pdf

Files related to this document may be found on github: https://github.com/richmit/hp42

Directory contents:

src - The org-mode file that generated this HTML document
src_42s - Ready to convert source listings for 42s code in this document
docs - This html document and associated PDF
bin - Importable RAW program files

2. Introduction

I frequently take repeated measurements, but don't feel the need to record all the measurements in my laboratory notebook. For example, when working on my stamp collection I will measure stamp thickness at 5 locations and use the average value. Or at my electronics bench I may measure inductance 3 or 5 times, and use the midrange as the value. The application described below is designed to make that process more automated and less error prone.

3. Supported Methods

The two most common methods for estimating & reporting measurement uncertainty are nicely documented in NIST Technical Note 1297. The first method assumes the non-systematic components of measurement errors are statistically independent and normally distributed. In this case the measurement is taken to be the mean (\(\mu\)), and the standard uncertainty (\(u\)) is defined as the sample standard deviation (\(s\)). The second method assumes a uniform error distribution – which I will refer to as rectangular in this document in order to avoid confusion with \(u\). In this case the measurement is assumed to be the midrange (\(MR=(x_{max}+x_{min})/2\)), and the standard uncertainty is defined as \(u=(x_{max}-x_{min})/(2\sqrt(3))\). The MEAS application supports both of these methods in addition to one based on rank statistics where the measurement is taken to be the median and the uncertainty is one half the interquartile range. While this last scheme is not easily related to a standard probability distribution, it has found some popularity – particularly in the life sciences.

Frequently the standard uncertainty is expanded by a factor (\(k\)) in order to provide a probabilistic uncertainty interval or confidence interval. The MEAS application supports only a fixed set of values for \(k\) for automatic reporting.

Finally, the application provides a number of raw statistics that might be useful for error analysis:

  • Mean or arithmetic average (\(\mu\))
  • Midrange (\(MR\))
  • Range
  • Standard deviation (\(\sigma\))
  • Population standard deviation (\(s\))
  • Number of observations (\(N\))
  • Sum
  • Sum of squares
  • First quartile (\(Q_1\))
  • Second quartile or median (\(Md\) or \(Q_2\))
  • Third quartile (\(Q_3\))
  • Interquartile range (\(IQR\))

4. Setup

The last menu provides configuration options.

4.1. Reporting Scheme

The reporting scheme is set via the first menu button – the current selection is displayed in the menu label (N=Normal, R=Rectangular, and Q=Quartiles). This key cycles between the schemes when pressed. Note that it also defaults the coverage factor (the second menu button)!

4.2. Coverage Factors

The coverage factor used to compute the expanded uncertainty is set via the second menu key. Repeatedly pressing this button will cycle through predefined values appropriate for the already selected reporting scheme.

This option is used both for reports and the expanded uncertainty computations elsewhere in the menus ([kuN], [kuR], & [kuQ]). It is not possible to set the coverage factor to an arbitrary value; however, the sample standard deviation ([SSD]), rectangular variance ([RtVA]), and interquartile range ([IQR]) are all in the menus if you need more flexibility.

For normally distributed errors the following coverage factors are supported.

Confidence % Coverage Factor
68.27 1
95.45 2
99.73 3

Note: This same set of coverage factors are also available when using the Quartile scheme; however, they are somewhat difficult to interpret from a probabilistic standpoint.

For errors with a rectangular distribution the following coverage factors are supported.

Coverage Factor
1
\(\sqrt(3)\)

4.3. Automatic Reporting

A report can be generated upon entering a specified number of measurements. This is very handy when a batch of items needs to be measured, and one wishes to do a fixed number of measurements per item. To set the automatic report count provide an integer in X, and use this menu key. The current value is displayed as part of the menu label. A dash (-) means no automatic reporting is configured. Use zero to turn off reporting.

5. Reporting

I find that most of the time I use units such that measurements have integer values. For example with paper thickness measurements I will use micrometers in a range between 700 and 1100. For other philatelic applications I may use millimeters with one or, rarely, two decimals. For these applications it is possible to fit the measurement value, uncertainty, max, and min all on the screen at once assuming FIX, SCI, or ENG has been set correctly. The report function attempts to use this compact reporting method if possible. Otherwise it uses the first line for the measurement estimate and the second line for the expanded uncertainty.

The measurement and expanded uncertainty are reported according to the selected reporting scheme and coverage factor. See the setup menu.

Reports can be automatically generated upon entry of a configurable number of measurements. See the setup menu.

MNU LL Key Description Notes
LBL 70 LBL 98 M+ Add a new measurement  
M- LBL 97 M- Delete last measurement  
EDIT LBL 38 EDIT Edit MeDAT Requires N>0 – i.e. can't edit an empty MeDAT matrix!
REP LBL 96 REP Display Report The report format & content is controlled by the settings.
→STK LBL 39 →STK Report to Stack Y: Measurement Estimate X: Expanded Uncertainty
CLRM LBL 95 CLRM Clear all measurements  
μ LBL 94 μ Arithmetic Mean Normal Errors: Measurement estimate
kuN LBL 93 kuN ERR: k*SSD Normal Errors: Expanded uncertainty estimate
MR LBL 92 MR Midrange Rectangular Errors: Measurement estimate
kuR LBL 91 kuR ERR: k*(MAX-MIN)/(2*sqrt(3)) Rectangular Errors: Expanded uncertainty estimate
MIN LBL 89 MIN Minimum value  
MAX LBL 88 MAX Maximum value  
PSD LBL 87 PSD Population Standard Deviation The one with n on the bottom. ;) Requires N>0
SSD LBL 86 SSD Sample Standard Deviation The one with n-1 on the bottom. ;) Requires N>1
RNG LBL 85 RNG Range: MAX-MIN  
RtVA LBL 90 RtVA Rectangular Variance (MAX-MIN)/(2*sqrt(3))
N LBL 84 N Number of measurements Number of rows in MeDAT
SUMS LBL 83 SUMS Y: Sum Squared X: Sum  
Q25 LBL 35 Q25 First Quartile (25%) Requires N>2
MED LBL 77 MED Median Quartile Scheme: Measurement estimate. Requires N>2
Q75 LBL 36 Q75 Third Quartile (75%) Requires N>2
IQR LBL 34 IQR Interquartile range (Q75-Q25) Requires N>2
kuQ LBL 46 kuQ ERR: k*(Q75-Q25)/2 Quartile Scheme: Expanded uncertainty estimate. Requires N>2
▒▒▒▒   ▒▒▒▒    
LBL 79 LBL 82 S:? Reporting Scheme Cycle between N=Normal, R=Rectangular, & Q=Quartiles
LBL 48 LBL 81 K:? Coverage Factor Cycle through predefined values for current reporting scheme
LBL 78 LBL 80 A:? Auto Report Count Automatically generate a report on N'th measurement entry
REP LBL 96 REP Display Report Duplicated here so you can see reports after option changes
→STK LBL 39 →STK Report to Stack Duplicated here so you can see reports after option changes
RESET RSTMES RESET Delete data & set defaults Use the global label RSTMES to access outside application

Notes:

  • Please ignore the first two columns in the table – they are used to auto-generate the menu code for the application.
  • I use PSD & SSD to be explicit and avoid confusion with the 42s internal function SDEV (which is PSD)
  • Method used for the first & third quartile:
    • Q1 is the median of the lower half of the data while Q3 is the median of the upper half
    • If N is odd, we do not include the median (the central value in the ordered list) in either half.
    • If N is even, we split this data set exactly in half.
  • RSTIMES is a global label that will set all global variables used by MEAS to default values

7. Global Variables

Application state is maintained in a number of global variables.

Variable Description  
MeDAT Measurement Matrix Feel free to edit this directly
MeRSC Reporting Scheme Use the setup menu to change this one
MeCFA Coverage Factor Use the setup menu to change this one
MeTGN Auto Report Count Use the setup menu to change this one

8. Use

In use the application is quite like the built in statistics application in that [M+] & [M+] add and delete measurements. All measurements are stored in a matrix named MeDAT. Feel free to edit this matrix with the MATRIX menu.

The [REP] key will generate a report. Reports can also be generated automatically when a set number of measurements have been entered (see the setup menu).

Menu page two, three, & four compute various statistics useful for uncertainty reporting. Page two has the most common statistics, page three is useful for custom uncertainty computations, and page four has rank based statistics.

Menu page five is for setup. The reporting scheme impacts reporting (menu page one: [REP]). The coverage factor impacts reporting (menu page one: [REP]) and and the expanded uncertainty computations (menu page two & four: [kuN], [kuR], & [kuQ]). The automatic reporting option impacts the add measurement function (menu page one: [M+]) such that a report is automatically generated when a specified number of measurements have been entered.

9. Future

Some things I might do some day…

  • A graphical representation showing the points and various confidence intervals would be cool
  • It would be neat to see a live dot plot of the measurements as they are being entered
  • Arbitrary k values
  • Support the larger screen when running on the DM42
  • Drop the data into the built in statistics tool
  • Add option to use "Tukey's hinges" for the first & third quartiles
  • Make the sub-functions perfect (i.e. minimally alter stack/last X)
  • Add rank statistics
  • Add the median & interquartile range reporting scheme used in biology
  • Make the setup menu not alter the stack
  • Add a printed report listing data and both normal & square estimates for all coverage factors

10. Code

10.1. Menu Code

(MJR-generate-42-menu-code "MEAS" 0 tbl 0 1 'stay 'up 'auto #'MJR-custom-gen-lab #'MJR-custom-gen-sub)

10.2. Local Subroutines

@@@@ LBL: Used: 30-52, 54-99

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: RESET 
LBL "RSTMES"
CLV "MeDAT"
CLV "MeCFA"
CLV "MeRDM"
CLV "MeREP"
CLV "MeRSC"
CLV "MeTGN"
XEQ 49 @NM@ DEFVAR
"MeDAT & Set"
"tings RESET"
AVIEW
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: EDIT: LABEL 38
LBL 38 @NM@ EDIT
FUNC 00
SF 25
RCL "MeDAT"
FC?C 25
GTO 99
R↓
EDITN "MeDAT"
"Enter data; R/S"
" to end"
PROMPT
EXITALL
XEQ 47 @NM@ SMLREP 
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: M+: LABEL 70
LBL 70 @NM@ M+_LBL
FUNC 00
XEQ 49 @NM@ DEFVAR
"M+"
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Set unset variables to defaults
LBL 49 @NM@ DEFVAR
FUNC 00
0
SF 25
RCL "MeRSC"
FC?C 25
STO "MeRSC"
SF 25
RCL "MeCFA"
FC?C 25
STO "MeCFA"
SF 25
RCL "MeTGN"
FC?C 25
STO "MeTGN"
SF 25
RCL "MeRDM"
FC?C 25
STO "MeRDM"
SF 25
RCL "MeREP"
FC?C 25
STO "MeREP"
R↓
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: A: LABEL 78
LBL 78 @NM@ A_LBL
FUNC 00
"A:"
RCL "MeTGN"
X=0?
"-"
X≠0?
AIP
R↓
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: S: LABEL 79
LBL 79 @NM@ S_LAB
FUNC 00
"S:"
RCL "MeRS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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: M- 97
LBL 97 @NM@ M-
FUNC 00
SF 25
RCL "MeDAT"
FC?C 25
GTO 72               @@@@ MeDAT is missing
DIM?
R↓
1
X=Y?
GTO 72               @@@@ MeDAT has only one row
SF 25                @@@@ Index MeDAT
INDEX "MeDAT"
FC?C 25
GTO 72               @@@@ MeDAT is missing
J-
RCLEL
DELR
XEQ 47 @NM@ SMLREP
RTN
LBL 72
XEQ 95 @NM@ CLRM 
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: CLRM 95
LBL 95 @NM@ CLRM 
FUNC 00
SF 25
INDEX "MeDAT"
CLV "MeDAT"
CF 25
"MeDAT Cleared"
AVIEW
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: M+ 98
LBL 98 @NM@ M+
FUNC 00
REAL?
GTO 56
"ERR: Bad Value"
AVIEW
RTN
LBL 56
SF 25                @@@@ Index & grow MeDAT
INDEX "MeDAT"
FS?C 25
GTO 55
1
1
DIM "MeDAT"
INDEX "MeDAT"
R↓
R↓
STOEL
XEQ 47 @NM@ SMLREP
RTN
LBL 55               @@@@ MeDAT exists.  Grow it
GROW
J-
J+
WRAP
STOEL                @@@@ Store element at new location
XEQ 84 @NM@ N
RCL "MeTGN"
X≠Y?
GTO 43
XEQ 96 @NM@ REP
RTN
LBL 43
XEQ 47 @NM@ SMLREP
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: micro report
LBL 47 @NM@ SMLREP
FUNC 00
XEQ 84 @NM@ N        
"N="
AIP
AVIEW
RCL "MeTGN"
X≤Y?
RTN
ALENG
8
X<>Y
-
LBL 53
" "
DSE ST X
GTO 53
"Report in "
R↓
X<>Y
-
AIP
AVIEW
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Report to Stack
LBL 39 @NM@ →STK
FUNC 02
XEQ 24 @@@@ E&U
X≠0?      @@@@ Status U V
GTO 75
R↓
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Compute estimate & uncertainty
@@@@ OUT: Z: Measure Estimating
@@@@      Y: Expanded Uncertainty
@@@@      X: Status
@@@@         0 - Good Result
@@@@         1 - ERROR
LBL 24 @NM@ E&U
FUNC 03
SF 25
RCL "MeDAT"
FC?C 25
GTO 26
DIM?
R↓
RCL "MeRSC"
27
+
GTO IND ST X
LBL 27 @@@@ Normal
R↓
2
X>Y?
GTO 26 @@@@ We require 2 points for a report!
XEQ 94 @NM@ μ 
XEQ 93 @NM@ kuN
0
RTN
LBL 28 @@@@ Rectangular
R↓
2
X>Y?
GTO 26 @@@@ We require 2 points for a report!
XEQ 92 @NM@ MR
XEQ 91 @NM@ kuR
0
RTN
LBL 29 @@@@ Quartiles
R↓
3
X>Y?
GTO 26 @@@@ We require 3 points for a report!
XEQ 77 @NM@ MED
XEQ 46 @NM@ kuQ
0
RTN
LBL 26
1
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: REP 96
LBL 96 @NM@ REP
FUNC 00
XEQ 24 @@@@ E&U
X≠0?
GTO 75
R↓                   @@@@ U V
XEQ 21 @NM@ MN=2A
ARCL ST Y
" "
XEQ 22 @@@@ |-CNA
"×u="
ARCL ST X            @@@@ U V
ALENG                @@@@ ALEN1 U V 
21                   @@@@ 21 ALEN1 U V 
X<Y?                 @@@@ Can we keep going with 4 value report?
GTO 45               @@@@ Can't do 2-line as line 1 is too long...
@@@@ Contineu to line 2 of compact report
R↓                   @@@@ ALEN1 U V 
"[LF]↓="
XEQ 89 @NM@ MIN      @@@@ MIN ALEN1 U V 
ARCL ST X
R↓                   @@@@ ALEN1 U V 
"  ↑="
XEQ 88 @NM@ MAX      @@@@ MAX ALEN1 U V 
ARCL ST X
R↓                   @@@@ ALEN1 U V 
ALENG                @@@@ ALEN2 ALEN1 U V 
-                    @@@@ ALEND U V 
21                   @@@@ 41 ALEND U V 
X<Y?
GTO 45               @@@@ Can't do compact report as line 2 was too long...
AVIEW
R↓                   @@@@ ALEND U V 
R↓                   @@@@ U V 
RTN
LBL 45               @@@@ Long form report..
R↓                   @@@@ ALEN? U V 
R↓                   @@@@ U V 
XEQ 21 @NM@ MN=2A
ARCL ST Y            @@@@ U V 
"[LF]"
XEQ 22 @@@@ |-CNA
"×u="
ARCL ST X            @@@@ U V 
AVIEW
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Set alpha to measure name
LBL 21 @NM@ MN=2A
FUNC 00
RCL "MeRSC"          @@@@ MeRSC
0                    @@@@ 0 MeRSC
X=Y?
"μ="
R↓                   @@@@ MeRSC
1                    @@@@ 1 MeRSC
X=Y?
"MR="
R↓                   @@@@ MeRSC
2                    @@@@ 2 MeRSC
X=Y?
"Q2="
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Append Coverage Names to alpha
LBL 22
FUNC 00
RCL "MeCFA"
65
+
XEQ IND ST X
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: MR (midrange) 92
LBL 92 @NM@ MR
FUNC 01
SF 25
INDEX "MeDAT"
FC?C 25
GTO 99
XEQ 88 @NM@ MAX
XEQ 89 @NM@ MIN
+
2
÷
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: MAX 88
LBL 88 @NM@ MAX
FUNC 01
SF 25
INDEX "MeDAT"
FC?C 25
GTO 99
[MAX]
X<>Y
R↓
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: MIN 89
LBL 89 @NM@ MIN
FUNC 01
SF 25
INDEX "MeDAT"
FC?C 25
GTO 99
[MIN]
X<>Y
R↓
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: kuR 91
LBL 91 @NM@ kuR
FUNC 01
SF 25
INDEX "MeDAT"
FC?C 25
GTO 99
XEQ 90 @NM@ RtVA    @@@@ RtVA
RCL "MeCFA"        
60
+                   @@@@ JMP RtVA
XEQ IND ST X        @@@@ VAL JMP RtVA
X<>Y                @@@@ JMP VAL RtVA
R↓                  @@@@ VAL RtVA
×                   @@@@ VAL*RtVA
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: RtVA 90
LBL 90 @NM@ RtVA 
FUNC 01
SF 25
INDEX "MeDAT"
FC?C 25
GTO 99
XEQ 85 @NM@ RNG
2
÷
3
SQRT
÷
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: RNG 85
LBL 85 @NM@ RNG       
FUNC 01
SF 25
INDEX "MeDAT"
FC?C 25
GTO 99
XEQ 88 @NM@ MAX
XEQ 89 @NM@ MIN
-
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: kuN 93
LBL 93 @NM@ kuN
FUNC 01
SF 25
RCL "MeDAT"
FC?C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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Q1 (First quartile) 35
@@@@ FAQ: Needs at least 3 values
LBL 35 @NM@ Q1 
FUNC 01
XEQ 74
R↓
R↓
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Q3 (Third quartile) 36
@@@@ FAQ: Needs at least 3 values
LBL 36 @NM@ Q3
FUNC 01
XEQ 74
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: IQR (Interquartile Range) 34
@@@@ FAQ: Needs at least 3 values
LBL 34 @NM@ IQR
FUNC 01
XEQ 74
X<>Y
R↓
X<>Y
-
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: kuQ (Quartiles uncertainty) 46
@@@@ FAQ: Needs at least 3 values
LBL 46 @NM@ kuQ
FUNC 01
XEQ 74
X<>Y
R↓
X<>Y
-
2
/
RCL "MeCFA"
60
+
XEQ IND ST X
X<>Y
R↓
×
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: QUART (quartiles) 74
@@@@ OUT: X: Q3 Y: Q2 Z: Q1
@@@@ FAQ: Needs at least 3 values
LBL 74 @NM@ QUART
FUNC 03
L4STK
SF 25
RCL "MeDAT"
FC?C 25
GTO 99
LSTO "_TMP"
DIM?
R↓
3
X>Y?
GTO 75
R↓
INDEX "_TMP"
LBL 71
[MIN]
R↓
RCLIJ
R↓
R<>R
J+
FC? 77
GTO 71
@@@@ Array is sorted now
RCL "_TMP"
DIM?                 @@@@ ROWS=1 COLS 
XEQ 76 @NM@ MED-RNG  @@@@ Q2 N
X<>Y                 @@@@ N Q2
RCL ST X             @@@@ N N Q2
1
+                    @@@@ (N+1) N Q2
2                    @@@@ 2 (N+1) N Q2
÷                    @@@@ (N+1)/2 N Q2
ENTER                @@@@ (N+1)/2 (N+1)/2 N Q2
FP
X=0?
GTO 37
@@@@ FRAC
R↓                   @@@@ (N+1)/2 N Q2
IP                   @@@@ IP((N+1)/2) N Q2
1                    @@@@ 1 IP((N+1)/2) N Q2
XEQ 76 @NM@ MED-RNG  @@@@ Q1 IP((N+1)/2) N Q2
R↓                   @@@@ IP((N+1)/2) N Q2 Q1
ISG ST X
NOP                  @@@@ IP((N+1)/2)+1 N Q2 Q1
XEQ 76 @NM@ MED-RNG  @@@@ Q3 N Q2 Q1
X<>Y                 @@@@ N Q3 Q2 Q1
R↓                   @@@@ Q3 Q2 Q1
RTN
LBL 37
@@@@ INT
R↓                   @@@@ (N+1)/2 N Q2
DSE ST X
NOP                  @@@@ (N+1)/2-1 N Q2 
1                    @@@@ 1 (N+1)/2-1 N Q2 
XEQ 76 @NM@ MED-RNG  @@@@ Q1 (N+1)/2-1 N Q2
R↓                   @@@@ (N+1)/2-1 N Q2 Q1
ISG ST X
NOP
ISG ST X
NOP                  @@@@ (N+1)/2+1 N Q2 Q1
XEQ 76 @NM@ MED-RNG  @@@@ Q3 N Q2 Q1
X<>Y                 @@@@ N Q3 Q2 Q1
R↓                   @@@@ Q3 Q2 Q1
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: MED of indexed matrix on RANGE X: Lower Y: upper 
LBL 76 @NM@ MED-RNG
FUNC 11              @@@@ Really takes two, but we want to leave Y
+                    @@@@ upper+Lower
2
÷                    @@@@ (upper+Lower)/2
RCL ST X             @@@@ (upper-Lower)/2 (upper-Lower)/2 
FP                   @@@@ FP((upper-Lower)/2) (upper-Lower)/2  Lower
X=0?
GTO 73
@@@@ Between
R↓
IP
ENTER
1
STOIJ
R↓
RCLEL
X<>Y
1
+
1
STOIJ
R↓
R↓
RCLEL
+
2
/
RTN
LBL 73
@@@@ On
R↓
1
STOIJ
R↓
R↓
RCLEL
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: "ERR: No MeDAT!" 99
LBL 99
@@@@ Not FUNC -- NOT A XEQ TARGET, but A GTO TARGET
"ERR: No MeDAT!"
AVIEW
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: "ERR: MeDAT Too Small!" 75
LBL 75
@@@@ Not FUNC -- NOT A XEQ TARGET, but A GTO TARGET
"ERR: MeDAT "
"Too Small!"
AVIEW
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Coverage values
LBL 60               @@@@ Value for coverage factor 0
FUNC 01
1
RTN
LBL 61               @@@@ Value for coverage factor 1
FUNC 01
RCL "MeRSC"
1
X≠Y?
GTO 59
R↓
3
SQRT
RTN
LBL 59
R↓
R↓
2
RTN
LBL 62               @@@@ Value for coverage factor 2
FUNC 01
3
RTN
LBL 63               @@@@ Value for coverage factor 3
FUNC 01
4
RTN
LBL 64               @@@@ Value for coverage factor 4
FUNC 01
999
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: Coverage Names
LBL 65               @@@@ Name for coverage factor 0
"1"
RTN
LBL 66               @@@@ Name for coverage factor 1
RCL "MeRSC"
1
X=Y?
"√3"
X≠Y?
"2"
R↓
R↓
RTN
LBL 67               @@@@ Name for coverage factor 2
"3"
RTN
LBL 68               @@@@ Name for coverage factor 3
"4"
RTN
LBL 69               @@@@ Name for coverage factor 4
"999"
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@ DSC: reporting scheme Names
LBL 50               @@@@ Name for reporting scheme 0
"N"
RTN
LBL 51               @@@@ Name for reporting scheme 1
"R"
RTN
LBL 52               @@@@ Name for reporting scheme 2
"Q"
RTN

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
END

11. EOF