Jump to content

File:Stirling series relative error.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 740 × 530 pixels, file size: 109 KB)

This file supersedes the file StirlingErrorGraphBB.svg. It is recommended to use this file rather than the other one.

Bahasa Indonesia  davvisámegiella  Deutsch  English  español  français  italiano  magyar  Nederlands  polski  svenska  македонски  മലയാളം  português do Brasil  русский  slovenščina  日本語  中文(简体)  中文(繁體)  farsi  +/−

minor quality

Summary

Description
English: Plot of the relative error in the Stirling series as compared with the gamma function. Recursion relation for the an coefficients taken from Mathworld
Date
Source Own work
Author Glosser.ca
SVG development
InfoField
 
The SVG code is valid.
 
This diagram was created with Mathematica.
Source code
InfoField

Mathematica code

b[0] = b[1] = 1;
b[n_] := b[n] = 
  1/(n + 1) (b[n - 1] - Sum[k b[k] b[n + 1 - k], {k, 2, n - 1}])
a[n_] := (2 n + 1)!! b[2 n + 1]

Approx[z_, n_] := Exp[-z] z^(z - 1/2) Sqrt[2 \[Pi]] Sum[a[k] z^-k, {k, 0, n}]

LogLinearPlot[
 Evaluate@Table[Log[10, Abs[(Approx[x, n] - Gamma[x])/Gamma[x]]], {n, 0, 5}],{x, 1, 10^9}, 
 PlotRange -> All,
 WorkingPrecision -> 120, 
 Frame -> True,
 FrameTicks -> {Table[{10^k, Superscript[10, k]}, {k, 0, 9}], Automatic}, 
 FrameLabel -> {"Argument", Log["Relative Error"]}, 
 PlotLegends -> LineLegend[Range[0, 5], LegendLabel -> "Number of terms"], 
 ImageSize -> Large, 
 PlotStyle -> Thick, 
 FrameStyle -> Directive[Black], 
 GridLines -> {10^Range[0, 9], Automatic}, 
 GridLinesStyle -> Directive[LightGray, Dashed]
]

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

22 April 2016

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:02, 23 April 2016Thumbnail for version as of 18:02, 23 April 2016740 × 530 (109 KB)RayhemAdd 10px margin
18:01, 23 April 2016Thumbnail for version as of 18:01, 23 April 2016715 × 505 (109 KB)RayhemMove legend to top of plot
21:42, 22 April 2016Thumbnail for version as of 21:42, 22 April 2016859 × 481 (83 KB)RayhemUser created page with UploadWizard

The following 3 pages use this file:

Global file usage

The following other wikis use this file:

Metadata