Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
161ca2f
test commit
demroz Jun 24, 2025
d8bd5e7
test commit
mzhelyez Jun 25, 2025
e6af424
working rvar
mzhelyez Jul 15, 2025
62b56b9
Merge branch 'boostorg:develop' into develop
demroz Jul 15, 2025
c66cf2b
working differentiation
mzhelyez Jul 21, 2025
89f846a
working differentiation
mzhelyez Jul 21, 2025
506129e
working tape management
mzhelyez Jul 23, 2025
73b2931
working differentiation
mzhelyez Jul 23, 2025
d2645c6
clean up code
mzhelyez Jul 23, 2025
34b866a
working higher order derivatives
mzhelyez Jul 29, 2025
4698857
removed build files
Jul 29, 2025
27ed863
added constant mult/add
Jul 29, 2025
a65ec02
added constant mult/add
Jul 29, 2025
c572315
added subtraction adndivision and fixed tests
mzhelyez Jul 31, 2025
dfc5631
added bool overloads and tests
mzhelyez Jul 31, 2025
c9e115d
fixes
mzhelyez Jul 31, 2025
800e35f
added stl functions
Aug 5, 2025
6868623
Merge branch 'boostorg:develop' into develop
demroz Aug 5, 2025
4285d87
added linear regression example
Aug 6, 2025
83e9b33
resolve merge conflics
Aug 6, 2025
ae8d70f
Merge pull request #2 from demroz/working_differentiation
demroz Aug 6, 2025
cf93c69
added linear regression example
Aug 6, 2025
1db9e2f
Merge pull request #3 from demroz/working_differentiation
demroz Aug 6, 2025
5df2a0b
fixed some tests not passing on intel cpu
mzhelyez Aug 7, 2025
39f9385
remove eigen dir
mzhelyez Aug 10, 2025
357477d
cleanup eigen sanity check
mzhelyez Aug 10, 2025
4ead0b9
removed eigen stuff
mzhelyez Aug 10, 2025
8af493f
added gamma function overloads
mzhelyez Aug 14, 2025
47cf220
more special function changes
mzhelyez Aug 15, 2025
047df54
erf/erfc/inverse support
mzhelyez Aug 15, 2025
bacc88b
grad fixes, and added black and scholes example
mzhelyez Aug 16, 2025
0f26461
fixed failining tests and added test support to jamfile
mzhelyez Aug 16, 2025
e2d5c3c
added license
mzhelyez Aug 16, 2025
0aa218a
added examples to jamfile
mzhelyez Aug 16, 2025
b5429d4
Merge pull request #4 from demroz/integrate_b2_build
demroz Aug 16, 2025
0b319a3
Merge branch 'boostorg:develop' into develop
demroz Aug 16, 2025
88d8346
cleaneed up files
mzhelyez Aug 16, 2025
94a1a92
more files cleaned up
mzhelyez Aug 16, 2025
6bae05e
removed old test
mzhelyez Aug 16, 2025
c7f9f57
added licence files and removed py files
Aug 16, 2025
7ed0c86
removed tabs, added licence, removed old files
Aug 16, 2025
8d3b036
boost assert
Aug 16, 2025
712c96e
removed tabs in comments
Aug 16, 2025
96f12fc
Remove documentation for z-test function which doesn't exist
andrjohns Aug 16, 2025
309d95e
Merge pull request #1303 from andrjohns/z-test-docs
mborland Aug 17, 2025
ce428a7
Merge branch 'develop' of https://github.com/demroz/math into develop
mzhelyez Aug 17, 2025
62b47b5
msvc builds should ideally pass now
mzhelyez Aug 17, 2025
4a433c4
removed tabs from reverse_mode_autodiff_stl_overloads.hpp
mzhelyez Aug 17, 2025
ccb6ad0
cleaned up code base don mborland's suggestions [ci skip]
mzhelyez Aug 18, 2025
0471ccc
removed unused parameters from derivative functions [ci skip]
mzhelyez Aug 19, 2025
5193b61
Handle trivial warns GCC/clang/MSVC
ckormanyos Aug 20, 2025
602f227
Merge pull request #5 from ckormanyos/warnings_gcc_clang_msvc
demroz Aug 20, 2025
b53cfc2
modified template variable names, changed copies to references
mzhelyez Aug 21, 2025
d95fe16
fixed overwritten conflicts from last merge, added .reserve to vector…
mzhelyez Aug 21, 2025
1c7ef46
added autodiff reverse docs
mzhelyez Aug 24, 2025
8bb3a24
added graphs
mzhelyez Aug 24, 2025
21b8e70
Merge pull request #8 from demroz/rdiff-docs
demroz Aug 24, 2025
b390ae0
Update doc/differentiation/autodiff_reverse.qbk
demroz Aug 25, 2025
d3e440c
Apply suggestions from code review
demroz Aug 25, 2025
33e2c24
modified docs
mzhelyez Aug 25, 2025
af4d914
rewrote reverse mode over reverse mode part of docs
mzhelyez Aug 25, 2025
2c943fb
added CMakeLists.txt back
mzhelyez Aug 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test/cuda
**/.temps/*
build/*
.vscode/*
*.svg
#*.svg
tools/bin/**
.idea/*

Expand All @@ -28,3 +28,4 @@ cmake-build-debug/*
build.ninja
.ninja*
a.out

665 changes: 665 additions & 0 deletions doc/differentiation/autodiff_reverse.qbk

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions doc/equations/autodiff/reverse_mode_autodiff_ex_eq.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,230 changes: 1,230 additions & 0 deletions doc/graphs/autodiff/autodiff_reverse_graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,255 changes: 2,255 additions & 0 deletions doc/html/math_toolkit/autodiff0.html

Large diffs are not rendered by default.

207 changes: 207 additions & 0 deletions doc/html/math_toolkit/dist_ref/dists/holtsmark_dist.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Holtsmark Distribution</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="../../../index.html" title="Math Toolkit 4.2.1">
<link rel="up" href="../dists.html" title="Distributions">
<link rel="prev" href="geometric_dist.html" title="Geometric Distribution">
<link rel="next" href="hyperexponential_dist.html" title="Hyperexponential Distribution">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="geometric_dist.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="hyperexponential_dist.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="math_toolkit.dist_ref.dists.holtsmark_dist"></a><a class="link" href="holtsmark_dist.html" title="Holtsmark Distribution">Holtsmark
Distribution</a>
</h4></div></div></div>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">holtsmark</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></pre>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">RealType</span> <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span>
<span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">Policy</a> <span class="special">=</span> <a class="link" href="../../pol_ref/pol_ref_ref.html" title="Policy Class Reference">policies::policy&lt;&gt;</a> <span class="special">&gt;</span>
<span class="keyword">class</span> <span class="identifier">holtsmark_distribution</span><span class="special">;</span>

<span class="keyword">typedef</span> <span class="identifier">holtsmark_distribution</span><span class="special">&lt;&gt;</span> <span class="identifier">holtsmark</span><span class="special">;</span>

<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Chapter 22. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&gt;</span>
<span class="keyword">class</span> <span class="identifier">holtsmark_distribution</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="keyword">typedef</span> <span class="identifier">RealType</span> <span class="identifier">value_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">Policy</span> <span class="identifier">policy_type</span><span class="special">;</span>

<span class="identifier">BOOST_MATH_GPU_ENABLED</span> <span class="identifier">holtsmark_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">location</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">scale</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>

<span class="identifier">BOOST_MATH_GPU_ENABLED</span> <span class="identifier">RealType</span> <span class="identifier">location</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<span class="identifier">BOOST_MATH_GPU_ENABLED</span> <span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
The <a href="http://en.wikipedia.org/wiki/holtsmark_distribution" target="_top">Holtsmark
distribution</a> is named after Johan Peter Holtsmark. It is special
case of a <a href="http://en.wikipedia.org/wiki/Stable_distribution" target="_top">stable
distribution</a> with shape parameter α=3/2, β=0.
</p>
<p>
<a href="http://en.wikipedia.org/wiki/Probability_distribution" target="_top">probability
distribution function PDF</a> given by:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../equations/holtsmark_ref1.svg"></span>

</p></blockquote></div>
<p>
The location parameter μ is the location of the distribution, while the scale
parameter [c] determines the width of the distribution. If the location
is zero, and the scale 1, then the result is a standard holtsmark distribution.
</p>
<p>
The distribution especially used in astrophysics for modeling gravitational
bodies.
</p>
<p>
The following graph shows how the distributions moves as the location parameter
changes:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../graphs/holtsmark_pdf1.svg" align="middle"></span>

</p></blockquote></div>
<p>
While the following graph shows how the shape (scale) parameter alters
the distribution:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../graphs/holtsmark_pdf2.svg" align="middle"></span>

</p></blockquote></div>
<h5>
<a name="math_toolkit.dist_ref.dists.holtsmark_dist.h0"></a>
<span class="phrase"><a name="math_toolkit.dist_ref.dists.holtsmark_dist.member_functions"></a></span><a class="link" href="holtsmark_dist.html#math_toolkit.dist_ref.dists.holtsmark_dist.member_functions">Member
Functions</a>
</h5>
<pre class="programlisting"><span class="identifier">BOOST_MATH_GPU_ENABLED</span> <span class="identifier">holtsmark_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">location</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">scale</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>
</pre>
<p>
Constructs a holtsmark distribution, with location parameter <span class="emphasis"><em>location</em></span>
and scale parameter <span class="emphasis"><em>scale</em></span>. When these parameters take
their default values (location = 0, scale = 1) then the result is a Standard
holtsmark Distribution.
</p>
<p>
Requires scale &gt; 0, otherwise calls <a class="link" href="../../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>.
</p>
<pre class="programlisting"><span class="identifier">BOOST_MATH_GPU_ENABLED</span> <span class="identifier">RealType</span> <span class="identifier">location</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
Returns the location parameter of the distribution.
</p>
<pre class="programlisting"><span class="identifier">BOOST_MATH_GPU_ENABLED</span> <span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
Returns the scale parameter of the distribution.
</p>
<h5>
<a name="math_toolkit.dist_ref.dists.holtsmark_dist.h1"></a>
<span class="phrase"><a name="math_toolkit.dist_ref.dists.holtsmark_dist.non_member_accessors"></a></span><a class="link" href="holtsmark_dist.html#math_toolkit.dist_ref.dists.holtsmark_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
<p>
All the <a class="link" href="../nmp.html" title="Non-Member Properties">usual non-member accessor
functions</a> that are generic to all distributions are supported:
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative Distribution Function</a>,
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density Function</a>,
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.hazard">Hazard Function</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.chf">Cumulative Hazard Function</a>,
__logcdf, __logpdf, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.mean">mean</a>,
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.median">median</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.mode">mode</a>,
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.variance">variance</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.sd">standard deviation</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.skewness">skewness</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.kurtosis">kurtosis</a>,
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.kurtosis_excess">kurtosis_excess</a>,
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.range">range</a> and <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.support">support</a>. For this distribution
all non-member accessor functions are marked with <code class="computeroutput"><span class="identifier">BOOST_MATH_GPU_ENABLED</span></code>
and can be run on both host and device.
</p>
<p>
Note however that the holtsmark distribution does not have a skewness,
kurtosis, etc. See <a class="link" href="../../pol_ref/assert_undefined.html" title="Mathematically Undefined Function Policies">mathematically
undefined function</a> to control whether these should fail to compile
with a BOOST_STATIC_ASSERTION_FAILURE, which is the default.
</p>
<p>
Alternately, the functions <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.skewness">skewness</a>,
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.kurtosis">kurtosis</a> and
<a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.kurtosis_excess">kurtosis_excess</a>
will all return a <a class="link" href="../../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>
if called.
</p>
<p>
The domain of the random variable is [-[max_value], +[min_value]].
</p>
<h5>
<a name="math_toolkit.dist_ref.dists.holtsmark_dist.h2"></a>
<span class="phrase"><a name="math_toolkit.dist_ref.dists.holtsmark_dist.accuracy"></a></span><a class="link" href="holtsmark_dist.html#math_toolkit.dist_ref.dists.holtsmark_dist.accuracy">Accuracy</a>
</h5>
<p>
The error is within 4 epsilon.
</p>
<p>
Errors in the PDF at 64-bit double precision:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../graphs/holtsmark_pdf_accuracy_64.png"></span>
</p>
<p>
Errors in the CDF-complement at 64-bit double precision:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../graphs/holtsmark_ccdf_accuracy_64.png"></span>
</p>
<h5>
<a name="math_toolkit.dist_ref.dists.holtsmark_dist.h3"></a>
<span class="phrase"><a name="math_toolkit.dist_ref.dists.holtsmark_dist.implementation"></a></span><a class="link" href="holtsmark_dist.html#math_toolkit.dist_ref.dists.holtsmark_dist.implementation">Implementation</a>
</h5>
<p>
See references.
</p>
<h5>
<a name="math_toolkit.dist_ref.dists.holtsmark_dist.h4"></a>
<span class="phrase"><a name="math_toolkit.dist_ref.dists.holtsmark_dist.references"></a></span><a class="link" href="holtsmark_dist.html#math_toolkit.dist_ref.dists.holtsmark_dist.references">References</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<a href="http://en.wikipedia.org/wiki/holtsmark_distribution" target="_top">Holtsmark
Distribution</a>
</li>
<li class="listitem">
T. Yoshimura, Numerical Evaluation and High Precision Approximation
Formula for Holtsmark Distribution, DOI: 10.36227/techrxiv.172054657.73020014/v1,
2024.
</li>
</ul></div>
</div>
<div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="geometric_dist.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="hyperexponential_dist.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Loading
Loading