next up previous
Next: About this document ...

CPS 251 HW 5 Due: Sep. 13

1)
(4 pts) Rewrite each formula below so that it fits on 'one line' (see the examples from the notes). Use appropriate Fortran syntax for your expressions.
a)
$\displaystyle{y = \frac{x+5}{x^3-x^2}}$
b)
$\displaystyle{v = w^{w^{w}}}$
c)
$\displaystyle{w = \frac{1}{x+1} - \frac{z}{x+y^2+z^3}}$
d)
$\displaystyle{f = \frac{x^2+2x-5}{x^4+3x+\frac{1}{x^3-2x^2+4x-7}}}$
2)
(3 pts) Write an F90 assignment statement that will assign a correct double precision value to y. Assume that x and y are declared to be double precision variables.
a)
$\displaystyle{y = 1 + \frac{1}{3.4\,x} - 9.7\,x^2}$
b)
$\displaystyle{y = \frac{2x+7.5}{6.1}}$
d)
$\displaystyle{y = \frac{(x + 7.1)^2}{x-4}}$




2017-09-11