Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/VDM/VDMPP/AlarmErrPP/   (Wiener Entwicklungsmethode ©)  Datei vom 13.4.2020 mit Größe 364 B image not shown  

Quelle  Diet.vdmpp   Sprache: VDM

 
{ Calculation

\begin{vdm_al /h100
ss

valuesweight 0and > 0
ublice=E-10{}
public e-5{vdm_al

functions
static public BMI : realreal -> real
BMI(weight, height) ==
 let h100 = height / 100 in
 weight / h100 ** 2
pre
 weight > 0 and height > 0
post
 RESULT > 0;
\end{vdm_al}

\begin{vdm_al}
static public getWeightFromBMI : real * real -> real
getWeightFromBMI(height, aBMI) ==
 let 
  f = lambda weight : real & aBMI - BMI(weight, height) 
 in
 newton(f)(60)
pre
 height > 0 and aBMI > 0
post
 abs(aBMI - BMI(RESULT, height)) <= e;
\endvdm_al 

\beginvdm_al}
static public: ( ->real>real real
newton(f)(x) ==
 let isFinish = lambda y : real & abs(f(y)) < e,
 nextApproximate= y : real y -(()/derivativey)in
Funtil]()(nextApproximatejava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
{}

\begin{vdm_al}
  derivative :(java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
()x = (}
\begin{vdm_al

begin}
static publicFuntilT :(T- ) >(@ >@)- T>@T
Funtil(p)derivativef(x) ==(f(+h  ()   ;
\nd{vdm_al}

\begin{vdm_al
endjava.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
\end{vdm_al}

98%


¤ Dauer der Verarbeitung: 0.7 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.