### Profile

 1 ```-- This file has been generated by CoCoSim2. ``` ```-- Compiler: Lustre compiler 2 (ToLustre.m) ``` ```-- Time: 17-Jan-2018 14:18:30 ``` ```--external libraries ``` ```#open ``` ```#open ``` ```--Round towards plus infinity. ``` ``` node _Ceiling (x: real) ``` ```returns(y:int); ``` ```let ``` ``` y= if x < 0.0 then real_to_int(x) ``` ``` else real_to_int(x) + 1; ``` ```tel ``` ```--Rounds number to the nearest representable value. ``` ``` node _Convergent (x: real) ``` ```returns(y:int); ``` ```let ``` ``` y = if (x > 0.5) then ``` ``` if (fmod(x, 2.0) = 0.5) then _Floor(x) ``` ``` else _Floor(x + 0.5) ``` ``` else ``` ``` if (x >= -0.5) then 0 ``` ``` else ``` ``` if (fmod(x, 2.0) = -0.5) then _Ceiling(x) ``` ``` else _Ceiling(x - 0.5); ``` ```tel ``` ```--Round towards minus infinity.. ``` ``` node _Floor (x: real) ``` ```returns(y:int); ``` ```let ``` ``` y= if x < 0.0 then real_to_int(x) - 1 ``` ``` else real_to_int(x); ``` ```tel ``` ```--Rounds number to the nearest representable value. ``` ```--If a tie occurs, rounds toward positive infinity ``` ``` node _Nearest (x: real) ``` ```returns(y:int); ``` ```let ``` ``` y = if (_fabs(x) >= 0.5) then _Floor(x + 0.5) ``` ``` else 0; ``` ```tel ``` ```--Rounds number to the nearest representable value. ``` ```--If a tie occurs,rounds positive numbers toward positive infinity and rounds negative numbers toward negative infinity ``` ``` node _Round (x: real) ``` ```returns(y:int); ``` ```let ``` ``` y = if (x >= 0.5) then _Floor(x + 0.5) ``` ``` else if (x > -0.5) then 0 ``` ``` else _Ceiling(x - 0.5); ``` ```tel ``` ```node bool_to_real (x: bool) ``` ```returns(y:real); ``` ```let ``` ``` y= if x then 1.0 else 0.0; ``` ```tel ``` ```node int_to_uint8 (x: int) ``` ```returns(y:int); ``` ```let ``` ``` y= if x > 255 then 0 + rem_int_int((x - 255 - 1),256) ``` ``` else if x < 0 then 255 + rem_int_int((x - (0) + 1),256) ``` ``` else x; ``` ```tel ``` ```node _fabs (x:real) ``` ```returns(z:real); ``` ```let ``` ``` z= if (x >= 0.0) then x ``` ``` else -x; ``` ```tel ``` ```node rem_int_int (x, y: int) ``` ```returns(z:int); ``` ```let ``` ``` z= if (x < 0) and (y > 0) then (x mod -y) ``` ``` else (x mod y); ``` ```tel ``` ```--Simulink code ``` ```-- Original block name: Add_PP ``` ```node Add_PP (In1_1:real; ``` ```In1_2:real; ``` ```In1_3:real; ``` ```In2_1:real; ``` ```In3_1:int; ``` ```In4_1:int; ``` ```In5_1:real; ``` ```In6_1:int; ``` ```In7_1:int; ``` ```In8_1:bool; ``` ```In9_1:real; ``` ```In10_1:int; ``` ```In11_1:real; ``` ```In12_1:int; ``` ```In13_1:real; ``` ```In14_1:int; ``` ```In15_1:real; ``` ```In16_1:int; ``` ```In17_1:real; ``` ```In18_1:int; ``` ```In19_1:real; ``` ```In20_1:int; ``` ```In21_1:real; ``` ```In22_1:int;) ``` ``` returns (Out1_1:real; ``` ```Out1_2:real; ``` ```Out1_3:real; ``` ```Out2_1:real; ``` ```Out3_1:real; ``` ```Out4_1:int; ``` ```Out5_1:real; ``` ```Out6_1:real; ``` ```Out7_1:int; ``` ```Out8_1:int; ``` ```Out9_1:int; ``` ```Out10_1:int; ``` ```Out11_1:int; ``` ```Out12_1:int; ``` ```Out13_1:int;); ``` ```-- Contract In progress ``` ```var Add_1:real; ``` ``` Add_2:real; ``` ``` Add_3:real;Add1_1:real;Add10_1:int;Add11_1:int;Add12_1:int;Add2_1:real;Add3_1:int;Add4_1:real;Add5_1:real;Add6_1:int;Add7_1:int;Add8_1:int;Add9_1:int; ``` ```let ``` ``` Add_1 = 0.0 + In1_1 - In2_1 + In1_1; ``` ``` Add_2 = 0.0 + In1_2 - In2_1 + In1_2; ``` ``` Add_3 = 0.0 + In1_3 - In2_1 + In1_3; ``` ``` Add1_1 = 0.0 + In1_1 + In1_2 + In1_3; ``` ``` Add10_1 = 0 + _Round(In17_1) + In18_1; ``` ``` Add11_1 = 0 + real_to_int(In19_1) + In20_1; ``` ``` Add12_1 = 0 + real_to_int(In21_1) + In22_1; ``` ``` Add2_1 = 0.0 - In1_1 - In1_2 - In1_3; ``` ``` Add3_1 = int_to_uint8(0 + int_to_uint8(In3_1) + int_to_uint8(In4_1)); ``` ``` Add4_1 = 0.0 + In5_1 + int_to_real(In6_1); ``` ``` Add5_1 = 0.0 + int_to_real(In7_1) + bool_to_real(In8_1); ``` ``` Add6_1 = 0 + _Floor(In9_1) + In10_1; ``` ``` Add7_1 = 0 + _Ceiling(In11_1) + In12_1; ``` ``` Add8_1 = 0 + _Convergent(In13_1) + In14_1; ``` ``` Add9_1 = 0 + _Nearest(In15_1) + In16_1; ``` ``` Out1_1 = Add_1; ``` ``` Out1_2 = Add_2; ``` ``` Out1_3 = Add_3; ``` ``` Out2_1 = Add1_1; ``` ``` Out3_1 = Add2_1; ``` ``` Out4_1 = Add3_1; ``` ``` Out5_1 = Add4_1; ``` ``` Out6_1 = Add5_1; ``` ``` Out7_1 = Add6_1; ``` ``` Out8_1 = Add7_1; ``` ``` Out9_1 = Add8_1; ``` ``` Out10_1 = Add9_1; ``` ``` Out11_1 = Add10_1; ``` ``` Out12_1 = Add11_1; ``` ``` Out13_1 = Add12_1; ``` ``` ``` ```tel ```