@@ -1817,7 +1817,7 @@ def __init__(self):
1817
1817
The result is symbolic if exact input is given::
1818
1818
1819
1819
sage: ex = beta(2,1+5*I); ex
1820
- beta( ...
1820
+ beta...
1821
1821
sage: set(ex.operands()) == set([1+5*I, 2])
1822
1822
True
1823
1823
sage: beta(2, 2.)
@@ -2644,7 +2644,7 @@ def __call__(self, l, **kwargs):
2644
2644
Traceback (most recent call last):
2645
2645
...
2646
2646
TypeError: __call__() takes exactly 2 arguments (1 given)
2647
-
2647
+
2648
2648
sage: cases(x)
2649
2649
Traceback (most recent call last):
2650
2650
...
@@ -2696,3 +2696,73 @@ def _sympy_(self, l):
2696
2696
2697
2697
cases = Function_cases ()
2698
2698
2699
+ ############################
2700
+ # Fresnel integrals #
2701
+ ############################
2702
+ class Function_Fresnel_sin (BuiltinFunction ):
2703
+ def __init__ (self ):
2704
+ r"""
2705
+ The sine Fresnel integral.
2706
+
2707
+ It is defined by the integral
2708
+
2709
+ .. MATH ::
2710
+
2711
+ \operatorname(S)(x) = \int_0^x \sin\left(\frac{\pi t^2}{2}\right)\, dt
2712
+
2713
+ for real `x`. Using power series expansions, it can be extended to the
2714
+ domain of complex numbers. See the :wikipedia:`Fresnel_integral`.
2715
+
2716
+ INPUT:
2717
+
2718
+ - ``x`` -- the argument of the function
2719
+
2720
+ EXAMPLES::
2721
+
2722
+ sage: from sage.functions.other import fresnel_sin
2723
+ sage: fresnel_sin(0)
2724
+ 0
2725
+ sage: fresnel_sin(x).subs(x==0)
2726
+ 0
2727
+ sage: x = var('x')
2728
+ sage: fresnel_sin(1).n(100)
2729
+ 0.43825914739035476607675669662
2730
+ sage: fresnel_sin(x)._sympy_()
2731
+ fresnels(x)
2732
+ """
2733
+ BuiltinFunction .__init__ (self , "fresnel_sin" , nargs = 1 ,
2734
+ latex_name = r"\operatorname{S}" ,
2735
+ conversions = dict (maxima = 'fresnel_s' ,
2736
+ sympy = 'fresnels' ,
2737
+ mathematica = 'FresnelS' ,
2738
+ maple = 'FresnelS' ))
2739
+
2740
+ def _eval_ (self , x ):
2741
+ r"""
2742
+ EXAMPLES::
2743
+
2744
+ sage: from sage.functions.other import fresnel_sin
2745
+ sage: fresnel_sin(pi)
2746
+ fresnel_sin(pi)
2747
+ sage: fresnel_sin(pi).n(100)
2748
+ 0.59824907809026766482843860921
2749
+ """
2750
+ return None
2751
+
2752
+ def _evalf_ (self , x , parent = None , algorithm = None ):
2753
+ r"""
2754
+ EXAMPLES::
2755
+
2756
+ sage: from sage.functions.other import fresnel_sin
2757
+ sage: fresnel_sin(pi)
2758
+ fresnel_sin(pi)
2759
+ sage: fresnel_sin(pi).n(100)
2760
+ 0.59824907809026766482843860921
2761
+ sage: fresnel_sin(1.0+2*I)
2762
+ 36.7254648839914 + 15.5877511044046*I
2763
+ """
2764
+ import mpmath
2765
+ from sage .libs .mpmath import utils as mpmath_utils
2766
+ return mpmath_utils .call (mpmath .fresnels , x , parent = parent )
2767
+
2768
+ fresnel_sin = Function_Fresnel_sin ()
0 commit comments