
(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 12 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 (pow (/ Om Omc) 2.0))))
(if (<= (/ t l) -1e+118)
(asin (/ (- (/ l t)) (sqrt 2.0)))
(if (<= (/ t l) 2e+99)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (* (sqrt t_1) (/ l (* t (sqrt 2.0)))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 - pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -1e+118) {
tmp = asin((-(l / t) / sqrt(2.0)));
} else if ((t / l) <= 2e+99) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin((sqrt(t_1) * (l / (t * sqrt(2.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 = 1.0d0 - ((om / omc) ** 2.0d0)
if ((t / l) <= (-1d+118)) then
tmp = asin((-(l / t) / sqrt(2.0d0)))
else if ((t / l) <= 2d+99) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin((sqrt(t_1) * (l / (t * sqrt(2.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 = 1.0 - Math.pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -1e+118) {
tmp = Math.asin((-(l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 2e+99) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin((Math.sqrt(t_1) * (l / (t * Math.sqrt(2.0)))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = 1.0 - math.pow((Om / Omc), 2.0) tmp = 0 if (t / l) <= -1e+118: tmp = math.asin((-(l / t) / math.sqrt(2.0))) elif (t / l) <= 2e+99: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin((math.sqrt(t_1) * (l / (t * math.sqrt(2.0))))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) tmp = 0.0 if (Float64(t / l) <= -1e+118) tmp = asin(Float64(Float64(-Float64(l / t)) / sqrt(2.0))); elseif (Float64(t / l) <= 2e+99) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); else tmp = asin(Float64(sqrt(t_1) * Float64(l / Float64(t * sqrt(2.0))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = 1.0 - ((Om / Omc) ^ 2.0); tmp = 0.0; if ((t / l) <= -1e+118) tmp = asin((-(l / t) / sqrt(2.0))); elseif ((t / l) <= 2e+99) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin((sqrt(t_1) * (l / (t * sqrt(2.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[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+118], N[ArcSin[N[((-N[(l / t), $MachinePrecision]) / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+99], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[t$95$1], $MachinePrecision] * N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+118}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\frac{\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+99}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{t_1} \cdot \frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999967e117Initial program 48.7%
sqrt-div48.7%
div-inv48.7%
add-sqr-sqrt48.7%
hypot-1-def48.7%
*-commutative48.7%
sqrt-prod48.7%
unpow248.7%
sqrt-prod0.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
associate-*r/99.5%
*-rgt-identity99.5%
associate-*l/99.4%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in Om around 0 39.6%
associate-/l*39.6%
unpow239.6%
unpow239.6%
Simplified39.6%
Taylor expanded in t around -inf 99.2%
associate-*r/99.2%
*-commutative99.2%
associate-/r*99.2%
mul-1-neg99.2%
Simplified99.2%
if -9.99999999999999967e117 < (/.f64 t l) < 1.9999999999999999e99Initial program 98.0%
unpow298.0%
clear-num98.0%
un-div-inv98.0%
Applied egg-rr98.0%
if 1.9999999999999999e99 < (/.f64 t l) Initial program 47.6%
sqrt-div47.6%
div-inv47.6%
add-sqr-sqrt47.6%
hypot-1-def47.6%
*-commutative47.6%
sqrt-prod47.6%
unpow247.6%
sqrt-prod97.3%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
associate-*r/97.5%
*-rgt-identity97.5%
associate-*l/97.5%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in t around inf 90.0%
*-commutative90.0%
unpow290.0%
unpow290.0%
times-frac99.5%
unpow299.5%
Simplified99.5%
Final simplification98.6%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (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 - pow((Om / Omc), 2.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((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / 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 - math.pow((Om / Omc), 2.0))) / 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(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(t / Float64(l / sqrt(2.0)))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.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[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(t / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\frac{\ell}{\sqrt{2}}}\right)}\right)
\end{array}
Initial program 77.5%
sqrt-div77.5%
div-inv77.5%
add-sqr-sqrt77.5%
hypot-1-def77.5%
*-commutative77.5%
sqrt-prod77.5%
unpow277.5%
sqrt-prod50.9%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
associate-*l/98.1%
associate-/l*98.2%
Simplified98.2%
Final simplification98.2%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (pow (/ Om Omc) 2.0))))
(if (<= (/ t l) -1e+118)
(asin (/ (- (/ l t)) (sqrt 2.0)))
(if (<= (/ t l) 2e+147)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (* (sqrt t_1) (* l (/ (sqrt 0.5) t))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 - pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -1e+118) {
tmp = asin((-(l / t) / sqrt(2.0)));
} else if ((t / l) <= 2e+147) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin((sqrt(t_1) * (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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((om / omc) ** 2.0d0)
if ((t / l) <= (-1d+118)) then
tmp = asin((-(l / t) / sqrt(2.0d0)))
else if ((t / l) <= 2d+147) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin((sqrt(t_1) * (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 t_1 = 1.0 - Math.pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -1e+118) {
tmp = Math.asin((-(l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 2e+147) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin((Math.sqrt(t_1) * (l * (Math.sqrt(0.5) / t))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = 1.0 - math.pow((Om / Omc), 2.0) tmp = 0 if (t / l) <= -1e+118: tmp = math.asin((-(l / t) / math.sqrt(2.0))) elif (t / l) <= 2e+147: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin((math.sqrt(t_1) * (l * (math.sqrt(0.5) / t)))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) tmp = 0.0 if (Float64(t / l) <= -1e+118) tmp = asin(Float64(Float64(-Float64(l / t)) / sqrt(2.0))); elseif (Float64(t / l) <= 2e+147) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); else tmp = asin(Float64(sqrt(t_1) * Float64(l * Float64(sqrt(0.5) / t)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = 1.0 - ((Om / Omc) ^ 2.0); tmp = 0.0; if ((t / l) <= -1e+118) tmp = asin((-(l / t) / sqrt(2.0))); elseif ((t / l) <= 2e+147) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin((sqrt(t_1) * (l * (sqrt(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[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+118], N[ArcSin[N[((-N[(l / t), $MachinePrecision]) / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+147], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[t$95$1], $MachinePrecision] * N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+118}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\frac{\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+147}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_1}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{t_1} \cdot \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999967e117Initial program 48.7%
sqrt-div48.7%
div-inv48.7%
add-sqr-sqrt48.7%
hypot-1-def48.7%
*-commutative48.7%
sqrt-prod48.7%
unpow248.7%
sqrt-prod0.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
associate-*r/99.5%
*-rgt-identity99.5%
associate-*l/99.4%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in Om around 0 39.6%
associate-/l*39.6%
unpow239.6%
unpow239.6%
Simplified39.6%
Taylor expanded in t around -inf 99.2%
associate-*r/99.2%
*-commutative99.2%
associate-/r*99.2%
mul-1-neg99.2%
Simplified99.2%
if -9.99999999999999967e117 < (/.f64 t l) < 2e147Initial program 98.1%
unpow298.1%
clear-num98.1%
un-div-inv98.1%
Applied egg-rr98.1%
if 2e147 < (/.f64 t l) Initial program 35.2%
unpow235.2%
Applied egg-rr35.2%
Taylor expanded in t around inf 87.8%
associate-*l/87.6%
*-commutative87.6%
unpow287.6%
unpow287.6%
times-frac99.5%
unpow299.5%
*-commutative99.5%
Simplified99.5%
Final simplification98.5%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+118)
(asin (/ (- (/ l t)) (sqrt 2.0)))
(if (<= (/ t l) 1e+99)
(asin
(sqrt
(/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (* (/ 1.0 t) (/ (sqrt 0.5) (/ 1.0 l)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+118) {
tmp = asin((-(l / t) / sqrt(2.0)));
} else if ((t / l) <= 1e+99) {
tmp = asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin(((1.0 / t) * (sqrt(0.5) / (1.0 / l))));
}
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+118)) then
tmp = asin((-(l / t) / sqrt(2.0d0)))
else if ((t / l) <= 1d+99) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin(((1.0d0 / t) * (sqrt(0.5d0) / (1.0d0 / l))))
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+118) {
tmp = Math.asin((-(l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 1e+99) {
tmp = Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin(((1.0 / t) * (Math.sqrt(0.5) / (1.0 / l))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+118: tmp = math.asin((-(l / t) / math.sqrt(2.0))) elif (t / l) <= 1e+99: tmp = math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin(((1.0 / t) * (math.sqrt(0.5) / (1.0 / l)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+118) tmp = asin(Float64(Float64(-Float64(l / t)) / sqrt(2.0))); elseif (Float64(t / l) <= 1e+99) tmp = asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); else tmp = asin(Float64(Float64(1.0 / t) * Float64(sqrt(0.5) / Float64(1.0 / l)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+118) tmp = asin((-(l / t) / sqrt(2.0))); elseif ((t / l) <= 1e+99) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin(((1.0 / t) * (sqrt(0.5) / (1.0 / l)))); 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+118], N[ArcSin[N[((-N[(l / t), $MachinePrecision]) / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+99], 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[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 / t), $MachinePrecision] * N[(N[Sqrt[0.5], $MachinePrecision] / N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+118}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\frac{\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+99}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{t} \cdot \frac{\sqrt{0.5}}{\frac{1}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999967e117Initial program 48.7%
sqrt-div48.7%
div-inv48.7%
add-sqr-sqrt48.7%
hypot-1-def48.7%
*-commutative48.7%
sqrt-prod48.7%
unpow248.7%
sqrt-prod0.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
associate-*r/99.5%
*-rgt-identity99.5%
associate-*l/99.4%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in Om around 0 39.6%
associate-/l*39.6%
unpow239.6%
unpow239.6%
Simplified39.6%
Taylor expanded in t around -inf 99.2%
associate-*r/99.2%
*-commutative99.2%
associate-/r*99.2%
mul-1-neg99.2%
Simplified99.2%
if -9.99999999999999967e117 < (/.f64 t l) < 9.9999999999999997e98Initial program 98.0%
unpow298.0%
clear-num98.0%
un-div-inv98.0%
Applied egg-rr98.0%
if 9.9999999999999997e98 < (/.f64 t l) Initial program 48.5%
Taylor expanded in t around inf 33.3%
associate-/l*33.3%
unpow233.3%
unpow233.3%
unpow233.3%
unpow233.3%
Simplified33.3%
Taylor expanded in Om around 0 99.5%
associate-/l*97.4%
Simplified97.4%
*-un-lft-identity97.4%
div-inv97.2%
times-frac99.5%
Applied egg-rr99.5%
Final simplification98.6%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+118)
(asin (/ (- (/ l t)) (sqrt 2.0)))
(if (<= (/ t l) 1e+99)
(asin
(sqrt
(/
(- 1.0 (/ Om (* Omc (/ Omc Om))))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* (/ 1.0 t) (/ (sqrt 0.5) (/ 1.0 l)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+118) {
tmp = asin((-(l / t) / sqrt(2.0)));
} else if ((t / l) <= 1e+99) {
tmp = asin(sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin(((1.0 / t) * (sqrt(0.5) / (1.0 / l))));
}
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+118)) then
tmp = asin((-(l / t) / sqrt(2.0d0)))
else if ((t / l) <= 1d+99) then
tmp = asin(sqrt(((1.0d0 - (om / (omc * (omc / om)))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin(((1.0d0 / t) * (sqrt(0.5d0) / (1.0d0 / l))))
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+118) {
tmp = Math.asin((-(l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 1e+99) {
tmp = Math.asin(Math.sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin(((1.0 / t) * (Math.sqrt(0.5) / (1.0 / l))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+118: tmp = math.asin((-(l / t) / math.sqrt(2.0))) elif (t / l) <= 1e+99: tmp = math.asin(math.sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin(((1.0 / t) * (math.sqrt(0.5) / (1.0 / l)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+118) tmp = asin(Float64(Float64(-Float64(l / t)) / sqrt(2.0))); elseif (Float64(t / l) <= 1e+99) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Om / Float64(Omc * Float64(Omc / Om)))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(Float64(1.0 / t) * Float64(sqrt(0.5) / Float64(1.0 / l)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+118) tmp = asin((-(l / t) / sqrt(2.0))); elseif ((t / l) <= 1e+99) tmp = asin(sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin(((1.0 / t) * (sqrt(0.5) / (1.0 / l)))); 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+118], N[ArcSin[N[((-N[(l / t), $MachinePrecision]) / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+99], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $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[(1.0 / t), $MachinePrecision] * N[(N[Sqrt[0.5], $MachinePrecision] / N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+118}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\frac{\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+99}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{t} \cdot \frac{\sqrt{0.5}}{\frac{1}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999967e117Initial program 48.7%
sqrt-div48.7%
div-inv48.7%
add-sqr-sqrt48.7%
hypot-1-def48.7%
*-commutative48.7%
sqrt-prod48.7%
unpow248.7%
sqrt-prod0.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
associate-*r/99.5%
*-rgt-identity99.5%
associate-*l/99.4%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in Om around 0 39.6%
associate-/l*39.6%
unpow239.6%
unpow239.6%
Simplified39.6%
Taylor expanded in t around -inf 99.2%
associate-*r/99.2%
*-commutative99.2%
associate-/r*99.2%
mul-1-neg99.2%
Simplified99.2%
if -9.99999999999999967e117 < (/.f64 t l) < 9.9999999999999997e98Initial program 98.0%
unpow298.0%
Applied egg-rr98.0%
unpow298.0%
clear-num98.0%
frac-times98.0%
*-un-lft-identity98.0%
Applied egg-rr98.0%
if 9.9999999999999997e98 < (/.f64 t l) Initial program 48.5%
Taylor expanded in t around inf 33.3%
associate-/l*33.3%
unpow233.3%
unpow233.3%
unpow233.3%
unpow233.3%
Simplified33.3%
Taylor expanded in Om around 0 99.5%
associate-/l*97.4%
Simplified97.4%
*-un-lft-identity97.4%
div-inv97.2%
times-frac99.5%
Applied egg-rr99.5%
Final simplification98.5%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1000.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 0.0002)
(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) <= -1000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.0002) {
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) <= (-1000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.0002d0) 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) <= -1000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.0002) {
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) <= -1000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.0002: 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) <= -1000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.0002) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l * 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) <= -1000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.0002) 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], -1000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e3Initial program 65.0%
sqrt-div65.0%
div-inv65.0%
add-sqr-sqrt65.0%
hypot-1-def65.0%
*-commutative65.0%
sqrt-prod64.9%
unpow264.9%
sqrt-prod0.0%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
associate-*r/99.3%
*-rgt-identity99.3%
associate-*l/99.3%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in Om around 0 43.6%
associate-/l*43.6%
unpow243.6%
unpow243.6%
Simplified43.6%
Taylor expanded in t around -inf 98.2%
mul-1-neg98.2%
*-commutative98.2%
Simplified98.2%
if -1e3 < (/.f64 t l) < 2.0000000000000001e-4Initial program 97.4%
sqrt-div97.4%
div-inv97.4%
add-sqr-sqrt97.4%
hypot-1-def97.4%
*-commutative97.4%
sqrt-prod97.4%
unpow297.4%
sqrt-prod58.1%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate-*r/97.4%
*-rgt-identity97.4%
associate-*l/97.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in Om around 0 87.2%
associate-/l*87.2%
unpow287.2%
unpow287.2%
Simplified87.2%
Taylor expanded in l around inf 87.1%
associate-*r/87.1%
associate-*r*87.1%
unpow287.1%
rem-square-sqrt87.1%
metadata-eval87.1%
associate-*r/87.1%
mul-1-neg87.1%
unpow287.1%
unpow287.1%
times-frac96.3%
unpow296.3%
Simplified96.3%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 59.8%
Taylor expanded in t around inf 35.3%
associate-/l*35.3%
unpow235.3%
unpow235.3%
unpow235.3%
unpow235.3%
Simplified35.3%
Taylor expanded in Om around 0 99.4%
Final simplification97.7%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -1e+213) (asin (/ (sqrt 0.5) (/ t l))) (if (<= (/ t l) 0.0002) (asin 1.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) <= -1e+213) {
tmp = asin((sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.0002) {
tmp = asin(1.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) <= (-1d+213)) then
tmp = asin((sqrt(0.5d0) / (t / l)))
else if ((t / l) <= 0.0002d0) then
tmp = asin(1.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) <= -1e+213) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin(1.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) <= -1e+213: tmp = math.asin((math.sqrt(0.5) / (t / l))) elif (t / l) <= 0.0002: tmp = math.asin(1.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) <= -1e+213) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); elseif (Float64(t / l) <= 0.0002) tmp = asin(1.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) <= -1e+213) tmp = asin((sqrt(0.5) / (t / l))); elseif ((t / l) <= 0.0002) tmp = asin(1.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], -1e+213], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[1.0], $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^{+213}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999984e212Initial program 47.8%
Taylor expanded in t around inf 41.2%
associate-/l*41.2%
unpow241.2%
unpow241.2%
unpow241.2%
unpow241.2%
Simplified41.2%
Taylor expanded in Om around 0 47.0%
associate-/l*47.0%
Simplified47.0%
if -9.99999999999999984e212 < (/.f64 t l) < 2.0000000000000001e-4Initial program 91.4%
sqrt-div91.3%
div-inv91.3%
add-sqr-sqrt91.3%
hypot-1-def91.3%
*-commutative91.3%
sqrt-prod91.3%
unpow291.3%
sqrt-prod40.9%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
associate-*l/97.9%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in Om around 0 73.5%
associate-/l*73.5%
unpow273.5%
unpow273.5%
Simplified73.5%
Taylor expanded in l around inf 69.0%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 59.8%
Taylor expanded in t around inf 35.3%
associate-/l*35.3%
unpow235.3%
unpow235.3%
unpow235.3%
unpow235.3%
Simplified35.3%
Taylor expanded in Om around 0 99.4%
associate-/l*97.8%
Simplified97.8%
associate-/r/99.3%
Applied egg-rr99.3%
Final simplification74.3%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -1e+213) (asin (/ (sqrt 0.5) (/ t l))) (if (<= (/ t l) 0.0002) (asin 1.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) <= -1e+213) {
tmp = asin((sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.0002) {
tmp = asin(1.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) <= (-1d+213)) then
tmp = asin((sqrt(0.5d0) / (t / l)))
else if ((t / l) <= 0.0002d0) then
tmp = asin(1.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) <= -1e+213) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin(1.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) <= -1e+213: tmp = math.asin((math.sqrt(0.5) / (t / l))) elif (t / l) <= 0.0002: tmp = math.asin(1.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) <= -1e+213) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); elseif (Float64(t / l) <= 0.0002) tmp = asin(1.0); else tmp = asin(Float64(Float64(l * 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+213) tmp = asin((sqrt(0.5) / (t / l))); elseif ((t / l) <= 0.0002) tmp = asin(1.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], -1e+213], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+213}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999984e212Initial program 47.8%
Taylor expanded in t around inf 41.2%
associate-/l*41.2%
unpow241.2%
unpow241.2%
unpow241.2%
unpow241.2%
Simplified41.2%
Taylor expanded in Om around 0 47.0%
associate-/l*47.0%
Simplified47.0%
if -9.99999999999999984e212 < (/.f64 t l) < 2.0000000000000001e-4Initial program 91.4%
sqrt-div91.3%
div-inv91.3%
add-sqr-sqrt91.3%
hypot-1-def91.3%
*-commutative91.3%
sqrt-prod91.3%
unpow291.3%
sqrt-prod40.9%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
associate-*l/97.9%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in Om around 0 73.5%
associate-/l*73.5%
unpow273.5%
unpow273.5%
Simplified73.5%
Taylor expanded in l around inf 69.0%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 59.8%
Taylor expanded in t around inf 35.3%
associate-/l*35.3%
unpow235.3%
unpow235.3%
unpow235.3%
unpow235.3%
Simplified35.3%
Taylor expanded in Om around 0 99.4%
Final simplification74.3%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -1000.0) (asin (/ (- l) (* t (sqrt 2.0)))) (if (<= (/ t l) 0.0002) (asin 1.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) <= -1000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.0002) {
tmp = asin(1.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) <= (-1000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.0002d0) then
tmp = asin(1.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) <= -1000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin(1.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) <= -1000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.0002: tmp = math.asin(1.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) <= -1000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.0002) tmp = asin(1.0); else tmp = asin(Float64(Float64(l * 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) <= -1000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.0002) tmp = asin(1.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], -1000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e3Initial program 65.0%
sqrt-div65.0%
div-inv65.0%
add-sqr-sqrt65.0%
hypot-1-def65.0%
*-commutative65.0%
sqrt-prod64.9%
unpow264.9%
sqrt-prod0.0%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
associate-*r/99.3%
*-rgt-identity99.3%
associate-*l/99.3%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in Om around 0 43.6%
associate-/l*43.6%
unpow243.6%
unpow243.6%
Simplified43.6%
Taylor expanded in t around -inf 98.2%
mul-1-neg98.2%
*-commutative98.2%
Simplified98.2%
if -1e3 < (/.f64 t l) < 2.0000000000000001e-4Initial program 97.4%
sqrt-div97.4%
div-inv97.4%
add-sqr-sqrt97.4%
hypot-1-def97.4%
*-commutative97.4%
sqrt-prod97.4%
unpow297.4%
sqrt-prod58.1%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate-*r/97.4%
*-rgt-identity97.4%
associate-*l/97.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in Om around 0 87.2%
associate-/l*87.2%
unpow287.2%
unpow287.2%
Simplified87.2%
Taylor expanded in l around inf 95.3%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 59.8%
Taylor expanded in t around inf 35.3%
associate-/l*35.3%
unpow235.3%
unpow235.3%
unpow235.3%
unpow235.3%
Simplified35.3%
Taylor expanded in Om around 0 99.4%
Final simplification97.2%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= l -1.15e-158) (asin 1.0) (if (<= l 1300000000000.0) (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 <= -1.15e-158) {
tmp = asin(1.0);
} else if (l <= 1300000000000.0) {
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 <= (-1.15d-158)) then
tmp = asin(1.0d0)
else if (l <= 1300000000000.0d0) 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 <= -1.15e-158) {
tmp = Math.asin(1.0);
} else if (l <= 1300000000000.0) {
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 <= -1.15e-158: tmp = math.asin(1.0) elif l <= 1300000000000.0: 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 <= -1.15e-158) tmp = asin(1.0); elseif (l <= 1300000000000.0) tmp = asin(Float64(Float64(l / 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 <= -1.15e-158) tmp = asin(1.0); elseif (l <= 1300000000000.0) 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, -1.15e-158], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 1300000000000.0], N[ArcSin[N[(N[(l / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{-158}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 1300000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.1499999999999999e-158 or 1.3e12 < l Initial program 83.6%
sqrt-div83.6%
div-inv83.6%
add-sqr-sqrt83.6%
hypot-1-def83.6%
*-commutative83.6%
sqrt-prod83.6%
unpow283.6%
sqrt-prod52.7%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
associate-*l/98.1%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in Om around 0 71.2%
associate-/l*71.2%
unpow271.2%
unpow271.2%
Simplified71.2%
Taylor expanded in l around inf 66.3%
if -1.1499999999999999e-158 < l < 1.3e12Initial program 70.2%
Taylor expanded in t around inf 36.6%
associate-/l*36.6%
unpow236.6%
unpow236.6%
unpow236.6%
unpow236.6%
Simplified36.6%
Taylor expanded in Om around 0 58.5%
associate-/l*57.5%
Simplified57.5%
Taylor expanded in t around 0 58.5%
*-lft-identity58.5%
times-frac58.5%
/-rgt-identity58.5%
Simplified58.5%
Final simplification62.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= l -1.22e-155) (asin 1.0) (if (<= l 1500000000000.0) (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.22e-155) {
tmp = asin(1.0);
} else if (l <= 1500000000000.0) {
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.22d-155)) then
tmp = asin(1.0d0)
else if (l <= 1500000000000.0d0) 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.22e-155) {
tmp = Math.asin(1.0);
} else if (l <= 1500000000000.0) {
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.22e-155: tmp = math.asin(1.0) elif l <= 1500000000000.0: 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.22e-155) tmp = asin(1.0); elseif (l <= 1500000000000.0) 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.22e-155) tmp = asin(1.0); elseif (l <= 1500000000000.0) 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.22e-155], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 1500000000000.0], 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.22 \cdot 10^{-155}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 1500000000000:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.22000000000000001e-155 or 1.5e12 < l Initial program 83.6%
sqrt-div83.6%
div-inv83.6%
add-sqr-sqrt83.6%
hypot-1-def83.6%
*-commutative83.6%
sqrt-prod83.6%
unpow283.6%
sqrt-prod52.7%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
associate-*l/98.1%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in Om around 0 71.2%
associate-/l*71.2%
unpow271.2%
unpow271.2%
Simplified71.2%
Taylor expanded in l around inf 66.3%
if -1.22000000000000001e-155 < l < 1.5e12Initial program 70.2%
Taylor expanded in t around inf 36.6%
associate-/l*36.6%
unpow236.6%
unpow236.6%
unpow236.6%
unpow236.6%
Simplified36.6%
Taylor expanded in Om around 0 58.5%
associate-/l*57.5%
Simplified57.5%
associate-/r/58.5%
Applied egg-rr58.5%
Final simplification62.8%
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 77.5%
sqrt-div77.5%
div-inv77.5%
add-sqr-sqrt77.5%
hypot-1-def77.5%
*-commutative77.5%
sqrt-prod77.5%
unpow277.5%
sqrt-prod50.9%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
associate-*l/98.1%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in Om around 0 60.6%
associate-/l*60.6%
unpow260.6%
unpow260.6%
Simplified60.6%
Taylor expanded in l around inf 43.7%
Final simplification43.7%
herbie shell --seed 2023264
(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)))))))