add VA curve of 'PNP 9012' & 'NPN 9013' to node analysis
authoryu.dongliang <18588496441@163.com>
Thu, 27 Feb 2025 03:41:44 +0000 (11:41 +0800)
committeryu.dongliang <18588496441@163.com>
Thu, 27 Feb 2025 03:41:44 +0000 (11:41 +0800)
17 files changed:
Makefile
cpk/9012.txt [new file with mode: 0644]
cpk/9013.txt [new file with mode: 0644]
main.c
scf_eda_pack.c
ses_core.h
ses_layout.c
ses_node_analysis.c
ses_step_dc_npn.c
ses_step_draw.c
ses_step_topo.c
test/Makefile
test/astable_multivibrator.c [new file with mode: 0644]
test/colpitts.c
test/fft.c
test/pnp.c
test/v.txt

index 17f9afc9aaaadea843a754432a9241fd04378707..4a9b09aa0398296fd30069cd4ba717e14e72db86 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,7 @@ LDFLAGS += -lcairo
 LDFLAGS += -lgsl -lgslcblas
 
 all:
-       gcc $(CFLAGS) $(CFILES) $(LDFLAGS)
+       gcc $(CFLAGS) $(CFILES) $(LDFLAGS) -o ses
 
 clean:
        rm *.o
diff --git a/cpk/9012.txt b/cpk/9012.txt
new file mode 100644 (file)
index 0000000..849920a
--- /dev/null
@@ -0,0 +1,8 @@
+ 20uA,  20mV, 150
+ 60uA,  60mV, 150
+120uA, 120mV, 150
+160uA, 160mV, 150
+220uA, 220mV, 150
+380uA, 380mV, 150
+0.5mA, 500mV, 150
+1.2mA, 700mV, 150
diff --git a/cpk/9013.txt b/cpk/9013.txt
new file mode 100644 (file)
index 0000000..849920a
--- /dev/null
@@ -0,0 +1,8 @@
+ 20uA,  20mV, 150
+ 60uA,  60mV, 150
+120uA, 120mV, 150
+160uA, 160mV, 150
+220uA, 220mV, 150
+380uA, 380mV, 150
+0.5mA, 500mV, 150
+1.2mA, 700mV, 150
diff --git a/main.c b/main.c
index 566a9ca64e63338a67d0b7b2a13678c4f24a7b78..f43076b308fb9600e41867ddf36d32f1a8073cb2 100644 (file)
--- a/main.c
+++ b/main.c
@@ -225,7 +225,7 @@ int ses_draw_IC(ScfEcomponent* c)
        char file[128];
        snprintf(file, sizeof(file) - 1, "./IC%ld.png", c->id);
 
-       ses_draw(c->f, file, c->f->x, c->f->y, c->f->w, c->f->h, 0, 0);
+       ses_draw(c->f, file, c->f->x, c->f->y, c->f->w, c->f->h, 0, -1);
        return 0;
 }
 
@@ -303,7 +303,7 @@ int main(int argc, char* argv[])
 
                printf("f: %s\n", f->name);
 
-               ses_steps_analyse(f, 100, 1);
+               ses_steps_analyse(f, 10 * 1000, 3);
        }
 
        ScfEboard_free(b);
index 999550f2dba32d38603a1786fff2751b81558799..dc1f052047fb0909ce871a65753a824128930e1e 100644 (file)
@@ -169,7 +169,7 @@ static ScfEdata  component_datas[] =
 
        {SCF_EDA_Diode,      0,                   0, 0, 0,    0,   0,   0, 0, &__diode_ops, NULL, NULL},
        {SCF_EDA_NPN,        0,                   0, 0, 0,    0,   0,   0, 0, &__npn_ops,   NULL, "./cpk/9013.txt"},
-       {SCF_EDA_PNP,        0,                   0, 0, 0,    0,   0,   0, 0, &__pnp_ops,   NULL, NULL},
+       {SCF_EDA_PNP,        0,                   0, 0, 0,    0,   0,   0, 0, &__pnp_ops,   NULL, "./cpk/9012.txt"},
 
        {SCF_EDA_NAND,       0,                   0, 0, 0,    0,   0,   0, 0, &__nand_ops,  "./cpk/nand.cpk", NULL},
        {SCF_EDA_NOR,        0,                   0, 0, 0,    0,   0,   0, 0, &__nor_ops,   "./cpk/nor.cpk", NULL},
index 6ca5e472f516cbdb360266d746be7d23ba1116fa..839eda2478511f8e2eb881290ae0d97f1509d225 100644 (file)
@@ -16,6 +16,8 @@ typedef struct ses_ctx_s     ses_ctx_t;
 #define SES_PATH_BRANCH  1
 #define SES_PATH_BRIDGE  2
 
+#define SHOW_COLOR  cairo_set_source_rgb
+
 struct ses_path_s
 {
        int            refs;
index adccb31a07a4439b4729345d8a70a49ba3aeeb11..b89f96d94ca498a728ec1b6495b2fd982a1d097b 100644 (file)
@@ -997,14 +997,29 @@ static void __ses_set_xy(ScfEfunction* f, int d)
                                p1 = c->pins[SCF_EDA_NAND_IN1];
                                p2 = c->pins[SCF_EDA_NAND_OUT];
 
+                               if (p0->y > p1->y)
+                                       SCF_XCHG(p0, p1);
+
                                if (0 == n) {
-                                       p0->x = c->x + 36;
-                                       p1->x = c->x + 36;
-                                       p2->x = c->x - 36;
+                                       if (c->y < p1->y) {
+                                               p0->x = c->x + d * 7 / 8;
+                                               p1->x = c->x + d / 8;
+                                       } else {
+                                               p0->x = c->x + d / 8;
+                                               p1->x = c->x + d * 7 / 8;
+                                       }
+
+                                       p2->x = c->x - d * 7 / 8;
                                } else {
-                                       p0->x = c->x - 36;
-                                       p1->x = c->x - 36;
-                                       p2->x = c->x + 36;
+                                       if (c->y < p1->y) {
+                                               p0->x = c->x - d * 7 / 8;
+                                               p1->x = c->x - d / 8;
+                                       } else {
+                                               p0->x = c->x - d / 8;
+                                               p1->x = c->x - d * 7 / 8;
+                                       }
+
+                                       p2->x = c->x + d * 7 / 8;
                                }
                                break;
 
@@ -1015,11 +1030,11 @@ static void __ses_set_xy(ScfEfunction* f, int d)
                                p1 = c->pins[SCF_EDA_NOT_OUT];
 
                                if (c->x < p1->x) {
-                                       p0->x = c->x - 36;
-                                       p1->x = c->x + 36;
+                                       p0->x = c->x - d * 7 / 8;
+                                       p1->x = c->x + d * 7 / 8;
                                } else {
-                                       p0->x = c->x + 36;
-                                       p1->x = c->x - 36;
+                                       p0->x = c->x + d * 7 / 8;
+                                       p1->x = c->x - d * 7 / 8;
                                }
                                break;
                        default:
@@ -1169,12 +1184,13 @@ static void __ses_set_cx(ScfEfunction* f, int d)
 {
        ScfEcomponent* c;
        ScfEcomponent* c2;
+       ScfEline*      el;
        ScfEpin*       p;
        ScfEpin*       p2;
 
-       size_t i;
-       size_t j;
-       size_t k;
+       long i;
+       long j;
+       long k;
 
        qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_cx);
        for (i = 1; i < f->n_components; i++) {
@@ -1184,9 +1200,11 @@ static void __ses_set_cx(ScfEfunction* f, int d)
                int tmp = c->x;
 
                if (SCF_EDA_NPN == c->type
-                               || SCF_EDA_PNP == c->type
-                               || SCF_EDA_NPN == c2->type
-                               || SCF_EDA_PNP == c2->type)
+                               || SCF_EDA_NPN  == c2->type
+                               || SCF_EDA_PNP  == c->type || SCF_EDA_PNP  == c2->type
+                               || SCF_EDA_NAND == c->type || SCF_EDA_NAND == c2->type
+                               || SCF_EDA_NOR  == c->type || SCF_EDA_NOR  == c2->type
+                               || SCF_EDA_NOT  == c->type || SCF_EDA_NOT  == c2->type)
                        c->x = c2->x + d * 2;
                else
                        c->x = c2->x + d;
@@ -1196,6 +1214,18 @@ static void __ses_set_cx(ScfEfunction* f, int d)
                        p->x     += c->x - tmp;
                }
        }
+
+       for (i = 0; i < f->n_components; i++) {
+               c  =        f->components[i];
+
+               for (j = 0; j < f->n_elines; j++) {
+                       el =        f->elines[j];
+
+                       if (c->y - d / 4 < el->lines[0]->y0 && el->lines[0]->y0 < c->y + d / 4)
+                               c->y -= d / 3;
+               }
+       }
+
        qsort(f->components, f->n_components, sizeof(ScfEcomponent*), ecomponent_cmp_id);
 }
 
@@ -1292,9 +1322,11 @@ _max:
                        continue;
 
                if (SCF_EDA_NPN == c->type
-                               || SCF_EDA_PNP == c->type
-                               || SCF_EDA_NPN == mt
-                               || SCF_EDA_PNP == mt)
+                               || SCF_EDA_NPN  == mt
+                               || SCF_EDA_PNP  == c->type || SCF_EDA_PNP  == mt
+                               || SCF_EDA_NAND == c->type || SCF_EDA_NAND == mt
+                               || SCF_EDA_NOR  == c->type || SCF_EDA_NOR  == mt
+                               || SCF_EDA_NOT  == c->type || SCF_EDA_NOT  == mt)
                        c->x = max + d * 2;
                else
                        c->x = max + d;
@@ -1321,9 +1353,11 @@ _max:
                                        break;
 
                                if (SCF_EDA_NPN == c->type
-                                               || SCF_EDA_PNP == c->type
-                                               || SCF_EDA_NPN == c2->type
-                                               || SCF_EDA_PNP == c2->type)
+                                               || SCF_EDA_NPN  == c2->type
+                                               || SCF_EDA_PNP  == c->type  || SCF_EDA_PNP  == c2->type
+                                               || SCF_EDA_NAND == c->type  || SCF_EDA_NAND == c2->type
+                                               || SCF_EDA_NOR  == c->type  || SCF_EDA_NOR  == c2->type
+                                               || SCF_EDA_NOT  == c->type  || SCF_EDA_NOT  == c2->type)
                                        c->x = c2->x + d * 2;
                                else
                                        c->x = c2->x + d;
@@ -1479,8 +1513,7 @@ int ses_layout_function(ScfEfunction* f, int d)
        f->w  = tx1 + d * 2;
        f->h += d;
 
-       scf_loge("f->x: %d, y: %d, w: %d, h: %d, tx0: %d, tx1: %d\n", f->x, f->y, f->w, f->h, tx0, tx1);
-
+       scf_logi("f->x: %d, y: %d, w: %d, h: %d, tx0: %d, tx1: %d\n", f->x, f->y, f->w, f->h, tx0, tx1);
        return 0;
 }
 
@@ -1511,6 +1544,8 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
        size_t j;
        size_t k;
 
+       cairo_set_source_rgb(cr, 0, 0, 0);
+
        for (i = 0; i < b->n_functions; i++) {
                f  =        b->functions[i];
 
@@ -1518,27 +1553,27 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
                        el =        f->elines[j];
 
                        if (SCF_EDA_PIN_POS & el->flags)
-                               cairo_set_source_rgb(cr, 1, 0, 0);
+                               SHOW_COLOR(cr, 1, 0, 0);
 
                        else if (SCF_EDA_PIN_NEG & el->flags)
-                               cairo_set_source_rgb(cr, 0, 0, 1);
+                               SHOW_COLOR(cr, 0, 0, 1);
 
                        else if (SCF_EDA_PIN_IN0 & el->flags)
-                               cairo_set_source_rgb(cr, 0.8, 0, 0);
+                               SHOW_COLOR(cr, 0.8, 0, 0);
 
                        else if (SCF_EDA_PIN_IN & el->flags)
-                               cairo_set_source_rgb(cr, 0, 0, 0.8);
+                               SHOW_COLOR(cr, 0, 0, 0.8);
 
                        else if (SCF_EDA_PIN_CONST & el->flags)
-                               cairo_set_source_rgb(cr, 0, 0.6, 0);
+                               SHOW_COLOR(cr, 0, 0.6, 0);
 
                        else if (SCF_EDA_PIN_OUT & el->flags)
-                               cairo_set_source_rgb(cr, 1, 0, 1);
+                               SHOW_COLOR(cr, 1, 0, 1);
 
                        else if (SCF_EDA_PIN_CF & el->flags)
-                               cairo_set_source_rgb(cr, 0.8, 0, 0.8);
+                               SHOW_COLOR(cr, 0.8, 0, 0.8);
                        else
-                               cairo_set_source_rgb(cr, 1, 0.5, 0.1);
+                               SHOW_COLOR(cr, 1, 0.5, 0.1);
 
                        uint8_t text[64];
 
@@ -1554,13 +1589,13 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
                                        continue;
 
                                if (!prev) {
-                                       snprintf(text, sizeof(text) - 1, "%ld", el->id);
+                                       int n = snprintf(text, sizeof(text) - 1, "%ld", el->id);
 
-                                       cairo_move_to  (cr, l->x0 - 30, l->y0 + 5);
+                                       cairo_move_to  (cr, l->x0 - 10 - n * 14, l->y0 + 10);
                                        cairo_show_text(cr, text);
                                }
 
-                               cairo_set_line_width(cr, 4);
+                               cairo_set_line_width(cr, 3);
                                cairo_move_to(cr, l->x0, l->y0);
                                cairo_line_to(cr, l->x1, l->y1);
                                cairo_stroke(cr);
index 928ace514fbc833c89d4903b52e0664ea0d9c7be..51198033c10b9c630f8ba95cf3a3afec728ff552 100644 (file)
@@ -120,6 +120,7 @@ int __ses_nodes_path2(ScfEfunction* f, ses_path_t* path, int vip_m, int vip_n, s
                                } else if (SCF_EDA_NPN_C == p->id)
                                        edge2 = ses_edges_find_edge_by_pin(edges, c->pins[SCF_EDA_NPN_B]);
 
+                       case SCF_EDA_Capacitor:
                        case SCF_EDA_Inductor:
                                if (!node) {
                                        node = ses_node_alloc();
@@ -484,28 +485,27 @@ static void __ses_Vb_by_curve(ScfEcomponent* c, double Ib, double* V)
        double R;
 
        if (0 == i) {
-               V0 = 0.0;
-               A0 = 0.0;
                V1 = c->curves[i]->v;
                A1 = c->curves[i]->a;
+               R  = V1 / Ib;
+               *V = V1;
 
        } else if (i >= c->n_curves) {
                assert(2 <= c->n_curves);
 
-               V0 = c->curves[c->n_curves - 2]->v;
-               A0 = c->curves[c->n_curves - 2]->a;
                V1 = c->curves[c->n_curves - 1]->v;
                A1 = c->curves[c->n_curves - 1]->a;
+               R  = V1 / Ib;
+               *V = V1;
        } else {
                V0 = c->curves[i - 1]->v;
                A0 = c->curves[i - 1]->a;
                V1 = c->curves[i]->v;
                A1 = c->curves[i]->a;
+               R  = (V1 - V0) / (A1 - A0);
+               *V =  V0 +  R  * (Ib - A0);
        }
 
-       R  = (V1 - V0) / (A1 - A0);
-       *V =  V0 +  R  * (Ib - A0);
-
        scf_logi("i: %d, n_curves: %ld, Ib: %lg, R: %lg, V: %lg\n", i, c->n_curves, Ib, R, *V);
 }
 
@@ -550,7 +550,7 @@ static int __ses_edges_update_Ab(ScfEfunction* f, scf_vector_t* edges, double* A
                        double Ib = X[n + edge->index];
                        double Rb = SCF_EDA_V_NPN_ON / Ib;
                        double V  = SCF_EDA_V_NPN_ON;
-#if 0
+#if 1
                        if (c->curves && c->n_curves > 0) {
                                __ses_Vb_by_curve(c, Ib, &V);
                                __ses_Vb_by_curve(c, V,  &V);
@@ -561,10 +561,10 @@ static int __ses_edges_update_Ab(ScfEfunction* f, scf_vector_t* edges, double* A
                                if (dV < V * 0.99 || dV > V * 1.01) {
 
                                        if (p0->IC)
-                                               scf_logi("edge: [%d] IC%ld_c%ldp%ld-c%ldp%ld, Vb: %lg, Ve: %lg, dV: %lg, V: %lg, Ib: %lg, Rb: %lg\n",
+                                               scf_logd("edge: [%d] IC%ld_c%ldp%ld-c%ldp%ld, Vb: %lg, Ve: %lg, dV: %lg, V: %lg, Ib: %lg, Rb: %lg\n",
                                                                edge->index, p0->IC->id, p0->cid, p0->id, p1->cid, p1->id, Vb, Ve, dV, V, Ib, Rb);
                                        else
-                                               scf_logi("edge: [%d] c%ldp%ld-c%ldp%ld, Vb: %lg, Ve: %lg, dV: %lg, V: %lg, Ib: %lg, Rb: %lg\n",
+                                               scf_logd("edge: [%d] c%ldp%ld-c%ldp%ld, Vb: %lg, Ve: %lg, dV: %lg, V: %lg, Ib: %lg, Rb: %lg\n",
                                                                edge->index, p0->cid, p0->id, p1->cid, p1->id, Vb, Ve, dV, V, Ib, Rb);
 
                                        A[(n + edge->index) * N + n + edge->index] = -Rb;
@@ -572,10 +572,10 @@ static int __ses_edges_update_Ab(ScfEfunction* f, scf_vector_t* edges, double* A
                                        k++;
                                } else {
                                        if (p0->IC)
-                                               scf_logw("edge: [%d] IC%ld_c%ldp%ld-c%ldp%ld, Vb: %lg, Ve: %lg, dV: %lg, V: %lg, Ib: %lg, Rb: %lg\n",
+                                               scf_logi("edge: [%d] IC%ld_c%ldp%ld-c%ldp%ld, Vb: %lg, Ve: %lg, dV: %lg, V: %lg, Ib: %lg, Rb: %lg\n",
                                                                edge->index, p0->IC->id, p0->cid, p0->id, p1->cid, p1->id, Vb, Ve, dV, V, Ib, Rb);
                                        else
-                                               scf_logw("edge: [%d] c%ldp%ld-c%ldp%ld, Vb: %lg, Ve: %lg, dV: %lg, V: %lg, Ib: %lg, Rb: %lg\n",
+                                               scf_logi("edge: [%d] c%ldp%ld-c%ldp%ld, Vb: %lg, Ve: %lg, dV: %lg, V: %lg, Ib: %lg, Rb: %lg\n",
                                                                edge->index, p0->cid, p0->id, p1->cid, p1->id, Vb, Ve, dV, V, Ib, Rb);
                                }
                        } else {
@@ -609,8 +609,15 @@ static int __ses_edges_update_Ab(ScfEfunction* f, scf_vector_t* edges, double* A
                                Ve = Bn->v;
 
                        double dV = Vb - Ve;
-                       double Rb = SCF_EDA_V_NPN_ON / Ib;
-
+                       double V  = SCF_EDA_V_NPN_ON;
+                       double Rb = V / Ib;
+#if 1
+                       if (c->curves && c->n_curves > 0) {
+                               __ses_Vb_by_curve(c, Ib, &V);
+                               __ses_Vb_by_curve(c, V,  &V);
+                               Rb = V / Ib;
+                       }
+#endif
                        if (dI < -1e-10
                                        && -1e8 < Rb && Rb < 1e8) {
 
@@ -698,7 +705,7 @@ static int __ses_nodes_path_solve2(ScfEfunction* f, ses_path_t* path, int vip_m,
 
        int n_offs = 0;
 
-#define MAX_TRYS 20
+#define MAX_TRYS 10000
        int try = 0;
        do {
                n_offs = 0;
@@ -717,8 +724,10 @@ static int __ses_nodes_path_solve2(ScfEfunction* f, ses_path_t* path, int vip_m,
 
        } while (ret > 0 && try < MAX_TRYS);
 
-       if (try >= MAX_TRYS)
+       if (try >= MAX_TRYS) {
+               free(A);
                return -1;
+       }
 
        for (i = 0; i < n; i++) {
                node  = nodes->data[i];
index 93be2aeab71dc1e3c189eaa85572b870257b2caf..2fa2115ee888d5d18e8b6dc7fe3a22beeb048462 100644 (file)
@@ -43,18 +43,18 @@ static int __dc_npn_status(ScfEfunction* root, ScfEfunction* f, ScfEpin* Bp, Scf
                        c->status = SCF_EDA_Status_OFF;
 
                        if (pb->IC)
-                               scf_loge("NPN IC%ld_T%ld, status: %d\n", pb->IC->id, c->id, c->status);
+                               scf_logi("NPN IC%ld_T%ld, status: %d\n", pb->IC->id, c->id, c->status);
                        else
-                               scf_loge("NPN T%ld, status: %d\n", c->id, c->status);
+                               scf_logi("NPN T%ld, status: %d\n", c->id, c->status);
                        continue;
                }
 
                if (c->lock) {
                        if (pb->IC)
-                               scf_loge("\033[34mIC%ld_T%ld, status: %d, lock: %d, pb->v: %lg, pe->v: %lg, diff: %lg, off: %lg\033[0m\n",
+                               scf_logi("\033[34mIC%ld_T%ld, status: %d, lock: %d, pb->v: %lg, pe->v: %lg, diff: %lg, off: %lg\033[0m\n",
                                                pb->IC->id, c->id, c->status, c->lock, pb->v, pe->v, pb->v - pe->v, SCF_EDA_V_NPN_OFF);
                        else
-                               scf_loge("\033[34mT%ld, status: %d, lock: %d, pb->v: %lg, pe->v: %lg, diff: %lg, off: %lg\033[0m\n",
+                               scf_logi("\033[34mT%ld, status: %d, lock: %d, pb->v: %lg, pe->v: %lg, diff: %lg, off: %lg\033[0m\n",
                                                c->id, c->status, c->lock, pb->v, pe->v, pb->v - pe->v, SCF_EDA_V_NPN_OFF);
                        continue;
                }
@@ -112,10 +112,10 @@ static int __dc_npn_status(ScfEfunction* root, ScfEfunction* f, ScfEpin* Bp, Scf
                }
 
                if (pb->IC)
-                       scf_loge("\033[34mIC%ld_T%ld, status: %d, lock: %d, pb->v: %lg, pe->v: %lg, diff: %lg, off: %lg\033[0m\n",
+                       scf_logi("\033[34mIC%ld_T%ld, status: %d, lock: %d, pb->v: %lg, pe->v: %lg, diff: %lg, off: %lg\033[0m\n",
                                        pb->IC->id, c->id, c->status, c->lock, pb->v, pe->v, pb->v - pe->v, SCF_EDA_V_NPN_OFF);
                else
-                       scf_loge("\033[34mT%ld, status: %d, lock: %d, pb->v: %lg, pe->v: %lg, diff: %lg, off: %lg\033[0m\n",
+                       scf_logi("\033[34mT%ld, status: %d, lock: %d, pb->v: %lg, pe->v: %lg, diff: %lg, off: %lg\033[0m\n",
                                        c->id, c->status, c->lock, pb->v, pe->v, pb->v - pe->v, SCF_EDA_V_NPN_OFF);
        }
 
index 58f513a380d2353b8aa74074bfcfe53d173e6b51..a2bc48b485a65657a8a69a4aeb4e1669d72fcb5f 100644 (file)
@@ -1,16 +1,16 @@
 #include<cairo/cairo.h>
 #include"ses_core.h"
 
-#define SHOW_BITS 1000.0
+#define SHOW_BITS  1000.0
 
 static void ses_text_a(cairo_t* cr, int x, int y, double a)
 {
        char text[64];
 
        if (a > 0)
-               cairo_set_source_rgb(cr, 0.7, 0.0, 0.0);
+               SHOW_COLOR(cr, 0.7, 0.0, 0.0);
        else
-               cairo_set_source_rgb(cr, 0.0, 0.0, 0.7);
+               SHOW_COLOR(cr, 0.0, 0.0, 0.7);
 
        if (a > 1e-1 || a < -1e-1) {
                snprintf(text, sizeof(text) - 1, "%lgA", (int64_t)(a * SHOW_BITS) / SHOW_BITS);
@@ -37,9 +37,9 @@ static void ses_text_v(cairo_t* cr, int x, int y, double v)
        char text[64];
 
        if (v > 0)
-               cairo_set_source_rgb(cr, 0.7, 0.0, 0.0);
+               SHOW_COLOR(cr, 0.7, 0.0, 0.0);
        else
-               cairo_set_source_rgb(cr, 0.0, 0.0, 0.7);
+               SHOW_COLOR(cr, 0.0, 0.0, 0.7);
 
        if (v > 1e-1 || v < -1e-1) {
                snprintf(text, sizeof(text) - 1, "%lgV", (int64_t)(v * SHOW_BITS) / SHOW_BITS);
@@ -79,9 +79,9 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
 
                cairo_set_line_width(cr, 2.5);
 
-               cairo_set_source_rgb  (cr, 0, 0, 0);
+               cairo_set_source_rgb(cr, 0, 0, 0);
                cairo_select_font_face(cr, "Calibri", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
-               cairo_set_font_size   (cr, 20);
+               cairo_set_font_size   (cr, 18);
 
                uint8_t text[64];
                int n = 0;
@@ -120,6 +120,17 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                else
                                        cairo_move_to(cr, c->x - 20 - n * 10, c->y + 12);
                                break;
+
+                       case SCF_EDA_NAND:
+                       case SCF_EDA_NOR:
+                       case SCF_EDA_NOT:
+                               n = snprintf(text, sizeof(text) - 1, "%ld", c->id);
+
+                               if (c->pins[2]->x < c->x)
+                                       cairo_move_to(cr, c->x + 10, c->y - 12);
+                               else
+                                       cairo_move_to(cr, c->x - 10 - n * 10, c->y - 12);
+                               break;
                        default:
                                n = snprintf(text, sizeof(text) - 1, "%ld", c->id);
                                cairo_move_to(cr, c->x - 10 - n * 10, c->y - 12);
@@ -130,9 +141,9 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                cairo_stroke(cr);
 
                if ((SCF_EDA_Diode == c->type || SCF_EDA_NPN == c->type) && SCF_EDA_Status_OFF == c->status)
-                       cairo_set_source_rgb(cr, 0.0, 0.6, 0.6);
+                       SHOW_COLOR(cr, 0.0, 0.6, 0.6);
                else
-                       cairo_set_source_rgb(cr, 0.6, 0.6, 0.0);
+                       SHOW_COLOR(cr, 0.6, 0.6, 0.0);
 
                for (k = 0; k < c->n_pins; k++) {
                        p  =        c->pins[k];
@@ -193,7 +204,7 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                break;
 
                        case SCF_EDA_Capacitor:
-                               cairo_set_source_rgb(cr, 0.8, 0.0, 0.0);
+                               SHOW_COLOR(cr, 0.8, 0.0, 0.0);
 
                                p = c->pins[SCF_EDA_Battery_POS];
                                if (p->y < c->y) {
@@ -201,34 +212,34 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                        cairo_line_to(cr, c->x + 8, c->y - 5);
                                        cairo_stroke(cr);
 
-                                       cairo_set_source_rgb(cr, 0.6, 0.6, 0.0);
+                                       SHOW_COLOR(cr, 0.6, 0.6, 0.0);
                                        cairo_move_to(cr, c->x, c->y - 5);
                                } else {
                                        cairo_move_to(cr, c->x - 8, c->y + 5);
                                        cairo_line_to(cr, c->x + 8, c->y + 5);
                                        cairo_stroke(cr);
 
-                                       cairo_set_source_rgb(cr, 0.6, 0.6, 0.0);
+                                       SHOW_COLOR(cr, 0.6, 0.6, 0.0);
                                        cairo_move_to(cr, c->x, c->y + 5);
                                }
                                cairo_line_to(cr, p->x, p->y);
                                cairo_stroke(cr);
 
-                               cairo_set_source_rgb(cr, 0.0, 0.0, 0.8);
+                               SHOW_COLOR(cr, 0.0, 0.0, 0.8);
                                p = c->pins[SCF_EDA_Battery_NEG];
                                if (p->y < c->y) {
                                        cairo_move_to(cr, c->x - 8, c->y - 5);
                                        cairo_line_to(cr, c->x + 8, c->y - 5);
                                        cairo_stroke(cr);
 
-                                       cairo_set_source_rgb(cr, 0.6, 0.6, 0.0);
+                                       SHOW_COLOR(cr, 0.6, 0.6, 0.0);
                                        cairo_move_to(cr, c->x, c->y - 5);
                                } else {
                                        cairo_move_to(cr, c->x - 8, c->y + 5);
                                        cairo_line_to(cr, c->x + 8, c->y + 5);
                                        cairo_stroke(cr);
 
-                                       cairo_set_source_rgb(cr, 0.6, 0.6, 0.0);
+                                       SHOW_COLOR(cr, 0.6, 0.6, 0.0);
                                        cairo_move_to(cr, c->x, c->y + 5);
                                }
                                cairo_line_to(cr, p->x, p->y);
@@ -239,7 +250,7 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                ses_text_v(cr, c->x + 10, c->y + 10, c->v);
                                ses_text_a(cr, c->x + 10, c->y + 25, c->a);
 
-                               cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
+                               SHOW_COLOR(cr, 0.0, 0.0, 0.0);
 
                                if (c->uf < 1e-6)
                                        snprintf(text, sizeof(text) - 1, "%lgpF", c->uf * 1e6);
@@ -254,7 +265,7 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                break;
 
                        case SCF_EDA_Inductor:
-                               cairo_set_source_rgb(cr, 0.8, 0.0, 0.0);
+                               SHOW_COLOR(cr, 0.8, 0.0, 0.0);
                                p = c->pins[SCF_EDA_Battery_POS];
 #define DRAW_Inductor() \
                                do { \
@@ -263,14 +274,14 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                                cairo_stroke(cr); \
                                                cairo_arc(cr, c->x + 1, c->y - 5, 5, M_PI * 0.45, M_PI * 1.55); \
                                                cairo_stroke(cr); \
-                                               cairo_set_source_rgb(cr, 0.6, 0.6, 0.0); \
+                                               SHOW_COLOR(cr, 0.6, 0.6, 0.0); \
                                                cairo_move_to(cr, c->x, c->y - 19); \
                                        } else { \
                                                cairo_arc(cr, c->x + 1, c->y + 15, 5, M_PI * 0.45, M_PI * 1.55); \
                                                cairo_stroke(cr); \
                                                cairo_arc(cr, c->x + 1, c->y + 5, 5, M_PI * 0.45, M_PI * 1.55); \
                                                cairo_stroke(cr); \
-                                               cairo_set_source_rgb(cr, 0.6, 0.6, 0.0); \
+                                               SHOW_COLOR(cr, 0.6, 0.6, 0.0); \
                                                cairo_move_to(cr, c->x, c->y + 19); \
                                        } \
                                        cairo_line_to(cr, p->x, p->y); \
@@ -279,7 +290,7 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                DRAW_Inductor();
                                cairo_stroke(cr);
 
-                               cairo_set_source_rgb(cr, 0.0, 0.0, 0.8);
+                               SHOW_COLOR(cr, 0.0, 0.0, 0.8);
                                p = c->pins[SCF_EDA_Battery_NEG];
                                DRAW_Inductor();
                                cairo_stroke(cr);
@@ -289,7 +300,7 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                ses_text_v(cr, c->x + 10, c->y + 10, c->v);
                                ses_text_a(cr, c->x + 10, c->y + 25, c->a);
 
-                               cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
+                               SHOW_COLOR(cr, 0.0, 0.0, 0.0);
 
                                if (c->uh > 100000.0)
                                        snprintf(text, sizeof(text) - 1, "%lgH", c->uh / 1000000.0);
@@ -315,13 +326,13 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                cairo_line_to(cr, c->x - dx1, c->y - dy1);
                                cairo_stroke(cr);
 
-                               cairo_set_source_rgb(cr, 0.0, 0.0, 0.8);
+                               SHOW_COLOR(cr, 0.0, 0.0, 0.8);
 
                                cairo_move_to    (cr,  c->x - dx1 + dx0, c->y - dy1 + dy0);
                                cairo_rel_line_to(cr, -dx0 * 2,   -dy0 * 2);
                                cairo_stroke(cr);
 
-                               cairo_set_source_rgb(cr, 0.6, 0.6, 0.0);
+                               SHOW_COLOR(cr, 0.6, 0.6, 0.0);
 
                                cairo_move_to    (cr,  c->x - dx1 - dx0, c->y - dy1 - dy0);
                                cairo_rel_line_to(cr,  dx1 * 2,    dy1 * 2);
@@ -335,9 +346,9 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
 
                                cairo_select_font_face(cr, "Georgia", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
 
-                               ses_text_a(cr, c->x + 10, c->y + 27, c->a);
+                               ses_text_a(cr, c->x + 8, c->y + 27, c->a);
 
-                               cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
+                               SHOW_COLOR(cr, 0.0, 0.0, 0.0);
                                if (c->r + c->dr > 1e6)
                                        snprintf(text, sizeof(text) - 1, "%lgMΩ", (int64_t)(c->r + c->dr) / 1000.0);
                                else if (c->r + c->dr > 999)
@@ -345,7 +356,7 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                else
                                        snprintf(text, sizeof(text) - 1, "%lgΩ", (int64_t)((c->r + c->dr) * 1000.0) / 1000.0);
 
-                               cairo_move_to  (cr, c->x + 10, c->y - 9);
+                               cairo_move_to  (cr, c->x + 8, c->y - 9);
                                cairo_show_text(cr, text);
                                cairo_stroke(cr);
                                break;
@@ -551,9 +562,12 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                p0 = c->pins[SCF_EDA_NAND_IN0];
                                p1 = c->pins[SCF_EDA_NAND_IN1];
 
+                               if (p0->y > p1->y)
+                                       SCF_XCHG(p0, p1);
+
                                if (c->x < p->x) {
                                        cairo_move_to(cr, p->x, p->y);
-                                       cairo_line_to(cr, c->x + 32, c->y);
+                                       cairo_line_to(cr, p->x, c->y);
                                        cairo_line_to(cr, c->x + 24, c->y);
                                        cairo_stroke(cr);
 
@@ -568,27 +582,16 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                        cairo_line_to(cr, c->x - 6, c->y - 10);
                                        cairo_line_to(cr, c->x + 6, c->y - 10);
 
-                                       if (p0->y < p1->y) {
-                                               cairo_move_to(cr, c->x -  6, c->y - 5);
-                                               cairo_line_to(cr, c->x - 14, c->y - 5);
-                                               cairo_line_to(cr, p0->x,     p0->y);
-
-                                               cairo_move_to(cr, c->x -  6, c->y + 5);
-                                               cairo_line_to(cr, c->x - 14, c->y + 5);
-                                               cairo_line_to(cr, p1->x,     p1->y);
-                                       } else {
-                                               cairo_move_to(cr, c->x -  6, c->y - 5);
-                                               cairo_line_to(cr, c->x - 14, c->y - 5);
-                                               cairo_line_to(cr, p1->x,     p1->y);
-
-                                               cairo_move_to(cr, c->x -  6, c->y + 5);
-                                               cairo_line_to(cr, c->x - 14, c->y + 5);
-                                               cairo_line_to(cr, p0->x,     p0->y);
-                                       }
+                                       cairo_move_to(cr, c->x - 6, c->y - 5);
+                                       cairo_line_to(cr, p0->x,    c->y - 5);
+                                       cairo_line_to(cr, p0->x,    p0->y);
 
+                                       cairo_move_to(cr, c->x - 6, c->y + 5);
+                                       cairo_line_to(cr, p1->x,    c->y + 5);
+                                       cairo_line_to(cr, p1->x,    p1->y);
                                } else {
                                        cairo_move_to(cr, p->x, p->y);
-                                       cairo_line_to(cr, c->x - 32, c->y);
+                                       cairo_line_to(cr, p->x, c->y);
                                        cairo_line_to(cr, c->x - 24, c->y);
                                        cairo_stroke(cr);
 
@@ -603,23 +606,13 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                        cairo_line_to(cr, c->x + 6, c->y - 10);
                                        cairo_line_to(cr, c->x - 6, c->y - 10);
 
-                                       if (p0->y < p1->y) {
-                                               cairo_move_to(cr, c->x +  6, c->y - 5);
-                                               cairo_line_to(cr, c->x + 14, c->y - 5);
-                                               cairo_line_to(cr, p0->x,     p0->y);
-
-                                               cairo_move_to(cr, c->x +  6, c->y + 5);
-                                               cairo_line_to(cr, c->x + 14, c->y + 5);
-                                               cairo_line_to(cr, p1->x,     p1->y);
-                                       } else {
-                                               cairo_move_to(cr, c->x +  6, c->y - 5);
-                                               cairo_line_to(cr, c->x + 14, c->y - 5);
-                                               cairo_line_to(cr, p1->x,     p1->y);
+                                       cairo_move_to(cr, c->x + 6, c->y - 5);
+                                       cairo_line_to(cr, p0->x,    c->y - 5);
+                                       cairo_line_to(cr, p0->x,    p0->y);
 
-                                               cairo_move_to(cr, c->x +  6, c->y + 5);
-                                               cairo_line_to(cr, c->x + 14, c->y + 5);
-                                               cairo_line_to(cr, p0->x,     p0->y);
-                                       }
+                                       cairo_move_to(cr, c->x + 6, c->y + 5);
+                                       cairo_line_to(cr, p1->x,    c->y + 5);
+                                       cairo_line_to(cr, p1->x,    p1->y);
                                }
                                cairo_stroke(cr);
 
@@ -648,9 +641,12 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                p0 = c->pins[SCF_EDA_NOR_IN0];
                                p1 = c->pins[SCF_EDA_NOR_IN1];
 
+                               if (p0->y > p1->y)
+                                       SCF_XCHG(p0, p1);
+
                                if (c->x < p->x) {
                                        cairo_move_to(cr, p->x, p->y);
-                                       cairo_line_to(cr, c->x + 32, c->y);
+                                       cairo_line_to(cr, p->x, c->y);
                                        cairo_line_to(cr, c->x + 24, c->y);
                                        cairo_stroke(cr);
 
@@ -676,27 +672,16 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                        cairo_move_to(cr, c->x - 6, c->y - 10);
                                        cairo_line_to(cr, c->x,     c->y - 10);
 
-                                       if (p0->y < p1->y) {
-                                               cairo_move_to(cr, c->x -  2, c->y - 5);
-                                               cairo_line_to(cr, c->x - 10, c->y - 5);
-                                               cairo_line_to(cr, p0->x,     p0->y);
-
-                                               cairo_move_to(cr, c->x -  2, c->y + 5);
-                                               cairo_line_to(cr, c->x - 10, c->y + 5);
-                                               cairo_line_to(cr, p1->x,     p1->y);
-                                       } else {
-                                               cairo_move_to(cr, c->x -  2, c->y - 5);
-                                               cairo_line_to(cr, c->x - 10, c->y - 5);
-                                               cairo_line_to(cr, p1->x,     p1->y);
-
-                                               cairo_move_to(cr, c->x -  2, c->y + 5);
-                                               cairo_line_to(cr, c->x - 10, c->y + 5);
-                                               cairo_line_to(cr, p0->x,     p0->y);
-                                       }
+                                       cairo_move_to(cr, c->x - 2, c->y - 5);
+                                       cairo_line_to(cr, p0->x,    c->y - 5);
+                                       cairo_line_to(cr, p0->x,    p0->y);
 
+                                       cairo_move_to(cr, c->x - 2, c->y + 5);
+                                       cairo_line_to(cr, p1->x,    c->y + 5);
+                                       cairo_line_to(cr, p1->x,    p1->y);
                                } else {
                                        cairo_move_to(cr, p->x, p->y);
-                                       cairo_line_to(cr, c->x - 32, c->y);
+                                       cairo_line_to(cr, p->x, c->y);
                                        cairo_line_to(cr, c->x - 24, c->y);
                                        cairo_stroke(cr);
 
@@ -722,23 +707,13 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                        cairo_move_to(cr, c->x + 6, c->y - 10);
                                        cairo_line_to(cr, c->x,     c->y - 10);
 
-                                       if (p0->y < p1->y) {
-                                               cairo_move_to(cr, c->x +  2, c->y - 5);
-                                               cairo_line_to(cr, c->x + 10, c->y - 5);
-                                               cairo_line_to(cr, p0->x,     p0->y);
-
-                                               cairo_move_to(cr, c->x +  2, c->y + 5);
-                                               cairo_line_to(cr, c->x + 10, c->y + 5);
-                                               cairo_line_to(cr, p1->x,     p1->y);
-                                       } else {
-                                               cairo_move_to(cr, c->x +  2, c->y - 5);
-                                               cairo_line_to(cr, c->x + 10, c->y - 5);
-                                               cairo_line_to(cr, p1->x,     p1->y);
+                                       cairo_move_to(cr, c->x + 2, c->y - 5);
+                                       cairo_line_to(cr, p0->x,    c->y - 5);
+                                       cairo_line_to(cr, p0->x,    p0->y);
 
-                                               cairo_move_to(cr, c->x +  2, c->y + 5);
-                                               cairo_line_to(cr, c->x + 10, c->y + 5);
-                                               cairo_line_to(cr, p0->x,     p0->y);
-                                       }
+                                       cairo_move_to(cr, c->x + 2, c->y + 5);
+                                       cairo_line_to(cr, p1->x,    c->y + 5);
+                                       cairo_line_to(cr, p1->x,    p1->y);
                                }
                                cairo_stroke(cr);
 
@@ -767,7 +742,7 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
 
                                if (c->x < p->x) {
                                        cairo_move_to(cr, p->x, p->y);
-                                       cairo_line_to(cr, c->x + 32, c->y);
+                                       cairo_line_to(cr, p->x, c->y);
                                        cairo_line_to(cr, c->x + 24, c->y);
                                        cairo_stroke(cr);
 
@@ -781,11 +756,11 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
 
                                        p = c->pins[SCF_EDA_NOT_IN];
                                        cairo_move_to(cr, c->x - 16, c->y);
-                                       cairo_line_to(cr, c->x - 24, c->y);
+                                       cairo_line_to(cr, p->x,      c->y);
                                        cairo_line_to(cr, p->x,      p->y);
                                } else {
                                        cairo_move_to(cr, p->x, p->y);
-                                       cairo_line_to(cr, c->x - 32, c->y);
+                                       cairo_line_to(cr, p->x, c->y);
                                        cairo_line_to(cr, c->x - 24, c->y);
                                        cairo_stroke(cr);
 
@@ -798,8 +773,8 @@ void __ses_function_draw(ScfEfunction* f, cairo_t* cr)
                                        cairo_line_to(cr, c->x - 16, c->y);
 
                                        p = c->pins[SCF_EDA_NOT_IN];
-                                       cairo_move_to(cr, c->x + 16,  c->y);
-                                       cairo_line_to(cr, c->x + 24, c->y);
+                                       cairo_move_to(cr, c->x + 16, c->y);
+                                       cairo_line_to(cr, p->x,      c->y);
                                        cairo_line_to(cr, p->x,      p->y);
                                }
                                cairo_stroke(cr);
@@ -849,22 +824,24 @@ int ses_draw(ScfEfunction* f, const char* file, uint32_t bx, uint32_t by, uint32
        cairo_stroke(cr);
 
        cairo_select_font_face(cr, "Calibri", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
-       cairo_set_font_size(cr, 20);
+       cairo_set_font_size (cr, 20);
        cairo_set_source_rgb(cr, 0, 0, 0);
 
-       int64_t t = ns * count;
-       int64_t s = t / 1000000000;
-       t %= 1000000000;
-       int64_t ms = t / 1000000;
-       t %= 1000000;
-       int64_t us = t / 1000;
-       t %= 1000;
-
-       uint8_t time[512];
-       snprintf(time, sizeof(time) - 1, "%03ld,%03ld,%03ld,%03ldns", s, ms, us, t);
-       cairo_move_to  (cr, 10, 20);
-       cairo_show_text(cr, time);
-       cairo_stroke(cr);
+       if (count >= 0) {
+               int64_t t = ns * count;
+               int64_t s = t / 1000000000;
+               t %= 1000000000;
+               int64_t ms = t / 1000000;
+               t %= 1000000;
+               int64_t us = t / 1000;
+               t %= 1000;
+
+               uint8_t time[512];
+               snprintf(time, sizeof(time) - 1, "%03ld,%03ld,%03ld,%03ldns", s, ms, us, t);
+               cairo_move_to  (cr, 10, 20);
+               cairo_show_text(cr, time);
+               cairo_stroke(cr);
+       }
 
        long i;
        long j;
@@ -878,27 +855,27 @@ int ses_draw(ScfEfunction* f, const char* file, uint32_t bx, uint32_t by, uint32
                cairo_set_line_width(cr, 2);
 
                if (SCF_EDA_PIN_POS & el->flags)
-                       cairo_set_source_rgb(cr, 1, 0, 0);
+                       SHOW_COLOR(cr, 1, 0, 0);
 
                else if (SCF_EDA_PIN_NEG & el->flags)
-                       cairo_set_source_rgb(cr, 0, 0, 1);
+                       SHOW_COLOR(cr, 0, 0, 1);
 
                else if (SCF_EDA_PIN_OUT & el->flags)
-                       cairo_set_source_rgb(cr, 1, 0, 1);
+                       SHOW_COLOR(cr, 1, 0, 1);
 
                else if (SCF_EDA_PIN_IN0 & el->flags)
-                       cairo_set_source_rgb(cr, 0.8, 0, 0);
+                       SHOW_COLOR(cr, 0.8, 0, 0);
 
                else if (SCF_EDA_PIN_IN & el->flags)
-                       cairo_set_source_rgb(cr, 0, 0, 0.8);
+                       SHOW_COLOR(cr, 0, 0, 0.8);
 
                else if (SCF_EDA_PIN_CONST & el->flags)
-                       cairo_set_source_rgb(cr, 0, 0.6, 0);
+                       SHOW_COLOR(cr, 0, 0.6, 0);
 
                else if (SCF_EDA_PIN_CF & el->flags)
-                       cairo_set_source_rgb(cr, 0.8, 0, 0.8);
+                       SHOW_COLOR(cr, 0.8, 0, 0.8);
                else
-                       cairo_set_source_rgb(cr, 1, 0.5, 0.1);
+                       SHOW_COLOR(cr, 1, 0.5, 0.1);
 
                uint8_t  text[64];
                ScfLine* prev = NULL;
@@ -911,16 +888,16 @@ int ses_draw(ScfEfunction* f, const char* file, uint32_t bx, uint32_t by, uint32
 
                        if (!prev) {
                                cairo_select_font_face(cr, "Calibri", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
-                               cairo_set_font_size(cr, 28);
+                               cairo_set_font_size(cr, 26);
 
                                int n = snprintf(text, sizeof(text) - 1, "%ld", el->id);
 
-                               cairo_move_to  (cr, l->x0 - 10 - n * 12, l->y0 + 10);
+                               cairo_move_to  (cr, l->x0 - 8 - n * 13, l->y0 + 12);
                                cairo_show_text(cr, text);
                                cairo_stroke(cr);
                        }
 
-                       cairo_set_line_width(cr, 4);
+                       cairo_set_line_width(cr, 3);
                        cairo_move_to(cr, l->x0, l->y0);
                        cairo_line_to(cr, l->x1, l->y1);
                        cairo_stroke(cr);
@@ -937,7 +914,7 @@ int ses_draw(ScfEfunction* f, const char* file, uint32_t bx, uint32_t by, uint32
                        prev = l;
                }
 
-               if (prev) {
+               if (prev && count >= 0) {
                        int n;
 
                        if (el->v < SCF_EDA_V_MIN)
@@ -954,14 +931,14 @@ int ses_draw(ScfEfunction* f, const char* file, uint32_t bx, uint32_t by, uint32
                                n = snprintf(text, sizeof(text) - 1, "%lguV", (int64_t)(el->v * 1000000.0 * SHOW_BITS) / SHOW_BITS);
 
                        if (el->v == B->pins[SCF_EDA_Battery_POS]->v)
-                               cairo_set_source_rgb(cr, 1, 0, 0);
+                               SHOW_COLOR(cr, 1, 0, 0);
                        else if (el->v == B->pins[SCF_EDA_Battery_NEG]->v)
-                               cairo_set_source_rgb(cr, 0, 0, 1);
+                               SHOW_COLOR(cr, 0, 0, 1);
 
-                       cairo_set_font_size(cr, 20);
+                       cairo_set_font_size(cr, 18);
 
                        if (prev->x1 - prev->x0 >= 12 + n * 12)
-                               cairo_move_to(cr, prev->x1 - 12 - n * 12, prev->y0 - 5);
+                               cairo_move_to(cr, prev->x1 - 12 - n * 10, prev->y0 - 5);
                        else
                                cairo_move_to(cr, prev->x1 + 4, prev->y0 - 5);
 
@@ -986,7 +963,7 @@ static int _draw_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_t*
        char file[128];
        snprintf(file, sizeof(file) - 1, "./draw_%ld.png", i);
 #if 0
-       if (count < 64000)
+       if (count < 64000 && count > 100)
                return 0;
 #endif
 
index fee43cdbab483220a168c10e493d0d9e326f7f91..1ceaa17ce7a20e7908ed07e148e270cee06ae4c4 100644 (file)
@@ -32,6 +32,7 @@ static int __ses_dfs_line(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* np, scf_v
        ScfEline*      el = f->elines[np->lid];
        ScfEpin*       p;
 
+       int  add = 0;
        int  ret = 0;
        long j;
 
@@ -49,6 +50,7 @@ static int __ses_dfs_line(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* np, scf_v
                                        return ret;
 
                                *ppath = NULL;
+                               add = 0;
                        }
                        continue;
                }
@@ -64,6 +66,7 @@ static int __ses_dfs_line(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* np, scf_v
                                return ret;
 
                        *ppath = NULL;
+                       add = 0;
                }
 
                if (!c->ops || !c->ops->shared || !c->ops->shared(p))
@@ -75,6 +78,7 @@ static int __ses_dfs_line(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* np, scf_v
           && SCF_EDA_Capacitor != rc->type && SCF_EDA_Inductor != rc->type) {
                        tmp    = *ppath;
                        *ppath = NULL;
+                       add = 1;
                }
 
                ret = __ses_dfs_path(f, c, p, __paths, ppath, flags);
@@ -84,17 +88,15 @@ static int __ses_dfs_line(ScfEfunction* f, ScfEcomponent* rc, ScfEpin* np, scf_v
                if (SCF_EDA_Path_OFF == ret)
                        p->vflag = 0;
 
-               if (tmp) {
+               if (tmp)
                        *ppath = tmp;
+       }
 
-                       if (j + 2 >= el->n_pins) {
-
-                               ret = __ses_dfs_add_ppath(__paths, ppath);
-                               if (ret < 0)
-                                       return ret;
-                               *ppath = NULL;
-                       }
-               }
+       if (add) {
+               ret = __ses_dfs_add_ppath(__paths, ppath);
+               if (ret < 0)
+                       return ret;
+               *ppath = NULL;
        }
 
        return ret;
@@ -1521,8 +1523,6 @@ int ses_layout_paths(ScfEfunction* f, scf_vector_t*  paths)
 
                if (el->flags & SCF_EDA_PIN_POS) {
 
-                       scf_loge("e%ld->flags: %#lx\n", el->id, el->flags);
-
                        int ret = _topo_paths(f, el, paths, 0);
                        if (ret < 0)
                                return ret;
index 1ddd2a924b426aedea018867c5306bcc6e8d0321..3709298a8c3ed44f363d7edc7bf990bbb0c6c09f 100644 (file)
@@ -1,9 +1,10 @@
-CFILES += main.c
+#CFILES += main.c
 #CFILES += test.c
-#CFILES += fft.c
+CFILES += fft.c
 #CFILES += dct.c
 #CFILES += pnp.c
 #CFILES += colpitts.c
+#CFILES += astable_multivibrator.c
 CFILES += ../scf_eda_pack.c
 CFILES += ../pack/scf_pack.c
 
diff --git a/test/astable_multivibrator.c b/test/astable_multivibrator.c
new file mode 100644 (file)
index 0000000..f32c904
--- /dev/null
@@ -0,0 +1,86 @@
+#include<stdio.h>
+#include<stdlib.h>
+#include<string.h>
+#include"ses_core.h"
+
+int main(int argc, char* argv[])
+{
+       ScfEcomponent* B;
+
+       ScfEcomponent* R0;
+       ScfEcomponent* R1;
+       ScfEcomponent* R2;
+       ScfEcomponent* R3;
+       ScfEcomponent* C0;
+       ScfEcomponent* C1;
+       ScfEcomponent* T0;
+       ScfEcomponent* T1;
+
+       ScfEfunction*  f;
+       ScfEboard*     b;
+
+       b = scf_eboard__alloc();
+       f = scf_efunction__alloc("astable_multivibrator");
+
+       EDA_INST_ADD_COMPONENT(f, B,  SCF_EDA_Battery);
+
+       B->pins[SCF_EDA_Battery_NEG]->flags = SCF_EDA_PIN_NEG;
+       B->pins[SCF_EDA_Battery_POS]->flags = SCF_EDA_PIN_POS;
+
+       EDA_INST_ADD_COMPONENT(f, R0, SCF_EDA_Resistor);
+       EDA_INST_ADD_COMPONENT(f, R1, SCF_EDA_Resistor);
+       EDA_INST_ADD_COMPONENT(f, R2, SCF_EDA_Resistor);
+       EDA_INST_ADD_COMPONENT(f, R3, SCF_EDA_Resistor);
+       EDA_INST_ADD_COMPONENT(f, C0, SCF_EDA_Capacitor);
+       EDA_INST_ADD_COMPONENT(f, C1, SCF_EDA_Capacitor);
+       EDA_INST_ADD_COMPONENT(f, T0, SCF_EDA_NPN);
+       EDA_INST_ADD_COMPONENT(f, T1, SCF_EDA_NPN);
+
+       EDA_PIN_ADD_PIN(B,  SCF_EDA_Battery_POS,  R0, 1);
+       EDA_PIN_ADD_PIN(B,  SCF_EDA_Battery_POS,  R1, 1);
+       EDA_PIN_ADD_PIN(B,  SCF_EDA_Battery_POS,  R2, 1);
+       EDA_PIN_ADD_PIN(B,  SCF_EDA_Battery_POS,  R3, 1);
+
+       EDA_PIN_ADD_PIN(R0, 0,                    T0, SCF_EDA_NPN_C);
+       EDA_PIN_ADD_PIN(T0, SCF_EDA_NPN_E,        B,  SCF_EDA_Battery_NEG);
+
+       EDA_PIN_ADD_PIN(R1, 0,                    T1, SCF_EDA_NPN_C);
+       EDA_PIN_ADD_PIN(T1, SCF_EDA_NPN_E,        B,  SCF_EDA_Battery_NEG);
+
+       EDA_PIN_ADD_PIN(R2, 0,                    C0, 1);
+       EDA_PIN_ADD_PIN(C0, 0,                    R0, 0);
+       EDA_PIN_ADD_PIN(R2, 0,                    T1, SCF_EDA_NPN_B);
+
+       EDA_PIN_ADD_PIN(R3, 0,                    C1, 1);
+       EDA_PIN_ADD_PIN(C1, 0,                    R1, 0);
+       EDA_PIN_ADD_PIN(R3, 0,                    T0, SCF_EDA_NPN_B);
+
+       T0->pins[SCF_EDA_NPN_C]->flags |= SCF_EDA_PIN_OUT;
+       T1->pins[SCF_EDA_NPN_C]->flags |= SCF_EDA_PIN_OUT;
+
+       R0->r  = 1000;
+       R1->r  = 1000;
+       R2->r  = 1000 * 10;
+       R3->r  = 1000 * 10;
+       C0->uf = 1;
+       C1->uf = 1;
+       C0->r  = 1;
+
+       scf_eboard__add_function(b, f);
+
+       long     len = 0;
+       uint8_t* buf = NULL;
+
+       ScfEboard_pack(b, &buf, &len);
+       ScfEboard_free(b);
+       b = NULL;
+
+       FILE* fp = fopen("./astable_multivibrator.cpk", "wb");
+       if (!fp)
+               return -EINVAL;
+
+       fwrite(buf, len, 1, fp);
+       fclose(fp);
+
+       return 0;
+}
index 576f8d6a8e204d6e270f5d4a7e1c70b022febd23..c61891381f0ba04a6113bc77aa6c9fde0d74aa2f 100644 (file)
@@ -72,13 +72,13 @@ int main(int argc, char* argv[])
        R2->r  = 1000 * 10;
        R3->r  = 1000 * 10;
        C0->uf = 10;
-       C1->uf = 0.01;
-       C2->uf = 0.01;
-       C3->uf = 0.01;
+       C1->uf = 0.03;
+       C2->uf = 0.03;
+       C3->uf = 0.03;
        C1->r  = 1;
        C2->r  = 1;
        C3->r  = 1;
-       L0->uh = 1000;
+       L0->uh = 900;
        L0->r  = 1;
 
        scf_eboard__add_function(b, f);
index e969a293995373b5c7a75db6672db6450aae336f..18a48b70812a453adc794407b586c169a09d32a4 100644 (file)
@@ -9,7 +9,7 @@
 #define REAL(z,i) ((z)[2*(i)])
 #define IMAG(z,i) ((z)[2*(i)+1])
 
-#define N 512
+#define N 1024
 
 int main()
 {
@@ -25,12 +25,12 @@ int main()
        cairo_surface_t* surface;
        cairo_t*         cr;
 
-       surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 600, 400);
+       surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1200, 720);
        cr      = cairo_create (surface);
 
        cairo_set_line_width(cr, 2);
        cairo_set_source_rgb(cr, 1, 1, 1);
-       cairo_rectangle     (cr, 0, 0, 600, 600);
+       cairo_rectangle     (cr, 0, 0, 1280, 720);
        cairo_fill(cr);
        cairo_stroke(cr);
 
@@ -38,15 +38,10 @@ int main()
        cairo_set_font_size(cr, 20);
        cairo_set_source_rgb(cr, 0, 0, 0);
 
-       cairo_move_to(cr, 20,  234.5);
-       cairo_line_to(cr, 580, 234.5);
-       cairo_stroke(cr);
-
        double v0 = 0.0;
        double s  = 0.0;
        double min = 10.0;
        double max = 0.0;
-       int    n  = 0;
 
        for (i = 0; i < N; i++) {
                fscanf(fp, "%d, %lg", &j, &v);
@@ -54,7 +49,7 @@ int main()
                REAL(data, i) = v;
                IMAG(data, i) = 0.0;
 #if 1
-               if (i > 11 && i < 550) {
+               if (i > 11 && i < N) {
                        printf("i: %d, v0: %lg, v: %lg\n", i, v0, v);
 
                        if (max < v)
@@ -62,18 +57,21 @@ int main()
                        if (min > v)
                                min = v;
 
-                       cairo_move_to(cr, 40 + (i - 1), 300 - 20 * v0);
-                       cairo_line_to(cr, 40 + i,       300 - 20 * v);
+                       cairo_move_to(cr, 40 + 1 * (i - 1), 300 - 20 * v0);
+                       cairo_line_to(cr, 40 + 1 * i,       300 - 20 * v);
                        cairo_stroke(cr);
 
                        s += v;
-                       n++;
                }
                v0 = v;
 #endif
        }
 
-       printf("s/n: %lg, max: %lg, min: %lg, 300 - 10 * (max + min): %lg\n", s/n, max, min, 300 - 10 * (max + min));
+       cairo_move_to(cr,   20, 300 - 10 * (max + min));
+       cairo_line_to(cr, 1200, 300 - 10 * (max + min));
+       cairo_stroke(cr);
+
+       printf("avg: %lg, max: %lg, min: %lg, 300 - 10 * (max + min): %lg\n", (max + min) / 2, max, min, 300 - 10 * (max + min));
 
        cairo_surface_write_to_png(surface, "sin.png");
 
@@ -106,7 +104,7 @@ int main()
                printf("%d, %lg %lg\n", i, REAL(data, i) / sqrt(N), IMAG(data, i) / sqrt(N));
        }
 
-       double f = 100 * 1000 * imax / N;
+       double f = 10 * 1000 * imax / N;
 
        printf("avg: %lg, Zmax: %lg, imax: %d, f: %lg\n", sum / (N - 1), Zmax, imax, f);
 
index b42576f68cf4f733495927483368498df1695db6..a623c04f12796b37676285c3d28d8460be404ba3 100644 (file)
@@ -78,9 +78,9 @@ int main(int argc, char* argv[])
        R5->r  = 1000;
        R0->r  = 1000;
        C0->uf = 10;
-       C1->uf = 0.01;
-       C2->uf = 0.01;
-       C3->uf = 0.01;
+       C1->uf = 0.03;
+       C2->uf = 0.03;
+       C3->uf = 0.03;
        C1->r  = 1;
        C2->r  = 1;
        C3->r  = 1;
index d858f69a90ce55110a12372322537c53ae62aca9..c72fc2a74fa3e2557e12996b9af5983a87c88ac9 100644 (file)
-0, 3.5787
-1, 3.68047
-2, 3.78351
-3, 3.88737
-4, 3.99158
-5, 4.0956
-6, 4.19892
-7, 4.30097
-8, 4.40122
-9, 4.49914
-10, 4.59422
-11, 4.68597
-12, 4.77396
-13, 4.85778
-14, 4.93709
-15, 5.01156
-16, 5.08091
-17, 5.1449
-18, 5.20328
-19, 5.25584
-20, 5.30236
-21, 5.34265
-22, 5.37647
-23, 5.40363
-24, 5.42389
-25, 5.43705
-26, 5.44291
-27, 5.44129
-28, 5.43205
-29, 5.41508
-30, 5.39032
-31, 5.35778
-32, 5.31752
-33, 5.26967
-34, 5.21441
-35, 5.15201
-36, 5.08275
-37, 5.00697
-38, 4.92505
-39, 4.83738
-40, 4.74436
-41, 4.64639
-42, 4.54389
-43, 4.43723
-44, 4.32683
-45, 4.21306
-46, 4.09631
-47, 3.97698
-48, 3.85548
-49, 3.73225
-50, 3.60774
-51, 3.48246
-52, 3.35693
-53, 3.23173
-54, 3.10744
-55, 2.9847
-56, 2.86413
-57, 2.74639
-58, 2.63211
-59, 2.52191
-60, 2.41636
-61, 2.31602
-62, 2.27093
-63, 2.37933
-64, 2.31907
-65, 2.26466
-66, 2.28757
-67, 2.30183
-68, 2.27642
-69, 2.30433
-70, 2.2949
-71, 2.29114
-72, 2.29311
-73, 2.30087
-74, 2.31448
-75, 2.334
-76, 2.35948
-77, 2.39095
-78, 2.42843
-79, 2.47188
-80, 2.52124
-81, 2.57638
-82, 2.63713
-83, 2.70327
-84, 2.7745
-85, 2.85051
-86, 2.93092
-87, 3.01533
-88, 3.10333
-89, 3.19448
-90, 3.28834
-91, 3.38451
-92, 3.48257
-93, 3.58212
-94, 3.68279
-95, 3.78423
-96, 3.88608
-97, 3.98799
-98, 4.08963
-99, 4.19063
-100, 4.29061
-101, 4.38918
-102, 4.4859
-103, 4.58033
-104, 4.67201
-105, 4.76045
-106, 4.84514
-107, 4.92562
-108, 5.0014
-109, 5.07203
-110, 5.13711
-111, 5.19626
-112, 5.24917
-113, 5.29556
-114, 5.33524
-115, 5.36804
-116, 5.39385
-117, 5.41259
-118, 5.42421
-119, 5.4287
-120, 5.42603
-121, 5.41622
-122, 5.39925
-123, 5.37513
-124, 5.34387
-125, 5.30547
-126, 5.25997
-127, 5.20742
-128, 5.14789
-129, 5.08152
-130, 5.00846
-131, 4.92895
-132, 4.84326
-133, 4.75174
-134, 4.65478
-135, 4.55284
-136, 4.4464
-137, 4.33598
-138, 4.22213
-139, 4.1054
-140, 3.98635
-141, 3.86552
-142, 3.74344
-143, 3.62063
-144, 3.49756
-145, 3.37471
-146, 3.25254
-147, 3.1315
-148, 3.01204
-149, 2.89461
-150, 2.77969
-151, 2.66775
-152, 2.5593
-153, 2.45487
-154, 2.35498
-155, 2.26024
-156, 2.26102
-157, 2.3029
-158, 2.30494
-159, 2.32172
-160, 2.28791
-161, 2.26952
-162, 2.29027
-163, 2.2798
-164, 2.2756
-165, 2.27766
-166, 2.28596
-167, 2.30041
-168, 2.32092
-169, 2.34736
-170, 2.37961
-171, 2.41753
-172, 2.461
-173, 2.5099
-174, 2.56409
-175, 2.62345
-176, 2.68786
-177, 2.75717
-178, 2.8312
-179, 2.90977
-180, 2.99264
-181, 3.07952
-182, 3.17008
-183, 3.26396
-184, 3.36072
-185, 3.45992
-186, 3.56105
-187, 3.66361
-188, 3.76707
-189, 3.87092
-190, 3.97465
-191, 4.07776
-192, 4.17979
-193, 4.28031
-194, 4.37892
-195, 4.47523
-196, 4.5689
-197, 4.65959
-198, 4.74698
-199, 4.83076
-200, 4.91058
-201, 4.98612
-202, 5.05704
-203, 5.12297
-204, 5.18355
-205, 5.23842
-206, 5.28719
-207, 5.32954
-208, 5.36513
-209, 5.39367
-210, 5.41493
-211, 5.4287
-212, 5.43487
-213, 5.43336
-214, 5.42416
-215, 5.40733
-216, 5.38296
-217, 5.35118
-218, 5.31219
-219, 5.26617
-220, 5.21333
-221, 5.1539
-222, 5.08811
-223, 5.01616
-224, 4.9383
-225, 4.85474
-226, 4.76573
-227, 4.67152
-228, 4.57239
-229, 4.46865
-230, 4.36066
-231, 4.24881
-232, 4.13355
-233, 4.01538
-234, 3.89483
-235, 3.77248
-236, 3.64893
-237, 3.52481
-238, 3.40075
-239, 3.27738
-240, 3.15531
-241, 3.03512
-242, 2.91737
-243, 2.80259
-244, 2.69125
-245, 2.5838
-246, 2.48067
-247, 2.38225
-248, 2.28892
-249, 2.381
-250, 2.31552
-251, 2.31703
-252, 2.26859
-253, 2.31632
-254, 2.28796
-255, 2.31161
-256, 2.2995
-257, 2.29332
-258, 2.29324
-259, 2.29939
-260, 2.31186
-261, 2.33068
-262, 2.35583
-263, 2.38724
-264, 2.42479
-265, 2.46828
-266, 2.51751
-267, 2.57221
-268, 2.63209
-269, 2.69686
-270, 2.76622
-271, 2.83985
-272, 2.91745
-273, 2.99875
-274, 3.08346
-275, 3.1713
-276, 3.262
-277, 3.35529
-278, 3.45086
-279, 3.54842
-280, 3.64761
-281, 3.74806
-282, 3.84937
-283, 3.95108
-284, 4.05271
-285, 4.15377
-286, 4.25372
-287, 4.35204
-288, 4.44819
-289, 4.54167
-290, 4.63199
-291, 4.71868
-292, 4.80134
-293, 4.87958
-294, 4.95309
-295, 5.02157
-296, 5.08478
-297, 5.14249
-298, 5.1945
-299, 5.24063
-300, 5.28071
-301, 5.31456
-302, 5.34199
-303, 5.36284
-304, 5.37691
-305, 5.38404
-306, 5.38405
-307, 5.37682
-308, 5.36221
-309, 5.34017
-310, 5.31067
-311, 5.27375
-312, 5.22948
-313, 5.17804
-314, 5.11964
-315, 5.05454
-316, 4.98307
-317, 4.90559
-318, 4.82249
-319, 4.73416
-320, 4.64103
-321, 4.5435
-322, 4.442
-323, 4.33691
-324, 4.22863
-325, 4.11755
-326, 4.00404
-327, 3.88849
-328, 3.77131
-329, 3.65292
-330, 3.53375
-331, 3.41429
-332, 3.29505
-333, 3.17656
-334, 3.05939
-335, 2.94414
-336, 2.83141
-337, 2.72181
-338, 2.61593
-339, 2.51434
-340, 2.41761
-341, 2.32621
-342, 2.33945
-343, 2.26971
-344, 2.29682
-345, 2.33427
-346, 2.29953
-347, 2.27064
-348, 2.28057
-349, 2.28396
-350, 2.27757
-351, 2.27703
-352, 2.28236
-353, 2.29359
-354, 2.31078
-355, 2.33394
-356, 2.36312
-357, 2.39832
-358, 2.43953
-359, 2.48669
-360, 2.5397
-361, 2.59843
-362, 2.66266
-363, 2.73216
-364, 2.80662
-365, 2.88568
-366, 2.96895
-367, 3.05602
-368, 3.14644
-369, 3.23977
-370, 3.33554
-371, 3.43334
-372, 3.53273
-373, 3.6333
-374, 3.73468
-375, 3.83649
-376, 3.93838
-377, 4.03999
-378, 4.14098
-379, 4.24098
-380, 4.33962
-381, 4.4365
-382, 4.53119
-383, 4.62327
-384, 4.71227
-385, 4.7977
-386, 4.87911
-387, 4.956
-388, 5.02792
-389, 5.09445
-390, 5.15519
-391, 5.20979
-392, 5.25795
-393, 5.29944
-394, 5.33408
-395, 5.36172
-396, 5.38228
-397, 5.39572
-398, 5.40202
-399, 5.40119
-400, 5.39325
-401, 5.37821
-402, 5.35612
-403, 5.32701
-404, 5.29091
-405, 5.24787
-406, 5.19794
-407, 5.1412
-408, 5.07776
-409, 5.00777
-410, 4.93143
-411, 4.84898
-412, 4.76073
-413, 4.66704
-414, 4.56832
-415, 4.46505
-416, 4.35773
-417, 4.24689
-418, 4.13308
-419, 4.01688
-420, 3.89884
-421, 3.7795
-422, 3.6594
-423, 3.53905
-424, 3.41893
-425, 3.2995
-426, 3.18122
-427, 3.06452
-428, 2.94984
-429, 2.83761
-430, 2.72828
-431, 2.62232
-432, 2.5202
-433, 2.42242
-434, 2.32949
-435, 2.31217
-436, 2.33284
-437, 2.2732
-438, 2.30019
-439, 2.3461
-440, 2.32083
-441, 2.30167
-442, 2.28875
-443, 2.28217
-444, 2.28196
-445, 2.2881
-446, 2.30052
-447, 2.31913
-448, 2.34381
-449, 2.3744
-450, 2.41075
-451, 2.4527
-452, 2.5001
-453, 2.55279
-454, 2.61063
-455, 2.67347
-456, 2.74115
-457, 2.81349
-458, 2.89032
-459, 2.9714
-460, 3.05648
-461, 3.14526
-462, 3.23739
-463, 3.33248
-464, 3.43009
-465, 3.52974
-466, 3.63094
-467, 3.73316
-468, 3.83588
-469, 3.93856
-470, 4.0407
-471, 4.14179
-472, 4.24138
-473, 4.33904
-474, 4.43437
-475, 4.52699
-476, 4.61658
-477, 4.7028
-478, 4.78535
-479, 4.86393
-480, 4.93823
-481, 5.00794
-482, 5.07273
-483, 5.13227
-484, 5.18623
-485, 5.23426
-486, 5.27603
-487, 5.31122
-488, 5.33954
-489, 5.36074
-490, 5.37461
-491, 5.381
-492, 5.37981
-493, 5.37101
-494, 5.35464
-495, 5.33077
-496, 5.29955
-497, 5.26116
-498, 5.21581
-499, 5.16374
-500, 5.10519
-501, 5.04043
-502, 4.9697
-503, 4.89327
-504, 4.81139
-505, 4.72431
-506, 4.63231
-507, 4.53567
-508, 4.43468
-509, 4.32968
-510, 4.22105
-511, 4.10919
-512, 3.99456
-513, 3.87767
-514, 3.75907
-515, 3.63932
-516, 3.51904
-517, 3.39885
-518, 3.27938
-519, 3.16123
-520, 3.04502
-521, 2.93131
-522, 2.82063
-523, 2.71348
-524, 2.61032
-525, 2.51158
-526, 2.41763
-527, 2.32885
-528, 2.28167
-529, 2.33358
-530, 2.27705
-531, 2.29317
-532, 2.33135
-533, 2.30576
-534, 2.28588
-535, 2.27219
-536, 2.29547
-537, 2.2966
-538, 2.30398
-539, 2.31772
-540, 2.33787
-541, 2.36442
-542, 2.39731
-543, 2.43644
-544, 2.48163
-545, 2.53266
-546, 2.58928
-547, 2.65117
-548, 2.71802
-549, 2.78949
-550, 2.86523
-551, 2.94489
-552, 3.02815
-553, 3.11467
-554, 3.20414
-555, 3.29625
-556, 3.3907
-557, 3.48719
-558, 3.58539
-559, 3.68496
-560, 3.78555
-561, 3.88675
-562, 3.98814
-563, 4.08927
-564, 4.18964
-565, 4.28873
-566, 4.38603
-567, 4.48101
-568, 4.57312
-569, 4.66188
-570, 4.74679
-571, 4.82742
-572, 4.90336
-573, 4.97427
-574, 5.03983
-575, 5.09979
-576, 5.15393
-577, 5.20207
-578, 5.24403
-579, 5.27968
-580, 5.30888
-581, 5.3315
-582, 5.34741
-583, 5.35649
-584, 5.35859
-585, 5.35359
-586, 5.3414
-587, 5.32192
-588, 5.29509
-589, 5.2609
-590, 5.21939
-591, 5.17064
-592, 5.11482
-593, 5.05213
-594, 4.98285
-595, 4.90731
-596, 4.82589
-597, 4.73899
-598, 4.64707
-599, 4.55057
-600, 4.44996
-601, 4.34571
-602, 4.23826
-603, 4.12805
-604, 4.01552
-605, 3.90108
-606, 3.78515
-607, 3.66813
-608, 3.55046
-609, 3.43257
-610, 3.31492
-611, 3.19799
-612, 3.0823
-613, 2.96839
-614, 2.85682
-615, 2.74817
-616, 2.64304
-617, 2.54201
-618, 2.44565
-619, 2.35452
-620, 2.26912
-621, 2.27739
-622, 2.26286
-623, 2.34326
-624, 2.30768
-625, 2.27821
-626, 2.27566
-627, 2.27375
-628, 2.27498
-629, 2.28097
-630, 2.28685
-631, 2.29877
-632, 2.31669
-633, 2.34062
-634, 2.37051
-635, 2.40637
-636, 2.44814
-637, 2.49578
-638, 2.54922
-639, 2.60835
-640, 2.673
-641, 2.74298
-642, 2.81803
-643, 2.89784
-644, 2.98205
-645, 3.07025
-646, 3.16201
-647, 3.25684
-648, 3.35427
-649, 3.4538
-650, 3.55494
-651, 3.65721
-652, 3.76015
-653, 3.86333
-654, 3.96634
-655, 4.06878
-656, 4.17027
-657, 4.27046
-658, 4.36898
-659, 4.46546
-660, 4.55953
-661, 4.65079
-662, 4.73884
-663, 4.82324
-664, 4.90355
-665, 4.97933
-666, 5.05011
-667, 5.11547
-668, 5.17497
-669, 5.22823
-670, 5.27491
-671, 5.3147
-672, 5.34737
-673, 5.37273
-674, 5.39067
-675, 5.40112
-676, 5.40405
-677, 5.3995
-678, 5.38753
-679, 5.36822
-680, 5.34168
-681, 5.308
-682, 5.26731
-683, 5.21971
-684, 5.16534
-685, 5.10432
-686, 5.03678
-687, 4.9629
-688, 4.88286
-689, 4.7969
-690, 4.70529
-691, 4.60836
-692, 4.50648
-693, 4.4001
-694, 4.2897
-695, 4.17581
-696, 4.05901
-697, 3.93987
-698, 3.81903
-699, 3.69708
-700, 3.57463
-701, 3.45226
-702, 3.33055
-703, 3.21002
-704, 3.09118
-705, 2.97451
-706, 2.86046
-707, 2.74948
-708, 2.642
-709, 2.53843
-710, 2.43922
-711, 2.3448
-712, 2.25764
-713, 2.393
-714, 2.33486
-715, 2.28227
-716, 2.26812
-717, 2.27953
-718, 2.28625
-719, 2.30347
-720, 2.29618
-721, 2.29536
-722, 2.30108
-723, 2.31335
-724, 2.33212
-725, 2.35729
-726, 2.38873
-727, 2.42625
-728, 2.46965
-729, 2.51868
-730, 2.57313
-731, 2.63274
-732, 2.69728
-733, 2.76651
-734, 2.84021
-735, 2.91815
-736, 3.00009
-737, 3.08581
-738, 3.17502
-739, 3.26746
-740, 3.36279
-741, 3.46066
-742, 3.56066
-743, 3.66235
-744, 3.76526
-745, 3.86886
-746, 3.97261
-747, 4.07598
-748, 4.1784
-749, 4.27933
-750, 4.37824
-751, 4.47464
-752, 4.56807
-753, 4.65809
-754, 4.74434
-755, 4.82645
-756, 4.90413
-757, 4.97707
-758, 5.04501
-759, 5.10769
-760, 5.16486
-761, 5.21627
-762, 5.26166
-763, 5.30076
-764, 5.33331
-765, 5.35905
-766, 5.37773
-767, 5.38912
-768, 5.39303
-769, 5.3893
-770, 5.37783
-771, 5.35855
-772, 5.3315
-773, 5.29674
-774, 5.25441
-775, 5.20473
-776, 5.14793
-777, 5.08431
-778, 5.01421
-779, 4.93796
-780, 4.85593
-781, 4.76848
-782, 4.67599
-783, 4.57881
-784, 4.4773
-785, 4.37181
-786, 4.26271
-787, 4.15037
-788, 4.03517
-789, 3.91752
-790, 3.79788
-791, 3.67672
-792, 3.55456
-793, 3.43196
-794, 3.30951
-795, 3.18783
-796, 3.06756
-797, 2.94934
-798, 2.83382
-799, 2.72161
-800, 2.61331
-801, 2.50949
-802, 2.41065
-803, 2.31727
-804, 2.39864
-805, 2.33363
-806, 2.2744
-807, 2.32808
-808, 2.29059
-809, 2.33323
-810, 2.31472
-811, 2.30195
-812, 2.29503
-813, 2.29404
-814, 2.29908
-815, 2.31025
-816, 2.32763
-817, 2.35129
-818, 2.38127
-819, 2.41757
-820, 2.46015
-821, 2.5089
-822, 2.56369
-823, 2.62429
-824, 2.69045
-825, 2.76186
-826, 2.83815
-827, 2.91894
-828, 3.00382
-829, 3.09236
-830, 3.18413
-831, 3.27872
-832, 3.3757
-833, 3.47469
-834, 3.5753
-835, 3.67716
-836, 3.77991
-837, 3.8832
-838, 3.98666
-839, 4.08991
-840, 4.19256
-841, 4.29419
-842, 4.39434
-843, 4.49255
-844, 4.58832
-845, 4.68114
-846, 4.77049
-847, 4.85586
-848, 4.93673
-849, 5.01263
-850, 5.08312
-851, 5.14781
-852, 5.20632
-853, 5.25839
-854, 5.30375
-855, 5.34224
-856, 5.37369
-857, 5.398
-858, 5.41512
-859, 5.42497
-860, 5.42753
-861, 5.42278
-862, 5.41068
-863, 5.39122
-864, 5.36438
-865, 5.33016
-866, 5.28857
-867, 5.23965
-868, 5.18346
-869, 5.12012
-870, 5.04978
-871, 4.97266
-872, 4.88905
-873, 4.79927
-874, 4.70373
-875, 4.60288
-876, 4.49721
-877, 4.38725
-878, 4.27354
-879, 4.15666
-880, 4.03718
-881, 3.91563
-882, 3.79258
-883, 3.66855
-884, 3.54403
-885, 3.41952
-886, 3.29551
-887, 3.17244
-888, 3.0508
-889, 2.93107
-890, 2.81373
-891, 2.69928
-892, 2.58826
-893, 2.48121
-894, 2.37868
-895, 2.28125
-896, 2.37248
-897, 2.30374
-898, 2.26273
-899, 2.33767
-900, 2.30092
-901, 2.27047
-902, 2.27143
-903, 2.27878
-904, 2.28164
-905, 2.28227
-906, 2.2893
-907, 2.30267
-908, 2.32228
-909, 2.34803
-910, 2.37978
-911, 2.41742
-912, 2.46082
-913, 2.50984
-914, 2.56437
-915, 2.62427
-916, 2.68942
-917, 2.75966
-918, 2.83481
-919, 2.91467
-920, 2.99898
-921, 3.08746
-922, 3.17975
-923, 3.27547
-924, 3.37419
-925, 3.47541
-926, 3.57864
-927, 3.68334
-928, 3.78898
-929, 3.895
-930, 4.00088
-931, 4.1061
-932, 4.21018
-933, 4.31266
-934, 4.41312
-935, 4.51116
-936, 4.60641
-937, 4.6985
-938, 4.7871
-939, 4.87187
-940, 4.95246
-941, 5.02852
-942, 5.09968
-943, 5.16559
-944, 5.22585
-945, 5.28008
-946, 5.32791
-947, 5.36899
-948, 5.40298
-949, 5.42959
-950, 5.44857
-951, 5.45973
-952, 5.46295
-953, 5.45816
-954, 5.44536
-955, 5.4246
-956, 5.396
-957, 5.35971
-958, 5.31592
-959, 5.26485
-960, 5.20673
-961, 5.1418
-962, 5.07031
-963, 4.99251
-964, 4.90866
-965, 4.819
-966, 4.72381
-967, 4.62338
-968, 4.51801
-969, 4.40806
-970, 4.29392
-971, 4.17601
-972, 4.05482
-973, 3.93089
-974, 3.80478
-975, 3.67711
-976, 3.54852
-977, 3.41968
-978, 3.29126
-979, 3.16391
-980, 3.03828
-981, 2.91499
-982, 2.79462
-983, 2.67774
-984, 2.56483
-985, 2.45639
-986, 2.35285
-987, 2.25621
-988, 2.33484
-989, 2.26359
-990, 2.36702
-991, 2.32251
-992, 2.28342
-993, 2.3178
-994, 2.29664
-995, 2.28131
-996, 2.29143
-997, 2.29029
-998, 2.29544
-999, 2.307
-1000, 2.32506
-1001, 2.34962
-1002, 2.38066
-1003, 2.41807
-1004, 2.46172
-1005, 2.51141
-1006, 2.56688
-1007, 2.62785
-1008, 2.69402
-1009, 2.76506
-1010, 2.84064
-1011, 2.92042
-1012, 3.00409
-1013, 3.09131
-1014, 3.18178
-1015, 3.2752
-1016, 3.37127
-1017, 3.46967
-1018, 3.57008
-1019, 3.67216
-1020, 3.77554
-1021, 3.87981
-1022, 3.98454
-1023, 4.08926
-1024, 4.19345
-1025, 4.29659
-1026, 4.39814
-1027, 4.49753
-1028, 4.59423
-1029, 4.68769
-1030, 4.77742
-1031, 4.86294
-1032, 4.94383
-1033, 5.0197
-1034, 5.09022
-1035, 5.1551
-1036, 5.21408
-1037, 5.26694
-1038, 5.31349
-1039, 5.35356
-1040, 5.38697
-1041, 5.41356
-1042, 5.43317
-1043, 5.44564
-1044, 5.4508
-1045, 5.44852
-1046, 5.43864
-1047, 5.42106
-1048, 5.3957
-1049, 5.36253
-1050, 5.32154
+0, 0.00281274
+1, -0.00253098
+2, -0.75151
+3, -1.2427
+4, -1.68784
+5, -2.09123
+6, -2.451
+7, -2.78236
+8, -3.08264
+9, -3.35477
+10, -3.60137
+11, -3.64628
+12, -3.64764
+13, -3.64901
+14, -3.65038
+15, -3.65176
+16, -3.65314
+17, -3.65453
+18, -3.65593
+19, -3.65733
+20, -3.65874
+21, -3.66015
+22, -3.66156
+23, -3.66298
+24, -3.6644
+25, -3.66583
+26, -3.66726
+27, -3.66869
+28, -3.67012
+29, -3.67156
+30, -3.673
+31, -3.67444
+32, -3.67588
+33, -3.67733
+34, -3.67878
+35, -3.68023
+36, -3.68168
+37, -3.68314
+38, -3.6846
+39, -3.68605
+40, -3.68751
+41, -3.68898
+42, -3.69044
+43, -3.6919
+44, -3.69337
+45, -3.69484
+46, -3.6963
+47, -3.69777
+48, -3.69924
+49, -3.70072
+50, -3.70081
+51, -3.70231
+52, -3.70381
+53, -3.7053
+54, -3.70721
+55, -3.70874
+56, -3.71028
+57, -3.71183
+58, -3.7134
+59, -3.71497
+60, -3.71657
+61, -3.71819
+62, -3.71985
+63, -3.72158
+64, -3.72339
+65, -3.72537
+66, -3.72763
+67, -3.73049
+68, -3.72714
+69, -2.43478
+70, -1.63811
+71, -0.916781
+72, -0.263657
+73, 0.327712
+74, 0.863167
+75, 1.34799
+76, 1.78698
+77, 2.17853
+78, 2.53848
+79, 2.86439
+80, 3.15948
+81, 3.42666
+82, 3.53226
+83, 3.53359
+84, 3.53491
+85, 3.53625
+86, 3.53759
+87, 3.53893
+88, 3.54028
+89, 3.54164
+90, 3.543
+91, 3.54436
+92, 3.54573
+93, 3.5471
+94, 3.54848
+95, 3.54985
+96, 3.55123
+97, 3.55262
+98, 3.554
+99, 3.55539
+100, 3.55678
+101, 3.55818
+102, 3.55957
+103, 3.56097
+104, 3.56237
+105, 3.56377
+106, 3.56518
+107, 3.56658
+108, 3.56799
+109, 3.5694
+110, 3.57081
+111, 3.57222
+112, 3.57364
+113, 3.57505
+114, 3.57647
+115, 3.57788
+116, 3.5793
+117, 3.58072
+118, 3.58214
+119, 3.58356
+120, 3.58363
+121, 3.58508
+122, 3.58653
+123, 3.58797
+124, 3.5899
+125, 3.59139
+126, 3.5929
+127, 3.59441
+128, 3.59593
+129, 3.59748
+130, 3.59906
+131, 3.60068
+132, 3.60236
+133, 3.60414
+134, 3.6061
+135, 3.60838
+136, 3.61135
+137, 3.60814
+138, 2.1705
+139, 1.40535
+140, 0.711938
+141, 0.0835447
+142, -0.485934
+143, -1.00202
+144, -1.46972
+145, -1.89358
+146, -2.27185
+147, -2.62
+148, -2.93551
+149, -3.22143
+150, -3.48054
+151, -3.50793
+152, -3.50925
+153, -3.51057
+154, -3.5119
+155, -3.51324
+156, -3.51458
+157, -3.51593
+158, -3.51728
+159, -3.51864
+160, -3.52
+161, -3.52136
+162, -3.52273
+163, -3.5241
+164, -3.52547
+165, -3.52685
+166, -3.52822
+167, -3.52961
+168, -3.53099
+169, -3.53238
+170, -3.53377
+171, -3.53516
+172, -3.53655
+173, -3.53794
+174, -3.53934
+175, -3.54074
+176, -3.54214
+177, -3.54354
+178, -3.54494
+179, -3.54635
+180, -3.54776
+181, -3.54916
+182, -3.55057
+183, -3.55198
+184, -3.55339
+185, -3.55481
+186, -3.55622
+187, -3.55763
+188, -3.55905
+189, -3.55913
+190, -3.56057
+191, -3.56201
+192, -3.56391
+193, -3.56539
+194, -3.56688
+195, -3.56839
+196, -3.5699
+197, -3.57144
+198, -3.573
+199, -3.5746
+200, -3.57625
+201, -3.578
+202, -3.57989
+203, -3.58205
+204, -3.58476
+205, -3.58108
+206, -2.4668
+207, -1.66711
+208, -0.943034
+209, -0.287428
+210, 0.306188
+211, 0.843678
+212, 1.33035
+213, 1.771
+214, 2.16408
+215, 2.5254
+216, 2.85254
+217, 3.14875
+218, 3.41695
+219, 3.54482
+220, 3.54614
+221, 3.54748
+222, 3.54881
+223, 3.55016
+224, 3.5515
+225, 3.55286
+226, 3.55422
+227, 3.55558
+228, 3.55695
+229, 3.55832
+230, 3.55969
+231, 3.56107
+232, 3.56245
+233, 3.56384
+234, 3.56523
+235, 3.56662
+236, 3.56801
+237, 3.56941
+238, 3.57081
+239, 3.57221
+240, 3.57361
+241, 3.57501
+242, 3.57642
+243, 3.57783
+244, 3.57924
+245, 3.58065
+246, 3.58206
+247, 3.58348
+248, 3.5849
+249, 3.58631
+250, 3.58773
+251, 3.58915
+252, 3.59058
+253, 3.592
+254, 3.59342
+255, 3.59485
+256, 3.59627
+257, 3.59634
+258, 3.59779
+259, 3.59924
+260, 3.6007
+261, 3.60261
+262, 3.60411
+263, 3.60561
+264, 3.60712
+265, 3.60865
+266, 3.61019
+267, 3.61176
+268, 3.61337
+269, 3.61503
+270, 3.61677
+271, 3.61865
+272, 3.62079
+273, 3.62342
+274, 3.62725
+275, 2.51163
+276, 1.71449
+277, 0.992093
+278, 0.337433
+279, -0.255849
+280, -0.793508
+281, -1.28076
+282, -1.72233
+283, -2.12249
+284, -2.4793
+285, -2.808
+286, -3.10588
+287, -3.37583
+288, -3.62046
+289, -3.50525
+290, -3.50657
+291, -3.5079
+292, -3.50923
+293, -3.51057
+294, -3.51191
+295, -3.51326
+296, -3.51462
+297, -3.51597
+298, -3.51733
+299, -3.5187
+300, -3.52007
+301, -3.52144
+302, -3.52281
+303, -3.52419
+304, -3.52557
+305, -3.52695
+306, -3.52833
+307, -3.52972
+308, -3.53111
+309, -3.5325
+310, -3.53389
+311, -3.53528
+312, -3.53668
+313, -3.53808
+314, -3.53948
+315, -3.54088
+316, -3.54228
+317, -3.54369
+318, -3.54509
+319, -3.5465
+320, -3.54791
+321, -3.54932
+322, -3.55073
+323, -3.55214
+324, -3.55355
+325, -3.55497
+326, -3.55504
+327, -3.55648
+328, -3.55791
+329, -3.55935
+330, -3.56128
+331, -3.56277
+332, -3.56427
+333, -3.56578
+334, -3.5673
+335, -3.56885
+336, -3.57044
+337, -3.57207
+338, -3.57378
+339, -3.57561
+340, -3.57767
+341, -3.58015
+342, -3.5836
+343, -2.6326
+344, -1.89433
+345, -1.14877
+346, -0.473714
+347, 0.137516
+348, 0.690954
+349, 1.19206
+350, 1.64579
+351, 2.05069
+352, 2.42273
+353, 2.75958
+354, 3.06458
+355, 3.34074
+356, 3.59078
+357, 3.57454
+358, 3.57588
+359, 3.57723
+360, 3.57858
+361, 3.57993
+362, 3.58129
+363, 3.58266
+364, 3.58403
+365, 3.58541
+366, 3.58679
+367, 3.58817
+368, 3.58956
+369, 3.59095
+370, 3.59234
+371, 3.59374
+372, 3.59514
+373, 3.59654
+374, 3.59795
+375, 3.59936
+376, 3.60077
+377, 3.60218
+378, 3.6036
+379, 3.60501
+380, 3.60643
+381, 3.60785
+382, 3.60927
+383, 3.6107
+384, 3.61212
+385, 3.61355
+386, 3.61498
+387, 3.61641
+388, 3.61784
+389, 3.61928
+390, 3.62071
+391, 3.62214
+392, 3.62358
+393, 3.62502
+394, 3.62646
+395, 3.62654
+396, 3.628
+397, 3.62947
+398, 3.63093
+399, 3.63286
+400, 3.63437
+401, 3.63588
+402, 3.63741
+403, 3.63895
+404, 3.6405
+405, 3.64209
+406, 3.64371
+407, 3.64539
+408, 3.64716
+409, 3.64907
+410, 3.65125
+411, 3.65397
+412, 3.65803
+413, 2.45749
+414, 1.66542
+415, 0.94763
+416, 0.297138
+417, -0.292366
+418, -0.826602
+419, -1.31075
+420, -1.74951
+421, -2.14124
+422, -2.50164
+423, -2.82825
+424, -3.12423
+425, -3.39245
+426, -3.49584
+427, -3.49715
+428, -3.49847
+429, -3.4998
+430, -3.50113
+431, -3.50247
+432, -3.50381
+433, -3.50515
+434, -3.50651
+435, -3.50786
+436, -3.50922
+437, -3.51058
+438, -3.51194
+439, -3.51331
+440, -3.51468
+441, -3.51606
+442, -3.51743
+443, -3.51881
+444, -3.52019
+445, -3.52158
+446, -3.52296
+447, -3.52435
+448, -3.52574
+449, -3.52713
+450, -3.52853
+451, -3.52992
+452, -3.53132
+453, -3.53272
+454, -3.53412
+455, -3.53552
+456, -3.53692
+457, -3.53832
+458, -3.53973
+459, -3.54114
+460, -3.54254
+461, -3.54395
+462, -3.54536
+463, -3.54677
+464, -3.54685
+465, -3.54828
+466, -3.54971
+467, -3.55161
+468, -3.55309
+469, -3.55458
+470, -3.55607
+471, -3.55758
+472, -3.55911
+473, -3.56067
+474, -3.56226
+475, -3.5639
+476, -3.56564
+477, -3.56751
+478, -3.56965
+479, -3.57231
+480, -3.57622
+481, -2.45211
+482, -1.6538
+483, -0.930987
+484, -0.27652
+485, 0.316064
+486, 0.85262
+487, 1.33845
+488, 1.77833
+489, 2.17071
+490, 2.5314
+491, 2.85798
+492, 3.15367
+493, 3.4214
+494, 3.66381
+495, 3.57627
+496, 3.57761
+497, 3.57896
+498, 3.58031
+499, 3.58167
+500, 3.58303
+501, 3.5844
+502, 3.58578
+503, 3.58715
+504, 3.58853
+505, 3.58992
+506, 3.59131
+507, 3.5927
+508, 3.5941
+509, 3.59549
+510, 3.5969
+511, 3.5983
+512, 3.59971
+513, 3.60112
+514, 3.60253
+515, 3.60394
+516, 3.60536
+517, 3.60678
+518, 3.6082
+519, 3.60962
+520, 3.61104
+521, 3.61247
+522, 3.61389
+523, 3.61532
+524, 3.61675
+525, 3.61818
+526, 3.61961
+527, 3.62105
+528, 3.62248
+529, 3.62392
+530, 3.62536
+531, 3.62679
+532, 3.62823
+533, 3.62832
+534, 3.62979
+535, 3.63125
+536, 3.63272
+537, 3.63465
+538, 3.63616
+539, 3.63768
+540, 3.63921
+541, 3.64075
+542, 3.64232
+543, 3.64391
+544, 3.64555
+545, 3.64724
+546, 3.64904
+547, 3.65101
+548, 3.65328
+549, 3.65622
+550, 3.65297
+551, 2.21035
+552, 1.44146
+553, 0.744668
+554, 0.113205
+555, -0.459054
+556, -0.977662
+557, -1.44765
+558, -1.87357
+559, -2.25369
+560, -2.60354
+561, -2.9206
+562, -3.20792
+563, -3.4683
+564, -3.52299
+565, -3.52431
+566, -3.52564
+567, -3.52698
+568, -3.52832
+569, -3.52967
+570, -3.53102
+571, -3.53237
+572, -3.53374
+573, -3.5351
+574, -3.53647
+575, -3.53784
+576, -3.53922
+577, -3.54059
+578, -3.54198
+579, -3.54336
+580, -3.54475
+581, -3.54614
+582, -3.54753
+583, -3.54892
+584, -3.55032
+585, -3.55172
+586, -3.55312
+587, -3.55452
+588, -3.55592
+589, -3.55733
+590, -3.55874
+591, -3.56015
+592, -3.56156
+593, -3.56297
+594, -3.56438
+595, -3.5658
+596, -3.56721
+597, -3.56863
+598, -3.57005
+599, -3.57147
+600, -3.57289
+601, -3.57431
+602, -3.57439
+603, -3.57583
+604, -3.57728
+605, -3.57917
+606, -3.58066
+607, -3.58215
+608, -3.58366
+609, -3.58518
+610, -3.58671
+611, -3.58827
+612, -3.58986
+613, -3.5915
+614, -3.59321
+615, -3.59505
+616, -3.59711
+617, -3.59959
+618, -3.60302
+619, -2.64977
+620, -1.91121
+621, -1.16405
+622, -0.487545
+623, 0.124992
+624, 0.679614
+625, 1.1818
+626, 1.6365
+627, 2.0482
+628, 2.41506
+629, 2.75264
+630, 3.0583
+631, 3.33505
+632, 3.58563
+633, 3.56879
+634, 3.57013
+635, 3.57147
+636, 3.57282
+637, 3.57417
+638, 3.57553
+639, 3.5769
+640, 3.57827
+641, 3.57964
+642, 3.58102
+643, 3.5824
+644, 3.58379
+645, 3.58517
+646, 3.58657
+647, 3.58796
+648, 3.58936
+649, 3.59076
+650, 3.59216
+651, 3.59357
+652, 3.59498
+653, 3.59639
+654, 3.5978
+655, 3.59922
+656, 3.60063
+657, 3.60205
+658, 3.60347
+659, 3.60489
+660, 3.60632
+661, 3.60774
+662, 3.60917
+663, 3.6106
+664, 3.61203
+665, 3.61346
+666, 3.61489
+667, 3.61632
+668, 3.61776
+669, 3.61919
+670, 3.62063
+671, 3.62071
+672, 3.62217
+673, 3.62363
+674, 3.62509
+675, 3.62702
+676, 3.62853
+677, 3.63004
+678, 3.63157
+679, 3.63311
+680, 3.63466
+681, 3.63625
+682, 3.63787
+683, 3.63956
+684, 3.64133
+685, 3.64326
+686, 3.64548
+687, 3.64829
+688, 3.64481
+689, 2.36907
+690, 1.5853
+691, 0.875018
+692, 0.231334
+693, -0.352001
+694, -0.880645
+695, -1.35973
+696, -1.79389
+697, -2.18147
+698, -2.53809
+699, -2.86128
+700, -3.15417
+701, -3.41959
+702, -3.49767
+703, -3.49898
+704, -3.5003
+705, -3.50163
+706, -3.50296
+707, -3.5043
+708, -3.50564
+709, -3.50699
+710, -3.50834
+711, -3.5097
+712, -3.51106
+713, -3.51242
+714, -3.51379
+715, -3.51515
+716, -3.51653
+717, -3.5179
+718, -3.51928
+719, -3.52066
+720, -3.52204
+721, -3.52342
+722, -3.52481
+723, -3.5262
+724, -3.52759
+725, -3.52898
+726, -3.53038
+727, -3.53177
+728, -3.53317
+729, -3.53457
+730, -3.53597
+731, -3.53737
+732, -3.53878
+733, -3.54018
+734, -3.54159
+735, -3.54299
+736, -3.5444
+737, -3.54581
+738, -3.54722
+739, -3.54863
+740, -3.54871
+741, -3.55014
+742, -3.55158
+743, -3.55348
+744, -3.55496
+745, -3.55645
+746, -3.55794
+747, -3.55946
+748, -3.56099
+749, -3.56254
+750, -3.56414
+751, -3.56579
+752, -3.56753
+753, -3.56942
+754, -3.57159
+755, -3.57429
+756, -3.57062
+757, -2.45714
+758, -1.65836
+759, -0.935114
+760, -0.280257
+761, 0.312681
+762, 0.849557
+763, 1.33567
+764, 1.77582
+765, 2.16844
+766, 2.52934
+767, 2.85611
+768, 3.15199
+769, 3.41988
+770, 3.54797
+771, 3.5493
+772, 3.55063
+773, 3.55197
+774, 3.55331
+775, 3.55466
+776, 3.55602
+777, 3.55738
+778, 3.55874
+779, 3.56011
+780, 3.56148
+781, 3.56286
+782, 3.56424
+783, 3.56562
+784, 3.56701
+785, 3.56839
+786, 3.56979
+787, 3.57118
+788, 3.57258
+789, 3.57398
+790, 3.57538
+791, 3.57678
+792, 3.57819
+793, 3.5796
+794, 3.58101
+795, 3.58242
+796, 3.58383
+797, 3.58525
+798, 3.58666
+799, 3.58808
+800, 3.5895
+801, 3.59092
+802, 3.59234
+803, 3.59376
+804, 3.59519
+805, 3.59661
+806, 3.59804
+807, 3.59947
+808, 3.6009
+809, 3.60099
+810, 3.60244
+811, 3.6039
+812, 3.60581
+813, 3.60731
+814, 3.60881
+815, 3.61032
+816, 3.61185
+817, 3.61339
+818, 3.61496
+819, 3.61657
+820, 3.61822
+821, 3.61996
+822, 3.62184
+823, 3.62395
+824, 3.62655
+825, 3.63028
+826, 2.51214
+827, 1.71495
+828, 0.992513
+829, 0.337813
+830, -0.255504
+831, -0.793196
+832, -1.28048
+833, -1.72207
+834, -2.12226
+835, -2.47909
+836, -2.80781
+837, -3.1057
+838, -3.37567
+839, -3.62031
+840, -3.53144
+841, -3.53277
+842, -3.5341
+843, -3.53545
+844, -3.53679
+845, -3.53814
+846, -3.5395
+847, -3.54086
+848, -3.54223
+849, -3.5436
+850, -3.54497
+851, -3.54635
+852, -3.54773
+853, -3.54911
+854, -3.5505
+855, -3.55189
+856, -3.55328
+857, -3.55467
+858, -3.55607
+859, -3.55747
+860, -3.55887
+861, -3.56027
+862, -3.56167
+863, -3.56308
+864, -3.56449
+865, -3.5659
+866, -3.56731
+867, -3.56872
+868, -3.57014
+869, -3.57155
+870, -3.57297
+871, -3.57439
+872, -3.57581
+873, -3.57723
+874, -3.57865
+875, -3.58007
+876, -3.5815
+877, -3.58157
+878, -3.58302
+879, -3.58446
+880, -3.58591
+881, -3.58783
+882, -3.58932
+883, -3.59082
+884, -3.59233
+885, -3.59386
+886, -3.59541
+887, -3.59698
+888, -3.5986
+889, -3.60027
+890, -3.60203
+891, -3.60396
+892, -3.60617
+893, -3.60897
+894, -3.60546
+895, -2.40634
+896, -1.61236
+897, -0.893468
+898, -0.242549
+899, 0.346824
+900, 0.880472
+901, 1.36366
+902, 1.80117
+903, 2.19136
+904, 2.55009
+905, 2.8749
+906, 3.169
+907, 3.43528
+908, 3.5386
+909, 3.53992
+910, 3.54125
+911, 3.54259
+912, 3.54393
+913, 3.54528
+914, 3.54663
+915, 3.54798
+916, 3.54935
+917, 3.55071
+918, 3.55208
+919, 3.55345
+920, 3.55483
+921, 3.55621
+922, 3.55759
+923, 3.55898
+924, 3.56037
+925, 3.56176
+926, 3.56315
+927, 3.56455
+928, 3.56595
+929, 3.56735
+930, 3.56875
+931, 3.57015
+932, 3.57156
+933, 3.57297
+934, 3.57438
+935, 3.57579
+936, 3.5772
+937, 3.57862
+938, 3.58003
+939, 3.58145
+940, 3.58287
+941, 3.58429
+942, 3.58571
+943, 3.58713
+944, 3.58855
+945, 3.58998
+946, 3.59005
+947, 3.5915
+948, 3.59295
+949, 3.59439
+950, 3.59632
+951, 3.59781
+952, 3.59931
+953, 3.60083
+954, 3.60235
+955, 3.6039
+956, 3.60547
+957, 3.60709
+958, 3.60876
+959, 3.61053
+960, 3.61245
+961, 3.61467
+962, 3.61749
+963, 3.61401
+964, 2.25464
+965, 1.4816
+966, 0.781039
+967, 0.146166
+968, -0.429183
+969, -0.950592
+970, -1.42312
+971, -1.85134
+972, -2.23357
+973, -2.58531
+974, -2.90407
+975, -3.19294
+976, -3.45472
+977, -3.53284
+978, -3.53417
+979, -3.5355
+980, -3.53684
+981, -3.53818
+982, -3.53953
+983, -3.54089
+984, -3.54225
+985, -3.54361
+986, -3.54498
+987, -3.54635
+988, -3.54772
+989, -3.5491
+990, -3.55048
+991, -3.55187
+992, -3.55326
+993, -3.55465
+994, -3.55604
+995, -3.55743
+996, -3.55883
+997, -3.56023
+998, -3.56163
+999, -3.56304
+1000, -3.56444
+1001, -3.56585
+1002, -3.56726
+1003, -3.56867
+1004, -3.57009
+1005, -3.5715
+1006, -3.57292
+1007, -3.57433
+1008, -3.57575
+1009, -3.57717
+1010, -3.57859
+1011, -3.58001
+1012, -3.58144
+1013, -3.58286
+1014, -3.58429
+1015, -3.58436
+1016, -3.58581
+1017, -3.58726
+1018, -3.58871
+1019, -3.59063
+1020, -3.59213
+1021, -3.59364
+1022, -3.59515
+1023, -3.59669
+1024, -3.59824
+1025, -3.59982
+1026, -3.60145
+1027, -3.60314
+1028, -3.60494
+1029, -3.60692
+1030, -3.60923
+1031, -3.61227
+1032, -3.60907
+1033, -2.15934
+1034, -1.38872
+1035, -0.690968
+1036, -0.0591962
+1037, 0.51284
+1038, 1.03079
+1039, 1.49977
+1040, 1.9244
+1041, 2.30296
+1042, 2.65114
+1043, 2.96639
+1044, 3.25184
+1045, 3.51028
+1046, 3.56518
+1047, 3.56651
+1048, 3.56785
+1049, 3.56919
+1050, 3.57054
+1051, 3.5719
+1052, 3.57326
+1053, 3.57463
+1054, 3.576
+1055, 3.57738
+1056, 3.57876
+1057, 3.58014
+1058, 3.58153
+1059, 3.58292
+1060, 3.58431
+1061, 3.58571
+1062, 3.5871
+1063, 3.58851
+1064, 3.58991
+1065, 3.59132
+1066, 3.59272
+1067, 3.59414
+1068, 3.59555
+1069, 3.59696
+1070, 3.59838
+1071, 3.5998
+1072, 3.60122
+1073, 3.60264
+1074, 3.60406
+1075, 3.60549
+1076, 3.60691
+1077, 3.60834
+1078, 3.60977
+1079, 3.6112
+1080, 3.61263
+1081, 3.61407
+1082, 3.6155
+1083, 3.61693
+1084, 3.61701
+1085, 3.61847
+1086, 3.61993
+1087, 3.62139
+1088, 3.62331
+1089, 3.62481
+1090, 3.62632
+1091, 3.62784
+1092, 3.62937
+1093, 3.63093
+1094, 3.6325
+1095, 3.63411
+1096, 3.63578
+1097, 3.63753
+1098, 3.63941
+1099, 3.64154
+1100, 3.64415
+1101, 3.64791
+1102, 2.52973
+1103, 1.73089
+1104, 1.00695
+1105, 0.3509
+1106, -0.243644
+1107, -0.782447
+1108, -1.27074
+1109, -1.71325
+1110, -2.11426
+1111, -2.47185
+1112, -2.80125
+1113, -3.09976
+1114, -3.37028
+1115, -3.61543
+1116, -3.527
+1117, -3.52832
+1118, -3.52966
+1119, -3.531
+1120, -3.53234
+1121, -3.5337
+1122, -3.53505
+1123, -3.53641
+1124, -3.53778
+1125, -3.53914
+1126, -3.54052
+1127, -3.54189
+1128, -3.54327
+1129, -3.54465
+1130, -3.54603
+1131, -3.54742
+1132, -3.54881
+1133, -3.5502
+1134, -3.5516
+1135, -3.55299
+1136, -3.55439
+1137, -3.55579
+1138, -3.5572
+1139, -3.5586
+1140, -3.56001
+1141, -3.56142
+1142, -3.56283
+1143, -3.56424
+1144, -3.56565
+1145, -3.56706
+1146, -3.56848
+1147, -3.5699
+1148, -3.57132
+1149, -3.57273
+1150, -3.57415
+1151, -3.57558
+1152, -3.577
+1153, -3.57707
+1154, -3.57851
+1155, -3.57996
+1156, -3.58141
+1157, -3.58332
+1158, -3.58482
+1159, -3.58632
+1160, -3.58783
+1161, -3.58936
+1162, -3.5909
+1163, -3.59248
+1164, -3.5941
+1165, -3.59577
+1166, -3.59755
+1167, -3.59949
+1168, -3.60174
+1169, -3.60463
+1170, -3.60126
+1171, -2.31885
+1172, -1.53315
+1173, -0.82174
+1174, -0.177603
+1175, 0.405629
+1176, 0.933717
+1177, 1.41187
+1178, 1.84482
+1179, 2.23089
+1180, 2.58588
+1181, 2.90731
+1182, 3.19834
+1183, 3.46184
+1184, 3.53995
+1185, 3.54127
+1186, 3.54261
+1187, 3.54394
+1188, 3.54529
+1189, 3.54663
+1190, 3.54799
+1191, 3.54934
+1192, 3.55071
+1193, 3.55207
+1194, 3.55344
+1195, 3.55482
+1196, 3.5562
+1197, 3.55758
+1198, 3.55896
+1199, 3.56035
+1200, 3.56174
+1201, 3.56313
+1202, 3.56452
+1203, 3.56592
+1204, 3.56732
+1205, 3.56872
+1206, 3.57012
+1207, 3.57153
+1208, 3.57293
+1209, 3.57434
+1210, 3.57575
+1211, 3.57716
+1212, 3.57858
+1213, 3.57999
+1214, 3.58141
+1215, 3.58283
+1216, 3.58425
+1217, 3.58567
+1218, 3.58709
+1219, 3.58851
+1220, 3.58993
+1221, 3.59136
+1222, 3.59143
+1223, 3.59288
+1224, 3.59433
+1225, 3.59578
+1226, 3.59771
+1227, 3.5992
+1228, 3.6007
+1229, 3.60222
+1230, 3.60375
+1231, 3.6053
+1232, 3.60687
+1233, 3.60849
+1234, 3.61017
+1235, 3.61195
+1236, 3.61389
+1237, 3.61613
+1238, 3.61902
+1239, 3.61566
+1240, 2.2594
+1241, 1.48591
+1242, 0.784951
+1243, 0.149711
+1244, -0.42597
+1245, -0.94768
+1246, -1.42048
+1247, -1.84895
+1248, -2.2314
+1249, -2.58335
+1250, -2.90229
+1251, -3.19133
+1252, -3.45327
+1253, -3.50602
+1254, -3.50733
+1255, -3.50866
+1256, -3.50999
+1257, -3.51133
+1258, -3.51267
+1259, -3.51401
+1260, -3.51536
+1261, -3.51672
+1262, -3.51808
+1263, -3.51944
+1264, -3.52081
+1265, -3.52217
+1266, -3.52355
+1267, -3.52492
+1268, -3.5263
+1269, -3.52768
+1270, -3.52906
+1271, -3.53045
+1272, -3.53184
+1273, -3.53323
+1274, -3.53462
+1275, -3.53601
+1276, -3.53741
+1277, -3.53881
+1278, -3.54021
+1279, -3.54161
+1280, -3.54301
+1281, -3.54441
+1282, -3.54582
+1283, -3.54723
+1284, -3.54863
+1285, -3.55004
+1286, -3.55145
+1287, -3.55286
+1288, -3.55428
+1289, -3.55569
+1290, -3.5571
+1291, -3.55718
+1292, -3.55862
+1293, -3.56006
+1294, -3.56196
+1295, -3.56344
+1296, -3.56493
+1297, -3.56643
+1298, -3.56795
+1299, -3.56948
+1300, -3.57104
+1301, -3.57264
+1302, -3.57429
+1303, -3.57603
+1304, -3.57791
+1305, -3.58005
+1306, -3.58271
+1307, -3.58664
+1308, -2.46239
+1309, -1.66311
+1310, -0.939418
+1311, -0.284154
+1312, 0.309153
+1313, 0.846362
+1314, 1.33278
+1315, 1.7732
+1316, 2.16607
+1317, 2.5272
+1318, 2.85417
+1319, 3.15023
+1320, 3.41828
+1321, 3.66099
+1322, 3.57362
+1323, 3.57495
+1324, 3.5763
+1325, 3.57765
+1326, 3.57901
+1327, 3.58037
+1328, 3.58174
+1329, 3.58311
+1330, 3.58449
+1331, 3.58587
+1332, 3.58725
+1333, 3.58864
+1334, 3.59003
+1335, 3.59143
+1336, 3.59282
+1337, 3.59422
+1338, 3.59563
+1339, 3.59703
+1340, 3.59844
+1341, 3.59985
+1342, 3.60126
+1343, 3.60268
+1344, 3.6041
+1345, 3.60552
+1346, 3.60694
+1347, 3.60836
+1348, 3.60978
+1349, 3.61121
+1350, 3.61264
+1351, 3.61406
+1352, 3.61549
+1353, 3.61693
+1354, 3.61836
+1355, 3.61979
+1356, 3.62123
+1357, 3.62266
+1358, 3.6241
+1359, 3.62554
+1360, 3.62563
+1361, 3.62709
+1362, 3.62856
+1363, 3.63046
+1364, 3.63196
+1365, 3.63347
+1366, 3.63498
+1367, 3.63651
+1368, 3.63806
+1369, 3.63962
+1370, 3.64122
+1371, 3.64285
+1372, 3.64455
+1373, 3.64636
+1374, 3.64833
+1375, 3.65064
+1376, 3.65363
+1377, 3.65048
+1378, 2.21046
+1379, 1.44156
+1380, 0.744754
+1381, 0.113283
+1382, -0.458983
+1383, -0.977598
+1384, -1.44759
+1385, -1.87352
+1386, -2.25364
+1387, -2.6035
+1388, -2.92056
+1389, -3.20788
+1390, -3.46826
+1391, -3.49667
+1392, -3.49799
+1393, -3.49931
+1394, -3.50064
+1395, -3.50197
+1396, -3.50331
+1397, -3.50466
+1398, -3.506
+1399, -3.50736
+1400, -3.50871
+1401, -3.51007
+1402, -3.51143
+1403, -3.5128
+1404, -3.51417
+1405, -3.51554
+1406, -3.51692
+1407, -3.51829
+1408, -3.51967
+1409, -3.52106
+1410, -3.52244
+1411, -3.52383
+1412, -3.52522
+1413, -3.52661
+1414, -3.528
+1415, -3.52939
+1416, -3.53079
+1417, -3.53219
+1418, -3.53358
+1419, -3.53499
+1420, -3.53639
+1421, -3.53779
+1422, -3.53919
+1423, -3.5406
+1424, -3.54201
+1425, -3.54341
+1426, -3.54482
+1427, -3.54623
+1428, -3.54764
+1429, -3.54773
+1430, -3.54916
+1431, -3.5506
+1432, -3.5525
+1433, -3.55398
+1434, -3.55547
+1435, -3.55697
+1436, -3.55849
+1437, -3.56002
+1438, -3.56159
+1439, -3.56319
+1440, -3.56486
+1441, -3.56663
+1442, -3.56857
+1443, -3.57082
+1444, -3.57373
+1445, -3.57038
+1446, -2.20434
+1447, -1.42946
+1448, -0.727862
+1449, -0.0926017
+1450, 0.482593
+1451, 1.0034
+1452, 1.47497
+1453, 1.90195
+1454, 2.28266
+1455, 2.63276
+1456, 2.94975
+1457, 3.23677
+1458, 3.49664
+1459, 3.57501
+1460, 3.57635
+1461, 3.57769
+1462, 3.57904
+1463, 3.58039
+1464, 3.58175
+1465, 3.58311
+1466, 3.58448
+1467, 3.58586
+1468, 3.58724
+1469, 3.58862
+1470, 3.59
+1471, 3.59139
+1472, 3.59279
+1473, 3.59418
+1474, 3.59558
+1475, 3.59699
+1476, 3.59839
+1477, 3.5998
+1478, 3.60121
+1479, 3.60262
+1480, 3.60403
+1481, 3.60545
+1482, 3.60687
+1483, 3.60829
+1484, 3.60971
+1485, 3.61113
+1486, 3.61256
+1487, 3.61399
+1488, 3.61542
+1489, 3.61685
+1490, 3.61828
+1491, 3.61971
+1492, 3.62114
+1493, 3.62258
+1494, 3.62402
+1495, 3.62545
+1496, 3.62689
+1497, 3.62833
+1498, 3.62843
+1499, 3.62989