Skip to content

Complex atan2 and tanh are wrong #1313

@RubenVerg

Description

@RubenVerg

I think there is a bug in the atan2 and tanh implementation for Complex numbers:

import spire.implicits.*
import spire.math.*
println(tan(atan2(Complex(2.0, 0.0), Complex(1.0, 0.0))))
// -> 1??
println(tanh(log(Complex(2.0, 0.0))))
// -> 1.5843415012250004??
println(tan(atan2(2.0, 1.0)))
// -> 2, as expected
println(tanh(log(2)))
// -> 0.6, as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions