equal
deleted
inserted
replaced
16 declare powr_neg_one [simp] |
16 declare powr_neg_one [simp] |
17 declare powr_neg_numeral [simp] |
17 declare powr_neg_numeral [simp] |
18 |
18 |
19 section "Horner Scheme" |
19 section "Horner Scheme" |
20 |
20 |
21 subsection \<open>Define auxiliary helper @{text horner} function\<close> |
21 subsection \<open>Define auxiliary helper \<open>horner\<close> function\<close> |
22 |
22 |
23 primrec horner :: "(nat \<Rightarrow> nat) \<Rightarrow> (nat \<Rightarrow> nat \<Rightarrow> nat) \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> real \<Rightarrow> real" where |
23 primrec horner :: "(nat \<Rightarrow> nat) \<Rightarrow> (nat \<Rightarrow> nat \<Rightarrow> nat) \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> nat \<Rightarrow> real \<Rightarrow> real" where |
24 "horner F G 0 i k x = 0" | |
24 "horner F G 0 i k x = 0" | |
25 "horner F G (Suc n) i k x = 1 / k - x * horner F G n (F i) (G i k) x" |
25 "horner F G (Suc n) i k x = 1 / k - x * horner F G n (F i) (G i k) x" |
26 |
26 |