Java Number Cruncher: The Java Programmer's Guide to Numerical Computing
暫譯: Java 數字運算:Java 程式設計師的數值計算指南

Ronald Mak

  • 出版商: Prentice Hall
  • 出版日期: 2002-11-08
  • 售價: $2,200
  • 貴賓價: 9.5$2,090
  • 語言: 英文
  • 頁數: 480
  • 裝訂: Paperback
  • ISBN: 0130460419
  • ISBN-13: 9780130460417
  • 相關分類: Java 程式語言
  • 已絕版

買這商品的人也買了...

相關主題

商品描述

Summary

  • Non-theoretical explanations of practical numerical algorithms
  • Algorithms in action with animated, interactive graphical Java programs and applets
  • Computational errors and how to remove them from your code

Understand "computer math" and get the numbers you expect, reliably.

In Java Number Cruncher, author Ronald Mak explains how to spot-and how to avoid-the subtle programming miscues that can cause vexing calculation errors in your applications. An authority on mapping pure math to computer math, he explains how to use the often-overlooked computational features of Java, and does so in a clear, non-theoretical style.

Without getting lost in mathematical detail, you'll learn practical numerical algorithms for safely summing numbers, finding roots of equations, interpolation and approximation, numerical integration, solving differential equations, matrix operations, and solving sets of simultaneous equations. You'll also enjoy intriguing topics such as searching for patterns in prime numbers, generating random numbers, computing thousands of digits of pi, and creating intricately beautiful fractal images.

Java Number Cruncher includes:

  • Practical information all Java programmers should know
  • Popular computational algorithms in Java-without excessive mathematical theory
  • Interactive graphical programs that bring the algorithms to life on the computer screen
  • Rounding errors, the pitfalls of integer arithmetic, Java's implementation of the IEEE 754 floating-point standard, and more

This book is useful to all Java programmers, especially for those who want to learn about numerical computation, and for developers of scientific, financial, and data analysis applications.

Table of Contents

Preface.
How to Download the Source Code.

I. WHY GOOD COMPUTATIONS GO BAD.

1. Floating-Point Numbers Are Not Real!

Roundoff Errors. Error Explosion. Real Numbers versus Floating-Point Numbers. Precision and Accuracy. Disobeying the Laws of Algebra. And What about Those Integers?


2. How Wholesome Are the Integers?

The Integer Types and Operations. Signed Magnitude versus Two's-Complement. Whole Numbers versus Integer Numbers. Wrapper Classes. Integer Division and Remainder. Integer Exponentiation.


3. The Floating-Point Standard.

The Floating-Point Formats. Denormalized Numbers. Decomposing Floating-Point Numbers. The Floating-Point Operations. 60, 6`, and NaN. No Exceptions! Another Look at Roundoff Errors. Strict or Nonstrict Floating-Point Arithmetic. The Machine Epsilon e. Error Analysis.

II. ITERATIVE COMPUTATIONS.


4. Summing Lists of Numbers.

A Summing Mystery-the Magnitude Problem. The Kahan Summation Algorithm. Summing Numbers in a Random Order. Summing Addends with Different Signs. Insightful Computing. Summation Summary.


5. Finding Roots.

Analytical versus Computer Solutions. The Functions. The Bisection Algorithm. The Regula Falsi Algorithm. The Improved Regula Falsi Algorithm. The Secant Algorithm. Newton's Algorithm. Fixed-Point Iteration. Double Trouble with Multiple Roots. Comparing the Root-Finder Algorithms.


6. Interpolation and Approximation.

The Power Form versus the Newton Form. Polynomial Interpolation Functions. Divided Differences. Constructing the Interpolation Function. Least-Squares Linear Regression. Constructing the Regression Line.


7. Numerical Integration.

Back to Basics. The Trapezoidal Algorithm. Simpson's Algorithm.


8. Solving Differential Equations Numerically.

Back to Basics. A Differential Equation Class. Euler's Algorithm. A Predictor-Corrector Algorithm. The Fourth-Order Runge-Kutta Algorithm.

III. A MATRIX PACKAGE.


9. Basic Matrix Operations.

Matrix. Square Matrix. Identity Matrix. Row Vector. Column Vector. Graphic Transformation Matrices. A Tumbling Cube in 3-D Space.


10. Solving Systems of Linear Equations.

The Gaussian Elimination Algorithm. Problems with Gaussian Elimination. Partial Pivoting. Scaling. LU Decomposition. Iterative Improvement. A Class for Solving Systems of Linear Equations. A Program to Test LU Decomposition. Polynomial Regression.


11. Matrix Inversion, Determinants, and Condition Numbers.

The Determinant. The Inverse. The Norm and the Condition Number. The Invertible Matrix Class. Hilbert Matrices. Comparing Solution Algorithms.

IV. THE JOYS OF COMPUTATION.


12. Big Numbers.

Big Integers. A Very Large Prime Number. Big Integers and Cryptography. Big Decimal Numbers. Big Decimal Functions.


13. Computing p.

Estimates of p and Ramanujan's Formulas. Arctangent Formulas That Generate p. Generating Billions of Digits.


14. Generating Random Numbers.

Pseudorandom Numbers. Uniformly Distributed Random Numbers. Normally Distributed Random Numbers. Exponentially Distributed Random Numbers. Monte Carlo, Buffon's Needle, and p.


15. Prime Numbers.

The Sieve of Eratosthenes and Factoring. Congruences and Modulo Arithmetic. The Lucas Test. The Miller-Rabin Test. A Combined Primality Tester. Generating Prime Numbers. Prime Number Patterns.


16. Fractals.

Fixed-Point Iteration and Orbits. Bifurcation and the Real Function f(x) 5 x2 1 c. Julia Sets and the Complex Function f(z) 5 z2 1 c. Newton's Algorithm in the Complex Plane. The Mandelbrot Set.


Index.

商品描述(中文翻譯)

摘要

- 實用數值演算法的非理論性解釋
- 透過動畫和互動式圖形 Java 程式及小程式展示演算法
- 計算錯誤及如何從程式碼中消除它們

了解「電腦數學」,可靠地獲得您所期望的數字。

在《Java Number Cruncher》中,作者 Ronald Mak 解釋了如何識別和避免那些可能導致應用程式中令人困惑的計算錯誤的微妙程式設計失誤。作為將純數學映射到電腦數學的權威,他以清晰且非理論的風格解釋了如何使用 Java 中常被忽視的計算特性。

在不迷失於數學細節的情況下,您將學習到安全地求和、尋找方程的根、插值和近似、數值積分、解微分方程、矩陣運算以及解聯立方程組的實用數值演算法。您還將享受一些引人入勝的主題,例如尋找質數中的模式、生成隨機數、計算數千位的圓周率以及創建精美的分形圖像。

《Java Number Cruncher》包括:

- 所有 Java 程式設計師應該知道的實用資訊
- Java 中流行的計算演算法—不過度的數學理論
- 使演算法在電腦螢幕上栩栩如生的互動式圖形程式
- 四捨五入錯誤、整數運算的陷阱、Java 對 IEEE 754 浮點標準的實現等

本書對所有 Java 程式設計師都很有用,特別是對於那些想要了解數值計算的開發者,以及科學、金融和數據分析應用的開發者。

目錄

前言。如何下載源代碼。

I. 為什麼良好的計算會出錯。

1. 浮點數不是實數!
四捨五入錯誤。錯誤爆炸。實數與浮點數。精度與準確性。違反代數法則。那整數呢?

2. 整數有多健康?
整數類型和運算。符號大小與二補數。整數與整數數字。包裝類。整數除法和餘數。整數指數運算。

3. 浮點標準。
浮點格式。非規範數。分解浮點數。浮點運算。60、6`和 NaN。沒有例外!再次檢視四捨五入錯誤。嚴格或非嚴格的浮點運算。機器誤差 e。錯誤分析。

II. 迭代計算。

4. 數字列表求和。
求和之謎—大小問題。Kahan 求和演算法。隨機順序求和。不同符號的加數求和。深刻的計算。求和總結。

5. 尋找根。
分析解與計算機解。函數。二分法演算法。偽根法演算法。改進的偽根法演算法。割線法。牛頓法。固定點迭代。多重根的雙重麻煩。比較根尋找演算法。

6. 插值和近似。
幂形式與牛頓形式。多項式插值函數。分割差。構建插值函數。最小二乘線性回歸。構建回歸線。

7. 數值積分。
回到基本。梯形演算法。辛普森演算法。

8. 數值解微分方程。
回到基本。微分方程類。歐拉演算法。預測-修正演算法。四階龍格-庫塔演算法。

III. 矩陣包。

9. 基本矩陣運算。
矩陣。方陣。單位矩陣。行向量。列向量。圖形變換矩陣。三維空間中的翻滾立方體。

10. 解線性方程組。
高斯消去演算法。高斯消去的問題。部分樞紐。縮放。LU 分解。迭代改進。解線性方程組的類。測試 LU 分解的程式。多項式回歸。

11. 矩陣反演、行列式和條件數。
行列式。反矩陣。範數和條件數。可逆矩陣類。希爾伯特矩陣。比較解演算法。

IV. 計算的樂趣。

12. 大數字。
大整數。一個非常大的質數。大整數與密碼學。大十進制數。大十進制函數。

13. 計算圓周率。
圓周率的估算和拉馬努金公式。生成圓周率的反正切公式。生成數十億位數字。

14. 生成隨機數。
假隨機數。均勻分佈的隨機數。正態分佈的隨機數。指數分佈的隨機數。蒙特卡羅、布芬的針和圓周率。

15. 質數。
埃拉托斯特尼篩法和因式分解。同餘和模運算。盧卡斯測試。米勒-拉賓測試。結合質數測試器。生成質數。質數模式。

16. 分形。
固定點迭代和軌道。分岔和實函數 f(x) = x² + c。朱莉亞集和複數函數 f(z) = z² + c。牛頓法在複平面中的應用。曼德布羅特集。

索引。