
(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 10 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 (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(if (<= (/ t l) -1e+148)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 5e+120)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (pow (/ t l) 2.0))))))
(asin (* l (/ (sqrt (* t_1 0.5)) t)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 - ((Om / Omc) / (Omc / Om));
double tmp;
if ((t / l) <= -1e+148) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 5e+120) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * pow((t / l), 2.0))))));
} else {
tmp = asin((l * (sqrt((t_1 * 0.5)) / 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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((om / omc) / (omc / om))
if ((t / l) <= (-1d+148)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 5d+120) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
else
tmp = asin((l * (sqrt((t_1 * 0.5d0)) / t)))
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 = 1.0 - ((Om / Omc) / (Omc / Om));
double tmp;
if ((t / l) <= -1e+148) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 5e+120) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
} else {
tmp = Math.asin((l * (Math.sqrt((t_1 * 0.5)) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = 1.0 - ((Om / Omc) / (Omc / Om)) tmp = 0 if (t / l) <= -1e+148: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 5e+120: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * math.pow((t / l), 2.0)))))) else: tmp = math.asin((l * (math.sqrt((t_1 * 0.5)) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) tmp = 0.0 if (Float64(t / l) <= -1e+148) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 5e+120) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))); else tmp = asin(Float64(l * Float64(sqrt(Float64(t_1 * 0.5)) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = 1.0 - ((Om / Omc) / (Omc / Om)); tmp = 0.0; if ((t / l) <= -1e+148) tmp = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 5e+120) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); else tmp = asin((l * (sqrt((t_1 * 0.5)) / t))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+148], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+120], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[N[(t$95$1 * 0.5), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+148}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+120}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_1}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{t_1 \cdot 0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e148Initial program 46.9%
Taylor expanded in Om around 0 44.2%
unpow244.2%
unpow244.2%
Simplified44.2%
Taylor expanded in t around -inf 99.5%
*-commutative99.5%
*-un-lft-identity99.5%
times-frac99.6%
Applied egg-rr99.6%
if -1e148 < (/.f64 t l) < 5.00000000000000019e120Initial program 98.6%
unpow298.6%
clear-num98.6%
un-div-inv98.6%
Applied egg-rr98.6%
if 5.00000000000000019e120 < (/.f64 t l) Initial program 42.5%
Taylor expanded in t around inf 89.6%
*-commutative89.6%
unpow289.6%
unpow289.6%
times-frac99.5%
unpow299.5%
*-commutative99.5%
associate-/l*96.4%
Simplified96.4%
expm1-log1p-u96.4%
expm1-udef28.2%
associate-*r/28.2%
pow1/228.2%
pow1/228.2%
pow-prod-down28.2%
Applied egg-rr28.2%
expm1-def96.4%
expm1-log1p96.4%
associate-/r/99.5%
unpow1/299.5%
*-commutative99.5%
Simplified99.5%
unpow242.5%
clear-num42.5%
un-div-inv42.5%
Applied egg-rr99.5%
Final simplification98.9%
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 82.8%
sqrt-div82.7%
div-inv82.7%
add-sqr-sqrt82.7%
hypot-1-def82.7%
*-commutative82.7%
sqrt-prod82.7%
unpow282.7%
sqrt-prod57.5%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
unpow297.9%
times-frac86.1%
unpow286.1%
unpow286.1%
associate-*r/86.1%
*-rgt-identity86.1%
unpow286.1%
unpow286.1%
times-frac97.9%
unpow297.9%
Simplified97.9%
unpow282.8%
clear-num82.8%
un-div-inv82.8%
Applied egg-rr97.9%
Final simplification97.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+148)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 5e+120)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* l (/ (sqrt (* (- 1.0 (/ (/ Om Omc) (/ Omc Om))) 0.5)) t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+148) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 5e+120) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l * (sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) * 0.5)) / 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 = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 5d+120) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l * (sqrt(((1.0d0 - ((om / omc) / (omc / om))) * 0.5d0)) / 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.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 5e+120) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l * (Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) * 0.5)) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+148: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 5e+120: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l * (math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) * 0.5)) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+148) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 5e+120) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l * Float64(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) * 0.5)) / 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 = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 5e+120) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l * (sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) * 0.5)) / 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[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+120], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+148}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+120}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{\left(1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\right) \cdot 0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e148Initial program 46.9%
Taylor expanded in Om around 0 44.2%
unpow244.2%
unpow244.2%
Simplified44.2%
Taylor expanded in t around -inf 99.5%
*-commutative99.5%
*-un-lft-identity99.5%
times-frac99.6%
Applied egg-rr99.6%
if -1e148 < (/.f64 t l) < 5.00000000000000019e120Initial program 98.6%
Taylor expanded in Om around 0 71.2%
unpow271.2%
unpow271.2%
Simplified71.2%
times-frac98.0%
Applied egg-rr98.0%
if 5.00000000000000019e120 < (/.f64 t l) Initial program 42.5%
Taylor expanded in t around inf 89.6%
*-commutative89.6%
unpow289.6%
unpow289.6%
times-frac99.5%
unpow299.5%
*-commutative99.5%
associate-/l*96.4%
Simplified96.4%
expm1-log1p-u96.4%
expm1-udef28.2%
associate-*r/28.2%
pow1/228.2%
pow1/228.2%
pow-prod-down28.2%
Applied egg-rr28.2%
expm1-def96.4%
expm1-log1p96.4%
associate-/r/99.5%
unpow1/299.5%
*-commutative99.5%
Simplified99.5%
unpow242.5%
clear-num42.5%
un-div-inv42.5%
Applied egg-rr99.5%
Final simplification98.4%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+148)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 5e+120)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* l (/ (sqrt 0.5) t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+148) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 5e+120) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l * (sqrt(0.5) / 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 = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 5d+120) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l * (sqrt(0.5d0) / 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.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 5e+120) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+148: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 5e+120: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+148) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 5e+120) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / 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 = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 5e+120) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l * (sqrt(0.5) / 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[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+120], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+148}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+120}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e148Initial program 46.9%
Taylor expanded in Om around 0 44.2%
unpow244.2%
unpow244.2%
Simplified44.2%
Taylor expanded in t around -inf 99.5%
*-commutative99.5%
*-un-lft-identity99.5%
times-frac99.6%
Applied egg-rr99.6%
if -1e148 < (/.f64 t l) < 5.00000000000000019e120Initial program 98.6%
Taylor expanded in Om around 0 71.2%
unpow271.2%
unpow271.2%
Simplified71.2%
times-frac98.0%
Applied egg-rr98.0%
if 5.00000000000000019e120 < (/.f64 t l) Initial program 42.5%
Taylor expanded in Om around 0 33.0%
unpow233.0%
unpow233.0%
Simplified33.0%
Taylor expanded in t around inf 99.2%
*-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
Simplified99.2%
Final simplification98.4%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (asin (* l (/ (- (sqrt 0.5)) t)))))
(if (<= l -1.1e+59)
(asin 1.0)
(if (<= l -2.6e+15)
t_1
(if (<= l -8.8e-20)
(asin 1.0)
(if (<= l -1.4e-295)
t_1
(if (<= l 5.6e-37) (asin (* l (/ (sqrt 0.5) t))) (asin 1.0))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = asin((l * (-sqrt(0.5) / t)));
double tmp;
if (l <= -1.1e+59) {
tmp = asin(1.0);
} else if (l <= -2.6e+15) {
tmp = t_1;
} else if (l <= -8.8e-20) {
tmp = asin(1.0);
} else if (l <= -1.4e-295) {
tmp = t_1;
} else if (l <= 5.6e-37) {
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) :: t_1
real(8) :: tmp
t_1 = asin((l * (-sqrt(0.5d0) / t)))
if (l <= (-1.1d+59)) then
tmp = asin(1.0d0)
else if (l <= (-2.6d+15)) then
tmp = t_1
else if (l <= (-8.8d-20)) then
tmp = asin(1.0d0)
else if (l <= (-1.4d-295)) then
tmp = t_1
else if (l <= 5.6d-37) 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 t_1 = Math.asin((l * (-Math.sqrt(0.5) / t)));
double tmp;
if (l <= -1.1e+59) {
tmp = Math.asin(1.0);
} else if (l <= -2.6e+15) {
tmp = t_1;
} else if (l <= -8.8e-20) {
tmp = Math.asin(1.0);
} else if (l <= -1.4e-295) {
tmp = t_1;
} else if (l <= 5.6e-37) {
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): t_1 = math.asin((l * (-math.sqrt(0.5) / t))) tmp = 0 if l <= -1.1e+59: tmp = math.asin(1.0) elif l <= -2.6e+15: tmp = t_1 elif l <= -8.8e-20: tmp = math.asin(1.0) elif l <= -1.4e-295: tmp = t_1 elif l <= 5.6e-37: 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) t_1 = asin(Float64(l * Float64(Float64(-sqrt(0.5)) / t))) tmp = 0.0 if (l <= -1.1e+59) tmp = asin(1.0); elseif (l <= -2.6e+15) tmp = t_1; elseif (l <= -8.8e-20) tmp = asin(1.0); elseif (l <= -1.4e-295) tmp = t_1; elseif (l <= 5.6e-37) tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = asin((l * (-sqrt(0.5) / t))); tmp = 0.0; if (l <= -1.1e+59) tmp = asin(1.0); elseif (l <= -2.6e+15) tmp = t_1; elseif (l <= -8.8e-20) tmp = asin(1.0); elseif (l <= -1.4e-295) tmp = t_1; elseif (l <= 5.6e-37) 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_] := Block[{t$95$1 = N[ArcSin[N[(l * N[((-N[Sqrt[0.5], $MachinePrecision]) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.1e+59], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -2.6e+15], t$95$1, If[LessEqual[l, -8.8e-20], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -1.4e-295], t$95$1, If[LessEqual[l, 5.6e-37], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\ell \cdot \frac{-\sqrt{0.5}}{t}\right)\\
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{+59}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -2.6 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -8.8 \cdot 10^{-20}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -1.4 \cdot 10^{-295}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{-37}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.1e59 or -2.6e15 < l < -8.79999999999999964e-20 or 5.6000000000000002e-37 < l Initial program 94.6%
Taylor expanded in Om around 0 71.8%
unpow271.8%
unpow271.8%
Simplified71.8%
Taylor expanded in t around 0 77.1%
if -1.1e59 < l < -2.6e15 or -8.79999999999999964e-20 < l < -1.4e-295Initial program 72.2%
Taylor expanded in Om around 0 52.3%
unpow252.3%
unpow252.3%
Simplified52.3%
Taylor expanded in t around -inf 46.0%
mul-1-neg46.0%
*-commutative46.0%
associate-*l/46.0%
*-commutative46.0%
Simplified46.0%
if -1.4e-295 < l < 5.6000000000000002e-37Initial program 72.1%
Taylor expanded in Om around 0 52.5%
unpow252.5%
unpow252.4%
Simplified52.4%
Taylor expanded in t around inf 54.2%
*-commutative54.2%
associate-*l/54.3%
*-commutative54.3%
Simplified54.3%
Final simplification62.5%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -200.0)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 0.5)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (* l (/ (sqrt 0.5) t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -200.0) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 0.5) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((l * (sqrt(0.5) / 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) <= (-200.0d0)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 0.5d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((l * (sqrt(0.5d0) / 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) <= -200.0) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 0.5) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -200.0: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 0.5: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -200.0) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 0.5) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -200.0) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 0.5) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l * (sqrt(0.5) / 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], -200.0], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.5], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -200:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.5:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -200Initial program 66.1%
Taylor expanded in t around -inf 87.6%
mul-1-neg87.6%
*-commutative87.6%
distribute-rgt-neg-in87.6%
unpow287.6%
unpow287.6%
times-frac98.5%
unpow298.5%
*-commutative98.5%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in Om around 0 98.5%
associate-*r/98.5%
neg-mul-198.5%
distribute-lft-neg-in98.5%
Simplified98.5%
if -200 < (/.f64 t l) < 0.5Initial program 98.2%
Taylor expanded in Om around 0 82.8%
unpow282.8%
unpow282.8%
Simplified82.8%
Taylor expanded in t around 0 82.2%
mul-1-neg82.2%
unpow282.2%
unpow282.2%
times-frac96.7%
unpow296.7%
Simplified96.7%
if 0.5 < (/.f64 t l) Initial program 68.7%
Taylor expanded in Om around 0 36.9%
unpow236.9%
unpow236.9%
Simplified36.9%
Taylor expanded in t around inf 99.2%
*-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
Simplified99.2%
Final simplification97.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -200.0)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 0.5)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (* l (/ (sqrt 0.5) t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -200.0) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 0.5) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((l * (sqrt(0.5) / 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) <= (-200.0d0)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 0.5d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((l * (sqrt(0.5d0) / 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) <= -200.0) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 0.5) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -200.0: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 0.5: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -200.0) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 0.5) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -200.0) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 0.5) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l * (sqrt(0.5) / 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], -200.0], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.5], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -200:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.5:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -200Initial program 66.1%
Taylor expanded in Om around 0 45.8%
unpow245.8%
unpow245.8%
Simplified45.8%
Taylor expanded in t around -inf 98.5%
*-un-lft-identity98.5%
associate-/l*98.6%
Applied egg-rr98.6%
if -200 < (/.f64 t l) < 0.5Initial program 98.2%
Taylor expanded in Om around 0 82.8%
unpow282.8%
unpow282.8%
Simplified82.8%
Taylor expanded in t around 0 82.2%
mul-1-neg82.2%
unpow282.2%
unpow282.2%
times-frac96.7%
unpow296.7%
Simplified96.7%
if 0.5 < (/.f64 t l) Initial program 68.7%
Taylor expanded in Om around 0 36.9%
unpow236.9%
unpow236.9%
Simplified36.9%
Taylor expanded in t around inf 99.2%
*-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
Simplified99.2%
Final simplification97.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -200.0)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 0.5)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (* l (/ (sqrt 0.5) t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -200.0) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 0.5) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((l * (sqrt(0.5) / 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) <= (-200.0d0)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 0.5d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((l * (sqrt(0.5d0) / 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) <= -200.0) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 0.5) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -200.0: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 0.5: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -200.0) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 0.5) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -200.0) tmp = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 0.5) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l * (sqrt(0.5) / 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], -200.0], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.5], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -200:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.5:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -200Initial program 66.1%
Taylor expanded in Om around 0 45.8%
unpow245.8%
unpow245.8%
Simplified45.8%
Taylor expanded in t around -inf 98.5%
*-commutative98.5%
*-un-lft-identity98.5%
times-frac98.6%
Applied egg-rr98.6%
if -200 < (/.f64 t l) < 0.5Initial program 98.2%
Taylor expanded in Om around 0 82.8%
unpow282.8%
unpow282.8%
Simplified82.8%
Taylor expanded in t around 0 82.2%
mul-1-neg82.2%
unpow282.2%
unpow282.2%
times-frac96.7%
unpow296.7%
Simplified96.7%
if 0.5 < (/.f64 t l) Initial program 68.7%
Taylor expanded in Om around 0 36.9%
unpow236.9%
unpow236.9%
Simplified36.9%
Taylor expanded in t around inf 99.2%
*-commutative99.2%
associate-*l/99.2%
*-commutative99.2%
Simplified99.2%
Final simplification97.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= l -1.4e-211) (asin 1.0) (if (<= l 7e-37) (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.4e-211) {
tmp = asin(1.0);
} else if (l <= 7e-37) {
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.4d-211)) then
tmp = asin(1.0d0)
else if (l <= 7d-37) 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.4e-211) {
tmp = Math.asin(1.0);
} else if (l <= 7e-37) {
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.4e-211: tmp = math.asin(1.0) elif l <= 7e-37: 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.4e-211) tmp = asin(1.0); elseif (l <= 7e-37) tmp = asin(Float64(l * Float64(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.4e-211) tmp = asin(1.0); elseif (l <= 7e-37) 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.4e-211], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 7e-37], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{-211}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 7 \cdot 10^{-37}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.3999999999999999e-211 or 7.0000000000000003e-37 < l Initial program 85.9%
Taylor expanded in Om around 0 66.2%
unpow266.2%
unpow266.2%
Simplified66.2%
Taylor expanded in t around 0 62.0%
if -1.3999999999999999e-211 < l < 7.0000000000000003e-37Initial program 75.4%
Taylor expanded in Om around 0 50.9%
unpow250.9%
unpow250.8%
Simplified50.8%
Taylor expanded in t around inf 60.9%
*-commutative60.9%
associate-*l/61.0%
*-commutative61.0%
Simplified61.0%
Final simplification61.7%
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 82.8%
Taylor expanded in Om around 0 61.6%
unpow261.6%
unpow261.6%
Simplified61.6%
Taylor expanded in t around 0 50.3%
Final simplification50.3%
herbie shell --seed 2023275
(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)))))))