gibson:teaching:fall-2016:math753:hw1

Here's homework 1, due Wednesday Sept 14 midnight. HW1 Julia notebook

- Download the HW1 Julia notebook.
- Start the HW1 Julia notebook (following these instructions).
- Work through the HW1 Julia notebook. Provide answers to the questions by filling in the cells with verbal answers or Julia code as appropriate (following these instructions).
- Clean up or remove any mistakes you made along the way so that the notebook is polished and easy to read.
- Upload your
`.zip`

or`.txt`

HW1 Julia notebook file to the Math 753 Canvas website.

A PDF of the Julia notebook is available so you can view the assignment in a browser, without Julia. (HW1 viewable as PDF)

**Due date: ** changed to Friday 9/16 at midnight.

**Problem 4:** The syntax for inputting a 16-bit float is `Float16(9.4)`

, not `9.0f0`

. The latter produces a 32-bit float.

**Problem 6:** This one's proving challenging for people. Some hints:

How many of the 7s will survive when `x = 4778 + 3.77777e-10`

is computed in 16 digits? Same for `y`

.
Once you have those rounded numbers, how many significant digits will survive in the floating=point computations , , etc.? If you can't figure this out, go ahead and do the computations in 64 bits and see if you can explain the answers you get.

If you want to compare the 64-bit calculations to something more accurate, use Julia's 256-bit `BigFloat`

type. There are two ways to get a `BigFloat`

.

julia> BigFloat(9.4) 9.400000000000000355271367880050092935562133789062500000000000000000000000000000 julia> big(9.4) 9.400000000000000355271367880050092935562133789062500000000000000000000000000000

Observe, however, that though we have 80 digits of precision in a `BigFloat`

, we've produced 9.4 accurate only to 16 digits. This is because you type 9.4, it's interpreted as a 64-bit float before it's handed off to the `BigFloat`

type. To get an accurate 9.4, you can do this

julia> big(94.0)/big(10.0)^1 9.399999999999999999999999999999999999999999999999999999999999999999999999999945

gibson/teaching/fall-2016/math753/hw1.txt · Last modified: 2016/09/15 08:07 by gibson