Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ADerrors.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alberto Ramos
ADerrors.jl
Commits
0f915039
Commit
0f915039
authored
Jul 07, 2020
by
Alberto Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding own hyperd numbers. Forwarddiff slow.
parent
d9e70198
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
1 deletion
+108
-1
src/ADerrorsHyperd.jl
src/ADerrorsHyperd.jl
+107
-0
src/ADerrorsTypes.jl
src/ADerrorsTypes.jl
+1
-1
No files found.
src/ADerrorsHyperd.jl
0 → 100644
View file @
0f915039
###
### "THE BEER-WARE LICENSE":
### Alberto Ramos wrote this file. As long as you retain this
### notice you can do whatever you want with this stuff. If we meet some
### day, and you think this stuff is worth it, you can buy me a beer in
### return. <alberto.ramos@cern.ch>
###
### file: ADerrorsHyperd.jl
### created: Mon Jul 6 19:58:53 2020
###
const
LG2
=
0.6931471805599453094172321214581765680755001343602552
const
LG10
=
2.3025850929940456840179914546843642076011014886287729
function
Base
.
sqrt
(
h
::
hyperd
)
v
=
sqrt
(
h
.
v
)
d1
=
0.5
/
v
dd
=
-
0.25
/
v
^
3
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
log
(
h
::
hyperd
)
v
=
log
(
h
.
v
)
d1
=
1.0
/
h
.
v
dd
=
-
d1
/
h
.
v
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
log2
(
h
::
hyperd
)
v
=
log2
(
h
.
v
)
d1
=
1.0
/
(
h
.
v
*
LG2
)
dd
=
-
d1
/
h
.
v
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
log10
(
h
::
hyperd
)
v
=
log2
(
h
.
v
)
d1
=
1.0
/
(
h
.
v
*
LG10
)
dd
=
-
d1
/
h
.
v
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
exp
(
h
::
hyperd
)
v
=
exp
(
h
.
v
)
d1
=
v
dd
=
v
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
exp2
(
h
::
hyperd
)
v
=
exp2
(
h
.
v
)
d1
=
v
*
LG2
dd
=
d1
*
LG2
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
exp10
(
h
::
hyperd
)
v
=
exp10
(
h
.
v
)
d1
=
v
*
LG10
dd
=
d1
*
LG10
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
sin
(
h
::
hyperd
)
v
=
sin
(
h
.
v
)
d1
=
cos
(
h
.
v
)
dd
=
-
v
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
cos
(
h
::
hyperd
)
v
=
cos
(
h
.
v
)
d1
=
-
sin
(
h
.
v
)
dd
=
-
v
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
tan
(
h
::
hyperd
)
v
=
tan
(
h
.
v
)
d1
=
1.0
+
v
*
v
dd
=
2.0
*
v
*
d1
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
sec
(
h
::
hyperd
)
v
=
sec
(
h
.
v
)
d1
=
v
*
tan
(
h
.
v
)
dd
=
v
*
(
tan
(
h
.
v
)
^
2
+
v
^
2
)
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
csc
(
h
::
hyperd
)
v
=
csc
(
h
.
v
)
d1
=
-
v
*
cot
(
h
.
v
)
dd
=
v
*
(
cot
(
h
.
v
)
^
2
+
v
^
2
)
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
function
Base
.
cot
(
h
::
hyperd
)
v
=
cot
(
h
.
v
)
d1
=
-
(
1
+
v
^
2
)
dd
=
-
2.0
*
v
*
d1
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
dd
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
src/ADerrorsTypes.jl
View file @
0f915039
...
@@ -14,7 +14,7 @@ mutable struct hyperd
...
@@ -14,7 +14,7 @@ mutable struct hyperd
v
::
Float64
v
::
Float64
d1
::
Float64
d1
::
Float64
d2
::
Float64
d2
::
Float64
d
3
::
Float64
d
d
::
Float64
end
end
mutable struct
cfdata
mutable struct
cfdata
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment