Wiki Agenda Contact Version française

KB3D: an avionics example

This avionics code has been modified to take into account floating-point inaccuracies.


Authors: Sylvie Boldo / Thi Minh Tuyen Nguyen

Topics: Floating-Point Computations

Tools: Frama-C / Jessie / Gappa

References:

Ref B: wialson galef="nPE hi> feren (by Aum

correspona> t>Auvalue -1<1t>Audecioinih2> - plane -lll got>Auits leflloruits right. Note2> at has untfical Comtocv tPVS t> - ta.cultml">F>KB3Dto l"> Howe="h,lvi pr hre/b, whml"> - value /h2> -linen.html"> untsal C,2> -lresultum y bp>still under #A020F0ng#pr gma >ReIof gerMpoil(ccah)>

Thi ">still under #B22222">//@ logta.iof ger l_s (rea.lx) = (x >= 0.0) ?<1t: -1;>

Thi ">still under #B22222">/*@lre"> res e1<= x-\to l"(x) <= e2;olsoje@n.hsures (\resultu!= 0 ==> \resultu== l_s (\to l"(x))) & ta;& ta;oje@nnnnnnnnnn\abs(\result) <= 1 ;oje@*/>

Thi ama-s (do.fre x, do.fre e1, do.fre e2) { lsoje>still under #4169E1liif>

Thi (x > e2)tools.still under #4169E1lireturn>

Thi 1;oje>still under #4169E1liif>

Thi (x < e1)tools.still under #4169E1lireturn>

Thi -1;oje>still under #4169E1lireturn>

Thi 0; }ais>still under #B22222">/*@lre"> res oje@nnnsxu== \to l"(sx) & ta;& ta; syu== \to l"(sy) & ta;& ta;oje@nnnvxu== \to l"(vx) & ta;& ta; vyu== \to l"(vy) & ta;& ta;oje@nnn\abs(sx) <= 100.0 & ta;& ta; \abs(sy) <= 100.0 & ta;& ta; oje@nnn\abs(vx) <= 1.0 & ta;& ta; \abs(vy) <= 1.0;soje@n.hsuresoje@nnnn\resultu!= 0 oje@nnnnnn==> \resultu== l_s (\to l"(sx)*\to l"(vx)+\to l"(sy)*\to l"(vy))oje@nnnnnnnnnn * l_s (\to l"(sx)*\to l"(vy)-\to l"(sy)*\to l"(vx));oje@*/>

Thi ama-v> still under #4169E1lireturn>

Thi s1*s2;n} ">still under #B22222">/* Lota.lVariafres: inenile-ine1.pre "LC_ALL=Cum

Thi -C Sylvie Bd" size=" size="+2"> Mosfootes, C© 2012-2017 Blueyferenfrom<> CssTriplatesFree.Netfere,eby<> larkfate2>Formally V