
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (* (sqrt 0.5) (/ l t))))
(if (<= (/ t l) -1e+148)
(asin (fabs t_1))
(if (<= (/ t l) 2e+151)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin t_1)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = sqrt(0.5) * (l / t);
double tmp;
if ((t / l) <= -1e+148) {
tmp = asin(fabs(t_1));
} else if ((t / l) <= 2e+151) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin(t_1);
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(0.5d0) * (l / t)
if ((t / l) <= (-1d+148)) then
tmp = asin(abs(t_1))
else if ((t / l) <= 2d+151) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin(t_1)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.sqrt(0.5) * (l / t);
double tmp;
if ((t / l) <= -1e+148) {
tmp = Math.asin(Math.abs(t_1));
} else if ((t / l) <= 2e+151) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin(t_1);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.sqrt(0.5) * (l / t) tmp = 0 if (t / l) <= -1e+148: tmp = math.asin(math.fabs(t_1)) elif (t / l) <= 2e+151: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin(t_1) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(sqrt(0.5) * Float64(l / t)) tmp = 0.0 if (Float64(t / l) <= -1e+148) tmp = asin(abs(t_1)); elseif (Float64(t / l) <= 2e+151) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(t_1); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = sqrt(0.5) * (l / t); tmp = 0.0; if ((t / l) <= -1e+148) tmp = asin(abs(t_1)); elseif ((t / l) <= 2e+151) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin(t_1); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+148], N[ArcSin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+151], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[t$95$1], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \sqrt{0.5} \cdot \frac{\ell}{t}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+148}:\\
\;\;\;\;\sin^{-1} \left(\left|t_1\right|\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+151}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} t_1\\
\end{array}
\end{array}
if (/.f64 t l) < -1e148Initial program 43.4%
Taylor expanded in t around inf 32.5%
*-commutative32.5%
unpow232.5%
unpow232.5%
times-frac40.6%
unpow240.6%
associate-/l*40.6%
associate-/r/40.6%
Simplified40.6%
Taylor expanded in Om around 0 40.6%
add-sqr-sqrt35.8%
sqrt-unprod44.8%
pow244.8%
Applied egg-rr44.8%
unpow244.8%
rem-sqrt-square98.5%
*-commutative98.5%
Simplified98.5%
if -1e148 < (/.f64 t l) < 2.00000000000000003e151Initial program 98.9%
unpow298.9%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
unpow298.9%
Applied egg-rr98.9%
if 2.00000000000000003e151 < (/.f64 t l) Initial program 53.2%
Taylor expanded in t around inf 91.7%
*-commutative91.7%
unpow291.7%
unpow291.7%
times-frac99.8%
unpow299.8%
associate-/l*99.8%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in Om around 0 98.6%
Final simplification98.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, ((t / l) * sqrt(2.0))))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 80.8%
sqrt-div80.8%
add-sqr-sqrt80.8%
hypot-1-def80.8%
*-commutative80.8%
sqrt-prod80.7%
unpow280.7%
sqrt-prod47.3%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
unpow280.8%
clear-num80.8%
un-div-inv80.8%
Applied egg-rr98.4%
Final simplification98.4%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+148)
(fabs (asin (/ l (/ t (sqrt 0.5)))))
(if (<= (/ t l) 2e+151)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* (sqrt 0.5) (/ l t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+148) {
tmp = fabs(asin((l / (t / sqrt(0.5)))));
} else if ((t / l) <= 2e+151) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((sqrt(0.5) * (l / t)));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-1d+148)) then
tmp = abs(asin((l / (t / sqrt(0.5d0)))))
else if ((t / l) <= 2d+151) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((sqrt(0.5d0) * (l / t)))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+148) {
tmp = Math.abs(Math.asin((l / (t / Math.sqrt(0.5)))));
} else if ((t / l) <= 2e+151) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+148: tmp = math.fabs(math.asin((l / (t / math.sqrt(0.5))))) elif (t / l) <= 2e+151: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+148) tmp = abs(asin(Float64(l / Float64(t / sqrt(0.5))))); elseif (Float64(t / l) <= 2e+151) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+148) tmp = abs(asin((l / (t / sqrt(0.5))))); elseif ((t / l) <= 2e+151) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((sqrt(0.5) * (l / t))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -1e+148], N[Abs[N[ArcSin[N[(l / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+151], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+148}:\\
\;\;\;\;\left|\sin^{-1} \left(\frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)\right|\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+151}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e148Initial program 43.4%
Taylor expanded in t around inf 32.5%
*-commutative32.5%
unpow232.5%
unpow232.5%
times-frac40.6%
unpow240.6%
associate-/l*40.6%
associate-/r/40.6%
Simplified40.6%
Taylor expanded in Om around 0 40.6%
add-sqr-sqrt35.8%
sqrt-unprod44.8%
pow244.8%
*-un-lft-identity44.8%
associate-*l/44.8%
Applied egg-rr44.8%
unpow244.8%
rem-sqrt-square98.5%
associate-/l*98.5%
Simplified98.5%
if -1e148 < (/.f64 t l) < 2.00000000000000003e151Initial program 98.9%
unpow298.9%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
unpow298.9%
Applied egg-rr98.9%
if 2.00000000000000003e151 < (/.f64 t l) Initial program 53.2%
Taylor expanded in t around inf 91.7%
*-commutative91.7%
unpow291.7%
unpow291.7%
times-frac99.8%
unpow299.8%
associate-/l*99.8%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in Om around 0 98.6%
Final simplification98.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 80.8%
sqrt-div80.8%
add-sqr-sqrt80.8%
hypot-1-def80.8%
*-commutative80.8%
sqrt-prod80.7%
unpow280.7%
sqrt-prod47.3%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
Taylor expanded in Om around 0 97.3%
Final simplification97.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -4e+146)
(asin (/ (/ (- l) t) (sqrt 2.0)))
(if (<= (/ t l) 2e+151)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* (sqrt 0.5) (/ l t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -4e+146) {
tmp = asin(((-l / t) / sqrt(2.0)));
} else if ((t / l) <= 2e+151) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((sqrt(0.5) * (l / t)));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-4d+146)) then
tmp = asin(((-l / t) / sqrt(2.0d0)))
else if ((t / l) <= 2d+151) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((sqrt(0.5d0) * (l / t)))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -4e+146) {
tmp = Math.asin(((-l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 2e+151) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -4e+146: tmp = math.asin(((-l / t) / math.sqrt(2.0))) elif (t / l) <= 2e+151: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -4e+146) tmp = asin(Float64(Float64(Float64(-l) / t) / sqrt(2.0))); elseif (Float64(t / l) <= 2e+151) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -4e+146) tmp = asin(((-l / t) / sqrt(2.0))); elseif ((t / l) <= 2e+151) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((sqrt(0.5) * (l / t))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -4e+146], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+151], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+146}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+151}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -3.99999999999999973e146Initial program 44.4%
sqrt-div44.4%
add-sqr-sqrt44.4%
hypot-1-def44.4%
*-commutative44.4%
sqrt-prod44.4%
unpow244.4%
sqrt-prod0.0%
add-sqr-sqrt99.4%
Applied egg-rr99.4%
Taylor expanded in Om around 0 98.3%
Taylor expanded in t around -inf 98.6%
neg-mul-198.6%
associate-/r*98.5%
Simplified98.5%
if -3.99999999999999973e146 < (/.f64 t l) < 2.00000000000000003e151Initial program 98.9%
unpow298.9%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
unpow298.9%
Applied egg-rr98.9%
if 2.00000000000000003e151 < (/.f64 t l) Initial program 53.2%
Taylor expanded in t around inf 91.7%
*-commutative91.7%
unpow291.7%
unpow291.7%
times-frac99.8%
unpow299.8%
associate-/l*99.8%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in Om around 0 98.6%
Final simplification98.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))))
(if (<= l -1.7e+51)
t_1
(if (<= l -5e-310)
(asin (/ (/ (- l) t) (sqrt 2.0)))
(if (<= l 3.4e-95)
(asin (/ l (* t (sqrt 2.0))))
(if (<= l 4.8e-23)
(asin 1.0)
(if (<= l 3.3e+20) (asin (/ (* l (sqrt 0.5)) t)) t_1)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
double tmp;
if (l <= -1.7e+51) {
tmp = t_1;
} else if (l <= -5e-310) {
tmp = asin(((-l / t) / sqrt(2.0)));
} else if (l <= 3.4e-95) {
tmp = asin((l / (t * sqrt(2.0))));
} else if (l <= 4.8e-23) {
tmp = asin(1.0);
} else if (l <= 3.3e+20) {
tmp = asin(((l * sqrt(0.5)) / t));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
if (l <= (-1.7d+51)) then
tmp = t_1
else if (l <= (-5d-310)) then
tmp = asin(((-l / t) / sqrt(2.0d0)))
else if (l <= 3.4d-95) then
tmp = asin((l / (t * sqrt(2.0d0))))
else if (l <= 4.8d-23) then
tmp = asin(1.0d0)
else if (l <= 3.3d+20) then
tmp = asin(((l * sqrt(0.5d0)) / t))
else
tmp = t_1
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
double tmp;
if (l <= -1.7e+51) {
tmp = t_1;
} else if (l <= -5e-310) {
tmp = Math.asin(((-l / t) / Math.sqrt(2.0)));
} else if (l <= 3.4e-95) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else if (l <= 4.8e-23) {
tmp = Math.asin(1.0);
} else if (l <= 3.3e+20) {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
} else {
tmp = t_1;
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) tmp = 0 if l <= -1.7e+51: tmp = t_1 elif l <= -5e-310: tmp = math.asin(((-l / t) / math.sqrt(2.0))) elif l <= 3.4e-95: tmp = math.asin((l / (t * math.sqrt(2.0)))) elif l <= 4.8e-23: tmp = math.asin(1.0) elif l <= 3.3e+20: tmp = math.asin(((l * math.sqrt(0.5)) / t)) else: tmp = t_1 return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))) tmp = 0.0 if (l <= -1.7e+51) tmp = t_1; elseif (l <= -5e-310) tmp = asin(Float64(Float64(Float64(-l) / t) / sqrt(2.0))); elseif (l <= 3.4e-95) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); elseif (l <= 4.8e-23) tmp = asin(1.0); elseif (l <= 3.3e+20) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = t_1; end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); tmp = 0.0; if (l <= -1.7e+51) tmp = t_1; elseif (l <= -5e-310) tmp = asin(((-l / t) / sqrt(2.0))); elseif (l <= 3.4e-95) tmp = asin((l / (t * sqrt(2.0)))); elseif (l <= 4.8e-23) tmp = asin(1.0); elseif (l <= 3.3e+20) tmp = asin(((l * sqrt(0.5)) / t)); else tmp = t_1; end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.7e+51], t$95$1, If[LessEqual[l, -5e-310], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 3.4e-95], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 4.8e-23], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 3.3e+20], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{if}\;\ell \leq -1.7 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 3.4 \cdot 10^{-95}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{-23}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 3.3 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if l < -1.69999999999999992e51 or 3.3e20 < l Initial program 92.7%
Taylor expanded in t around 0 64.3%
unpow264.3%
unpow264.3%
times-frac75.7%
unpow275.7%
Simplified75.7%
unpow292.7%
clear-num92.7%
un-div-inv92.7%
Applied egg-rr75.7%
if -1.69999999999999992e51 < l < -4.999999999999985e-310Initial program 70.4%
sqrt-div70.4%
add-sqr-sqrt70.4%
hypot-1-def70.4%
*-commutative70.4%
sqrt-prod70.3%
unpow270.3%
sqrt-prod49.2%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 97.0%
Taylor expanded in t around -inf 56.1%
neg-mul-156.1%
associate-/r*56.1%
Simplified56.1%
if -4.999999999999985e-310 < l < 3.39999999999999993e-95Initial program 67.5%
sqrt-div67.5%
add-sqr-sqrt67.4%
hypot-1-def67.4%
*-commutative67.4%
sqrt-prod67.4%
unpow267.4%
sqrt-prod37.6%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
Taylor expanded in Om around 0 98.2%
Taylor expanded in t around inf 59.2%
if 3.39999999999999993e-95 < l < 4.79999999999999993e-23Initial program 84.3%
Taylor expanded in t around 0 69.2%
unpow269.2%
unpow269.2%
times-frac69.2%
unpow269.2%
Simplified69.2%
Taylor expanded in Om around 0 69.2%
if 4.79999999999999993e-23 < l < 3.3e20Initial program 76.6%
Taylor expanded in t around inf 51.0%
*-commutative51.0%
unpow251.0%
unpow251.0%
times-frac51.0%
unpow251.0%
associate-/l*50.8%
associate-/r/51.0%
Simplified51.0%
Taylor expanded in Om around 0 51.0%
Taylor expanded in l around 0 51.0%
Final simplification66.2%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -1.45e+61)
(asin 1.0)
(if (<= l -5e-310)
(asin (/ (/ (- l) t) (sqrt 2.0)))
(if (<= l 1.16e-91)
(asin (/ l (* t (sqrt 2.0))))
(if (<= l 1.35e-22)
(asin 1.0)
(if (<= l 8.2e+18) (asin (/ (* l (sqrt 0.5)) t)) (asin 1.0)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.45e+61) {
tmp = asin(1.0);
} else if (l <= -5e-310) {
tmp = asin(((-l / t) / sqrt(2.0)));
} else if (l <= 1.16e-91) {
tmp = asin((l / (t * sqrt(2.0))));
} else if (l <= 1.35e-22) {
tmp = asin(1.0);
} else if (l <= 8.2e+18) {
tmp = asin(((l * sqrt(0.5)) / t));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-1.45d+61)) then
tmp = asin(1.0d0)
else if (l <= (-5d-310)) then
tmp = asin(((-l / t) / sqrt(2.0d0)))
else if (l <= 1.16d-91) then
tmp = asin((l / (t * sqrt(2.0d0))))
else if (l <= 1.35d-22) then
tmp = asin(1.0d0)
else if (l <= 8.2d+18) then
tmp = asin(((l * sqrt(0.5d0)) / t))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.45e+61) {
tmp = Math.asin(1.0);
} else if (l <= -5e-310) {
tmp = Math.asin(((-l / t) / Math.sqrt(2.0)));
} else if (l <= 1.16e-91) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else if (l <= 1.35e-22) {
tmp = Math.asin(1.0);
} else if (l <= 8.2e+18) {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if l <= -1.45e+61: tmp = math.asin(1.0) elif l <= -5e-310: tmp = math.asin(((-l / t) / math.sqrt(2.0))) elif l <= 1.16e-91: tmp = math.asin((l / (t * math.sqrt(2.0)))) elif l <= 1.35e-22: tmp = math.asin(1.0) elif l <= 8.2e+18: tmp = math.asin(((l * math.sqrt(0.5)) / t)) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (l <= -1.45e+61) tmp = asin(1.0); elseif (l <= -5e-310) tmp = asin(Float64(Float64(Float64(-l) / t) / sqrt(2.0))); elseif (l <= 1.16e-91) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); elseif (l <= 1.35e-22) tmp = asin(1.0); elseif (l <= 8.2e+18) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -1.45e+61) tmp = asin(1.0); elseif (l <= -5e-310) tmp = asin(((-l / t) / sqrt(2.0))); elseif (l <= 1.16e-91) tmp = asin((l / (t * sqrt(2.0)))); elseif (l <= 1.35e-22) tmp = asin(1.0); elseif (l <= 8.2e+18) tmp = asin(((l * sqrt(0.5)) / t)); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[l, -1.45e+61], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -5e-310], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.16e-91], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.35e-22], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 8.2e+18], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.45 \cdot 10^{+61}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 1.16 \cdot 10^{-91}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 1.35 \cdot 10^{-22}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 8.2 \cdot 10^{+18}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.45e61 or 1.15999999999999994e-91 < l < 1.3500000000000001e-22 or 8.2e18 < l Initial program 92.8%
Taylor expanded in t around 0 66.2%
unpow266.2%
unpow266.2%
times-frac75.5%
unpow275.5%
Simplified75.5%
Taylor expanded in Om around 0 75.0%
if -1.45e61 < l < -4.999999999999985e-310Initial program 69.4%
sqrt-div69.4%
add-sqr-sqrt69.4%
hypot-1-def69.4%
*-commutative69.4%
sqrt-prod69.3%
unpow269.3%
sqrt-prod47.8%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 96.0%
Taylor expanded in t around -inf 55.7%
neg-mul-155.7%
associate-/r*55.7%
Simplified55.7%
if -4.999999999999985e-310 < l < 1.15999999999999994e-91Initial program 67.5%
sqrt-div67.5%
add-sqr-sqrt67.4%
hypot-1-def67.4%
*-commutative67.4%
sqrt-prod67.4%
unpow267.4%
sqrt-prod37.6%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
Taylor expanded in Om around 0 98.2%
Taylor expanded in t around inf 59.2%
if 1.3500000000000001e-22 < l < 8.2e18Initial program 76.6%
Taylor expanded in t around inf 51.0%
*-commutative51.0%
unpow251.0%
unpow251.0%
times-frac51.0%
unpow251.0%
associate-/l*50.8%
associate-/r/51.0%
Simplified51.0%
Taylor expanded in Om around 0 51.0%
Taylor expanded in l around 0 51.0%
Final simplification65.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -7.5e-76)
(asin 1.0)
(if (or (<= l 3.9e-91) (and (not (<= l 5.2e-22)) (<= l 860000000.0)))
(asin (/ l (* t (sqrt 2.0))))
(asin 1.0))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -7.5e-76) {
tmp = asin(1.0);
} else if ((l <= 3.9e-91) || (!(l <= 5.2e-22) && (l <= 860000000.0))) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-7.5d-76)) then
tmp = asin(1.0d0)
else if ((l <= 3.9d-91) .or. (.not. (l <= 5.2d-22)) .and. (l <= 860000000.0d0)) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -7.5e-76) {
tmp = Math.asin(1.0);
} else if ((l <= 3.9e-91) || (!(l <= 5.2e-22) && (l <= 860000000.0))) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if l <= -7.5e-76: tmp = math.asin(1.0) elif (l <= 3.9e-91) or (not (l <= 5.2e-22) and (l <= 860000000.0)): tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (l <= -7.5e-76) tmp = asin(1.0); elseif ((l <= 3.9e-91) || (!(l <= 5.2e-22) && (l <= 860000000.0))) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -7.5e-76) tmp = asin(1.0); elseif ((l <= 3.9e-91) || (~((l <= 5.2e-22)) && (l <= 860000000.0))) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[l, -7.5e-76], N[ArcSin[1.0], $MachinePrecision], If[Or[LessEqual[l, 3.9e-91], And[N[Not[LessEqual[l, 5.2e-22]], $MachinePrecision], LessEqual[l, 860000000.0]]], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -7.5 \cdot 10^{-76}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 3.9 \cdot 10^{-91} \lor \neg \left(\ell \leq 5.2 \cdot 10^{-22}\right) \land \ell \leq 860000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -7.4999999999999997e-76 or 3.89999999999999994e-91 < l < 5.2e-22 or 8.6e8 < l Initial program 87.3%
Taylor expanded in t around 0 59.4%
unpow259.4%
unpow259.4%
times-frac67.9%
unpow267.9%
Simplified67.9%
Taylor expanded in Om around 0 66.9%
if -7.4999999999999997e-76 < l < 3.89999999999999994e-91 or 5.2e-22 < l < 8.6e8Initial program 70.7%
sqrt-div70.7%
add-sqr-sqrt70.7%
hypot-1-def70.7%
*-commutative70.7%
sqrt-prod70.6%
unpow270.6%
sqrt-prod44.6%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around inf 57.6%
Final simplification63.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -3.8e-72)
(asin 1.0)
(if (<= l 2.6e-87)
(asin (/ l (* t (sqrt 2.0))))
(if (<= l 4e-22)
(asin 1.0)
(if (<= l 6.2e+17) (asin (/ l (/ t (sqrt 0.5)))) (asin 1.0))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -3.8e-72) {
tmp = asin(1.0);
} else if (l <= 2.6e-87) {
tmp = asin((l / (t * sqrt(2.0))));
} else if (l <= 4e-22) {
tmp = asin(1.0);
} else if (l <= 6.2e+17) {
tmp = asin((l / (t / sqrt(0.5))));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-3.8d-72)) then
tmp = asin(1.0d0)
else if (l <= 2.6d-87) then
tmp = asin((l / (t * sqrt(2.0d0))))
else if (l <= 4d-22) then
tmp = asin(1.0d0)
else if (l <= 6.2d+17) then
tmp = asin((l / (t / sqrt(0.5d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -3.8e-72) {
tmp = Math.asin(1.0);
} else if (l <= 2.6e-87) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else if (l <= 4e-22) {
tmp = Math.asin(1.0);
} else if (l <= 6.2e+17) {
tmp = Math.asin((l / (t / Math.sqrt(0.5))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if l <= -3.8e-72: tmp = math.asin(1.0) elif l <= 2.6e-87: tmp = math.asin((l / (t * math.sqrt(2.0)))) elif l <= 4e-22: tmp = math.asin(1.0) elif l <= 6.2e+17: tmp = math.asin((l / (t / math.sqrt(0.5)))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (l <= -3.8e-72) tmp = asin(1.0); elseif (l <= 2.6e-87) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); elseif (l <= 4e-22) tmp = asin(1.0); elseif (l <= 6.2e+17) tmp = asin(Float64(l / Float64(t / sqrt(0.5)))); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -3.8e-72) tmp = asin(1.0); elseif (l <= 2.6e-87) tmp = asin((l / (t * sqrt(2.0)))); elseif (l <= 4e-22) tmp = asin(1.0); elseif (l <= 6.2e+17) tmp = asin((l / (t / sqrt(0.5)))); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[l, -3.8e-72], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 2.6e-87], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 4e-22], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 6.2e+17], N[ArcSin[N[(l / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{-72}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-87}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{-22}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 6.2 \cdot 10^{+17}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -3.80000000000000002e-72 or 2.60000000000000002e-87 < l < 4.0000000000000002e-22 or 6.2e17 < l Initial program 87.3%
Taylor expanded in t around 0 59.4%
unpow259.4%
unpow259.4%
times-frac67.9%
unpow267.9%
Simplified67.9%
Taylor expanded in Om around 0 66.9%
if -3.80000000000000002e-72 < l < 2.60000000000000002e-87Initial program 70.3%
sqrt-div70.3%
add-sqr-sqrt70.3%
hypot-1-def70.3%
*-commutative70.3%
sqrt-prod70.3%
unpow270.3%
sqrt-prod44.8%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 58.0%
if 4.0000000000000002e-22 < l < 6.2e17Initial program 76.6%
Taylor expanded in t around inf 51.0%
*-commutative51.0%
unpow251.0%
unpow251.0%
times-frac51.0%
unpow251.0%
associate-/l*50.8%
associate-/r/51.0%
Simplified51.0%
Taylor expanded in Om around 0 51.0%
Taylor expanded in l around 0 51.0%
associate-/l*50.8%
Simplified50.8%
Final simplification63.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -1e-75)
(asin 1.0)
(if (<= l 2.6e-87)
(asin (/ l (* t (sqrt 2.0))))
(if (<= l 1.22e-23)
(asin 1.0)
(if (<= l 1.05e+17) (asin (/ (* l (sqrt 0.5)) t)) (asin 1.0))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1e-75) {
tmp = asin(1.0);
} else if (l <= 2.6e-87) {
tmp = asin((l / (t * sqrt(2.0))));
} else if (l <= 1.22e-23) {
tmp = asin(1.0);
} else if (l <= 1.05e+17) {
tmp = asin(((l * sqrt(0.5)) / t));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-1d-75)) then
tmp = asin(1.0d0)
else if (l <= 2.6d-87) then
tmp = asin((l / (t * sqrt(2.0d0))))
else if (l <= 1.22d-23) then
tmp = asin(1.0d0)
else if (l <= 1.05d+17) then
tmp = asin(((l * sqrt(0.5d0)) / t))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1e-75) {
tmp = Math.asin(1.0);
} else if (l <= 2.6e-87) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else if (l <= 1.22e-23) {
tmp = Math.asin(1.0);
} else if (l <= 1.05e+17) {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if l <= -1e-75: tmp = math.asin(1.0) elif l <= 2.6e-87: tmp = math.asin((l / (t * math.sqrt(2.0)))) elif l <= 1.22e-23: tmp = math.asin(1.0) elif l <= 1.05e+17: tmp = math.asin(((l * math.sqrt(0.5)) / t)) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (l <= -1e-75) tmp = asin(1.0); elseif (l <= 2.6e-87) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); elseif (l <= 1.22e-23) tmp = asin(1.0); elseif (l <= 1.05e+17) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -1e-75) tmp = asin(1.0); elseif (l <= 2.6e-87) tmp = asin((l / (t * sqrt(2.0)))); elseif (l <= 1.22e-23) tmp = asin(1.0); elseif (l <= 1.05e+17) tmp = asin(((l * sqrt(0.5)) / t)); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[l, -1e-75], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 2.6e-87], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.22e-23], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 1.05e+17], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1 \cdot 10^{-75}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-87}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 1.22 \cdot 10^{-23}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 1.05 \cdot 10^{+17}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -9.9999999999999996e-76 or 2.60000000000000002e-87 < l < 1.22000000000000007e-23 or 1.05e17 < l Initial program 87.3%
Taylor expanded in t around 0 59.4%
unpow259.4%
unpow259.4%
times-frac67.9%
unpow267.9%
Simplified67.9%
Taylor expanded in Om around 0 66.9%
if -9.9999999999999996e-76 < l < 2.60000000000000002e-87Initial program 70.3%
sqrt-div70.3%
add-sqr-sqrt70.3%
hypot-1-def70.3%
*-commutative70.3%
sqrt-prod70.3%
unpow270.3%
sqrt-prod44.8%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 58.0%
if 1.22000000000000007e-23 < l < 1.05e17Initial program 76.6%
Taylor expanded in t around inf 51.0%
*-commutative51.0%
unpow251.0%
unpow251.0%
times-frac51.0%
unpow251.0%
associate-/l*50.8%
associate-/r/51.0%
Simplified51.0%
Taylor expanded in Om around 0 51.0%
Taylor expanded in l around 0 51.0%
Final simplification63.3%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin 1.0))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin(1.0);
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(1.0d0)
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(1.0);
}
t = abs(t) def code(t, l, Om, Omc): return math.asin(1.0)
t = abs(t) function code(t, l, Om, Omc) return asin(1.0) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin(1.0); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} 1
\end{array}
Initial program 80.8%
Taylor expanded in t around 0 41.9%
unpow241.9%
unpow241.9%
times-frac47.6%
unpow247.6%
Simplified47.6%
Taylor expanded in Om around 0 47.1%
Final simplification47.1%
herbie shell --seed 2023308
(FPCore (t l Om Omc)
:name "Toniolo and Linder, Equation (2)"
:precision binary64
(asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))