Remez algorithm

Change (if needed) interval endpoints, degree, number of gridpoints, and function formula, according to instructions below. It could be made of several statements, like:  1;if(Abs(x)>0.00001){Sin(x)/x}
When ready, use 'Compute' several times (iterations).
If you change parameters and/or function, push on 'Reset'.
Function interpreter by J. Pezzullo; graphics by Grigory -

a       b       degree gridpoints       function (see instructions below)

Operators: + - * / and parentheses
Constants: Pi (=3.14...), e (=2.718...), Deg(=180/Pi = 57.2...)
Built-in Functions...
[Unless otherwise indicated, all functions take a single numeric argument, enclosed in parentheses after the name of the function.]
Algebraic: Abs, Sqrt, Power(x,y) [= x raised to power of y)], Fact [factorial]
Transcendental: Exp, Ln [natural], Log10, Log2
Trigonometric: Sin, Cos, Tan, Cot, Sec, Csc
Inverse Trig: ASin, ACos, ATan, ACot, ASec, ACsc
Hyperbolic: SinH, CosH, TanH, CotH, SecH, CscH
Inverse Hyp: ASinH, ACosH, ATanH, ACotH, ASecH, ACscH
Statistical: Norm, ChiSq(x,df), StudT(t,df), FishF(F,df1,df2)
Inverse Stat: ANorm, AChiSq(p,df), AStudT(p,df), AFishF(p,df1,df2)

Note: Most versions of JavaScript are case-sensitive. Make sure you type function names exactly as you see them above.

Note: The trig functions work in radians. For degrees, multiply or divide by the Deg variable. For example: Sin(30/Deg) will return 0.5, and ATan(1)*Deg will return 45.

Note: The factorial function is implemented for all real numbers. For non-integers its accuracy is about 6 significant figures. For negative integers it returns either a very large number or a division-by-zero error.

Note: The statistical functions Norm and StudT return 2-tail p-values (eg: Norm(1.96)=0.05), while ChiSq and FishF return 1-tail values. This is consistent with the way these functions are most frequently used.

Note: Some of the functions listed above are not currently implemented in JavaScript, so I have programmed them as user-defined functions. You can see the algorithms by 'viewing the document source' for this page. Feel free to copy them if you find them useful.

Disclaimer: I believe this calculator to be reasonably accurate and reliable, but I make no guarantees and assume no responsibility for any computational inaccuracies or their consequences.

Return to the Interactive Statistics page, or to the JCP Home Page

Send e-mail to John C. Pezzullo (this page's author) at