or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
2017q1 Homework1 (compute-pi)
contributed by <
etc276
>tags:
嵌入式
Reviewed by
yangyang95
開發環境
作業要求
$ make gencsv
以外的輸出機制,預期執行$ make plot
後,可透過 gnuplot 產生前述多種實做的效能分析比較圖表開發紀錄
重現實驗
$ make check
後查看各版本時間也就是 Wall-clock time,當然若有其他程式同時在執行,必定會影響到。
增加迭代
研究 error rate
查看 Makefile 發現用來產生圖檔的資料 csv 檔是由 benchmark_clock_gettime 輸出,因此修改此 .c 檔,再輸出 error。後改為寫一個 out.pg,並在 Makefile 新增
plot :
以產生兩種圖檔。產生圖檔的過程遇到一個困難是,csv 檔的資料分隔是用逗號(,)所以一開始想用
"%lf,%lf,%lf,%lf,%lf,%lf"
的方式撰寫 out.pg,後來才發現可以使用set datafile separator ","
用 gnuplot 畫出來的 error rate
set logscale xy
,看的細一點Leibniz formula for π
參考 shelly4132的共筆
考慮以下分解:

對兩邊從0到1去做積分

當
時,除積分項以外的項收斂到萊布尼茨級數。同時,積分項收斂到0:
所以這便證明了萊布尼茨公式。

其他計算圓周率的方式如 蒙地卡羅、尤拉等等 (待補實作code)