Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/TheAlgorithms/Python
/ reduce
Method
reduce
maths/dual_number_automatic_differentiation.py:23–27 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
21
return
f
"{self.real}+{s}"
22
23
def
reduce(self):
24
cur = self.duals.copy()
25
while
cur[-1] == 0:
26
cur.pop(-1)
27
return
Dual(self.real, cur)
28
29
def
__add__(self, other):
30
if
not isinstance(other, Dual):
Callers
nothing calls this directly
Calls
3
Dual
Class · 0.85
copy
Method · 0.80
pop
Method · 0.45
Tested by
no test coverage detected