Главная » Просмотр файлов » Heath - Scientific Computing

Heath - Scientific Computing (523150), страница 12

Файл №523150 Heath - Scientific Computing (Heath - Scientific Computing) 12 страницаHeath - Scientific Computing (523150) страница 122013-09-15СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 12)

SCIENTIFIC COMPUTING1.32 In a floating-point number system having an underflow level of UFL = 10−38 , whichof the following computations will incur an underflow?√(a) a = b2 + c2 , with b = 1, c = 10−25 .√(b) a = b2 + c2 , with b = c = 10−25 .(c) u = (v × w)/(y × z), with v = 10−15 ,w = 10−30 , y = 10−20 , and z = 10−25 .In each case where underflow occurs, is it reasonable simply to set to zero the quantity thatunderflows?1.33 (a) Explain in words the difference between the unit roundoff, mach , and the underflow level, UFL, in a floating-point system.Of these two quantities,(b) Which one depends only on the number ofdigits in the mantissa field?(c) Which one depends only on the number ofdigits in the exponent field?(d ) Which one does not depend on the rounding rule used?(e) Which one is not affected by allowing subnormal numbers?1.34 Let xk be a monotonically decreasing, finite sequence of positive numbers (i.e., xk >xk+1 for each k).

Assuming it is practical totake the numbers in any order we choose, inwhat order should the sequence be summed tominimize rounding error?1.35 Is cancellation an example of roundingerror? Why?1.36 (a) Explain why a divergent infinite series, such as∞X1,nn=1can have a finite sum in floating-point arithmetic.(b) At what point will the partial sums ceaseto change?1.37 In floating-point arithmetic, if you arecomputing the sum of a convergent infinite series∞XxiS=i=1of positive terms in the natural order, whatstopping criterion would you use to attain themaximum possible accuracy using the smallestnumber of terms?1.38 Explain why an alternating infinite series, such asex = 1 + x +x2x3++ ···2!3!for x < 0, is difficult to evaluate accurately infloating-point arithmetic.1.39 If f is a real-valued function of a realvariable, the truncation error of the finite difference approximation to the derivativef 0 (x) ≈f (x + h) − f (x)hgoes to zero as h → 0.

If we use floatingpoint arithmetic, list two factors that limithow small a value of h we can use in practice.1.40 For computing the midpoint m of an interval [x, y], which of the following two formulas is preferable in floating-point arithmetic?Why?(a) m = (x + y)/2.0(b) m = x + (y − x)/2.01.41 List at least two ways in which evaluation of the quadratic formula√−b ± b2 − 4acx=2amay suffer numerical difficulties in floatingpoint arithmetic.Exercises1.1 The average normal human body temperature is usually quoted as 98.6 degreesFahrenheit, which might be presumed to havebeen determined by computing the averageover a large population and then rounding tothree significant digits. In fact, however, 98.6is simply the Fahrenheit equivalent of 37 degrees Celsius, which is accurate to only twoEXERCISES29significant digits.(a) What is the maximum relative errorthe accepted value, assuming it is accuratewithin ±0.05◦ F?(b) What is the maximum relative errorthe accepted value, assuming it is accuratewithin ±0.5◦ C?intointo1.2 What are the approximate absolute andrelative errors in approximating π by each ofthe following quantities?(a) 3(b) 3.14(c) 22/71.3 If a is an approximate value for a quantity whose true value is t, and a has relative error r, prove from the definitions of these termsthat a = t(1 + r).1.4 Consider the problem of evaluating thefunction sin(x), in particular, the propagateddata error, i.e., the error in the function valuedue to a perturbation h in the argument x.(a) Estimate the absolute error in evaluatingsin(x).(b) Estimate the relative error in evaluatingsin(x).(c) Estimate the condition number for thisproblem.(d ) For what values of the argument x is thisproblem highly sensitive?1.5 Consider the function f : R2 → R defined by f (x, y) = x − y.

Measuring the sizeof the input (x, y) by |x| + |y|, and assumingthat |x| + |y| ≈ 1 and x − y ≈ , show thatcond(f ) ≈ 1/. What can you conclude aboutthe sensitivity of subtraction?1.6 The sine function is given by the infiniteseriessin(x) = x −x3x5x7+−+ ···.3!5!7!(a) What are the forward and backward errorsif we approximate the sine function by usingonly the first term in the series, i.e., sin(x) ≈ x,for x = 0.1, 0.5, and 1.0?(b) What are the forward and backward errors if we approximate the sine function byusing the first two terms in the series, i.e.,sin(x) ≈ x − x3 /6, for x = 0.1, 0.5, and 1.0?1.7 A floating-point number system is characterized by four integers: the base β, the precision t, and the lower and upper limits L andU of the exponent range.(a) If β = 10, what are the smallest values of tand U , and largest value of L, such that both2365.27 and 0.0000512 can be represented exactly in a normalized floating-point system?(b) How would your answer change if the system is not normalized, i.e., if gradual underflow is allowed?1.8 In a floating-point system with precisiont = 6 decimal digits, let x = 1.23456 andy = 1.23579.(a) How many significant digits does the difference y − x contain?(b) If the floating-point system is normalized,what is the minimum exponent range for whichx, y, and y − x are all exactly representable?(c) Is the difference y−x exactly representable,regardless of exponent range, if gradual underflow is allowed? Why?1.9 (a) Using four-digit decimal arithmeticand the formula given in Example 1.1, compute the surface area of the Earth, with r =6370 km.(b) Using the same formula and precision,compute the difference in surface area if thevalue for the radius is increased by 1 km.(c) Since dA/dr = 8πr, the change in surface area is approximated by 8πrh, where his the change in radius.

Use this formula, stillwith four-digit arithmetic, to compute the difference in surface area due to an increase of1 km in radius. How does the value obtainedusing this approximate formula compare withthat obtained from the “exact” formula in partb?(d ) Determine which of the previous two answers is more nearly correct by repeating bothcomputations using higher precision, say, sixdigit decimal arithmetic.(e) Explain the results you obtained in partsa–d.(f ) Try this problem on a computer.

Howsmall must the change h in radius be for the30CHAPTER 1. SCIENTIFIC COMPUTINGsame phenomenon to occur? Try both singleprecision and double precision, if available.1.10 Consider the expression11−,1−x 1+x1.16 Let x be a given nonzero floating-pointnumber in a normalized system, and let y be anadjacent floating-point number, also nonzero.assuming x 6= ±1.(a) For what range of values of x is it difficult to compute this expression accurately infloating-point arithmetic?(b) Give a rearrangement of the terms suchthat, for the range of x in part a, the computation is more accurate in floating-point arithmetic.1.11 If x ≈ y, then we would expect somecancellation in computing log(x) − log(y).

Onthe other hand, log(x)−log(y) = log(x/y), andthe latter involves no cancellation. Does thismean that computing log(x/y) is likely to givea better result? (Hint: For what value is thelog function sensitive?)1.12 (a) Which of the two mathematicallyequivalent expressionsx2 − y 2and (x − y)(x + y)can be evaluated more accurately in floatingpoint arithmetic? Why?(b) For what values of x and y, relative to eachother, is there a substantial difference in theaccuracy of the two expressions?1.13 The Euclidean norm of an n-dimensionalvector x is defined bykxk2 =nXx2i!1/21.15 Explain how the various definitions forthe unit roundoff mach given in Section 1.3.5can differ in practice.

(Hint: Consider the toyfloating-point system of Example 1.5.).i=1How would you avoid overflow and harmful underflow in this computation?(a) What is the minimum possible spacing between x and y?(b) What is the maximum possible spacing between x and y?1.17 How many normalized machine numbersare there in a single-precision IEEE floatingpoint system? How many additional machinenumbers are gained if subnormals are allowed?1.18 In a single-precision IEEE floating-pointsystem, what are the values of the largest machine number, OFL, and the smallest positive normalized machine number, UFL? Howdo your answers change if subnormals are allowed?1.19 What is the IEEE single-precision binary floating-point representation of the decimal fraction 0.1(a) with chopping?(b) with rounding to nearest?1.20 (a) In a floating-point system, is the unitroundoff mach necessarily a machine number?(b) Is it possible to have a floating-point system in which mach < UFL? If so, give anexample.1.21 Assume that you are solving thequadratic equation ax2 + bx + c = 0, witha = 1.22, b = 3.34, and c = 2.28, using anormalized floating-point system with β = 10,t = 3.1.14 Give specific examples to show thatfloating-point addition is not associative ineach of the following floating-point systems:(a) What is the computed value of the discriminant b2 − 4ac?(a) The toy floating-point system of Example 1.5(b) What is the correct value of the discriminant in real (exact) arithmetic?(b) IEEE single-precision floating-point arithmetic(c) What is the relative error in the computedvalue of the discriminant?COMPUTER PROBLEMS311.22 Assume a normalized floating-point system with β = 10, t = 3, and L = −98.(a) What is the value of the underflow levelUFL for this system?(b) If x = 6.87 × 10−97 and y = 6.81 × 10−97 ,what is the result of x − y?(c) What would be the result of x − y if thesystem permitted gradual underflow?takes single-length inputs and adds c to thedouble-length product of a and b before normalizing and returning a single-length result.How can such an instruction be used to compute double-precision products without usingany double-length variables (i.e., the doublelength product of a and b will be contained intwo single-length variables, say, s and t)?1.23 Consider the following claim: if twofloating-point numbers x and y with the samesign differ by a factor of at most the base β(i.e., 1/β ≤ x/y ≤ β), then their difference,x − y, is exactly representable in the floatingpoint system.

Show that this claim is true forβ = 2, but give a counterexample for β > 2.1.25 Verify that the alternative quadratic formula given in Example 1.10 indeed gives thecorrect roots to the quadratic equation (in exact arithmetic).1.24 Some microprocessors have an instruction mpyadd(a,b,c), for multiply-add, which1.26 Give a detailed explanation of the numerical inferiority of the one-pass formula forcomputing the standard deviation comparedwith the two-pass formula given in Example 1.12.Computer Problems1.1 Write a program to compute the absolute and relative errors in Stirling’s approximation√n! ≈ 2πn (n/e)nfor n = 1, . .

. , 10. Does the absolute error growor shrink as n increases? Does the relative error grow or shrink as n increases?1.2 Write a program to determine approximate values for the unit roundoff mach and theunderflow level UFL, and test it on a real computer. (Optional : Can you also determine theoverflow level OFL, on your machine? This istrickier because an actual overflow may be fatal.) Print the resulting values in decimal, andalso try to determine the number of bits in themantissa and exponent fields of the floatingpoint system you use.1.3 In most floating-point systems, a quickapproximation to the unit roundoff can be obtained by evaluating the expressionmach ≈ |3 ∗ (4/3 − 1) − 1|.(a) Explain why this trick works.(b) Try it on a variety of computers (in bothsingle and double precision) and calculators toconfirm that it works.(c) Would this trick work in a floating-pointsystem with base β = 3?1.4 Write a program to compute the mathematical constant e, the base of natural logarithms, from the definitione = lim (1 + 1/n)n .n→∞Specifically, compute (1 + 1/n)n for n = 10k ,k = 1, 2, .

Характеристики

Тип файла
PDF-файл
Размер
1,88 Mb
Тип материала
Учебное заведение
Неизвестно

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6264
Авторов
на СтудИзбе
317
Средний доход
с одного платного файла
Обучение Подробнее