1 people like it.

On the derivatives of the powers of trigonometric and hyperbolic sine and cosine

List and calculate and evaluate the polynomials and the expressions for the the derivatives of the powers of trigonometric and hyperbolic sine and cosine.

  1: 
  2: 
  3: 
  4: 
  5: 
  6: 
  7: 
  8: 
  9: 
 10: 
 11: 
 12: 
 13: 
 14: 
 15: 
 16: 
 17: 
 18: 
 19: 
 20: 
 21: 
 22: 
 23: 
 24: 
 25: 
 26: 
 27: 
 28: 
 29: 
 30: 
 31: 
 32: 
 33: 
 34: 
 35: 
 36: 
 37: 
 38: 
 39: 
 40: 
 41: 
 42: 
 43: 
 44: 
 45: 
 46: 
 47: 
 48: 
 49: 
 50: 
 51: 
 52: 
 53: 
 54: 
 55: 
 56: 
 57: 
 58: 
 59: 
 60: 
 61: 
 62: 
 63: 
 64: 
 65: 
 66: 
 67: 
 68: 
 69: 
 70: 
 71: 
 72: 
 73: 
 74: 
 75: 
 76: 
 77: 
 78: 
 79: 
 80: 
 81: 
 82: 
 83: 
 84: 
 85: 
 86: 
 87: 
 88: 
 89: 
 90: 
 91: 
 92: 
 93: 
 94: 
 95: 
 96: 
 97: 
 98: 
 99: 
100: 
101: 
102: 
103: 
104: 
105: 
106: 
107: 
108: 
109: 
110: 
111: 
112: 
113: 
114: 
115: 
116: 
117: 
118: 
119: 
120: 
121: 
122: 
123: 
124: 
125: 
126: 
127: 
128: 
129: 
130: 
131: 
132: 
133: 
134: 
135: 
136: 
137: 
138: 
139: 
140: 
141: 
142: 
143: 
144: 
145: 
146: 
147: 
148: 
149: 
150: 
151: 
152: 
153: 
154: 
155: 
156: 
157: 
158: 
159: 
160: 
161: 
162: 
163: 
164: 
165: 
166: 
167: 
168: 
169: 
170: 
171: 
172: 
173: 
174: 
175: 
176: 
177: 
178: 
179: 
180: 
181: 
182: 
183: 
184: 
185: 
186: 
187: 
188: 
189: 
190: 
191: 
192: 
193: 
194: 
195: 
196: 
197: 
198: 
199: 
200: 
201: 
202: 
203: 
204: 
205: 
206: 
207: 
208: 
209: 
210: 
211: 
212: 
213: 
214: 
215: 
216: 
217: 
218: 
219: 
220: 
221: 
222: 
223: 
224: 
225: 
226: 
227: 
228: 
229: 
230: 
231: 
232: 
233: 
234: 
235: 
236: 
237: 
238: 
239: 
240: 
241: 
242: 
243: 
244: 
245: 
246: 
247: 
248: 
249: 
250: 
251: 
252: 
253: 
254: 
255: 
256: 
257: 
258: 
259: 
260: 
261: 
262: 
263: 
264: 
265: 
266: 
267: 
268: 
269: 
270: 
271: 
272: 
273: 
274: 
275: 
276: 
277: 
278: 
279: 
280: 
281: 
282: 
283: 
284: 
285: 
286: 
287: 
288: 
289: 
290: 
291: 
292: 
293: 
294: 
295: 
296: 
297: 
298: 
299: 
300: 
301: 
302: 
303: 
304: 
305: 
306: 
307: 
308: 
309: 
310: 
311: 
312: 
313: 
314: 
315: 
316: 
317: 
318: 
319: 
320: 
321: 
322: 
323: 
324: 
325: 
326: 
327: 
328: 
329: 
330: 
331: 
332: 
333: 
334: 
335: 
336: 
337: 
338: 
339: 
340: 
341: 
342: 
343: 
344: 
345: 
346: 
347: 
348: 
349: 
350: 
351: 
352: 
353: 
354: 
355: 
356: 
357: 
358: 
359: 
360: 
361: 
362: 
363: 
364: 
365: 
366: 
367: 
368: 
369: 
370: 
371: 
372: 
373: 
374: 
375: 
376: 
377: 
378: 
379: 
380: 
381: 
382: 
383: 
384: 
385: 
386: 
387: 
388: 
389: 
390: 
391: 
392: 
393: 
394: 
395: 
396: 
397: 
398: 
399: 
400: 
401: 
402: 
403: 
404: 
405: 
406: 
407: 
408: 
409: 
410: 
411: 
412: 
413: 
414: 
415: 
416: 
417: 
418: 
419: 
420: 
421: 
422: 
423: 
424: 
425: 
426: 
427: 
428: 
429: 
430: 
431: 
432: 
433: 
434: 
435: 
436: 
437: 
438: 
439: 
440: 
441: 
442: 
443: 
444: 
445: 
446: 
447: 
448: 
449: 
450: 
451: 
452: 
453: 
454: 
455: 
456: 
457: 
458: 
459: 
460: 
461: 
462: 
463: 
464: 
465: 
466: 
467: 
468: 
469: 
470: 
471: 
472: 
473: 
474: 
475: 
476: 
477: 
478: 
479: 
480: 
481: 
482: 
483: 
484: 
485: 
486: 
487: 
488: 
489: 
490: 
491: 
492: 
493: 
494: 
495: 
496: 
497: 
498: 
499: 
500: 
501: 
502: 
503: 
504: 
505: 
506: 
507: 
508: 
509: 
510: 
511: 
512: 
513: 
514: 
515: 
516: 
517: 
518: 
519: 
520: 
521: 
522: 
523: 
524: 
525: 
526: 
527: 
528: 
529: 
530: 
531: 
532: 
533: 
534: 
535: 
536: 
537: 
538: 
539: 
540: 
541: 
542: 
543: 
544: 
545: 
546: 
547: 
548: 
549: 
550: 
551: 
552: 
553: 
554: 
555: 
556: 
557: 
558: 
559: 
560: 
561: 
562: 
563: 
564: 
565: 
566: 
567: 
568: 
569: 
570: 
571: 
572: 
573: 
574: 
575: 
576: 
577: 
578: 
579: 
580: 
581: 
582: 
583: 
584: 
585: 
586: 
587: 
588: 
589: 
590: 
591: 
592: 
593: 
594: 
595: 
596: 
597: 
598: 
599: 
600: 
601: 
602: 
603: 
604: 
605: 
606: 
607: 
608: 
609: 
610: 
611: 
612: 
613: 
614: 
615: 
616: 
617: 
618: 
619: 
620: 
621: 
622: 
623: 
624: 
625: 
626: 
627: 
628: 
629: 
630: 
631: 
632: 
633: 
634: 
635: 
636: 
637: 
638: 
639: 
640: 
641: 
642: 
643: 
644: 
645: 
646: 
647: 
648: 
649: 
650: 
651: 
652: 
653: 
654: 
655: 
656: 
657: 
658: 
659: 
660: 
661: 
662: 
663: 
664: 
665: 
666: 
667: 
668: 
669: 
670: 
671: 
672: 
673: 
674: 
675: 
676: 
677: 
678: 
679: 
680: 
681: 
682: 
683: 
684: 
685: 
686: 
687: 
688: 
689: 
690: 
691: 
692: 
693: 
694: 
695: 
696: 
697: 
698: 
699: 
700: 
701: 
702: 
703: 
704: 
705: 
706: 
707: 
708: 
709: 
710: 
711: 
712: 
713: 
714: 
715: 
716: 
717: 
718: 
719: 
720: 
721: 
722: 
723: 
724: 
725: 
726: 
727: 
728: 
729: 
730: 
731: 
732: 
733: 
734: 
735: 
736: 
737: 
738: 
739: 
740: 
741: 
742: 
743: 
744: 
745: 
746: 
747: 
748: 
749: 
750: 
751: 
752: 
753: 
754: 
755: 
756: 
757: 
758: 
759: 
760: 
761: 
762: 
763: 
764: 
765: 
766: 
767: 
768: 
769: 
770: 
771: 
772: 
773: 
774: 
775: 
776: 
777: 
778: 
779: 
780: 
781: 
782: 
783: 
784: 
785: 
786: 
787: 
788: 
789: 
790: 
791: 
792: 
793: 
794: 
795: 
796: 
797: 
798: 
799: 
800: 
801: 
802: 
803: 
804: 
805: 
806: 
807: 
808: 
809: 
810: 
811: 
812: 
813: 
814: 
815: 
816: 
817: 
818: 
819: 
820: 
821: 
822: 
823: 
824: 
825: 
826: 
827: 
828: 
829: 
830: 
831: 
832: 
833: 
834: 
835: 
836: 
837: 
838: 
839: 
840: 
841: 
842: 
843: 
844: 
845: 
846: 
847: 
848: 
849: 
850: 
851: 
852: 
853: 
854: 
855: 
856: 
857: 
858: 
859: 
860: 
861: 
862: 
863: 
864: 
865: 
866: 
867: 
868: 
869: 
870: 
871: 
872: 
873: 
874: 
875: 
876: 
877: 
878: 
879: 
880: 
881: 
882: 
883: 
884: 
885: 
886: 
887: 
888: 
889: 
890: 
891: 
892: 
893: 
894: 
895: 
896: 
897: 
898: 
899: 
900: 
901: 
902: 
903: 
904: 
905: 
906: 
907: 
908: 
909: 
910: 
911: 
912: 
913: 
914: 
915: 
916: 
917: 
918: 
919: 
920: 
921: 
922: 
923: 
924: 
925: 
926: 
927: 
928: 
929: 
930: 
931: 
932: 
933: 
934: 
935: 
936: 
937: 
// Stijn "Adhemar" Vandamme
// On the derivatives of powers of trigonometric and hyperbolic sine and cosine

// <https://arxiv.org/pdf/1911.01386.pdf>
// <http://fssnip.net/7Xf>

// To the extent possible under law,
// the author Stijn "Adhemar" Vandamme
// has dedicated all copyright and related and neighboring rights
// to this software source code to the public domain worldwide.
// This software source code is distributed without any warranty.
// See <https://creativecommons.org/publicdomain/zero/1.0/>.

namespace Adhemar.Derivatives

open System
open System.Diagnostics.Contracts
open System.Numerics
open System.Text
open Microsoft.FSharp.Core.Operators
open Microsoft.FSharp.Reflection

module Complex =

    let ofFloat64 f =
        Complex (f, 0.0)

    let ofInt32 n =
        ofFloat64 (float n)

    let ofUInt32 (n : uint32) =
        ofFloat64 (float n)

    let ofInt64 (n : int64) =
        ofFloat64 (float n)

module IntegerMath =

    let isEven k =
        k % 2u = 0u

    let powerOfMinusOne p =
        if p % 2 = 0 then
            1
        else
            -1

    let rec power n p =
        if p = 0u then
            1
        else
            n * power n (p - 1u)

    let rec factorial n =
        if n = 0u then
            1u
        else
            n * factorial (n - 1u)

    let choose n m =
        if m > n then
            0u
        else
            factorial n / (factorial m * factorial (n - m))

type ICoefficient =

    // InvalidCastExceptions may occur when adding or multiplying with ICoefficients of different types
    // ArgumentExceptions may occur when adding or multiplying with incompatible ICoefficients

    abstract member Zero : ICoefficient
    abstract member IsOne : bool
    abstract member Add : ICoefficient -> ICoefficient
    abstract member Scale64 : int64 -> ICoefficient
    abstract member Multiply : ICoefficient -> ICoefficient
    abstract member IsNegative : bool
    abstract member CoefficientString : bool * bool -> string
    abstract member ApplyFloat64 : Map<string, float> -> float
    abstract member ApplyComplex : Map<string, Complex> -> Complex

type Coefficient64 (value : int64) =

    member __.Value =
        value

    static member Zero =
        Coefficient64 0L

    member __.IsOne =
        __.Value = 1L

    static member (+) (m : Coefficient64, n : Coefficient64) =
        Coefficient64 (m.Value + n.Value)

    static member (*) (scalingFactor : int64, m : Coefficient64) =
        Coefficient64 (scalingFactor * m.Value)

    static member (*) (m : Coefficient64, n : Coefficient64) =
        Coefficient64 (m.Value * n.Value)

    member __.IsNegative =
        __.Value < 0L

    static member (~-) (m : Coefficient64) =
        -1L * m

    override __.ToString () =
        sprintf "%d" __.Value

    member __.CoefficientString (first : bool, explicitOne : bool) =
        if explicitOne || (not __.IsOne && not (-__).IsOne) then
            if first then
                string __
            elif __.IsNegative then
                sprintf " - %d" (-__).Value
            else
                sprintf " + %d" __.Value
        else
            if __.IsOne then
                if first then
                    String.Empty
                else
                    " + "
            else
                if first then
                    "-"
                else
                    " - "

    interface ICoefficient with
        member __.Zero =
            upcast Coefficient64.Zero
        member __.IsOne =
            __.IsOne
        member __.Add (t : ICoefficient) =
            upcast (__ + downcast t)
        member __.Scale64 (scalingFactor : int64) =
            upcast (scalingFactor * __)
        member __.Multiply (t : ICoefficient) =
            upcast (__ * downcast t)
        member __.IsNegative =
            __.IsNegative
        member __.CoefficientString (first : bool, explicitOne : bool) =
            __.CoefficientString (first, explicitOne)
        member __.ApplyFloat64 (_m : Map<string, float>) =
            float __.Value
        member __.ApplyComplex (m : Map<string, Complex>) =
            Complex.ofInt64 __.Value

    member __.IsZero =
        __ = Coefficient64.Zero

    static member (-) (m : Coefficient64, n : Coefficient64) =
        m + (-n)

    static member One =
        Coefficient64 1L

    static member MinusOne =
        -Coefficient64.One

    override __.GetHashCode () =
        __.Value.GetHashCode ()

    member __.Equals (that : Coefficient64) =
        __.Value = that.Value

    interface IEquatable<Coefficient64> with
        member __.Equals (that : Coefficient64) =
            __.Equals that

    override __.Equals (that : obj) =
        match that with
            | null ->
                false
            | :? Coefficient64 as thatCoefficient64 ->
                __.Equals thatCoefficient64
            | _ ->
                false

    static member op_Equality (r : Coefficient64, t : Coefficient64) =
        r.Equals t

    static member op_Inequality (r : Coefficient64, t : Coefficient64) =
        not (Coefficient64.op_Equality (r, t))

    static member op_Implicit (value : int64) =
        Coefficient64 value

type Polynomial<'T when 'T : equality and 'T :> ICoefficient>
        (x : string, ys : string list option,
            f : (string list option -> Map<string, float> -> float) option,
            g : (string list option -> Map<string, Complex> -> Complex) option,
            coefficients : 'T list) =

    static let isEmptyOrSingleton cs =
        match cs with
            | []
            | [_] ->
                true
            | _ ->
                false

    static let isZero (t : 'T) =
        let x = t :> ICoefficient
        x = x.Zero

    static let rec exactlyOneNonZero (cs : 'T list) =
        match cs with
            | [] ->
                None
            | [c] ->
                Some c
            | h :: ts ->
                if isZero h then
                    exactlyOneNonZero ts
                else
                    None

    static let rec add (cs, ds) =
        match cs, ds with
            | _, [] ->
                cs
            | [], _ ->
                ds
            | g :: ts, h :: rs ->
                downcast ((g :> ICoefficient).Add h) :: add (ts, rs)

    static let rec shiftRank k (cs : 'T list) =
        if k <= 0 then
            List.skip (-k) cs
        elif List.isEmpty cs then
            List.empty
        else
            downcast (List.head cs).Zero :: (shiftRank (k - 1) cs)

    static let rec hasOnlyEvenIndexedItems (cs : 'T list) =
        match cs with
            | [] ->
                true
            | h :: ts ->
                hasOnlyOddIndexedItems ts

    and hasOnlyOddIndexedItems (cs : 'T list) =
        match cs with
            | [] ->
                true
            | h :: ts ->
                isZero h && hasOnlyEvenIndexedItems ts

    do
        let rec nonZeroHighestCoefficient cs =
            match cs with
                | [] ->
                    true
                | [c] when isZero c ->
                    false
                | _ :: ts ->
                    nonZeroHighestCoefficient ts
        let isNoneOrAllAreNotEmpty zs =
            match zs with
                | None ->
                    true
                | Some bs ->
                    let isNeitherNullNorEmpty s =
                        not (String.IsNullOrEmpty s)
                    List.forall isNeitherNullNorEmpty bs
        let distinct v ws =
            let allDistinct mySequence =
                let folder state element =
                    match state with
                        | Some elementsSoFar when not (Set.contains element elementsSoFar) ->
                            Some (Set.add element elementsSoFar)
                        | _ ->
                            None
                let initialState = Some Set.empty
                let scanning = Seq.scan folder initialState mySequence
                Seq.forall Option.isSome scanning
            match ws with
                | None ->
                    true
                | Some zs ->
                    allDistinct (v :: zs)
        if isNull x then
            nullArg "x"
        elif not (nonZeroHighestCoefficient coefficients) then
            invalidArg "coefficients" "Zero highest coefficient"
        elif not (isNoneOrAllAreNotEmpty ys) then
            invalidArg "ys" "At least one empty y in ys"
        elif isEmptyOrSingleton coefficients && x <> String.Empty then
            invalidArg "x" "Non-empty variable x for constant Polynomial"
        elif isEmptyOrSingleton coefficients && Option.isSome ys then
            invalidArg "ys" "Some arguments ys for constant Polynomial"
        elif isEmptyOrSingleton coefficients && Option.isSome f then
            invalidArg "ys" "Some function f for constant Polynomial"
        elif not (isEmptyOrSingleton coefficients) && x = String.Empty then
            invalidArg "x" "Empty x for non-constant Polynomial"
        elif not (distinct x ys) then
            invalidArg "ys" ("Some duplicate argument y" +
                " or argument y with same token as variable function x")
        elif Option.isSome ys && Option.isNone f then
            invalidArg "f" "Some argument y but no function f"

    static member Create
            (x : string, ys : string list option,
                f : (string list option -> Map<string, float> -> float) option,
                g : (string list option -> Map<string, Complex> -> Complex) option,
                coefficients : 'T list) =
        let rec deZeroHighestCoefficient cs =
            match cs with
                | [] ->
                    List.empty
                | [c] when isZero c ->
                    List.empty
                | h :: ts ->
                    let deZeroTail = deZeroHighestCoefficient ts
                    if isZero h && List.isEmpty (deZeroHighestCoefficient ts) then
                        List.empty
                    else
                        h :: deZeroTail
        let deZeroCoefficients = deZeroHighestCoefficient coefficients
        if isEmptyOrSingleton deZeroCoefficients then
            Polynomial (String.Empty, None, None, None, deZeroCoefficients)
        else
            let emptyInsteadOfNull (s : string) =
                if isNull s then
                    String.Empty
                else
                    s
            Polynomial (emptyInsteadOfNull x, ys, f, g, coefficients)

    member __.X =
        x

    member __.Ys =
        ys

    member __.F =
        f

    member __.G =
        g

    member __.Coefficients =
        coefficients

    static member Zero =
        Polynomial (String.Empty, None, None, None, List.empty<'T>)

    member __.IsOne =
        match __.Coefficients with
            | [c] ->
                (c :> ICoefficient).IsOne
            | _ ->
                false

    member __.IsConstant =
        isEmptyOrSingleton __.Coefficients

    static member AreCompatible (p : Polynomial<'T>, q : Polynomial<'T>) =
        p.X = q.X && p.Ys = q.Ys || p.IsConstant || q.IsConstant

    static member Compatibleness (p : Polynomial<'T>, q : Polynomial<'T>) =
        if not (Polynomial.AreCompatible (p, q)) then
            invalidArg "q" "Polynomial p and q are incompatible"
        Contract.EndContractBlock ()
        if p.IsConstant then
            q.X, q.Ys, q.F, q.G
        else
            p.X, p.Ys, p.F, p.G

    static member (+) (p : Polynomial<'T>, q : Polynomial<'T>) =
        if not (Polynomial.AreCompatible (p, q)) then
            invalidArg "q" "Polynomial p and q are incompatible"
        Contract.EndContractBlock ()
        let x, ys, f, g = Polynomial.Compatibleness (p, q)
        Polynomial.Create (x, ys, f, g, add (p.Coefficients, q.Coefficients))

    static member (*) (scalingFactor : int64, p : Polynomial<'T>) =
        let mapper f (t : 'T) =
            ((t :> ICoefficient).Scale64 f) :?> 'T
        Polynomial.Create (p.X, p.Ys, p.F, p.G, List.map (mapper scalingFactor) p.Coefficients)

    static member (*) (p : Polynomial<'T>, q : Polynomial<'T>) =
        if not (Polynomial.AreCompatible (p, q)) then
            invalidArg "q" "Polynomial p and q are incompatible"
        Contract.EndContractBlock ()
        let rec multiply (cs : 'T list, ds : 'T list) =
            match cs with
                | [] ->
                    List.empty
                | h :: ts ->
                    let multiplyTerm g d =
                        downcast ((g :> ICoefficient).Multiply d)
                    add (List.map (multiplyTerm h) ds, shiftRank 1 (multiply (ts, ds)))
        let x, ys, f, g = Polynomial.Compatibleness (p, q)
        Polynomial.Create (x, ys, f, g, multiply (p.Coefficients, q.Coefficients))

    member __.IsNegative =
        match exactlyOneNonZero __.Coefficients with
            | Some c ->
                (c :> ICoefficient).IsNegative
            | None ->
                false

    member __.IsZero =
        List.isEmpty __.Coefficients

    member __.Rank =
        List.length coefficients - 1

    member __.IsMonomial =
        Option.isSome (exactlyOneNonZero __.Coefficients)

    static member (~-) (p : Polynomial<'T>) =
        -1L * p

    member __.YsString =
        match __.Ys with
            | None ->
                String.Empty
            | Some zs ->
                let separator = ","
                sprintf "(%s)" (String.Join (separator, zs))

    override __.ToString () =
        if __.IsZero then
            "0"
        else
            let PolynomialTerms = seq {
                for k = __.Rank downto 0 do
                    let d = List.item k __.Coefficients
                    if not (isZero d) then
                        yield (k = __.Rank), (k = 0), k, d
            }
            let stringBuilder = StringBuilder ()
            for fi, eo, p, c in PolynomialTerms do
                let t = c.CoefficientString (fi, eo)
                ignore (stringBuilder.Append t)
                if p <> 0 then
                    if not (String.IsNullOrEmpty t) &&
                            t <> "-" && not (t.EndsWith " ") then
                        ignore (stringBuilder.Append " ")
                    ignore (stringBuilder.Append __.X)
                    if p <> 1 then
                        ignore (stringBuilder.Append (sprintf "^%d" p))
                    ignore (stringBuilder.Append __.YsString)
            string stringBuilder

    member __.CoefficientString (first : bool, explicitOne : bool) =
        if explicitOne || (not __.IsOne && not (-__).IsOne) then
            if __.IsZero || __.IsMonomial then
                if __.IsNegative then
                    if first then
                        sprintf "-%O" -__
                    else
                        sprintf " - %O" -__
                else
                    if first then
                        sprintf "%O" __
                    else
                        sprintf " + %O" __
            else
                if first then
                    if explicitOne then
                        string __
                    else
                        sprintf "(%O)" __
                else
                    sprintf " + (%O)" __
        else
            if __.IsOne then
                if first then
                    String.Empty
                else
                    " + "
            else
                if first then
                    "-"
                else
                    " - "

    member __.ApplyFloat64 (m : Map<string, float>) =
        if __.IsZero then
            0.0
        elif __.IsConstant then
            (List.exactlyOne __.Coefficients :> ICoefficient).ApplyFloat64 m
        else
            let mapper u a (i : int) c =
                ((c :> ICoefficient).ApplyFloat64 a) * Math.Pow (u, float i)
            let v =
                match Map.tryFind __.X m with
                    | None ->
                        (Option.get f) __.Ys m
                    | Some w ->
                        w
            Seq.sum (Seq.mapi (mapper v m) __.Coefficients)

    member __.ApplyComplex (m : Map<string, Complex>) =
        if __.IsZero then
            Complex.Zero
        elif __.IsConstant then
            (List.exactlyOne __.Coefficients :> ICoefficient).ApplyComplex m
        else
            let seqAddComplex (zs : Complex seq) =
                Seq.fold (+) Complex.Zero zs
            let mapper u a (i : int) c =
                ((c :> ICoefficient).ApplyComplex a) * Complex.Pow (u, float i)
            let v =
                match Map.tryFind __.X m with
                    | None ->
                        (Option.get g) __.Ys m
                    | Some w ->
                        w
            seqAddComplex (Seq.mapi (mapper v m) __.Coefficients)

    interface ICoefficient with
        member __.Zero =
            upcast Polynomial<'T>.Zero
        member __.IsOne =
            __.IsOne
        member __.Add (t : ICoefficient) =
            upcast (__ + downcast t)
        member __.Scale64 (scalingFactor : int64) =
            upcast (scalingFactor * __)
        member __.Multiply (t : ICoefficient) =
            upcast (__ * downcast t)
        member __.IsNegative =
            __.IsNegative
        member __.CoefficientString (first : bool, explicitOne : bool) =
            __.CoefficientString (first, explicitOne)
        member __.ApplyFloat64 (m : Map<string, float>) =
            __.ApplyFloat64 m
        member __.ApplyComplex (m : Map<string, Complex>) =
            __.ApplyComplex m

    static member (-) (p : Polynomial<'T>, q : Polynomial<'T>) =
        p + (-q)

    static member (<<<) (p : Polynomial<'T>, k : int) =
        if p.IsConstant && not (p.IsZero) && k > 0 then
            invalidArg "k" ("Cannot shift rank of non-zero constant polynomial" +
                " (as constant polynomials have no variable)")
        Polynomial.Create (p.X, p.Ys, p.F, p.G, shiftRank k p.Coefficients)

    static member (>>>) (p : Polynomial<'T>, k : int) =
        p <<< -k

    member __.Derivative =
        if __.IsConstant then
            Polynomial<'T>.Zero
        else
            let mapper p (t : 'T) =
                (t :> ICoefficient).Scale64 (int64 p) :?> 'T
            let coefficients = List.mapi mapper __.Coefficients
            (Polynomial.Create (__.X, __.Ys, __.F, __.G, coefficients)) >>> 1

    static member Constant (t : 'T) =
        Polynomial<'T>.Create (String.Empty, None, None, None, [t])

    member __.HasOnlyEvenPowers =
        hasOnlyEvenIndexedItems __.Coefficients

    member __.HasOnlyOddPowers =
        hasOnlyOddIndexedItems __.Coefficients

    override __.GetHashCode () =
        __.Coefficients.GetHashCode () ^^^
            (__.X.GetHashCode () <<< 1) ^^^ (__.Ys.GetHashCode () <<< 2)

    member __.Equals (that : Polynomial<'T>) =
        __.X = that.X && __.Ys = that.Ys && __.Coefficients = that.Coefficients

    interface IEquatable<Polynomial<'T>> with
        member __.Equals (that : Polynomial<'T>) =
            __.Equals that

    override __.Equals (that : obj) =
        match that with
            | null ->
                false
            | :? Polynomial<'T> as thatPolynomial ->
                __.Equals thatPolynomial
            | _ ->
                false

    static member op_Equality (p : Polynomial<'T>, q : Polynomial<'T>) =
        p.Equals q

    static member op_Inequality (p : Polynomial<'T>, q : Polynomial<'T>) =
        not (Polynomial.op_Equality (p, q))

module DiscriminatedUnions =

    let instance<'T> (caseInfo : UnionCaseInfo) =
        FSharpValue.MakeUnion (caseInfo, Array.empty) :?> 'T

    let cases<'T> =
        Seq.map instance<'T> (FSharpType.GetUnionCases typeof<'T>)

module TrigHypes =

    let zero = Polynomial<Coefficient64>.Zero
    let one = Polynomial.Constant Coefficient64.One
    let minusOne = Polynomial.Constant Coefficient64.MinusOne

    let alwaysTrue _ =
        true

type TrigHyp =
    | Sin
    | Cos
    | Sinh
    | Cosh

with
    member __.Token =
        (sprintf "%A" __).ToLowerInvariant ()

    member __.Float64Function =
        match __ with
            | TrigHyp.Sin ->
                Math.Sin
            | TrigHyp.Cos ->
                Math.Cos
            | TrigHyp.Sinh ->
                Math.Sinh
            | TrigHyp.Cosh ->
                Math.Cosh

    member __.ComplexFunction =
        match __ with
            | TrigHyp.Sin ->
                Complex.Sin
            | TrigHyp.Cos ->
                Complex.Cos
            | TrigHyp.Sinh ->
                Complex.Sinh
            | TrigHyp.Cosh ->
                Complex.Cosh

    member __.IsTrigonometric =
        List.contains __ [TrigHyp.Sin; TrigHyp.Cos]

    member __.IsHyperbolic =
        List.contains __ [TrigHyp.Sinh; TrigHyp.Cosh]

    member __.IsTrigonometricOrHyperbolicSine =
        List.contains __ [TrigHyp.Sin; TrigHyp.Sinh]

    member __.Other =
        match __ with
            | TrigHyp.Sin ->
                TrigHyp.Cos
            | TrigHyp.Cos ->
                TrigHyp.Sin
            | TrigHyp.Sinh ->
                TrigHyp.Cosh
            | TrigHyp.Cosh ->
                TrigHyp.Sinh

    member __.NegateInductionInOther =
        __ = TrigHyp.Cos

    member __.DerivativeFactorInOtherCoefficients =
        match __ with
            | TrigHyp.Cosh ->
                [TrigHypes.one; TrigHypes.zero; TrigHypes.one]
            | _ ->
                [TrigHypes.minusOne; TrigHypes.zero; TrigHypes.one]

    member __.SubstituteInSelfCoefficients =
        match __ with
            | TrigHyp.Sinh ->
                [TrigHypes.one; TrigHypes.zero; TrigHypes.one]
            | TrigHyp.Cosh ->
                [TrigHypes.minusOne; TrigHypes.zero; TrigHypes.one]
            | _ ->
                [TrigHypes.one; TrigHypes.zero; TrigHypes.minusOne]

    member __.NonNegativeConditionInOther =
        match __ with
            | TrigHyp.Cos ->
                IntegerMath.isEven
            | _ ->
                TrigHypes.alwaysTrue

    member __.NonNegativeConditionInSelf =
        let sinNonNegativeConditionInSelf k =
            IntegerMath.isEven (k / 2u)
        let cosNonNegativeConditionInSelf k =
            IntegerMath.isEven ((k + 1u) / 2u)
        match __ with
            | TrigHyp.Sin ->
                sinNonNegativeConditionInSelf
            | TrigHyp.Cos ->
                cosNonNegativeConditionInSelf
            | _ ->
                TrigHypes.alwaysTrue

// The derivatives of the powers of trigonometric and hyperbolic sine and cosine
// using the complex definitions and the binomial theorem
module TrigHypComplexDefinitions =

    // For trigonometric sine and cosine, see also:
    // Feng Qi. Derivatives of tangent function and tangent numbers.
    // Applied Mathematics and Computation, volume 268, Thursday 1 October 2015, pages 844-858.
    // Specificaly pages 854-855.
    // <https://www.sciencedirect.com/science/article/abs/pii/S0096300315009078>
    // <https://doi.org/10.1016/j.amc.2015.06.123>
    // <https://arxiv.org/pdf/1202.1205.pdf>

    let private seqAddComplex (zs : Complex seq) =
        Seq.fold (+) Complex.Zero zs

    // Evaluates the k'th derivative of trigHyp^n(x), evaluated at x (: float),
    // using the complex definition and the binomial theorem
    let derivativeOfPowerFloat64 trigHyp k n x =
        let term (t : TrigHyp) r m y q =
            let twoQMinusM = 2 * q - int m
            let factorCosine = int (IntegerMath.choose m (uint32 q)) * IntegerMath.power twoQMinusM r
            let factorInt32 =
                if t.IsTrigonometricOrHyperbolicSine then
                    IntegerMath.powerOfMinusOne q * factorCosine
                else
                    factorCosine
            let factor = float factorInt32
            if t.IsTrigonometric then
                let argument =
                    let halfPi = Math.PI / 2.0
                    if t = TrigHyp.Sin then
                        float (r - m) * halfPi + float twoQMinusM * y
                    else
                        float r * halfPi + float twoQMinusM * y
                Complex (factor * Math.Cos argument, factor * Math.Sin argument)
            else
                Complex.ofFloat64 (factor * Math.Exp (float twoQMinusM * y))
        let ns = int n
        let denominator = Complex.ofInt32 (IntegerMath.power 2 n)
        let unsigned = seqAddComplex (Seq.map (term trigHyp k n x) {0 .. ns}) / denominator
        if trigHyp.IsTrigonometricOrHyperbolicSine then
            let sign = Complex.ofInt32 (IntegerMath.powerOfMinusOne ns)
            sign * unsigned
        else
            unsigned

    // Evaluates the k'th derivative of trigHyp^n(x), evaluated at x (: Complex),
    // using the complex definition and the binomial theorem
    let derivativeOfPowerComplex trigHyp k n x =
        let term (t : TrigHyp) r m y q =
            let twoQMinusM = 2 * q - int m
            let factorCosine = int (IntegerMath.choose m (uint32 q)) * IntegerMath.power twoQMinusM r
            let factorInt32 =
                if t.IsTrigonometricOrHyperbolicSine then
                    IntegerMath.powerOfMinusOne q * factorCosine
                else
                    factorCosine
            let factor = Complex.ofInt32 factorInt32
            if t.IsTrigonometric then
                let argument =
                    let halfPi = Complex.ofFloat64 (Math.PI / 2.0)
                    if t = TrigHyp.Sin then
                        Complex.ofUInt32 (r - m) * halfPi + Complex.ofInt32 twoQMinusM * y
                    else
                        Complex.ofUInt32 r * halfPi + Complex.ofInt32 twoQMinusM * y
                factor * Complex.Cos argument + factor * Complex.Sin argument * Complex.ImaginaryOne
            else
                factor * Complex.Exp (Complex.ofInt32 twoQMinusM * y)
        let ns = int n
        let denominator = Complex.ofInt32 (IntegerMath.power 2 n)
        let unsigned = seqAddComplex (Seq.map (term trigHyp k n x) {0 .. ns}) / denominator
        if trigHyp.IsTrigonometricOrHyperbolicSine then
            let sign = Complex.ofInt32 (IntegerMath.powerOfMinusOne ns)
            sign * unsigned
        else
            unsigned

// The derivatives of the powers of trigonometric and hyperbolic sine and cosine
// using polynomials
// both intermediate (polynomial in other)
// and final (polynomial in self, possibly to be multiplied by a single additional factor other)
module TrigHypPolynomials =

    let singleVariableFunction (h : float -> float) (ys : string list option) (m : Map<string, float>) =
        h (Map.find (List.head (Option.get ys)) m)

    let singleVariableFunctionComplex (h : Complex -> Complex) (ys : string list option)
            (m : Map<string, Complex>) =
        h (Map.find (List.head (Option.get ys)) m)

    // Intermediate polynomials: f_k(n)(u), g_k(n)(u), h_k(n)(u)
    let rec derivativePowerPolynomialInOther (trigHyp : TrigHyp) (k : uint32) =
        if k = 0u then
            Polynomial.Constant TrigHypes.one
        else
            let n = "n"
            let x = trigHyp.Other.Token
            let ys = Some ["x"]
            let f = Some (singleVariableFunction trigHyp.Other.Float64Function)
            let g = Some (singleVariableFunctionComplex trigHyp.Other.ComplexFunction)
            let zero = Polynomial<Coefficient64>.Zero
            let p (j : uint32) =
                let oneMinusJ = Coefficient64 (1L - int64 j)
                let nPlusOneMinusJ = Polynomial (n, None, None, None, [oneMinusJ; Coefficient64.One])
                Polynomial (x, ys, f, g, [zero; nPlusOneMinusJ])
            let q = Polynomial (x, ys, f, g, trigHyp.DerivativeFactorInOtherCoefficients)
            let previousPolynomial = derivativePowerPolynomialInOther trigHyp (k - 1u)
            let r = p k * previousPolynomial + q * previousPolynomial.Derivative
            if trigHyp.NegateInductionInOther then
                -r
            else
                r

    // Final polynomials: s_k(n)(v), c_k(n)(v), t_k(n)(v), d_k(n)(v)
    let derivativePowerPolynomialInSelf (trigHyp : TrigHyp) (k : uint32) =
        let derivativePowerPolynomialFromPolynomialInOther
                (g : TrigHyp) (p : Polynomial<Polynomial<Coefficient64>>) =
            if not p.HasOnlyEvenPowers then
                invalidArg "p" "Polynomial p has at least one odd power"
            elif not (p.X = g.Other.Token && Option.isSome p.Ys || p.IsConstant) then
                invalidArg "p" (sprintf "Polynomial p is not compatible with a polynomial in %s"
                                        g.Other.Token)
            Contract.EndContractBlock ()
            let mapper (h : TrigHyp) i t =
                let rec powerOfSinSquaredMinusOne n =
                    let one = Polynomial.Constant Coefficient64.One
                    if n = 0u then
                        Polynomial.Constant one
                    else
                        let x = h.Token
                        let ys = p.Ys
                        let f = Some (singleVariableFunction h.Float64Function)
                        let g = Some (singleVariableFunctionComplex h.ComplexFunction)
                        let r = Polynomial (x, ys, f, g, h.SubstituteInSelfCoefficients)
                        if n = 1u then
                            r
                        else
                            r * powerOfSinSquaredMinusOne (n - 1u)
                (Polynomial.Constant t) * powerOfSinSquaredMinusOne ((uint32 i) / 2u)
            Seq.sum (Seq.mapi (mapper g) p.Coefficients)
        let q =
            if IntegerMath.isEven k then
                derivativePowerPolynomialInOther trigHyp k
            else
                (derivativePowerPolynomialInOther trigHyp k) >>> 1
        derivativePowerPolynomialFromPolynomialInOther trigHyp q

    // Prints the intermediate and the final expression for the k'th derivative of trigHyp^n(x)
    let printDerivative stream (trigHyp : TrigHyp) k =
        let otherOrEmpty =
            if IntegerMath.isEven k then
                String.Empty
            else
                sprintf " %s(x)" trigHyp.Other.Token
        let token = trigHyp.Token
        fprintfn stream "d^%d/dx^%d [%s^n(x)]" k k token
        let inOther = derivativePowerPolynomialInOther trigHyp k
        if trigHyp.NonNegativeConditionInOther k then
            fprintfn stream " = %s^(n-%d)(x) [%A]" token k inOther
        else
            fprintfn stream " = -%s^(n-%d)(x) [%A]" token k -inOther
        let inSelf = derivativePowerPolynomialInSelf trigHyp k
        if trigHyp.NonNegativeConditionInSelf k then
            fprintfn stream " = %s^(n-%d)(x)%s [%A]" token k otherOrEmpty inSelf
        else
            fprintfn stream " = -%s^(n-%d)(x)%s [%A]" token k otherOrEmpty -inSelf
        if k = 0u then
            fprintfn stream " = %s^n(x)" token

    let printDerivativesUpto stream (trigHyp : TrigHyp) (lastK : uint32) =
        fprintfn stream "Derivatives of %s^n(x)" trigHyp.Token
        fprintfn stream ""
        for k = 0 to int lastK do
            printDerivative stream trigHyp (uint32 k)

    // Evaluates the k'th derivative of trigHyp^n(x), evaluated at x (: float), using the intermediate step
    let derivativeOfPowerInOtherFloat64 (trigHyp : TrigHyp) k n x =
        let y = trigHyp.Float64Function x
        let o = trigHyp.Other.Float64Function x
        let p = derivativePowerPolynomialInOther trigHyp k
        let m = Map.ofList [trigHyp.Other.Token, o; "n", float n]
        Math.Pow (y, float (n - int k)) * p.ApplyFloat64 m

    // Evaluates the k'th derivative of trigHyp^n(x), evaluated at x (: Complex), using the intermediate step
    let derivativeOfPowerInOtherComplex (trigHyp : TrigHyp) k n z =
        let y = trigHyp.ComplexFunction z
        let o = trigHyp.Other.ComplexFunction z
        let p = derivativePowerPolynomialInOther trigHyp k
        let m = Map.ofList [trigHyp.Other.Token, o; "n", Complex.ofInt32 n]
        Complex.Pow (y, Complex.ofInt32 (n - int k)) * p.ApplyComplex m

    // Evaluates the k'th derivative of trigHyp^n(x), evaluated at x (: float), using the final step
    let derivativeOfPowerFloat64 (trigHyp : TrigHyp) k n x =
        let y = trigHyp.Float64Function x
        let p = derivativePowerPolynomialInSelf trigHyp k
        let m = Map.ofList [trigHyp.Token, y; "n", float n]
        let a = Math.Pow (y, float (n - int k)) * p.ApplyFloat64 m
        if IntegerMath.isEven k then
            a
        else
            trigHyp.Other.Float64Function x * a

    // Evaluates the k'th derivative of trigHyp^n(x), evaluated at x (: Complex), using the final step
    let derivativeOfPowerComplex (trigHyp : TrigHyp) k n z =
        let y = trigHyp.ComplexFunction z
        let p = derivativePowerPolynomialInSelf trigHyp k
        let m = Map.ofList [trigHyp.Token, y; "n", Complex.ofInt32 n]
        let a = Complex.Pow (y, Complex.ofInt32 (n - int k)) * p.ApplyComplex m
        if IntegerMath.isEven k then
            a
        else
            trigHyp.Other.ComplexFunction z * a

module Derivatives =

    // Prints the k'th derivative of trigHyp^n(z) evaluated at x (: float),
    // calculated using the different expressions
    let printDerivativeOfPower stream (trigHyp : TrigHyp) k n x =
        let z = Complex.ofFloat64 x
        fprintfn stream "d^%d/dx^%d [%s^%d(x)] | x = %s" k k trigHyp.Token n (x.ToString "R")
        fprintfn stream " = %O" (TrigHypComplexDefinitions.derivativeOfPowerComplex trigHyp k (uint32 n) z)
        fprintfn stream " = %O" (TrigHypComplexDefinitions.derivativeOfPowerFloat64 trigHyp k (uint32 n) x)
        fprintfn stream " = %O" (TrigHypPolynomials.derivativeOfPowerInOtherComplex trigHyp k n z)
        fprintfn stream " = %s" ((TrigHypPolynomials.derivativeOfPowerInOtherFloat64 trigHyp k n x).ToString
                                                                                                        "R")
        fprintfn stream " = %O" (TrigHypPolynomials.derivativeOfPowerComplex trigHyp k n z)
        fprintfn stream " = %s" ((TrigHypPolynomials.derivativeOfPowerFloat64 trigHyp k n x).ToString "R")

    [<EntryPoint>]
    let main _args =
        let lastK = 6u
        let stream = Console.Out
        for th in DiscriminatedUnions.cases<TrigHyp> do
            TrigHypPolynomials.printDerivativesUpto stream th lastK
            fprintfn stream ""
        ignore (Console.ReadKey ())
        0
module Derivatives

from Adhemar.Derivatives
namespace System
namespace System.Diagnostics
namespace System.Diagnostics.Contracts
namespace System.Numerics
namespace System.Text
namespace Microsoft
namespace Microsoft.FSharp
namespace Microsoft.FSharp.Core
module Operators

from Microsoft.FSharp.Core
namespace Microsoft.FSharp.Reflection
Multiple items
type Complex =
  struct
    new : real:float * imaginary:float -> Complex
    member Equals : obj:obj -> bool + 1 overload
    member GetHashCode : unit -> int
    member Imaginary : float
    member Magnitude : float
    member Phase : float
    member Real : float
    member ToString : unit -> string + 3 overloads
    static val Zero : Complex
    static val One : Complex
    ...
  end

Full name: System.Numerics.Complex

--------------------
Complex()
Complex(real: float, imaginary: float) : unit
val ofFloat64 : f:float -> Complex

Full name: Adhemar.Derivatives.Complex.ofFloat64
val f : float
val ofInt32 : n:int -> Complex

Full name: Adhemar.Derivatives.Complex.ofInt32
val n : int
Multiple items
val float : value:'T -> float (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.float

--------------------
type float = Double

Full name: Microsoft.FSharp.Core.float

--------------------
type float<'Measure> = float

Full name: Microsoft.FSharp.Core.float<_>
val ofUInt32 : n:uint32 -> Complex

Full name: Adhemar.Derivatives.Complex.ofUInt32
val n : uint32
Multiple items
val uint32 : value:'T -> uint32 (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.uint32

--------------------
type uint32 = UInt32

Full name: Microsoft.FSharp.Core.uint32
val ofInt64 : n:int64 -> Complex

Full name: Adhemar.Derivatives.Complex.ofInt64
val n : int64
Multiple items
val int64 : value:'T -> int64 (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.int64

--------------------
type int64 = Int64

Full name: Microsoft.FSharp.Core.int64

--------------------
type int64<'Measure> = int64

Full name: Microsoft.FSharp.Core.int64<_>
val isEven : k:uint32 -> bool

Full name: Adhemar.Derivatives.IntegerMath.isEven
val k : uint32
val powerOfMinusOne : p:int -> int

Full name: Adhemar.Derivatives.IntegerMath.powerOfMinusOne
val p : int
val power : n:int -> p:uint32 -> int

Full name: Adhemar.Derivatives.IntegerMath.power
val p : uint32
val factorial : n:uint32 -> uint32

Full name: Adhemar.Derivatives.IntegerMath.factorial
val choose : n:uint32 -> m:uint32 -> uint32

Full name: Adhemar.Derivatives.IntegerMath.choose
val m : uint32
type ICoefficient =
  interface
    abstract member Add : ICoefficient -> ICoefficient
    abstract member ApplyComplex : Map<string,Complex> -> Complex
    abstract member ApplyFloat64 : Map<string,float> -> float
    abstract member CoefficientString : bool * bool -> string
    abstract member Multiply : ICoefficient -> ICoefficient
    abstract member Scale64 : int64 -> ICoefficient
    abstract member IsNegative : bool
    abstract member IsOne : bool
    abstract member Zero : ICoefficient
  end

Full name: Adhemar.Derivatives.ICoefficient
abstract member ICoefficient.Zero : ICoefficient

Full name: Adhemar.Derivatives.ICoefficient.Zero
abstract member ICoefficient.IsOne : bool

Full name: Adhemar.Derivatives.ICoefficient.IsOne
type bool = Boolean

Full name: Microsoft.FSharp.Core.bool
abstract member ICoefficient.Add : ICoefficient -> ICoefficient

Full name: Adhemar.Derivatives.ICoefficient.Add
abstract member ICoefficient.Scale64 : int64 -> ICoefficient

Full name: Adhemar.Derivatives.ICoefficient.Scale64
abstract member ICoefficient.Multiply : ICoefficient -> ICoefficient

Full name: Adhemar.Derivatives.ICoefficient.Multiply
abstract member ICoefficient.IsNegative : bool

Full name: Adhemar.Derivatives.ICoefficient.IsNegative
abstract member ICoefficient.CoefficientString : bool * bool -> string

Full name: Adhemar.Derivatives.ICoefficient.CoefficientString
Multiple items
val string : value:'T -> string

Full name: Microsoft.FSharp.Core.Operators.string

--------------------
type string = String

Full name: Microsoft.FSharp.Core.string
abstract member ICoefficient.ApplyFloat64 : Map<string,float> -> float

Full name: Adhemar.Derivatives.ICoefficient.ApplyFloat64
Multiple items
module Map

from Microsoft.FSharp.Collections

--------------------
type Map<'Key,'Value (requires comparison)> =
  interface IEnumerable
  interface IComparable
  interface IEnumerable<KeyValuePair<'Key,'Value>>
  interface ICollection<KeyValuePair<'Key,'Value>>
  interface IDictionary<'Key,'Value>
  new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
  member Add : key:'Key * value:'Value -> Map<'Key,'Value>
  member ContainsKey : key:'Key -> bool
  override Equals : obj -> bool
  member Remove : key:'Key -> Map<'Key,'Value>
  ...

Full name: Microsoft.FSharp.Collections.Map<_,_>

--------------------
new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
abstract member ICoefficient.ApplyComplex : Map<string,Complex> -> Complex

Full name: Adhemar.Derivatives.ICoefficient.ApplyComplex
Multiple items
type Coefficient64 =
  interface IEquatable<Coefficient64>
  interface ICoefficient
  new : value:int64 -> Coefficient64
  member CoefficientString : first:bool * explicitOne:bool -> string
  member Equals : that:Coefficient64 -> bool
  override Equals : that:obj -> bool
  override GetHashCode : unit -> int
  override ToString : unit -> string
  member IsNegative : bool
  member IsOne : bool
  ...

Full name: Adhemar.Derivatives.Coefficient64

--------------------
new : value:int64 -> Coefficient64
val value : int64
member Coefficient64.Value : int64

Full name: Adhemar.Derivatives.Coefficient64.Value
static member Coefficient64.Zero : Coefficient64

Full name: Adhemar.Derivatives.Coefficient64.Zero
member Coefficient64.IsOne : bool

Full name: Adhemar.Derivatives.Coefficient64.IsOne
val __ : Coefficient64
property Coefficient64.Value: int64
val m : Coefficient64
val n : Coefficient64
val scalingFactor : int64
member Coefficient64.IsNegative : bool

Full name: Adhemar.Derivatives.Coefficient64.IsNegative
override Coefficient64.ToString : unit -> string

Full name: Adhemar.Derivatives.Coefficient64.ToString
val sprintf : format:Printf.StringFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf
member Coefficient64.CoefficientString : first:bool * explicitOne:bool -> string

Full name: Adhemar.Derivatives.Coefficient64.CoefficientString
val first : bool
val explicitOne : bool
val not : value:bool -> bool

Full name: Microsoft.FSharp.Core.Operators.not
property Coefficient64.IsOne: bool
property Coefficient64.IsNegative: bool
Multiple items
type String =
  new : value:char -> string + 7 overloads
  member Chars : int -> char
  member Clone : unit -> obj
  member CompareTo : value:obj -> int + 1 overload
  member Contains : value:string -> bool
  member CopyTo : sourceIndex:int * destination:char[] * destinationIndex:int * count:int -> unit
  member EndsWith : value:string -> bool + 2 overloads
  member Equals : obj:obj -> bool + 2 overloads
  member GetEnumerator : unit -> CharEnumerator
  member GetHashCode : unit -> int
  ...

Full name: System.String

--------------------
String(value: nativeptr<char>) : unit
String(value: nativeptr<sbyte>) : unit
String(value: char []) : unit
String(c: char, count: int) : unit
String(value: nativeptr<char>, startIndex: int, length: int) : unit
String(value: nativeptr<sbyte>, startIndex: int, length: int) : unit
String(value: char [], startIndex: int, length: int) : unit
String(value: nativeptr<sbyte>, startIndex: int, length: int, enc: Encoding) : unit
field string.Empty
override Coefficient64.Zero : ICoefficient

Full name: Adhemar.Derivatives.Coefficient64.Zero
property Coefficient64.Zero: Coefficient64
override Coefficient64.IsOne : bool

Full name: Adhemar.Derivatives.Coefficient64.IsOne
override Coefficient64.Add : t:ICoefficient -> ICoefficient

Full name: Adhemar.Derivatives.Coefficient64.Add
val t : ICoefficient
override Coefficient64.Scale64 : scalingFactor:int64 -> ICoefficient

Full name: Adhemar.Derivatives.Coefficient64.Scale64
override Coefficient64.Multiply : t:ICoefficient -> ICoefficient

Full name: Adhemar.Derivatives.Coefficient64.Multiply
override Coefficient64.IsNegative : bool

Full name: Adhemar.Derivatives.Coefficient64.IsNegative
override Coefficient64.CoefficientString : first:bool * explicitOne:bool -> string

Full name: Adhemar.Derivatives.Coefficient64.CoefficientString
member Coefficient64.CoefficientString : first:bool * explicitOne:bool -> string
override Coefficient64.ApplyFloat64 : _m:Map<string,float> -> float

Full name: Adhemar.Derivatives.Coefficient64.ApplyFloat64
override Coefficient64.ApplyComplex : m:Map<string,Complex> -> Complex

Full name: Adhemar.Derivatives.Coefficient64.ApplyComplex
val m : Map<string,Complex>
member Coefficient64.IsZero : bool

Full name: Adhemar.Derivatives.Coefficient64.IsZero
static member Coefficient64.One : Coefficient64

Full name: Adhemar.Derivatives.Coefficient64.One
static member Coefficient64.MinusOne : Coefficient64

Full name: Adhemar.Derivatives.Coefficient64.MinusOne
property Coefficient64.One: Coefficient64
override Coefficient64.GetHashCode : unit -> int

Full name: Adhemar.Derivatives.Coefficient64.GetHashCode
Int64.GetHashCode() : int
member Coefficient64.Equals : that:Coefficient64 -> bool

Full name: Adhemar.Derivatives.Coefficient64.Equals
val that : Coefficient64
type IEquatable<'T> =
  member Equals : other:'T -> bool

Full name: System.IEquatable<_>
override Coefficient64.Equals : that:Coefficient64 -> bool

Full name: Adhemar.Derivatives.Coefficient64.Equals
member Coefficient64.Equals : that:Coefficient64 -> bool
override Coefficient64.Equals : that:obj -> bool
override Coefficient64.Equals : that:obj -> bool

Full name: Adhemar.Derivatives.Coefficient64.Equals
val that : obj
type obj = Object

Full name: Microsoft.FSharp.Core.obj
val thatCoefficient64 : Coefficient64
val r : Coefficient64
val t : Coefficient64
static member Coefficient64.( = ) : r:Coefficient64 * t:Coefficient64 -> bool
static member Coefficient64.op_Implicit : value:int64 -> Coefficient64

Full name: Adhemar.Derivatives.Coefficient64.op_Implicit
Multiple items
type Polynomial<'T (requires equality and 'T :> ICoefficient)> =
  interface IEquatable<Polynomial<'T>>
  interface ICoefficient
  new : x:string * ys:string list option * f:(string list option -> Map<string,float> -> float) option * g:(string list option -> Map<string,Complex> -> Complex) option * coefficients:'T list -> Polynomial<'T>
  member ApplyComplex : m:Map<string,Complex> -> Complex
  member ApplyFloat64 : m:Map<string,float> -> float
  member CoefficientString : first:bool * explicitOne:bool -> string
  member Equals : that:Polynomial<'T> -> bool
  override Equals : that:obj -> bool
  override GetHashCode : unit -> int
  override ToString : unit -> string
  ...

Full name: Adhemar.Derivatives.Polynomial<_>

--------------------
new : x:string * ys:string list option * f:(string list option -> Map<string,float> -> float) option * g:(string list option -> Map<string,Complex> -> Complex) option * coefficients:'T list -> Polynomial<'T>
val x : string
val ys : string list option
type 'T list = List<'T>

Full name: Microsoft.FSharp.Collections.list<_>
type 'T option = Option<'T>

Full name: Microsoft.FSharp.Core.option<_>
val f : (string list option -> Map<string,float> -> float) option
val g : (string list option -> Map<string,Complex> -> Complex) option
val coefficients : 'T list (requires equality and 'T :> ICoefficient)
val isEmptyOrSingleton : ('b list -> bool)
val cs : 'b list
val isZero : ('T -> bool) (requires equality and 'T :> ICoefficient)
val t : 'T (requires equality and 'T :> ICoefficient)
val x : ICoefficient
property ICoefficient.Zero: ICoefficient
val exactlyOneNonZero : ('T list -> 'T option) (requires equality and 'T :> ICoefficient)
val cs : 'T list (requires equality and 'T :> ICoefficient)
union case Option.None: Option<'T>
val c : 'T (requires equality and 'T :> ICoefficient)
union case Option.Some: Value: 'T -> Option<'T>
val h : 'T (requires equality and 'T :> ICoefficient)
val ts : 'T list (requires equality and 'T :> ICoefficient)
val add : ('b list * 'b list -> 'b list) (requires 'b :> ICoefficient)
val cs : #ICoefficient list
val ds : #ICoefficient list
val g : #ICoefficient
val ts : #ICoefficient list
val h : #ICoefficient
val rs : #ICoefficient list
val shiftRank : (int -> 'T list -> 'T list) (requires equality and 'T :> ICoefficient)
val k : int
Multiple items
module List

from Microsoft.FSharp.Collections

--------------------
type List<'T> =
  | ( [] )
  | ( :: ) of Head: 'T * Tail: 'T list
  interface IEnumerable
  interface IEnumerable<'T>
  member GetSlice : startIndex:int option * endIndex:int option -> 'T list
  member Head : 'T
  member IsEmpty : bool
  member Item : index:int -> 'T with get
  member Length : int
  member Tail : 'T list
  static member Cons : head:'T * tail:'T list -> 'T list
  static member Empty : 'T list

Full name: Microsoft.FSharp.Collections.List<_>
val skip : count:int -> list:'T list -> 'T list

Full name: Microsoft.FSharp.Collections.List.skip
val isEmpty : list:'T list -> bool

Full name: Microsoft.FSharp.Collections.List.isEmpty
val empty<'T> : 'T list

Full name: Microsoft.FSharp.Collections.List.empty
val head : list:'T list -> 'T

Full name: Microsoft.FSharp.Collections.List.head
val hasOnlyEvenIndexedItems : ('T list -> bool) (requires equality and 'T :> ICoefficient)
val hasOnlyOddIndexedItems : ('T list -> bool) (requires equality and 'T :> ICoefficient)
val nonZeroHighestCoefficient : ('T list -> bool) (requires equality and 'T :> ICoefficient)
val isNoneOrAllAreNotEmpty : (string list option -> bool)
val zs : string list option
val bs : string list
val isNeitherNullNorEmpty : (string -> bool)
val s : string
String.IsNullOrEmpty(value: string) : bool
val forall : predicate:('T -> bool) -> list:'T list -> bool

Full name: Microsoft.FSharp.Collections.List.forall
val distinct : ('a -> 'a list option -> bool) (requires comparison)
val v : 'a (requires comparison)
val ws : 'a list option (requires comparison)
val allDistinct : (seq<'b> -> bool) (requires comparison)
val mySequence : seq<'b> (requires comparison)
val folder : (Set<'c> option -> 'c -> Set<'c> option) (requires comparison)
val state : Set<'c> option (requires comparison)
val element : 'c (requires comparison)
val elementsSoFar : Set<'c> (requires comparison)
Multiple items
module Set

from Microsoft.FSharp.Collections

--------------------
type Set<'T (requires comparison)> =
  interface IComparable
  interface IEnumerable
  interface IEnumerable<'T>
  interface ICollection<'T>
  new : elements:seq<'T> -> Set<'T>
  member Add : value:'T -> Set<'T>
  member Contains : value:'T -> bool
  override Equals : obj -> bool
  member IsProperSubsetOf : otherSet:Set<'T> -> bool
  member IsProperSupersetOf : otherSet:Set<'T> -> bool
  ...

Full name: Microsoft.FSharp.Collections.Set<_>

--------------------
new : elements:seq<'T> -> Set<'T>
val contains : element:'T -> set:Set<'T> -> bool (requires comparison)

Full name: Microsoft.FSharp.Collections.Set.contains
val add : value:'T -> set:Set<'T> -> Set<'T> (requires comparison)

Full name: Microsoft.FSharp.Collections.Set.add
val initialState : Set<'c> option (requires comparison)
val empty<'T (requires comparison)> : Set<'T> (requires comparison)

Full name: Microsoft.FSharp.Collections.Set.empty
val scanning : seq<Set<'b> option> (requires comparison)
module Seq

from Microsoft.FSharp.Collections
val scan : folder:('State -> 'T -> 'State) -> state:'State -> source:seq<'T> -> seq<'State>

Full name: Microsoft.FSharp.Collections.Seq.scan
val forall : predicate:('T -> bool) -> source:seq<'T> -> bool

Full name: Microsoft.FSharp.Collections.Seq.forall
module Option

from Microsoft.FSharp.Core
val isSome : option:'T option -> bool

Full name: Microsoft.FSharp.Core.Option.isSome
val zs : 'a list (requires comparison)
val isNull : value:'T -> bool (requires 'T : null)

Full name: Microsoft.FSharp.Core.Operators.isNull
val nullArg : argumentName:string -> 'T

Full name: Microsoft.FSharp.Core.Operators.nullArg
val invalidArg : argumentName:string -> message:string -> 'T

Full name: Microsoft.FSharp.Core.Operators.invalidArg
val isNone : option:'T option -> bool

Full name: Microsoft.FSharp.Core.Option.isNone
static member Polynomial.Create : x:string * ys:string list option * f:(string list option -> Map<string,float> -> float) option * g:(string list option -> Map<string,Complex> -> Complex) option * coefficients:'T list -> Polynomial<'T>

Full name: Adhemar.Derivatives.Polynomial`1.Create
val deZeroHighestCoefficient : ('T list -> 'T list) (requires equality and 'T :> ICoefficient)
val deZeroTail : 'T list (requires equality and 'T :> ICoefficient)
val deZeroCoefficients : 'T list (requires equality and 'T :> ICoefficient)
val emptyInsteadOfNull : (string -> string)
member Polynomial.X : string

Full name: Adhemar.Derivatives.Polynomial`1.X
val __ : Polynomial<'T> (requires equality and 'T :> ICoefficient)
member Polynomial.Ys : string list option

Full name: Adhemar.Derivatives.Polynomial`1.Ys
member Polynomial.F : (string list option -> Map<string,float> -> float) option

Full name: Adhemar.Derivatives.Polynomial`1.F
member Polynomial.G : (string list option -> Map<string,Complex> -> Complex) option

Full name: Adhemar.Derivatives.Polynomial`1.G
member Polynomial.Coefficients : 'T list

Full name: Adhemar.Derivatives.Polynomial`1.Coefficients
static member Polynomial.Zero : Polynomial<'T>

Full name: Adhemar.Derivatives.Polynomial`1.Zero
member Polynomial.IsOne : bool

Full name: Adhemar.Derivatives.Polynomial`1.IsOne
property Polynomial.Coefficients: 'T list
member Polynomial.IsConstant : bool

Full name: Adhemar.Derivatives.Polynomial`1.IsConstant
static member Polynomial.AreCompatible : p:Polynomial<'T> * q:Polynomial<'T> -> bool

Full name: Adhemar.Derivatives.Polynomial`1.AreCompatible
val p : Polynomial<'T> (requires equality and 'T :> ICoefficient)
val q : Polynomial<'T> (requires equality and 'T :> ICoefficient)
property Polynomial.X: string
property Polynomial.Ys: string list option
property Polynomial.IsConstant: bool
static member Polynomial.Compatibleness : p:Polynomial<'T> * q:Polynomial<'T> -> string * string list option * (string list option -> Map<string,float> -> float) option * (string list option -> Map<string,Complex> -> Complex) option

Full name: Adhemar.Derivatives.Polynomial`1.Compatibleness
static member Polynomial.AreCompatible : p:Polynomial<'T> * q:Polynomial<'T> -> bool
type Contract =
  static member Assert : condition:bool -> unit + 1 overload
  static member Assume : condition:bool -> unit + 1 overload
  static member EndContractBlock : unit -> unit
  static member Ensures : condition:bool -> unit + 1 overload
  static member EnsuresOnThrow<'TException> : condition:bool -> unit + 1 overload
  static member Exists<'T> : collection:IEnumerable<'T> * predicate:Predicate<'T> -> bool + 1 overload
  static member ForAll<'T> : collection:IEnumerable<'T> * predicate:Predicate<'T> -> bool + 1 overload
  static member Invariant : condition:bool -> unit + 1 overload
  static member OldValue<'T> : value:'T -> 'T
  static member Requires : condition:bool -> unit + 3 overloads
  ...

Full name: System.Diagnostics.Contracts.Contract
Contract.EndContractBlock() : unit
property Polynomial.F: (string list option -> Map<string,float> -> float) option
property Polynomial.G: (string list option -> Map<string,Complex> -> Complex) option
static member Polynomial.Compatibleness : p:Polynomial<'T> * q:Polynomial<'T> -> string * string list option * (string list option -> Map<string,float> -> float) option * (string list option -> Map<string,Complex> -> Complex) option
static member Polynomial.Create : x:string * ys:string list option * f:(string list option -> Map<string,float> -> float) option * g:(string list option -> Map<string,Complex> -> Complex) option * coefficients:'T list -> Polynomial<'T>
val mapper : (int64 -> 'T -> 'T) (requires equality and 'T :> ICoefficient)
val f : int64
val map : mapping:('T -> 'U) -> list:'T list -> 'U list

Full name: Microsoft.FSharp.Collections.List.map
val multiply : ('T list * 'T list -> 'T list) (requires equality and 'T :> ICoefficient)
val ds : 'T list (requires equality and 'T :> ICoefficient)
val multiplyTerm : (ICoefficient -> ICoefficient -> #ICoefficient)
val g : ICoefficient
val d : ICoefficient
member Polynomial.IsNegative : bool

Full name: Adhemar.Derivatives.Polynomial`1.IsNegative
member Polynomial.IsZero : bool

Full name: Adhemar.Derivatives.Polynomial`1.IsZero
member Polynomial.Rank : int

Full name: Adhemar.Derivatives.Polynomial`1.Rank
val length : list:'T list -> int

Full name: Microsoft.FSharp.Collections.List.length
member Polynomial.IsMonomial : bool

Full name: Adhemar.Derivatives.Polynomial`1.IsMonomial
member Polynomial.YsString : string

Full name: Adhemar.Derivatives.Polynomial`1.YsString
val zs : string list
val separator : string
String.Join(separator: string, values: Collections.Generic.IEnumerable<string>) : string
String.Join<'T>(separator: string, values: Collections.Generic.IEnumerable<'T>) : string
String.Join(separator: string, [<ParamArray>] values: obj []) : string
String.Join(separator: string, [<ParamArray>] value: string []) : string
String.Join(separator: string, value: string [], startIndex: int, count: int) : string
override Polynomial.ToString : unit -> string

Full name: Adhemar.Derivatives.Polynomial`1.ToString
property Polynomial.IsZero: bool
val PolynomialTerms : seq<bool * bool * int * 'T> (requires equality and 'T :> ICoefficient)
Multiple items
val seq : sequence:seq<'T> -> seq<'T>

Full name: Microsoft.FSharp.Core.Operators.seq

--------------------
type seq<'T> = Collections.Generic.IEnumerable<'T>

Full name: Microsoft.FSharp.Collections.seq<_>
property Polynomial.Rank: int
val d : 'T (requires equality and 'T :> ICoefficient)
val item : index:int -> list:'T list -> 'T

Full name: Microsoft.FSharp.Collections.List.item
val stringBuilder : StringBuilder
Multiple items
type StringBuilder =
  new : unit -> StringBuilder + 5 overloads
  member Append : value:string -> StringBuilder + 18 overloads
  member AppendFormat : format:string * arg0:obj -> StringBuilder + 4 overloads
  member AppendLine : unit -> StringBuilder + 1 overload
  member Capacity : int with get, set
  member Chars : int -> char with get, set
  member Clear : unit -> StringBuilder
  member CopyTo : sourceIndex:int * destination:char[] * destinationIndex:int * count:int -> unit
  member EnsureCapacity : capacity:int -> int
  member Equals : sb:StringBuilder -> bool
  ...

Full name: System.Text.StringBuilder

--------------------
StringBuilder() : unit
StringBuilder(capacity: int) : unit
StringBuilder(value: string) : unit
StringBuilder(value: string, capacity: int) : unit
StringBuilder(capacity: int, maxCapacity: int) : unit
StringBuilder(value: string, startIndex: int, length: int, capacity: int) : unit
val fi : bool
val eo : bool
val t : string
abstract member ICoefficient.CoefficientString : bool * bool -> string
val ignore : value:'T -> unit

Full name: Microsoft.FSharp.Core.Operators.ignore
StringBuilder.Append(value: char []) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: obj) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: uint64) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: uint32) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: uint16) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: decimal) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: float) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: float32) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: int64) : StringBuilder
   (+0 other overloads)
StringBuilder.Append(value: int) : StringBuilder
   (+0 other overloads)
String.EndsWith(value: string) : bool
String.EndsWith(value: string, comparisonType: StringComparison) : bool
String.EndsWith(value: string, ignoreCase: bool, culture: Globalization.CultureInfo) : bool
property Polynomial.YsString: string
member Polynomial.CoefficientString : first:bool * explicitOne:bool -> string

Full name: Adhemar.Derivatives.Polynomial`1.CoefficientString
property Polynomial.IsOne: bool
property Polynomial.IsMonomial: bool
property Polynomial.IsNegative: bool
member Polynomial.ApplyFloat64 : m:Map<string,float> -> float

Full name: Adhemar.Derivatives.Polynomial`1.ApplyFloat64
val m : Map<string,float>
val exactlyOne : list:'T list -> 'T

Full name: Microsoft.FSharp.Collections.List.exactlyOne
val mapper : (float -> Map<string,float> -> int -> ICoefficient -> float)
val u : float
val a : Map<string,float>
val i : int
Multiple items
val int : value:'T -> int (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.int

--------------------
type int = int32

Full name: Microsoft.FSharp.Core.int

--------------------
type int<'Measure> = int

Full name: Microsoft.FSharp.Core.int<_>
val c : ICoefficient
type Math =
  static val PI : float
  static val E : float
  static member Abs : value:sbyte -> sbyte + 6 overloads
  static member Acos : d:float -> float
  static member Asin : d:float -> float
  static member Atan : d:float -> float
  static member Atan2 : y:float * x:float -> float
  static member BigMul : a:int * b:int -> int64
  static member Ceiling : d:decimal -> decimal + 1 overload
  static member Cos : d:float -> float
  ...

Full name: System.Math
Math.Pow(x: float, y: float) : float
val v : float
val tryFind : key:'Key -> table:Map<'Key,'T> -> 'T option (requires comparison)

Full name: Microsoft.FSharp.Collections.Map.tryFind
val get : option:'T option -> 'T

Full name: Microsoft.FSharp.Core.Option.get
val w : float
val sum : source:seq<'T> -> 'T (requires member ( + ) and member get_Zero)

Full name: Microsoft.FSharp.Collections.Seq.sum
val mapi : mapping:(int -> 'T -> 'U) -> source:seq<'T> -> seq<'U>

Full name: Microsoft.FSharp.Collections.Seq.mapi
member Polynomial.ApplyComplex : m:Map<string,Complex> -> Complex

Full name: Adhemar.Derivatives.Polynomial`1.ApplyComplex
field Complex.Zero
val seqAddComplex : (seq<Complex> -> Complex)
val zs : seq<Complex>
val fold : folder:('State -> 'T -> 'State) -> state:'State -> source:seq<'T> -> 'State

Full name: Microsoft.FSharp.Collections.Seq.fold
val mapper : (Complex -> Map<string,Complex> -> int -> ICoefficient -> Complex)
val u : Complex
val a : Map<string,Complex>
Complex.Pow(value: Complex, power: float) : Complex
Complex.Pow(value: Complex, power: Complex) : Complex
val v : Complex
val w : Complex
override Polynomial.Zero : ICoefficient

Full name: Adhemar.Derivatives.Polynomial`1.Zero
override Polynomial.IsOne : bool

Full name: Adhemar.Derivatives.Polynomial`1.IsOne
override Polynomial.Add : t:ICoefficient -> ICoefficient

Full name: Adhemar.Derivatives.Polynomial`1.Add
override Polynomial.Scale64 : scalingFactor:int64 -> ICoefficient

Full name: Adhemar.Derivatives.Polynomial`1.Scale64
override Polynomial.Multiply : t:ICoefficient -> ICoefficient

Full name: Adhemar.Derivatives.Polynomial`1.Multiply
override Polynomial.IsNegative : bool

Full name: Adhemar.Derivatives.Polynomial`1.IsNegative
override Polynomial.CoefficientString : first:bool * explicitOne:bool -> string

Full name: Adhemar.Derivatives.Polynomial`1.CoefficientString
member Polynomial.CoefficientString : first:bool * explicitOne:bool -> string
override Polynomial.ApplyFloat64 : m:Map<string,float> -> float

Full name: Adhemar.Derivatives.Polynomial`1.ApplyFloat64
member Polynomial.ApplyFloat64 : m:Map<string,float> -> float
override Polynomial.ApplyComplex : m:Map<string,Complex> -> Complex

Full name: Adhemar.Derivatives.Polynomial`1.ApplyComplex
member Polynomial.ApplyComplex : m:Map<string,Complex> -> Complex
member Polynomial.Derivative : Polynomial<'T>

Full name: Adhemar.Derivatives.Polynomial`1.Derivative
val mapper : (int -> 'T -> 'T) (requires equality and 'T :> ICoefficient)
val mapi : mapping:(int -> 'T -> 'U) -> list:'T list -> 'U list

Full name: Microsoft.FSharp.Collections.List.mapi
static member Polynomial.Constant : t:'T -> Polynomial<'T>

Full name: Adhemar.Derivatives.Polynomial`1.Constant
member Polynomial.HasOnlyEvenPowers : bool

Full name: Adhemar.Derivatives.Polynomial`1.HasOnlyEvenPowers
member Polynomial.HasOnlyOddPowers : bool

Full name: Adhemar.Derivatives.Polynomial`1.HasOnlyOddPowers
override Polynomial.GetHashCode : unit -> int

Full name: Adhemar.Derivatives.Polynomial`1.GetHashCode
Object.GetHashCode() : int
String.GetHashCode() : int
member Polynomial.Equals : that:Polynomial<'T> -> bool

Full name: Adhemar.Derivatives.Polynomial`1.Equals
val that : Polynomial<'T> (requires equality and 'T :> ICoefficient)
override Polynomial.Equals : that:Polynomial<'T> -> bool

Full name: Adhemar.Derivatives.Polynomial`1.Equals
member Polynomial.Equals : that:Polynomial<'T> -> bool
override Polynomial.Equals : that:obj -> bool
override Polynomial.Equals : that:obj -> bool

Full name: Adhemar.Derivatives.Polynomial`1.Equals
val thatPolynomial : Polynomial<'T> (requires equality and 'T :> ICoefficient)
static member Polynomial.( = ) : p:Polynomial<'T> * q:Polynomial<'T> -> bool
val instance : caseInfo:UnionCaseInfo -> 'T

Full name: Adhemar.Derivatives.DiscriminatedUnions.instance
val caseInfo : UnionCaseInfo
type UnionCaseInfo
member GetCustomAttributes : unit -> obj []
member GetCustomAttributes : attributeType:Type -> obj []
member GetCustomAttributesData : unit -> IList<CustomAttributeData>
member GetFields : unit -> PropertyInfo []
member DeclaringType : Type
member Name : string
member Tag : int

Full name: Microsoft.FSharp.Reflection.UnionCaseInfo
type FSharpValue =
  static member GetExceptionFields : exn:obj * ?bindingFlags:BindingFlags -> obj []
  static member GetRecordField : record:obj * info:PropertyInfo -> obj
  static member GetRecordFields : record:obj * ?bindingFlags:BindingFlags -> obj []
  static member GetTupleField : tuple:obj * index:int -> obj
  static member GetTupleFields : tuple:obj -> obj []
  static member GetUnionFields : value:obj * unionType:Type * ?bindingFlags:BindingFlags -> UnionCaseInfo * obj []
  static member MakeFunction : functionType:Type * implementation:(obj -> obj) -> obj
  static member MakeRecord : recordType:Type * values:obj [] * ?bindingFlags:BindingFlags -> obj
  static member MakeTuple : tupleElements:obj [] * tupleType:Type -> obj
  static member MakeUnion : unionCase:UnionCaseInfo * args:obj [] * ?bindingFlags:BindingFlags -> obj
  ...

Full name: Microsoft.FSharp.Reflection.FSharpValue
static member FSharpValue.MakeUnion : unionCase:UnionCaseInfo * args:obj [] * ?allowAccessToPrivateRepresentation:bool -> obj
static member FSharpValue.MakeUnion : unionCase:UnionCaseInfo * args:obj [] * ?bindingFlags:Reflection.BindingFlags -> obj
type Array =
  member Clone : unit -> obj
  member CopyTo : array:Array * index:int -> unit + 1 overload
  member GetEnumerator : unit -> IEnumerator
  member GetLength : dimension:int -> int
  member GetLongLength : dimension:int -> int64
  member GetLowerBound : dimension:int -> int
  member GetUpperBound : dimension:int -> int
  member GetValue : [<ParamArray>] indices:int[] -> obj + 7 overloads
  member Initialize : unit -> unit
  member IsFixedSize : bool
  ...

Full name: System.Array
val empty<'T> : 'T []

Full name: Microsoft.FSharp.Collections.Array.empty
val cases<'T> : seq<'T>

Full name: Adhemar.Derivatives.DiscriminatedUnions.cases
val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U>

Full name: Microsoft.FSharp.Collections.Seq.map
type FSharpType =
  static member GetExceptionFields : exceptionType:Type * ?bindingFlags:BindingFlags -> PropertyInfo []
  static member GetFunctionElements : functionType:Type -> Type * Type
  static member GetRecordFields : recordType:Type * ?bindingFlags:BindingFlags -> PropertyInfo []
  static member GetTupleElements : tupleType:Type -> Type []
  static member GetUnionCases : unionType:Type * ?bindingFlags:BindingFlags -> UnionCaseInfo []
  static member IsExceptionRepresentation : exceptionType:Type * ?bindingFlags:BindingFlags -> bool
  static member IsFunction : typ:Type -> bool
  static member IsModule : typ:Type -> bool
  static member IsRecord : typ:Type * ?bindingFlags:BindingFlags -> bool
  static member IsTuple : typ:Type -> bool
  ...

Full name: Microsoft.FSharp.Reflection.FSharpType
static member FSharpType.GetUnionCases : unionType:Type * ?allowAccessToPrivateRepresentation:bool -> UnionCaseInfo []
static member FSharpType.GetUnionCases : unionType:Type * ?bindingFlags:Reflection.BindingFlags -> UnionCaseInfo []
val typeof<'T> : Type

Full name: Microsoft.FSharp.Core.Operators.typeof
val zero : Polynomial<Coefficient64>

Full name: Adhemar.Derivatives.TrigHypes.zero
val one : Polynomial<Coefficient64>

Full name: Adhemar.Derivatives.TrigHypes.one
static member Polynomial.Constant : t:'T -> Polynomial<'T>
val minusOne : Polynomial<Coefficient64>

Full name: Adhemar.Derivatives.TrigHypes.minusOne
property Coefficient64.MinusOne: Coefficient64
val alwaysTrue : 'a -> bool

Full name: Adhemar.Derivatives.TrigHypes.alwaysTrue
type TrigHyp =
  | Sin
  | Cos
  | Sinh
  | Cosh
  member ComplexFunction : (Complex -> Complex)
  member DerivativeFactorInOtherCoefficients : Polynomial<Coefficient64> list
  member Float64Function : (float -> float)
  member IsHyperbolic : bool
  member IsTrigonometric : bool
  member IsTrigonometricOrHyperbolicSine : bool
  member NegateInductionInOther : bool
  member NonNegativeConditionInOther : (uint32 -> bool)
  member NonNegativeConditionInSelf : (uint32 -> bool)
  member Other : TrigHyp
  member SubstituteInSelfCoefficients : Polynomial<Coefficient64> list
  member Token : string

Full name: Adhemar.Derivatives.TrigHyp
union case TrigHyp.Sin: TrigHyp
union case TrigHyp.Cos: TrigHyp
union case TrigHyp.Sinh: TrigHyp
union case TrigHyp.Cosh: TrigHyp
member TrigHyp.Token : string

Full name: Adhemar.Derivatives.TrigHyp.Token
val __ : TrigHyp
member TrigHyp.Float64Function : (float -> float)

Full name: Adhemar.Derivatives.TrigHyp.Float64Function
Math.Sin(a: float) : float
Math.Cos(d: float) : float
Math.Sinh(value: float) : float
Math.Cosh(value: float) : float
member TrigHyp.ComplexFunction : (Complex -> Complex)

Full name: Adhemar.Derivatives.TrigHyp.ComplexFunction
Complex.Sin(value: Complex) : Complex
Complex.Cos(value: Complex) : Complex
Complex.Sinh(value: Complex) : Complex
Complex.Cosh(value: Complex) : Complex
member TrigHyp.IsTrigonometric : bool

Full name: Adhemar.Derivatives.TrigHyp.IsTrigonometric
val contains : value:'T -> source:'T list -> bool (requires equality)

Full name: Microsoft.FSharp.Collections.List.contains
member TrigHyp.IsHyperbolic : bool

Full name: Adhemar.Derivatives.TrigHyp.IsHyperbolic
member TrigHyp.IsTrigonometricOrHyperbolicSine : bool

Full name: Adhemar.Derivatives.TrigHyp.IsTrigonometricOrHyperbolicSine
member TrigHyp.Other : TrigHyp

Full name: Adhemar.Derivatives.TrigHyp.Other
member TrigHyp.NegateInductionInOther : bool

Full name: Adhemar.Derivatives.TrigHyp.NegateInductionInOther
member TrigHyp.DerivativeFactorInOtherCoefficients : Polynomial<Coefficient64> list

Full name: Adhemar.Derivatives.TrigHyp.DerivativeFactorInOtherCoefficients
module TrigHypes

from Adhemar.Derivatives
member TrigHyp.SubstituteInSelfCoefficients : Polynomial<Coefficient64> list

Full name: Adhemar.Derivatives.TrigHyp.SubstituteInSelfCoefficients
member TrigHyp.NonNegativeConditionInOther : (uint32 -> bool)

Full name: Adhemar.Derivatives.TrigHyp.NonNegativeConditionInOther
module IntegerMath

from Adhemar.Derivatives
member TrigHyp.NonNegativeConditionInSelf : (uint32 -> bool)

Full name: Adhemar.Derivatives.TrigHyp.NonNegativeConditionInSelf
val sinNonNegativeConditionInSelf : (uint32 -> bool)
val cosNonNegativeConditionInSelf : (uint32 -> bool)
val private seqAddComplex : zs:seq<Complex> -> Complex

Full name: Adhemar.Derivatives.TrigHypComplexDefinitions.seqAddComplex
val derivativeOfPowerFloat64 : trigHyp:TrigHyp -> k:uint32 -> n:uint32 -> x:float -> Complex

Full name: Adhemar.Derivatives.TrigHypComplexDefinitions.derivativeOfPowerFloat64
val trigHyp : TrigHyp
val x : float
val term : (TrigHyp -> uint32 -> uint32 -> float -> int -> Complex)
val t : TrigHyp
val r : uint32
val y : float
val q : int
val twoQMinusM : int
val factorCosine : int
val factorInt32 : int
property TrigHyp.IsTrigonometricOrHyperbolicSine: bool
val factor : float
property TrigHyp.IsTrigonometric: bool
val argument : float
val halfPi : float
field Math.PI = 3.14159265359
Math.Exp(d: float) : float
val ns : int
val denominator : Complex
val unsigned : Complex
val sign : Complex
val derivativeOfPowerComplex : trigHyp:TrigHyp -> k:uint32 -> n:uint32 -> x:Complex -> Complex

Full name: Adhemar.Derivatives.TrigHypComplexDefinitions.derivativeOfPowerComplex
val x : Complex
val term : (TrigHyp -> uint32 -> uint32 -> Complex -> int -> Complex)
val y : Complex
val factor : Complex
val argument : Complex
val halfPi : Complex
field Complex.ImaginaryOne
Complex.Exp(value: Complex) : Complex
val singleVariableFunction : h:(float -> float) -> ys:string list option -> m:Map<string,float> -> float

Full name: Adhemar.Derivatives.TrigHypPolynomials.singleVariableFunction
val h : (float -> float)
val find : key:'Key -> table:Map<'Key,'T> -> 'T (requires comparison)

Full name: Microsoft.FSharp.Collections.Map.find
val singleVariableFunctionComplex : h:(Complex -> Complex) -> ys:string list option -> m:Map<string,Complex> -> Complex

Full name: Adhemar.Derivatives.TrigHypPolynomials.singleVariableFunctionComplex
val h : (Complex -> Complex)
val derivativePowerPolynomialInOther : trigHyp:TrigHyp -> k:uint32 -> Polynomial<Polynomial<Coefficient64>>

Full name: Adhemar.Derivatives.TrigHypPolynomials.derivativePowerPolynomialInOther
val n : string
property TrigHyp.Other: TrigHyp
property TrigHyp.Token: string
property TrigHyp.Float64Function: float -> float
property TrigHyp.ComplexFunction: Complex -> Complex
val zero : Polynomial<Coefficient64>
val p : (uint32 -> Polynomial<Polynomial<Coefficient64>>)
val j : uint32
val oneMinusJ : Coefficient64
val nPlusOneMinusJ : Polynomial<Coefficient64>
val q : Polynomial<Polynomial<Coefficient64>>
property TrigHyp.DerivativeFactorInOtherCoefficients: Polynomial<Coefficient64> list
val previousPolynomial : Polynomial<Polynomial<Coefficient64>>
val r : Polynomial<Polynomial<Coefficient64>>
property Polynomial.Derivative: Polynomial<Polynomial<Coefficient64>>
property TrigHyp.NegateInductionInOther: bool
val derivativePowerPolynomialInSelf : trigHyp:TrigHyp -> k:uint32 -> Polynomial<Polynomial<Coefficient64>>

Full name: Adhemar.Derivatives.TrigHypPolynomials.derivativePowerPolynomialInSelf
val derivativePowerPolynomialFromPolynomialInOther : (TrigHyp -> Polynomial<Polynomial<Coefficient64>> -> Polynomial<Polynomial<Coefficient64>>)
val g : TrigHyp
val p : Polynomial<Polynomial<Coefficient64>>
property Polynomial.HasOnlyEvenPowers: bool
val mapper : (TrigHyp -> int -> Polynomial<Coefficient64> -> Polynomial<Polynomial<Coefficient64>>)
val h : TrigHyp
val t : Polynomial<Coefficient64>
val powerOfSinSquaredMinusOne : (uint32 -> Polynomial<Polynomial<Coefficient64>>)
val one : Polynomial<Coefficient64>
property TrigHyp.SubstituteInSelfCoefficients: Polynomial<Coefficient64> list
property Polynomial.Coefficients: Polynomial<Coefficient64> list
val printDerivative : stream:IO.TextWriter -> trigHyp:TrigHyp -> k:uint32 -> unit

Full name: Adhemar.Derivatives.TrigHypPolynomials.printDerivative
val stream : IO.TextWriter
val otherOrEmpty : string
val token : string
val fprintfn : textWriter:IO.TextWriter -> format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.fprintfn
val inOther : Polynomial<Polynomial<Coefficient64>>
property TrigHyp.NonNegativeConditionInOther: uint32 -> bool
val inSelf : Polynomial<Polynomial<Coefficient64>>
property TrigHyp.NonNegativeConditionInSelf: uint32 -> bool
val printDerivativesUpto : stream:IO.TextWriter -> trigHyp:TrigHyp -> lastK:uint32 -> unit

Full name: Adhemar.Derivatives.TrigHypPolynomials.printDerivativesUpto
val lastK : uint32
val derivativeOfPowerInOtherFloat64 : trigHyp:TrigHyp -> k:uint32 -> n:int -> x:float -> float

Full name: Adhemar.Derivatives.TrigHypPolynomials.derivativeOfPowerInOtherFloat64
val o : float
val ofList : elements:('Key * 'T) list -> Map<'Key,'T> (requires comparison)

Full name: Microsoft.FSharp.Collections.Map.ofList
val derivativeOfPowerInOtherComplex : trigHyp:TrigHyp -> k:uint32 -> n:int -> z:Complex -> Complex

Full name: Adhemar.Derivatives.TrigHypPolynomials.derivativeOfPowerInOtherComplex
val z : Complex
val o : Complex
val derivativeOfPowerFloat64 : trigHyp:TrigHyp -> k:uint32 -> n:int -> x:float -> float

Full name: Adhemar.Derivatives.TrigHypPolynomials.derivativeOfPowerFloat64
val a : float
val derivativeOfPowerComplex : trigHyp:TrigHyp -> k:uint32 -> n:int -> z:Complex -> Complex

Full name: Adhemar.Derivatives.TrigHypPolynomials.derivativeOfPowerComplex
val a : Complex
val printDerivativeOfPower : stream:IO.TextWriter -> trigHyp:TrigHyp -> k:uint32 -> n:int -> x:float -> unit

Full name: Adhemar.Derivatives.Derivatives.printDerivativeOfPower
Double.ToString() : string
Double.ToString(provider: IFormatProvider) : string
Double.ToString(format: string) : string
Double.ToString(format: string, provider: IFormatProvider) : string
module TrigHypComplexDefinitions

from Adhemar.Derivatives
module TrigHypPolynomials

from Adhemar.Derivatives
Multiple items
type EntryPointAttribute =
  inherit Attribute
  new : unit -> EntryPointAttribute

Full name: Microsoft.FSharp.Core.EntryPointAttribute

--------------------
new : unit -> EntryPointAttribute
val main : _args:string [] -> int

Full name: Adhemar.Derivatives.Derivatives.main
type Console =
  static member BackgroundColor : ConsoleColor with get, set
  static member Beep : unit -> unit + 1 overload
  static member BufferHeight : int with get, set
  static member BufferWidth : int with get, set
  static member CapsLock : bool
  static member Clear : unit -> unit
  static member CursorLeft : int with get, set
  static member CursorSize : int with get, set
  static member CursorTop : int with get, set
  static member CursorVisible : bool with get, set
  ...

Full name: System.Console
property Console.Out: IO.TextWriter
val th : TrigHyp
module DiscriminatedUnions

from Adhemar.Derivatives
Console.ReadKey() : ConsoleKeyInfo
Console.ReadKey(intercept: bool) : ConsoleKeyInfo

More information

Link:http://fssnip.net/7Xf
Posted:5 days ago
Author:Stijn “Adhemar” Vandamme
Tags: derivatives , polynomials