Skip to content

diegovester/Simpsons-Trapezoidal-Rules

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simpsons-Trapezodial-Rules

This is a C program that uses the tinyexpr library to parse through mathmatical functions, and then uses the Simpsons Trapezodial Rule to approximate the area under the curve.

Description

  • This program asks for user input on the number of intervals, the upper and lower bounds, and the function, and which approximation method to use.
  • Depending on what the user chooses, program will approximate with either simpsons or trapezoidal rule, and parse through the function using tinyexpr library
  • The program supports
    • e.g. x + x^2
    • (x*5)^2
    • (x * 5) / 2
    • Factorials fac 5 == 120
    • the following constants pi, e

Getting Started

Dependencies

  • Linux based system: containing gcc compiler
  • Standard gcc Libaries Needed: stdio.h, string.h, ctype.h, math.h, and stdlib.h
  • custom library: tinyexpr.h

Installing & Executing

  • First you need to clone this repo
  • then run this command
gh repo clone Betim-Hodza/Simpsons-Trapezoidal-Rules
cd SimpsonsAndTrapezoidal
gcc main.c tinyexpr-master/tinyexpr.c -lm
./a.out

alt text alt text

Authors

Betim Hodza

Sources

Tinyexpr:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C 98.4%
  • Makefile 1.6%