Skip to content

Commit 232aa70

Browse files
committed
update doc
1 parent 24f1280 commit 232aa70

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

devsim_docs/TCADdocs.pdf

78.8 KB
Binary file not shown.

devsim_docs/source/changes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changes
33
-------
44

5+
Version 0.0.3
6+
~~~~~~~~~~~~~
7+
8+
Add new method for Bernoulli function evaluation in :ref:`sec_bernoulli_new`.
9+
510
Version 0.0.2
611
~~~~~~~~~~~~~
712

devsim_docs/source/sg.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,36 @@ or
165165
Evaluate Bernoulli
166166
~~~~~~~~~~~~~~~~~~
167167

168+
.. _sec_bernoulli_new:
169+
170+
New Method
171+
^^^^^^^^^^
172+
173+
The C++ standard library provides the ``expm1`` function
174+
175+
.. math::
176+
177+
\text{expm1}(x) = \exp(x) - 1
178+
179+
which is more accurate than subtracting ``1`` from ``exp(x)``.
180+
181+
A sample implementation is:
182+
183+
.. code::
184+
185+
def B(x):
186+
y = expm1(x)
187+
if x != y:
188+
b = 1.0/y
189+
else:
190+
b = 1.0 / (1. + 0.5*x)
191+
return b
192+
193+
Note that the check for ``x != y`` prevents a bad result when ``x == 0``.
194+
195+
Old Method
196+
^^^^^^^^^^
197+
168198
This requires an expansion near :math:`0` and use of :eq:`hf4`.
169199

170200
.. math::

0 commit comments

Comments
 (0)