Changes in / [d997f8e:79b5869]


Ignore:
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • doc/bibliography/cfa.bib

    rd997f8e r79b5869  
    30353035    year        = 1992,
    30363036    pages       = {T1-53},
    3037 }
    3038 
    3039 @manual{GMP,
    3040     keywords    = {GMP arbitrary-precision library},
    3041     contributer = {pabuhr@plg},
    3042     title       = {{GNU} Multiple Precision Arithmetic Library},
    3043     author      = {GMP},
    3044     organization= {GNU},
    3045     year        = 2016,
    3046     note        = {\href{https://gmplib.org}{https://\-gmplib.org}},
    30473037}
    30483038
  • src/Parser/lex.ll

    rd997f8e r79b5869  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Mon May 22 07:46:30 2017
    13  * Update Count     : 525
     12 * Last Modified On : Thu May 18 09:03:49 2017
     13 * Update Count     : 513
    1414 */
    1515
     
    377377"?"{op_binary_over}"?"  { IDENTIFIER_RETURN(); }                // binary
    378378        /*
    379           This rule handles ambiguous cases with operator identifiers, e.g., "int *?*?()", where the string "*?*?"  can be
    380           lexed as "*?"/"*?" or "*"/"?*?". Since it is common practise to put a unary operator juxtaposed to an identifier,
    381           e.g., "*i", users will be annoyed if they cannot do this with respect to operator identifiers. Therefore, there is
    382           a lexical look-ahead for the second case, with backtracking to return the leading unary operator and then
    383           reparsing the trailing operator identifier.  Otherwise a space is needed between the unary operator and operator
    384           identifier to disambiguate this common case.
    385 
    386           A similar issue occurs with the dereference, *?(...), and routine-call, ?()(...) identifiers.  The ambiguity
    387           occurs when the deference operator has no parameters, *?() and *?()(...), requiring arbitrary whitespace
    388           look-ahead for the routine-call parameter-list to disambiguate.  However, the dereference operator must have a
    389           parameter/argument to dereference *?(...).  Hence, always interpreting the string *?() as * ?() does not preclude
    390           any meaningful program.
    391 
    392           The remaining cases are with the increment/decrement operators and conditional expression:
    393 
    394           i++? ...(...);
    395           i?++ ...(...);
    396 
    397           requiring arbitrary whitespace look-ahead for the operator parameter-list, even though that interpretation is an
    398       incorrect expression (juxtaposed identifiers).  Therefore, it is necessary to disambiguate these cases with a
    399       space:
    400 
    401           i++ ? i : 0;
    402           i? ++i : 0;
     379          This rule handles ambiguous cases with operator identifiers, e.g., "int *?*?()", where the string "*?*?"
     380          can be lexed as "*"/"?*?" or "*?"/"*?". Since it is common practise to put a unary operator juxtaposed
     381          to an identifier, e.g., "*i", users will be annoyed if they cannot do this with respect to operator
     382          identifiers. Even with this special hack, there are 5 general cases that cannot be handled. The first
     383          case is for the function-call identifier "?()":
     384
     385          int * ?()();  // declaration: space required after '*'
     386          * ?()();      // expression: space required after '*'
     387
     388          Without the space, the string "*?()" is ambiguous without N character look ahead; it requires scanning
     389          ahead to determine if there is a '(', which is the start of an argument/parameter list.
     390
     391          The 4 remaining cases occur in expressions:
     392
     393          i++?i:0;              // space required before '?'
     394          i--?i:0;              // space required before '?'
     395          i?++i:0;              // space required after '?'
     396          i?--i:0;              // space required after '?'
     397
     398          In the first two cases, the string "i++?" is ambiguous, where this string can be lexed as "i"/"++?" or
     399          "i++"/"?"; it requires scanning ahead to determine if there is a '(', which is the start of an argument
     400          list.  In the second two cases, the string "?++x" is ambiguous, where this string can be lexed as
     401          "?++"/"x" or "?"/"++x"; it requires scanning ahead to determine if there is a '(', which is the start of
     402          an argument list.
    403403        */
    404 {op_unary}"?"({op_unary_pre_post}|"()"|"[?]"|{op_binary_over}"?") {
     404{op_unary}"?"({op_unary_pre_post}|"[?]"|{op_binary_over}"?") {
    405405        // 1 or 2 character unary operator ?
    406406        int i = yytext[1] == '?' ? 1 : 2;
  • src/libcfa/math

    rd997f8e r79b5869  
    1010// Created On       : Mon Apr 18 23:37:04 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 24 17:40:39 2017
    13 // Update Count     : 60
     12// Last Modified On : Sun Apr 24 12:45:02 2016
     13// Update Count     : 59
    1414//
    1515
     
    2020#include <math.h>                                                                               // fpclassify, isfinite, isnormal, isnan, isinf
    2121} // extern "C"
     22
     23float fabs( float );
     24// extern "C" { double fabs( double ); }
     25long double fabs( long double );
     26float cabs( float _Complex );
     27// extern "C" { double cabs( double _Complex ); }
     28long double cabs( long double _Complex );
    2229
    2330float ?%?( float, float );
  • src/libcfa/math.c

    rd997f8e r79b5869  
    1010// Created On       : Tue Apr 19 22:23:08 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 23 22:52:13 2017
    13 // Update Count     : 76
     12// Last Modified On : Sun Apr 24 08:52:31 2016
     13// Update Count     : 75
    1414//
    1515
     
    1919#include <complex.h>
    2020} // extern "C"
     21
     22float fabs( float x ) { return fabsf( x ); }
     23long double fabs( long double x ) { return fabsl( x ); }
     24float cabs( float _Complex x ) { return cabsf( x ); }
     25long double cabs( long double _Complex x ) { return cabsl( x ); }
    2126
    2227float ?%?( float x, float y ) { return fmodf( x, y ); }
  • src/tests/.expect/64/math.txt

    rd997f8e r79b5869  
    1 fmod:1 1 1 1 1 1
    2 remainder:-1 -1 -1
    3 remquo:7 0.0999999 7 0.1 7 0.0999999999999999999
    4 div:7 0.0999999 7 0.1 7 0.0999999999999999999
    5 fma:-2 -2 -2
    6 fdim:2 2 2
    7 nan:nan nan nan
    8 exp:2.71828 2.71828182845905 2.71828182845904524 1.46869+2.28736i 1.46869393991589+2.28735528717884i 1.46869393991588516+2.28735528717884239i
    9 exp2:2 2 2
    10 expm1:1.71828 1.71828182845905 1.71828182845904524
    11 log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
    12 log2:3 3 3
    13 log10:2 2 2
    14 log1p:0.693147 0.693147180559945 0.693147180559945309
    15 ilogb:0 0 0
    16 logb:3 3 3
    17 sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
    18 cbrt:3 3 3
    19 hypot:1.41421 1.4142135623731 1.41421356237309505
    20 pow:1 1 1 0.273957+0.583701i 0.273957253830121+0.583700758758615i 0.273957253830121071+0.583700758758614628i
    21 sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
    22 cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
    23 tan:1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i
    24 asin:1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
    25 acos:0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
    26 atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
    27 atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831 sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
    28 cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
    29 tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
    30 acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
    31 asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
    32 atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
    33 erf:0.842701 0.842700792949715 0.842700792949714869
    34 erfc:0.157299 0.157299207050285 0.157299207050285131
    35 lgamma:1.79176 1.79175946922805 1.791759469228055
    36 lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
    37 tgamma:6 6 6
    38 floor:1 1 1
    39 ceil:2 2 2
    40 trunc:3 3 3
    41 rint:2 2 2
    42 rint:2 2 2
    43 rint:2 2 2
    44 lrint:2 2 2
    45 llrint:2 2 2
    46 nearbyint:4 4 4
    47 round:2 2 2
    48 round:2 2 2
    49 round:2 2 2
    50 lround:2 2 2
    51 llround:2 2 2
    52 copysign:-1 -1 -1
    53 frexp:0.5 3 0.5 3 0.5 3
    54 ldexp:8 8 8
    55 modf:2 0.3 2 0.3 2 0.3 nextafter:2 2 2
    56 nexttoward:2 2 2
    57 scalbn:16 16 16
    58 scalbln:16 16 16
     1fabs: 1 1 1 1.41421 1.41421356237309505 1.41421356237309505
     2fmod: 1 1 1 1 1 1
     3remainder: -1 -1 -1
     4remquo: 7 0.0999999 7 0.1 7 0.0999999999999999999
     5div: 7 0.0999999 7 0.1 7 0.0999999999999999999
     6fma: -2 -2 -2
     7fdim: 2 2 2
     8nan: nan nan nan
     9exp: 2.71828 2.71828182845905 2.71828182845904524 1.46869+2.28736i 1.46869393991589+2.28735528717884i 1.46869393991588516+2.28735528717884239i
     10exp2: 2 2 2
     11expm1: 1.71828 1.71828182845905 1.71828182845904524
     12log: 0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
     13log2: 3 3 3
     14log10: 2 2 2
     15log1p: 0.693147 0.693147180559945 0.693147180559945309
     16ilogb: 0 0 0
     17logb: 3 3 3
     18sqrt: 1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
     19cbrt: 3 3 3
     20hypot: 1.41421 1.4142135623731 1.41421356237309505
     21pow: 1 1 1 0.273957+0.583701i 0.273957253830121+0.583700758758615i 0.273957253830121071+0.583700758758614628i
     22sin: 0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
     23cos: 0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
     24tan: 1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i
     25asin: 1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
     26acos: 0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
     27atan: 0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
     28atan2: 0.785398 0.785398163397448 0.78539816339744831 atan: 0.785398 0.785398163397448 0.78539816339744831 sinh: 1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
     29cosh: 1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
     30tanh: 0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
     31acosh: 0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
     32asinh: 0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
     33atanh: inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
     34erf: 0.842701 0.842700792949715 0.842700792949714869
     35erfc: 0.157299 0.157299207050285 0.157299207050285131
     36lgamma: 1.79176 1.79175946922805 1.791759469228055
     37lgamma: 1.79176 1 1.79175946922805 1 1.791759469228055 1
     38tgamma: 6 6 6
     39floor: 1 1 1
     40ceil: 2 2 2
     41trunc: 3 3 3
     42rint: 2 2 2
     43rint: 2 2 2
     44rint: 2 2 2
     45lrint: 2 2 2
     46llrint: 2 2 2
     47nearbyint: 4 4 4
     48round: 2 2 2
     49round: 2 2 2
     50round: 2 2 2
     51lround: 2 2 2
     52llround: 2 2 2
     53copysign: -1 -1 -1
     54frexp: 0.5 3 0.5 3 0.5 3
     55ldexp: 8 8 8
     56modf: 2 0.3 2 0.3 2 0.3 nextafter: 2 2 2
     57nexttoward: 2 2 2
     58scalbn: 16 16 16
     59scalbln: 16 16 16
  • src/tests/KRfunctions.c

    rd997f8e r79b5869  
     1//                               -*- Mode: C -*-
    12//
    23// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
     
    1011// Created On       : Thu Feb 16 15:23:17 2017
    1112// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 24 22:05:00 2017
    13 // Update Count     : 3
     13// Last Modified On : Thu Feb 16 15:25:52 2017
     14// Update Count     : 2
    1415//
    1516
  • src/tests/complex.c

    rd997f8e r79b5869  
    1 //
    2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
    3 //
    4 // The contents of this file are covered under the licence agreement in the
    5 // file "LICENCE" distributed with Cforall.
    6 //
    7 // complex.c --
    8 //
    9 // Author           : Peter A. Buhr
    10 // Created On       : Wed May 24 22:07:31 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 24 22:08:01 2017
    13 // Update Count     : 1
    14 //
    15 
    161#include <stdio.h>
    172#include <complex.h>
     
    3520#endif // __CFA
    3621}
    37 
    38 // Local Variables: //
    39 // tab-width: 4 //
    40 // compile-command: "cfa complex.c" //
    41 // End: //
  • src/tests/gmp.c

    rd997f8e r79b5869  
    1010// Created On       : Tue Apr 19 08:55:51 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 24 22:05:38 2017
    13 // Update Count     : 540
     12// Last Modified On : Mon May 22 09:05:09 2017
     13// Update Count     : 538
    1414//
    1515
     
    8888        sout | (int)0 | fact | endl;
    8989        for ( unsigned int i = 1; i <= 40; i += 1 ) {
    90                 fact *= i;                                                                              // general case
     90                fact = fact * i;                                                                // general case
    9191                sout | i | fact | endl;
    9292        } // for
     
    9494
    9595// Local Variables: //
     96// mode: c //
    9697// tab-width: 4 //
    97 // compile-command: "cfa gmp.c -l gmp" //
    9898// End: //
  • src/tests/math.c

    rd997f8e r79b5869  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 24 13:04:33 2017
    13 // Update Count     : 71
     12// Last Modified On : Sun Apr 24 13:24:20 2016
     13// Update Count     : 70
    1414//
    1515
     
    2222        long double l;
    2323
     24        sout | "fabs:" | fabs( -1.0F ) | fabs( -1.0D ) | fabs( -1.0L ) | cabs( -1.0F+1.0FI ) | cabs( -1.0D+1.0DI ) | cabs( -1.0DL+1.0LI ) | endl;
    2425        sout | "fmod:" | 5.0F % -2.0F | fmod( 5.0F, -2.0F ) | 5.0D % -2.0D | fmod( 5.0D, -2.0D ) | 5.0L % -2.0L | fmod( 5.0L, -2.0L ) | endl;
    2526        sout | "remainder:" | remainder( 2.0F, 3.0F ) | remainder( 2.0D, 3.0D ) | remainder( 2.0L, 3.0L ) | endl;
  • src/tests/numericConstants.c

    rd997f8e r79b5869  
    1 //
    2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
    3 //
    4 // The contents of this file are covered under the licence agreement in the
    5 // file "LICENCE" distributed with Cforall.
    6 //
    7 // numericConstants.c --
    8 //
    9 // Author           : Peter A. Buhr
    10 // Created On       : Wed May 24 22:10:36 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 24 22:11:36 2017
    13 // Update Count     : 2
    14 //
    15 
    161int main() {
    172        1;                                                      // decimal
     
    6348        0x_ff.ffp0;                                     // hex real
    6449        0x_1.ffff_ffff_p_128_l;
    65 } // main
    66 
    67 // Local Variables: //
    68 // tab-width: 4 //
    69 // compile-command: "cfa minmax.c" //
    70 // End: //
     50}
  • src/tests/rational.c

    rd997f8e r79b5869  
    1010// Created On       : Mon Mar 28 08:43:12 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May 17 15:46:35 2017
    13 // Update Count     : 65
     12// Last Modified On : Mon May 15 21:32:22 2017
     13// Update Count     : 64
    1414//
    1515
Note: See TracChangeset for help on using the changeset viewer.