Discussion Overview
The discussion revolves around calculating the value of pi in Fortran 90/95 without utilizing intrinsic functions, specifically through the use of the sine and cosine functions derived from their infinite series representations. Participants explore various methods and approaches to achieve this calculation while adhering to the project constraints.
Discussion Character
- Homework-related
- Exploratory
- Technical explanation
- Debate/contested
Main Points Raised
- The original poster (OP) seeks to calculate pi using the condition where sin(x) equals cos(x) with a specified error margin of 10-4.
- One participant suggests a basic looping method to increment x and compare sin(x) and cos(x) until the condition is met, noting that this approach may be inefficient.
- Another participant emphasizes the need for an outer loop to try different values of x while calculating sin(x) and cos(x) within inner loops.
- There is a clarification that the use of intrinsic sin(x) and cos(x) functions is not allowed, and the OP must rely on infinite series to compute these values.
- One participant proposes that using Taylor series expansions for sine and cosine could be a viable approach, suggesting that fewer terms than 9000 might suffice for the required accuracy.
- Another participant mentions alternative methods for calculating pi without using trigonometric functions, referencing external resources for potential formulas.
Areas of Agreement / Disagreement
Participants express differing views on the implementation details and efficiency of the proposed methods. There is no consensus on a single approach, and the discussion remains unresolved regarding the best way to calculate pi under the given constraints.
Contextual Notes
Participants note limitations regarding the use of intrinsic functions and the necessity to rely on infinite series for sine and cosine calculations. The discussion also highlights the potential overuse of terms in series expansions, suggesting that fewer terms may achieve the desired accuracy.