How to resolve the algorithm Almkvist-Giullera formula for pi step by step in the Quackery programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Almkvist-Giullera formula for pi step by step in the Quackery programming language

Table of Contents

Problem Statement

The Almkvist-Giullera formula for calculating   1/π2   is based on the Calabi-Yau differential equations of order 4 and 5,   which were originally used to describe certain manifolds in string theory.

The formula is:

This formula can be used to calculate the constant   π-2,   and thus to calculate   π. Note that, because the product of all terms but the power of 1000 can be calculated as an integer, the terms in the series can be separated into a large integer term: multiplied by a negative integer power of 10:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Almkvist-Giullera formula for pi step by step in the Quackery programming language

Source code in the quackery programming language

  [ $ "bigrat.qky" loadfile ] now!

  [ 1 swap times [ i^ 1+ * ] ] is !       ( n --> n   )

  [ dup dup 2 ** 532 *
    over 126 * + 9 +
    swap 6 * ! * 32 *
    swap ! 6 ** 3 * / ]        is intterm ( n --> n   )

  [ dup intterm 
    10 rot 6 * 3 + ** 
    reduce ]                   is vterm   ( n --> n/d )

  10 times [ i^ intterm echo cr ] cr
  
  0 n->v 
  53 times [ i^ vterm v+ ]
  1/v 70 vsqrt drop 
  70 point$ echo$ cr

  

You may also check:How to resolve the algorithm Rock-paper-scissors step by step in the Liberty BASIC programming language
You may also check:How to resolve the algorithm Chinese remainder theorem step by step in the OCaml programming language
You may also check:How to resolve the algorithm Permutation test step by step in the Wren programming language
You may also check:How to resolve the algorithm RSA code step by step in the FreeBASIC programming language
You may also check:How to resolve the algorithm User input/Text step by step in the D programming language