From b35e3998333e8190bf07ade51dba30773b3a3d0b Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Wed, 27 Sep 2023 10:10:33 -0600 Subject: [PATCH] fix bug in which err = 0 --- homeworks/hw-2.org | 80 ++++++----------------------------------- homeworks/hw-2.pdf | Bin 65550 -> 68368 bytes homeworks/hw-2.tex | 37 +++++++++---------- src/approx/maceps.lisp | 1 + 4 files changed, 31 insertions(+), 87 deletions(-) diff --git a/homeworks/hw-2.org b/homeworks/hw-2.org index 9dad2d3..29502d7 100644 --- a/homeworks/hw-2.org +++ b/homeworks/hw-2.org @@ -45,7 +45,6 @@ Computing $\epsilon_{\text{mac}}$ for single precision numbers | 1.0 | 4.7683716e-07 | 4.7683716e-07 | | 1.0 | 2.3841858e-07 | 2.3841858e-07 | | 1.0 | 1.1920929e-07 | 1.1920929e-07 | -| 1.0 | 5.9604645e-08 | 0.0 | (with many rows truncated) @@ -54,14 +53,14 @@ Computing $\epsilon_{\text{mac}}$ for single precision numbers | 1.0 | 0.25 | 0.25 | | 1.0 | 0.125 | 0.125 | | 1.0 | 0.0625 | 0.0625 | +| 1.0 | 0.03125 | 0.03125 | | 1.0 | 1.9073486e-06 | 1.9073486e-06 | | 1.0 | 9.536743e-07 | 9.536743e-07 | | 1.0 | 4.7683716e-07 | 4.7683716e-07 | | 1.0 | 2.3841858e-07 | 2.3841858e-07 | | 1.0 | 1.1920929e-07 | 1.1920929e-07 | -| 1.0 | 5.9604645e-08 | 0.0 | -$\epsilon_{\text{mac}}$ \approx 5.9604 \cdot 10^{-8} +$\epsilon_{\text{mac single precision}}$ \approx 1.192(10^-7) * Question Two Computing $\epsilon_{\text{mac}}$ for double precision numbers: @@ -75,62 +74,6 @@ Computing $\epsilon_{\text{mac}}$ for double precision numbers: :domain-values domain-values))) #+END_SRC -#+RESULTS: -| a | h | err | -| 1.0d0 | 0.5d0 | 0.5d0 | -| 1.0d0 | 0.25d0 | 0.25d0 | -| 1.0d0 | 0.125d0 | 0.125d0 | -| 1.0d0 | 0.0625d0 | 0.0625d0 | -| 1.0d0 | 0.03125d0 | 0.03125d0 | -| 1.0d0 | 0.015625d0 | 0.015625d0 | -| 1.0d0 | 0.0078125d0 | 0.0078125d0 | -| 1.0d0 | 0.00390625d0 | 0.00390625d0 | -| 1.0d0 | 0.001953125d0 | 0.001953125d0 | -| 1.0d0 | 9.765625d-4 | 9.765625d-4 | -| 1.0d0 | 4.8828125d-4 | 4.8828125d-4 | -| 1.0d0 | 2.44140625d-4 | 2.44140625d-4 | -| 1.0d0 | 1.220703125d-4 | 1.220703125d-4 | -| 1.0d0 | 6.103515625d-5 | 6.103515625d-5 | -| 1.0d0 | 3.0517578125d-5 | 3.0517578125d-5 | -| 1.0d0 | 1.52587890625d-5 | 1.52587890625d-5 | -| 1.0d0 | 7.62939453125d-6 | 7.62939453125d-6 | -| 1.0d0 | 3.814697265625d-6 | 3.814697265625d-6 | -| 1.0d0 | 1.9073486328125d-6 | 1.9073486328125d-6 | -| 1.0d0 | 9.5367431640625d-7 | 9.5367431640625d-7 | -| 1.0d0 | 4.76837158203125d-7 | 4.76837158203125d-7 | -| 1.0d0 | 2.384185791015625d-7 | 2.384185791015625d-7 | -| 1.0d0 | 1.1920928955078125d-7 | 1.1920928955078125d-7 | -| 1.0d0 | 5.960464477539063d-8 | 5.960464477539063d-8 | -| 1.0d0 | 2.9802322387695313d-8 | 2.9802322387695313d-8 | -| 1.0d0 | 1.4901161193847656d-8 | 1.4901161193847656d-8 | -| 1.0d0 | 7.450580596923828d-9 | 7.450580596923828d-9 | -| 1.0d0 | 3.725290298461914d-9 | 3.725290298461914d-9 | -| 1.0d0 | 1.862645149230957d-9 | 1.862645149230957d-9 | -| 1.0d0 | 9.313225746154785d-10 | 9.313225746154785d-10 | -| 1.0d0 | 4.656612873077393d-10 | 4.656612873077393d-10 | -| 1.0d0 | 2.3283064365386963d-10 | 2.3283064365386963d-10 | -| 1.0d0 | 1.1641532182693481d-10 | 1.1641532182693481d-10 | -| 1.0d0 | 5.820766091346741d-11 | 5.820766091346741d-11 | -| 1.0d0 | 2.9103830456733704d-11 | 2.9103830456733704d-11 | -| 1.0d0 | 1.4551915228366852d-11 | 1.4551915228366852d-11 | -| 1.0d0 | 7.275957614183426d-12 | 7.275957614183426d-12 | -| 1.0d0 | 3.637978807091713d-12 | 3.637978807091713d-12 | -| 1.0d0 | 1.8189894035458565d-12 | 1.8189894035458565d-12 | -| 1.0d0 | 9.094947017729282d-13 | 9.094947017729282d-13 | -| 1.0d0 | 4.547473508864641d-13 | 4.547473508864641d-13 | -| 1.0d0 | 2.2737367544323206d-13 | 2.2737367544323206d-13 | -| 1.0d0 | 1.1368683772161603d-13 | 1.1368683772161603d-13 | -| 1.0d0 | 5.684341886080802d-14 | 5.684341886080802d-14 | -| 1.0d0 | 2.842170943040401d-14 | 2.842170943040401d-14 | -| 1.0d0 | 1.4210854715202004d-14 | 1.4210854715202004d-14 | -| 1.0d0 | 7.105427357601002d-15 | 7.105427357601002d-15 | -| 1.0d0 | 3.552713678800501d-15 | 3.552713678800501d-15 | -| 1.0d0 | 1.7763568394002505d-15 | 1.7763568394002505d-15 | -| 1.0d0 | 8.881784197001252d-16 | 8.881784197001252d-16 | -| 1.0d0 | 4.440892098500626d-16 | 4.440892098500626d-16 | -| 1.0d0 | 2.220446049250313d-16 | 2.220446049250313d-16 | -| 1.0d0 | 1.1102230246251565d-16 | 0.0d0 | - (with many rows truncated) | a | h | err | | 1.0d0 | 0.5d0 | 0.5d0 | @@ -148,9 +91,8 @@ Computing $\epsilon_{\text{mac}}$ for double precision numbers: | 1.0d0 | 8.881784197001252d-16 | 8.881784197001252d-16 | | 1.0d0 | 4.440892098500626d-16 | 4.440892098500626d-16 | | 1.0d0 | 2.220446049250313d-16 | 2.220446049250313d-16 | -| 1.0d0 | 1.1102230246251565d-16 | 0.0d0 | -Thus, $\epsilon_{\text{mac}}$ \approx 1.1102 \cdot 10^{-16} +Thus, $\epsilon_{\text{mac double precision}}$ \approx 2.220 \cdot 10^{-16} * Question Three - |v|_2 #+BEGIN_SRC lisp :session t @@ -204,9 +146,9 @@ Thus, $\epsilon_{\text{mac}}$ \approx 1.1102 \cdot 10^{-16} * Question Six - ||v - u|| via |v|_{2} #+BEGIN_SRC lisp :session t - (let* ((vs '((1 1) (2 3) (4 5) (-1 2))) - (vs2 '((7 9) (2 2) (8 -1) (4 4))) - (2-norm (lizfcm.vector:p-norm 2))) + (let ((vs '((1 1) (2 3) (4 5) (-1 2))) + (vs2 '((7 9) (2 2) (8 -1) (4 4))) + (2-norm (lizfcm.vector:p-norm 2))) (lizfcm.utils:table (:headers '("v1" "v2" "2-norm-d") :domain-order (v1 v2) :domain-values (mapcar (lambda (v1 v2) @@ -225,9 +167,9 @@ Thus, $\epsilon_{\text{mac}}$ \approx 1.1102 \cdot 10^{-16} * Question Seven - ||v - u|| via |v|_{1} #+BEGIN_SRC lisp :session t - (let* ((vs '((1 1) (2 3) (4 5) (-1 2))) - (vs2 '((7 9) (2 2) (8 -1) (4 4))) - (1-norm (lizfcm.vector:p-norm 1))) + (let ((vs '((1 1) (2 3) (4 5) (-1 2))) + (vs2 '((7 9) (2 2) (8 -1) (4 4))) + (1-norm (lizfcm.vector:p-norm 1))) (lizfcm.utils:table (:headers '("v1" "v2" "1-norm-d") :domain-order (v1 v2) :domain-values (mapcar (lambda (v1 v2) @@ -246,8 +188,8 @@ Thus, $\epsilon_{\text{mac}}$ \approx 1.1102 \cdot 10^{-16} * Question Eight - ||v - u|| via |v|_{\infty} #+BEGIN_SRC lisp :session t - (let* ((vs '((1 1) (2 3) (4 5) (-1 2))) - (vs2 '((7 9) (2 2) (8 -1) (4 4)))) + (let ((vs '((1 1) (2 3) (4 5) (-1 2))) + (vs2 '((7 9) (2 2) (8 -1) (4 4)))) (lizfcm.utils:table (:headers '("v1" "v2" "max-norm-d") :domain-order (v1 v2) :domain-values (mapcar (lambda (v1 v2) diff --git a/homeworks/hw-2.pdf b/homeworks/hw-2.pdf index fed1f4400b8bca65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ZzieiY?g?;#tvJ!tc3YC|L;AMvj;zF;i1J=a*}gqwV~oZ?7o z?UGuos(+reLRg+OxbMl)~>0q@T%?~f8u z)#bYKF1?PduJc#@T;}CR2AL%G$!Lsz&$Hv7`}-EOWN4fy8%x+c3NsD4li-UpEk>GF zc%+8*b1EGtmbs)wYw*cm^;>CzePRNLv6lp8n^GTf+0W3|OPRm9-C+$XUP zl-9U%dr*kue8Daia&%)ZK9>#UA~$|pV5)40V@g1s%AFfU(s^-;!MvRj7Ol{JtLI1Z z(;siyY?I6h<{xB8t7DV+;KLJ2V`!%FYU@{5o|2HZp*$arb;`QQY~7PLQ#7-l8aSCo zCX&}rIjz6^dt&hWrr9j_#n&jD&Ik0_1O0xGoJ$O1r*Jd0&>i(o8DGL=CI_rpLqw!0;tU~NmcjbXxk=BP#pm`LEY{LIgv_ik9Ufu>)?~&;-K7%4@BPvpC5jx@ zS>7XP4Jq3j@MqzT($$PoSbg%2{pz`x6whKig@$~U(ov$5DWj8SQrLYqI63+A1TJb) zX-{GJ*fW=L(uD>UV{E5H$H2~Ak}gW}=)M8qqI zldut^?Iy(8zVMdh#|N6f9k{-uK`U>W%d_!@3=Nnw-K>VNO&PPZsp13VFc-1*5 z2QI;j?LBDcZM{fK71x40!R=!q?YrHbc=9WT(ZKt~Oz7x-snOZ|CH9gFCbec>I$^y4 zmE%+#o_g?6wvqy~cMJZZPDn zf@B=E!wb^DkOIr4U6oc{#ZujG@)bL?yK4pdcgSK3nQt@pupm^}{4aQguoxNTG~}`V E2QLr=hX4Qo diff --git a/homeworks/hw-2.tex b/homeworks/hw-2.tex index 5155448..e0aa172 100644 --- a/homeworks/hw-2.tex +++ b/homeworks/hw-2.tex @@ -1,4 +1,4 @@ -% Created 2023-09-25 Mon 09:52 +% Created 2023-09-27 Wed 10:09 % Intended LaTeX compiler: pdflatex \documentclass[11pt]{article} \usepackage[utf8]{inputenc} @@ -29,15 +29,16 @@ \setlength\parindent{0pt} \section{Question One} -\label{sec:orga203815} +\label{sec:orga21c813} Computing \(\epsilon_{\text{mac}}\) for single precision numbers \begin{verbatim} -(load "../cl/lizfcm.asd") +(load "../lizfcm.asd") (ql:quickload :lizfcm) -(let ((domain-values (lizfcm.approx:compute-maceps 1.0 - (lambda (x) x)))) +(let ((domain-values (lizfcm.approx:compute-maceps (lambda (x) x) + 1.0 + 1.0))) (lizfcm.utils:table (:headers '("a" "h" "err") :domain-order (a h err) :domain-values domain-values))) @@ -52,24 +53,25 @@ a & h & err\\[0pt] 1.0 & 0.25 & 0.25\\[0pt] 1.0 & 0.125 & 0.125\\[0pt] 1.0 & 0.0625 & 0.0625\\[0pt] +1.0 & 0.03125 & 0.03125\\[0pt] 1.0 & 1.9073486e-06 & 1.9073486e-06\\[0pt] 1.0 & 9.536743e-07 & 9.536743e-07\\[0pt] 1.0 & 4.7683716e-07 & 4.7683716e-07\\[0pt] 1.0 & 2.3841858e-07 & 2.3841858e-07\\[0pt] 1.0 & 1.1920929e-07 & 1.1920929e-07\\[0pt] -1.0 & 5.9604645e-08 & 0.0\\[0pt] \end{tabular} \end{center} -\(\epsilon_{\text{mac}}\) \(\approx\) 5.9604 \(\cdot\) 10\textsuperscript{-8} +\(\epsilon_{\text{mac single precision}}\) \(\approx\) 1.192(10\textsuperscript{-7}) \section{Question Two} -\label{sec:orgdd79be1} +\label{sec:org06c4a23} Computing \(\epsilon_{\text{mac}}\) for double precision numbers: \begin{verbatim} -(let ((domain-values (lizfcm.approx:compute-maceps 1.0d0 - (lambda (x) x)))) +(let ((domain-values (lizfcm.approx:compute-maceps (lambda (x) x) + 1.0d0 + 1.0d0))) (lizfcm.utils:table (:headers '("a" "h" "err") :domain-order (a h err) :domain-values domain-values))) @@ -94,14 +96,13 @@ a & h & err\\[0pt] 1.0d0 & 8.881784197001252d-16 & 8.881784197001252d-16\\[0pt] 1.0d0 & 4.440892098500626d-16 & 4.440892098500626d-16\\[0pt] 1.0d0 & 2.220446049250313d-16 & 2.220446049250313d-16\\[0pt] -1.0d0 & 1.1102230246251565d-16 & 0.0d0\\[0pt] \end{tabular} \end{center} -Thus, \(\epsilon_{\text{mac}}\) \(\approx\) 1.1102 \(\cdot\) 10\textsuperscript{-16} +Thus, \(\epsilon_{\text{mac double precision}}\) \(\approx\) 2.220 \(\cdot\) 10\textsuperscript{-16} \section{Question Three - |v|\textsubscript{2}} -\label{sec:org04608d9} +\label{sec:orgf181ba7} \begin{verbatim} (let ((vs '((1 1) (2 3) (4 5) (-1 2))) (2-norm (lizfcm.vector:p-norm 2))) @@ -123,7 +124,7 @@ x & y & 2norm\\[0pt] \end{center} \section{Question Four - |v|\textsubscript{1}} -\label{sec:orgfb57f3a} +\label{sec:org2196087} \begin{verbatim} (let ((vs '((1 1) (2 3) (4 5) (-1 2))) (1-norm (lizfcm.vector:p-norm 1))) @@ -145,7 +146,7 @@ x & y & 1norm\\[0pt] \end{center} \section{Question Five - |v|\textsubscript{\(\infty\)}} -\label{sec:org7bbdf04} +\label{sec:org11b8894} \begin{verbatim} (let ((vs '((1 1) (2 3) (4 5) (-1 2)))) (lizfcm.utils:table (:headers '("x" "y" "max-norm") @@ -166,7 +167,7 @@ x & y & infty-norm\\[0pt] \end{center} \section{Question Six - ||v - u|| via |v|\textsubscript{2}} -\label{sec:orge36996c} +\label{sec:orga2324b2} \begin{verbatim} (let* ((vs '((1 1) (2 3) (4 5) (-1 2))) (vs2 '((7 9) (2 2) (8 -1) (4 4))) @@ -192,7 +193,7 @@ v1 & v2 & 2-norm\\[0pt] \end{center} \section{Question Seven - ||v - u|| via |v|\textsubscript{1}} -\label{sec:orgd1577f0} +\label{sec:org388fbc7} \begin{verbatim} (let* ((vs '((1 1) (2 3) (4 5) (-1 2))) (vs2 '((7 9) (2 2) (8 -1) (4 4))) @@ -218,7 +219,7 @@ v1 & v2 & 1-norm-d\\[0pt] \end{center} \section{Question Eight - ||v - u|| via |v|\textsubscript{\(\infty\)}} -\label{sec:org2661676} +\label{sec:org6e77f76} \begin{verbatim} (let* ((vs '((1 1) (2 3) (4 5) (-1 2))) (vs2 '((7 9) (2 2) (8 -1) (4 4)))) diff --git a/src/approx/maceps.lisp b/src/approx/maceps.lisp index ad234e8..debaa67 100644 --- a/src/approx/maceps.lisp +++ b/src/approx/maceps.lisp @@ -8,4 +8,5 @@ (setf h (/ h 2) err (abs (- (funcall f (+ a h)) (funcall f a)))) + when (> err 0) collect (list a h err))))