SSL sqrt_approx.pvs
Interaktion und PortierbarkeitPVS
sqrt_approx : theory begin %----------------------------------------------------------------------------- % % Includes sqrt_newton, sqrt_approx % % This theory was originally developed by Michel Levy (LSR IMAG, France) after % Exercise Page 66 N°8 of Reasoned Programming by Krysia Broda, % Susan Eisenbach, Hessam Koshnevisan, and Steve Vickers, 1994. Prentice Hall. % % It was modified and integrated to sqrt_approx in the NASA PVS Library % by C. Munoz (NIA) on March 28 2005. The definition of sqrt_bisect was % moved to the Interval package. % %-----------------------------------------------------------------------------
IMPORTING sq,sqrt,log_nat
x,y : VAR nnreal
n : VAR nat
z : VAR posreal
eps,eps1,eps2 : VAR posreal
sqrt_newton_aux(x,(y | x < sq(y)),eps) : recursive {z | x < sq(z) AND sq(z)-x < eps} = if sq(y)-x < eps then y else sqrt_newton_aux(x,((y+x/y)/2),eps) endif measureif sq(y)-x < eps then 0 else 1+log_nat((sq(y)-x)/eps,4)`1 endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.