Fix sign in (d/dx)*cosh(x)=sinh(x)

This commit is contained in:
Iaroslav 2020-09-20 19:31:17 +07:00
parent b89a05347c
commit 1b426d79b4
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7

View File

@ -217,7 +217,7 @@ fun <T : Any, F : ExtendedField<T>> AutoDiffField<T, F>.sinh(x: Variable<T>): Va
derive(variable { sin(x.value) }) { z -> x.d += z.d * cosh(x.value) }
fun <T : Any, F : ExtendedField<T>> AutoDiffField<T, F>.cosh(x: Variable<T>): Variable<T> =
derive(variable { cos(x.value) }) { z -> x.d -= z.d * sinh(x.value) }
derive(variable { cos(x.value) }) { z -> x.d += z.d * sinh(x.value) }
fun <T : Any, F : ExtendedField<T>> AutoDiffField<T, F>.tanh(x: Variable<T>): Variable<T> =
derive(variable { tan(x.value) }) { z ->