Vedic Calculator

download Vedic Calculator

of 22

  • date post

  • Category


  • view

  • download


Embed Size (px)


This calculator has been developed by me. It gives high precision results which Normal calculator can not give. It is helpful in calculations for Space technology, Supercomputers, Nano technology etc. I can give this calculator to interested people.

Transcript of Vedic Calculator

  • 1. Multi-Precision Library based on Vedic Mathematics Presented by: Divyang panchasara

2. Project Goal

  • To give multi-precision, i.e. as many precision digits required for any calculations.
  • To give maximum accuracy up to the precision wanted that the normal built in computer functions can not give .
  • To implement the principles of Vedic mathematics and various approximation algorithms for series calculations.
  • Create a function parser to process any equation.

3. SAMPLE COMPARISION BETWEEN VEDIC & GMP METHOD As shown in the example graph, the straight division method given by Vedic mathematics is much faster than even the GMP method which is assumed to be very fast. 4. Vedic Multiplication

  • The following method explains how to solve long multi-precision numbers by bit-wise calculations.
  • The product of 6471 x 6212 can be computed as:
  • 6 646476471 471 71 1xxxxxxx
  • 6626216212212122
  • 3612+246 + 8 + 4212 + 4 + 14 +68 + 7 + 214 + 22
  • 40197852
  • 45311

5. Why More precision?

  • The idea for developing such a library has come from the requirements of astronomical sciences as well as Nano and Pico level calculations.
  • The astronomical calculations include calculations of orbital routes, etc. and these involve high precision and accuracy because of the high unit it uses, ex. Light years.
  • Nano calculations require high precision to ensure correctness. Hence high precision mathematics is required to avoid inaccuracy.

6. Software Development Life Cycle Requirement Definition System and Software design Implementation & unit testing Integration and system testing Operation and maintenance 7. SYSTEM REQUIREMENT SPECIFICATION:

  • Project is made to support Vedic mathematics concepts and Series Algorithms that can help to reduce the processing time and increase accuracy.
  • Vedic mathematics should help in getting high precision in calculations which ordinary computer can not give due to overflow problems as well as complex logic.
  • Functions made by use of Vedic mathematics and the Algorithms should help in very low speed -processing (chip) and very high speed processing like supercomputer.
  • Make use of lower or middle level language in developing functions so that they can be supported and used by any higher level application.
  • Create library from the functions created by the principles which can be used to develop an application by higher level language.
  • All the calculations to be done with inputs in string format to prevent overflow, as well as use the normalized form for all calculations.


  • Architectural design : The functions and the modules are defined and documented.
  • Abstract and method specification:The optimal method and algorithms for each method are decided and an abstract specification under the constraints under which the functions work must be decided under which the program is going to operate.
  • Interface Design:For each functions the interface and convention with all the other functions must be designed and documented.
  • Algorithm Design:Each of the algorithms is framed for each function in the program.
  • Parser Design:The function parser is designed from scratch on basis on which concept to follow and how to implement it.
  • Application Design:The final user-level application should be designed in such a way so as to meet the user requirements.


  • Code the `+`, `-`, `*` & `/` operators first and ensure their functioning to be perfect.
  • Make algorithms for implementing the logarithm and exponential functions.
  • Make series functions using approximation methods.
  • Make the derived functions such as power, n th root, etc, which are based on the logarithmic function.
  • Debug all the functions and make them error-free.


  • Unit Testing:The basic operator functions were individually tested and ensured to be free from errors.
  • Function Testing:All the other basic operator functions which were made on basis of the operators and algorithms were independently tested and validated to be giving expected outputs for specific inputs.
  • Parser Testing:The function parser is based on Reverse Polish notation and hence the precedence rule has to be taken care of.
  • Application Testing:The application level program should be validated and tested depending on the requirement of the user.
  • Alpha Testing:This testing continues till the client agrees that delivered system is an acceptable implementation of system requirements.

11. Applications

  • A DLL file would be created that could be used in higher level applications.
  • A Visual Basic application would be created that could provide users a GUI for solving high precision mathematical calculations.
  • A function parser would be developed which would be used to process the standard format equations directly.
  • A file-handling project would be made which would process a whole input file and generate and output file.
  • A Web application would be developed to solve multi-precision equations online.
  • An application would be developed for calculating orbital routes of Earth and Mars which would be used by a research agency based in U.S..
  • A Firmware chip would be made by our company in future that could be used on any platform to get high precision calculations with maximum accuracy.


  • The Vmat library has been in a flexible way. Hence there remains scope of evolution.
  • Each function would be constructed in generalized exponential form to increase calculation limits.
  • A DLL should be created including all the functions we have made so that it can be distributed and anyone can use our functions in any programming language.
  • Rest changes are based on changing requirements and customer needs.

13. Dependency:

  • TheV MAT Multi-Precision Library is not dependent on any specific system or software configuration.
  • The Library has been made as much independent of platform as possible.
  • The overflow problem is solved by using the string variables and not any predefined data types.
  • As self made functions are used there are minimal chances of any approximations.


  • Basic operator functions .
  • (+, -, *, /, sqrt)
  • Trigonometric & Hyperbolic functionsby making use of basic operators.
  • (log, exp, sine, cos, tan, sinh, cosh, asin, acos, atan, asinh, acosh, etc.)
  • Library of functionsconstructed by integrating all the functions.
  • (Vedic.h file)
  • Function parserto process and evaluate equations.
  • (parser.h)
  • File handling projectwhich takes input file of equations and generates output file.
  • (Vedic.c)

15. Tools And Language

  • The mathematical library would be made in C Language. The choice of C-Language was made because of many reasons. First of all C is a very robust language with rich set of built in functions of string.
  • C compiler combines the capabilities of an assembly language with features of a high level language hence it is very well suited for writing system software.
  • C-Language is highly portable. This means that C programs written for one computer can be run on another with little or no modification. Portability is very important for our project because it can be used by anyone on any platform.
  • C-Language is suited for structured programming, thus requiring the user to think of a problem in terms of modules and blocks. A proper collection of these modules make a whole program. The modular programming makes debugging, testing and maintenance easier.
  • Another important feature of C is its ability to extend itself. A C Program is basically a collection of functions that are supported by the C Library. We can continuously add our own functions thereby making our programming easier.

16. Standard Convention:

  • All the input values should be taken in string variables.
  • The input can be normalized or any standard exponential form.
  • None of the computers built in functions should be used till possible extent.
  • All the processing should be done in normalized form of input.
  • All the functions should be integrated in one common file to prevent any re-declaration or overlapping.
  • Create functions to optimize the inputs to prevent unnecessary calculations.
  • All the functions should be internally compatible with each other.
  • All the trigonometric functions should be made by the use of the arithmetic functions made by us to prevent loss of accuracy.
  • All the outputs should be in standard exponential format and these conversions should take place at the application level.