Opened 4 years ago

Last modified 3 years ago

#24299 needs_work defect

Bugs with inverse trig and hyperbolic functions of CIF argument — at Version 4

Reported by: zimmerma Owned by:
Priority: major Milestone: sage-8.2
Component: symbolics Keywords:
Cc: jdemeyer Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by rws)

sage: sinh(CIF(1))
[1.1752011936438013 .. 1.1752011936438017]
sage: asinh(CIF(1))
0.881373587019543

The second command should return a (complex) interval.

Also:

sage: asin(CIF(0.6))
...
TypeError: unable to convert '0.59999999999999998?' to a real number

Change History (4)

comment:1 Changed 4 years ago by zimmerma

  • Cc jdemeyer added

comment:2 Changed 4 years ago by rws

  • Component changed from basic arithmetic to symbolics

That's a symbolic function evaluation issue, not the fault of CIF.

comment:3 Changed 4 years ago by rws

As an explanation, the handling of inexact function arguments has several layers. The fallback layer (if the arg has no suitable member function and exact evaluation has no tricks) is to call the helper functions in libs/pynac/pynac.pyx which use member functions of RR and CC. There is in most cases no automatic back-conversion to the argument type so, as fallback, you at least get Real/ComplexField elements.

There is work ongoing in Pynac to use arb instead of RR and CC because of speed and ease of conversion to e.g. interval field elements. It's just that inverse hyperbolic functions are still waiting for it. Of course one could state it's the responsibility of CIF to implement inverse hyperbolic functions (and inverse trig functions, for that matter) but I'm not holding my breath. CIF is a math programming exercise, Pynac tries to solve real calculus problems, so we'll implement it in Pynac-0.7.14.

comment:4 Changed 4 years ago by rws

  • Description modified (diff)
  • Milestone changed from sage-8.1 to sage-8.2
  • Summary changed from asinh(CIF(1)) returns an element of CC instead of CIF to Bugs with inverse trig and hyperbolic functions of CIF argument
Note: See TracTickets for help on using tickets.