### ----------------------------------------------------
### -- Math::Libgsl::Function
### -- Licenses: Artistic-2.0
### -- Authors: Fernando Santagata
### -- File: lib/Math/Libgsl/Function.rakumod
### ----------------------------------------------------
### -- Chunk 4 of 8
 is export(:hermite) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hermite_func_der_e($m, $n, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
# Zeros of Hermite Polynomials and Hermite Functions
sub hermite-zero(Int $n, Int $s --> Num) is export(:hermite) {
  gsl_sf_hermite_phys_zero($n, $s);
}
sub hermite-zero-e(Int $n, Int $s --> List) is export(:hermite) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hermite_phys_zero_e($n, $s, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub hermite-prob-zero(Int $n, Int $s --> Num) is export(:hermite) {
  gsl_sf_hermite_prob_zero($n, $s);
}
sub hermite-prob-zero-e(Int $n, Int $s --> List) is export(:hermite) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hermite_prob_zero_e($n, $s, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub hermite-func-zero(Int $n, Int $s --> Num) is export(:hermite) {
  gsl_sf_hermite_func_zero($n, $s);
}
sub hermite-func-zero-e(Int $n, Int $s --> List) is export(:hermite) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hermite_func_zero_e($n, $s, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
# Hypergeometric Functions
sub F01(Num(Cool) $c, Num(Cool) $x --> Num) is export(:hyperg) {
  gsl_sf_hyperg_0F1($c.Num, $x);
}
sub F01-e(Num(Cool) $c, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_0F1_e($c.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub F11(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> Num) is export(:hyperg) {
  gsl_sf_hyperg_1F1($a.Num, $b.Num, $x);
}
sub F11-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_1F1_e($a.Num, $b.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub F11-int(Int $m, Int $n, Num(Cool) $x --> Num) is export(:hyperg) {
  gsl_sf_hyperg_1F1_int($m, $n, $x);
}
sub F11-int-e(Int $m, Int $n, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_1F1_int_e($m, $n, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub U(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> Num) is export(:hyperg) {
  gsl_sf_hyperg_U($a.Num, $b.Num, $x);
}
sub U-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_U_e($a.Num, $b.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub U-e10(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result_e10 $res .= new;
  my $ret = gsl_sf_hyperg_U_e10_e($a.Num, $b.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err, $res.e10;
}
sub U-int(Int $m, Int $n, Num(Cool) $x --> Num) is export(:hyperg) {
  gsl_sf_hyperg_U_int($m, $n, $x);
}
sub U-int-e(Int $m, Int $n, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_U_int_e($m, $n, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub U-int-e10(Int $m, Int $n, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result_e10 $res .= new;
  my $ret = gsl_sf_hyperg_U_int_e10_e($m, $n, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err, $res.e10;
}
sub F21(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x --> Num) is export(:hyperg) {
  gsl_sf_hyperg_2F1($a.Num, $b.Num, $c.Num, $x);
}
sub F21-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_2F1_e($a.Num, $b.Num, $c.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0 && $ret ≠ GSL_EMAXITER;
  return $res.val, $res.err;
}
sub F21-conj(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> Num) is export(:hyperg) {
  gsl_sf_hyperg_2F1_conj($aR.Num, $aI.Num, $c.Num, $x);
}
sub F21-conj-e(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_2F1_conj_e($aR.Num, $aI.Num, $c.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub F21-renorm(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> Num) is export(:hyperg) {
  gsl_sf_hyperg_2F1_renorm($a.Num, $b.Num, $c.Num, $x);
}
sub F21-renorm-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_2F1_renorm_e($a.Num, $b.Num, $c.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub F21-conj-renorm(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> Num) is export(:hyperg) {
  gsl_sf_hyperg_2F1_conj_renorm($aR.Num, $aI.Num, $c.Num, $x);
}
sub F21-conj-renorm-e(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_2F1_conj_renorm_e($aR.Num, $aI.Num, $c.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub F20(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> Num) is export(:hyperg) {
  gsl_sf_hyperg_2F0($a.Num, $b.Num, $x);
}
sub F20-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $x --> List) is export(:hyperg) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_hyperg_2F0_e($a.Num, $b.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0 && $ret ≠ GSL_EMAXITER;
  return $res.val, $res.err;
}
# Laguerre Functions
sub laguerre1(Num(Cool) $a, Num(Cool) $x --> Num) is export(:laguerre) {
  gsl_sf_laguerre_1($a.Num, $x);
}
sub laguerre1-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:laguerre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_laguerre_1_e($a.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub laguerre2(Num(Cool) $a, Num(Cool) $x --> Num) is export(:laguerre) {
  gsl_sf_laguerre_2($a.Num, $x);
}
sub laguerre2-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:laguerre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_laguerre_2_e($a.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub laguerre3(Num(Cool) $a, Num(Cool) $x --> Num) is export(:laguerre) {
  gsl_sf_laguerre_3($a.Num, $x);
}
sub laguerre3-e(Num(Cool) $a, Num(Cool) $x --> List) is export(:laguerre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_laguerre_3_e($a.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub laguerre-n(UInt $n, Num(Cool) $a where * > -1, Num(Cool) $x --> Num) is export(:laguerre) {
  gsl_sf_laguerre_n($n, $a.Num, $x);
}
sub laguerre-n-e(UInt $n, Num(Cool) $a where * > -1, Num(Cool) $x --> List) is export(:laguerre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_laguerre_n_e($n, $a.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
# Lambert W Functions
sub lambert-W0(Num(Cool) $x --> Num) is export(:lambert) {
  gsl_sf_lambert_W0($x);
}
sub lambert-W0-e(Num(Cool) $x --> List) is export(:lambert) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_lambert_W0_e($x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub lambert-Wm1(Num(Cool) $x --> Num) is export(:lambert) {
  gsl_sf_lambert_Wm1($x);
}
sub lambert-Wm1-e(Num(Cool) $x --> List) is export(:lambert) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_lambert_Wm1_e($x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
# Legendre Functions and Spherical Harmonics
# Legendre Polynomials
sub legendre-P1(Num(Cool) $x --> Num) is export(:legendre) {
  gsl_sf_legendre_P1($x);
}
sub legendre-P1-e(Num(Cool) $x --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_P1_e($x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-P2(Num(Cool) $x --> Num) is export(:legendre) {
  gsl_sf_legendre_P2($x);
}
sub legendre-P2-e(Num(Cool) $x --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_P2_e($x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-P3(Num(Cool) $x --> Num) is export(:legendre) {
  gsl_sf_legendre_P3($x);
}
sub legendre-P3-e(Num(Cool) $x --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_P3_e($x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-Pl(UInt $l, Num(Cool) $x where -1 ≤ * ≤ 1 --> Num) is export(:legendre) {
  gsl_sf_legendre_Pl($l, $x);
}
sub legendre-Pl-e(UInt $l, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_Pl_e($l, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-Pl-array(UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: $lmax + 1;
  my $ret = gsl_sf_legendre_Pl_array($lmax, $x, $out);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $out.list;
}
sub legendre-Pl-deriv-array(UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: $lmax + 1;
  my $derout = CArray[num64].allocate: $lmax + 1;
  my $ret = gsl_sf_legendre_Pl_deriv_array($lmax, $x, $out, $derout);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list);
}
sub legendre-Q0(Num(Cool) $x where { $_ > -1 && $_ ≠ 1 } --> Num) is export(:legendre) {
  gsl_sf_legendre_Q0($x);
}
sub legendre-Q0-e(Num(Cool) $x where { $_ > -1 && $_ ≠ 1 } --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_Q0_e($x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-Q1(Num(Cool) $x where { $_ > -1 && $_ ≠ 1 } --> Num) is export(:legendre) {
  gsl_sf_legendre_Q1($x);
}
sub legendre-Q1-e(Num(Cool) $x where { $_ > -1 && $_ ≠ 1 } --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_Q1_e($x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-Ql(UInt $l, Num(Cool) $x where { $_ > -1 && $_ ≠ 1 } --> Num) is export(:legendre) {
  gsl_sf_legendre_Ql($l, $x);
}
sub legendre-Ql-e(UInt $l, Num(Cool) $x where { $_ > -1 && $_ ≠ 1 } --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_Ql_e($l, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
# Associated Legendre Polynomials and Spherical Harmonics
sub legendre-array-index(UInt $l, UInt $m --> UInt) is export(:legendre) {
  return gsl_sf_legendre_array_index($l, $m);
}
sub legendre-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_array($norm, $lmax, $x, $out);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $out.list;
}
sub legendre-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_array_e($norm, $lmax, $x, $csphase, $out);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $out.list;
}
sub legendre-deriv-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_deriv_array($norm, $lmax, $x, $out, $derout);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list);
}
sub legendre-deriv-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_deriv_array_e($norm, $lmax, $x, $csphase, $out, $derout);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list);
}
sub legendre-deriv-alt-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_deriv_alt_array($norm, $lmax, $x, $out, $derout);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list);
}
sub legendre-deriv-alt-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_deriv_alt_array_e($norm, $lmax, $x, $csphase, $out, $derout);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list);
}
sub legendre-deriv2-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout2 = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_deriv2_array($norm, $lmax, $x, $out, $derout, $derout2);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list), :derout2($derout2.list);
}
sub legendre-deriv2-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout2 = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_deriv2_array_e($norm, $lmax, $x, $csphase, $out, $derout, $derout2);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list), :derout2($derout2.list);
}
sub legendre-deriv2-alt-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout2 = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_deriv2_alt_array($norm, $lmax, $x, $out, $derout, $derout2);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list), :derout2($derout2.list);
}
sub legendre-deriv2-alt-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $derout2 = CArray[num64].allocate: gsl_sf_legendre_array_n($lmax);
  my $ret = gsl_sf_legendre_deriv2_alt_array_e($norm, $lmax, $x, $csphase, $out, $derout, $derout2);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return :out($out.list), :derout($derout.list), :derout2($derout2.list);
}
sub legendre-Plm(UInt $l, UInt $m, Num(Cool) $x where -1 ≤ * ≤ 1 --> Num) is export(:legendre) {
  die 'l must be ≥ m' if $l < $m;
  gsl_sf_legendre_Plm($l, $m, $x);
}
sub legendre-Plm-e(UInt $l, UInt $m, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  die 'l must be ≥ m' if $l < $m;
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_Plm_e($l, $m, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-sphPlm(UInt $l, UInt $m, Num(Cool) $x where -1 ≤ * ≤ 1 --> Num) is export(:legendre) {
  die 'l must be ≥ m' if $l < $m;
  gsl_sf_legendre_sphPlm($l, $m, $x);
}
sub legendre-sphPlm-e(UInt $l, UInt $m, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre) {
  die 'l must be ≥ m' if $l < $m;
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_sphPlm_e($l, $m, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
# Conical Functions
sub conicalP-half(Num(Cool) $lambda, Num(Cool) $x where * > -1 --> Num) is export(:legendre) {
  gsl_sf_conicalP_half($lambda.Num, $x);
}
sub conicalP-half-e(Num(Cool) $lambda, Num(Cool) $x where * > -1 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_conicalP_half_e($lambda.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub conicalP-mhalf(Num(Cool) $lambda, Num(Cool) $x where * > -1 --> Num) is export(:legendre) {
  gsl_sf_conicalP_mhalf($lambda.Num, $x);
}
sub conicalP-mhalf-e(Num(Cool) $lambda, Num(Cool) $x where * > -1 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_conicalP_mhalf_e($lambda.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub conicalP0(Num(Cool) $lambda, Num(Cool) $x where * > -1 --> Num) is export(:legendre) {
  gsl_sf_conicalP_0($lambda.Num, $x);
}
sub conicalP0-e(Num(Cool) $lambda, Num(Cool) $x where * > -1 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_conicalP_0_e($lambda.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub conicalP1(Num(Cool) $lambda, Num(Cool) $x where * > -1 --> Num) is export(:legendre) {
  gsl_sf_conicalP_1($lambda.Num, $x);
}
sub conicalP1-e(Num(Cool) $lambda, Num(Cool) $x where * > -1 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_conicalP_1_e($lambda.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub conicalP-sph-reg(Int $l where * ≥ -1, Num(Cool) $lambda, Num(Cool) $x where * > -1 --> Num) is export(:legendre) {
  gsl_sf_conicalP_sph_reg($l, $lambda.Num, $x);
}
sub conicalP-sph-reg-e(Int $l where * ≥ -1, Num(Cool) $lambda, Num(Cool) $x where * > -1 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_conicalP_sph_reg_e($l, $lambda.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub conicalP-cyl-reg(Int $m where * ≥ -1, Num(Cool) $lambda, Num(Cool) $x where * > -1 --> Num) is export(:legendre) {
  gsl_sf_conicalP_cyl_reg($m, $lambda.Num, $x);
}
sub conicalP-cyl-reg-e(Int $m where * ≥ -1, Num(Cool) $lambda, Num(Cool) $x where * > -1 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_conicalP_cyl_reg_e($m, $lambda.Num, $x, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
# Radial Functions for Hyperbolic Space
sub legendre-H3d0(Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> Num) is export(:legendre) {
  gsl_sf_legendre_H3d_0($lambda.Num, $eta);
}
sub legendre-H3d0-e(Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_H3d_0_e($lambda.Num, $eta, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-H3d1(Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> Num) is export(:legendre) {
  gsl_sf_legendre_H3d_1($lambda.Num, $eta);
}
sub legendre-H3d1-e(Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_H3d_1_e($lambda.Num, $eta, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-H3d(UInt $l, Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> Num) is export(:legendre) {
  gsl_sf_legendre_H3d($l, $lambda.Num, $eta);
}
sub legendre-H3d-e(UInt $l, Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> List) is export(:legendre) {
  my gsl_sf_result $res .= new;
  my $ret = gsl_sf_legendre_H3d_e($l, $lambda.Num, $eta, $res);
  fail X::Libgsl.new: errno => $ret if $ret > 0;
  return $res.val, $res.err;
}
sub legendre-H3d-array(UInt $lmax, Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> List) is export(:legendre) {
  my $out = CArray[num64].allocate: gsl_sf_legendre