tclquadcode

Check-in [86167d6917]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add a 'cos2' test case to illustrate the cost of non-numeric ordering comparisons
Timelines: family | ancestors | descendants | both | notworking | kbk-jumpthread
Files: files | file ages | folders
SHA3-256:86167d691745292d2ca3c0b0c47f96e623a7595774afcb30d24d520178b1c10f
User & Date: kbk 2018-12-16 04:55:59
Context
2018-12-16
05:18
Add constant folding for unary +. It probably ought to be folded out altogether, since it serves only to trigger type checking.

Add an outline of the actual process of jump threading once the threads have been determined. check-in: c388c8737b user: kbk tags: notworking, kbk-jumpthread

04:55
Add a 'cos2' test case to illustrate the cost of non-numeric ordering comparisons check-in: 86167d6917 user: kbk tags: notworking, kbk-jumpthread
04:43
Finish forward analysis in the jump threading pass. check-in: dc90afa15d user: kbk tags: notworking, kbk-jumpthread
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to demos/perftest/tester.tcl.

    29     29       set t 1.0
    30     30       set i 0
    31     31       while {[incr i] < $n} {
    32     32   	set t [expr {-$t*$x*$x / [incr j] / [incr j]}]
    33     33   	set s [expr {$s + $t}]
    34     34       }
    35     35       return $s
           36  +}
           37  +proc cos2 {x {n 16}} {
           38  +    set j 0
           39  +    set s 1.0
           40  +    set t 1.0
           41  +    set i 0
           42  +    while {+[incr i] < +$n} {
           43  +	set t [expr {-$t*$x*$x / [incr j] / [incr j]}]
           44  +	set s [expr {$s + $t}]
           45  +    }
           46  +    return $s
    36     47   }
    37     48   proc coscaller1 {x} {
    38     49       cos [expr {double($x)}]
    39     50   }
    40     51   proc coscaller2 {} {
    41     52       for {set i -100} {$i <= 100} {incr i} {
    42     53   	set x [expr {0.00314159 * $i}]
................................................................................
  2260   2271   set errorCode {}
  2261   2272   set demos {
  2262   2273       # Mathematical operations; [fib] and [cos] are supposed to be accelerated
  2263   2274       # heavily, the others are less critical
  2264   2275       {fib 85}
  2265   2276       {fib-r 15}
  2266   2277       {cos 1.2}
         2278  +    {cos2 1.2}
  2267   2279       # Fails on a roundoff error: {tantest 1.2}
  2268   2280       {inttest 345}
  2269   2281       {math::ln_Gamma 1.3}
  2270   2282       {polartest 0.6 0.8}
  2271   2283       {lmapconsttest}
  2272   2284       {powmul1 13 3}
  2273   2285       {powmul2 13 3}
................................................................................
  2589   2601   # compilation engine will do that for us if necessary.
  2590   2602   
  2591   2603   set toCompile {
  2592   2604       # Mathematical operations; [fib] and [cos] are supposed to be accelerated
  2593   2605       # heavily, the others are less critical
  2594   2606       fib fib-r
  2595   2607       ::cos
         2608  +    ::cos2
  2596   2609       tantest
  2597   2610       inttest
  2598   2611       math::ln_Gamma
  2599   2612       polartest
  2600   2613       lmapconsttest
  2601   2614       shift
  2602   2615       powmul1 powmul2