
(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
(if (<= (/ t l) -1e+117)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 2e+124)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (/ l (* t (sqrt 2.0)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+117) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 2e+124) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = asin((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) :: tmp
if ((t / l) <= (-1d+117)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 2d+124) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
else
tmp = asin((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 tmp;
if ((t / l) <= -1e+117) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 2e+124) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+117: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 2e+124: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t))))))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+117) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 2e+124) 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(l / t))))))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+117) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 2e+124) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t))))))); else tmp = asin((l / (t * sqrt(2.0)))); 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+117], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+124], 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[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+117}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+124}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.00000000000000005e117Initial program 46.7%
Taylor expanded in t around -inf 88.3%
associate-*r*88.3%
*-commutative88.3%
unpow288.3%
unpow288.3%
times-frac99.4%
unpow299.4%
associate-/l*99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
if -1.00000000000000005e117 < (/.f64 t l) < 1.9999999999999999e124Initial program 98.5%
unpow298.5%
div-inv98.5%
associate-*l*94.7%
Applied egg-rr94.7%
unpow294.7%
clear-num94.7%
un-div-inv94.7%
Applied egg-rr94.7%
associate-*r*98.5%
div-inv98.5%
clear-num98.5%
un-div-inv98.5%
Applied egg-rr98.5%
if 1.9999999999999999e124 < (/.f64 t l) Initial program 50.1%
sqrt-div50.1%
div-inv50.1%
add-sqr-sqrt50.1%
hypot-1-def50.1%
*-commutative50.1%
sqrt-prod50.1%
unpow250.1%
sqrt-prod97.9%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in Om around 0 98.0%
Taylor expanded in t around inf 99.7%
Final simplification98.8%
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 (sqrt 2.0)) l)))))
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 * sqrt(2.0)) / l))));
}
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 * Math.sqrt(2.0)) / l))));
}
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 * math.sqrt(2.0)) / l))))
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(Float64(t * sqrt(2.0)) / l)))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l)))); 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[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 83.9%
sqrt-div83.9%
div-inv83.9%
add-sqr-sqrt83.9%
hypot-1-def83.9%
*-commutative83.9%
sqrt-prod83.8%
unpow283.8%
sqrt-prod52.7%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
associate-*r/98.2%
*-rgt-identity98.2%
associate-*l/98.3%
Simplified98.3%
Final simplification98.3%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (let* ((t_1 (pow (/ t l) 2.0))) (if (<= t_1 0.001) (asin (- 1.0 t_1)) (asin (/ l (* t (sqrt 2.0)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = pow((t / l), 2.0);
double tmp;
if (t_1 <= 0.001) {
tmp = asin((1.0 - t_1));
} else {
tmp = asin((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 = (t / l) ** 2.0d0
if (t_1 <= 0.001d0) then
tmp = asin((1.0d0 - t_1))
else
tmp = asin((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 = Math.pow((t / l), 2.0);
double tmp;
if (t_1 <= 0.001) {
tmp = Math.asin((1.0 - t_1));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.pow((t / l), 2.0) tmp = 0 if t_1 <= 0.001: tmp = math.asin((1.0 - t_1)) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(t / l) ^ 2.0 tmp = 0.0 if (t_1 <= 0.001) tmp = asin(Float64(1.0 - t_1)); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = (t / l) ^ 2.0; tmp = 0.0; if (t_1 <= 0.001) tmp = asin((1.0 - t_1)); else tmp = asin((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[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, 0.001], N[ArcSin[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{t}{\ell}\right)}^{2}\\
\mathbf{if}\;t_1 \leq 0.001:\\
\;\;\;\;\sin^{-1} \left(1 - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (pow.f64 (/.f64 t l) 2) < 1e-3Initial program 98.0%
sqrt-div98.0%
div-inv98.0%
add-sqr-sqrt98.0%
hypot-1-def98.0%
*-commutative98.0%
sqrt-prod98.0%
unpow298.0%
sqrt-prod55.6%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in Om around 0 96.7%
expm1-log1p-u96.7%
expm1-udef96.7%
associate-/l*96.7%
Applied egg-rr96.7%
expm1-def96.7%
expm1-log1p96.7%
associate-/r/96.7%
*-commutative96.7%
associate-*r/96.7%
*-commutative96.7%
associate-*r/96.7%
Simplified96.7%
Taylor expanded in t around 0 87.0%
associate-*r/87.0%
*-commutative87.0%
unpow287.0%
rem-square-sqrt87.0%
associate-*r*87.0%
metadata-eval87.0%
associate-*r/87.0%
mul-1-neg87.0%
unsub-neg87.0%
unpow287.0%
unpow287.0%
times-frac96.1%
unpow296.1%
Simplified96.1%
if 1e-3 < (pow.f64 (/.f64 t l) 2) Initial program 71.1%
sqrt-div71.1%
div-inv71.1%
add-sqr-sqrt71.1%
hypot-1-def71.1%
*-commutative71.1%
sqrt-prod70.9%
unpow270.9%
sqrt-prod50.0%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around inf 61.6%
Final simplification78.0%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* t (/ (sqrt 2.0) l))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, (t * (sqrt(2.0) / l)))));
}
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 * (Math.sqrt(2.0) / l)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, (t * (math.sqrt(2.0) / l)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(t * Float64(sqrt(2.0) / l))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, (t * (sqrt(2.0) / l))))); 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[(t * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{\sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 83.9%
sqrt-div83.9%
div-inv83.9%
add-sqr-sqrt83.9%
hypot-1-def83.9%
*-commutative83.9%
sqrt-prod83.8%
unpow283.8%
sqrt-prod52.7%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
associate-*r/98.2%
*-rgt-identity98.2%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in Om around 0 97.4%
expm1-log1p-u70.6%
expm1-udef70.6%
associate-/l*70.6%
Applied egg-rr70.6%
expm1-def70.6%
expm1-log1p97.4%
associate-/r/97.4%
*-commutative97.4%
associate-*r/97.4%
*-commutative97.4%
associate-*r/97.4%
Simplified97.4%
Final simplification97.4%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (/ (* t (sqrt 2.0)) l)))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
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 * Math.sqrt(2.0)) / l))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t * math.sqrt(2.0)) / l))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l)))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l)))); 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 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 83.9%
sqrt-div83.9%
div-inv83.9%
add-sqr-sqrt83.9%
hypot-1-def83.9%
*-commutative83.9%
sqrt-prod83.8%
unpow283.8%
sqrt-prod52.7%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
associate-*r/98.2%
*-rgt-identity98.2%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in Om around 0 97.4%
Final simplification97.4%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+53)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 2e+36)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* t (/ (/ t l) l)))))))
(asin (/ l (* t (sqrt 2.0)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+53) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 2e+36) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t * ((t / l) / l)))))));
} else {
tmp = asin((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) :: tmp
if ((t / l) <= (-1d+53)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 2d+36) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * (t * ((t / l) / l)))))))
else
tmp = asin((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 tmp;
if ((t / l) <= -1e+53) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 2e+36) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t * ((t / l) / l)))))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+53: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 2e+36: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t * ((t / l) / l))))))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+53) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 2e+36) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(t * Float64(Float64(t / l) / l))))))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+53) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 2e+36) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t * ((t / l) / l))))))); else tmp = asin((l / (t * sqrt(2.0)))); 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+53], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+36], 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[(t * N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+53}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+36}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(t \cdot \frac{\frac{t}{\ell}}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.9999999999999999e52Initial program 59.3%
Taylor expanded in t around -inf 89.2%
associate-*r*89.2%
*-commutative89.2%
unpow289.2%
unpow289.2%
times-frac99.3%
unpow299.3%
associate-/l*99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
if -9.9999999999999999e52 < (/.f64 t l) < 2.00000000000000008e36Initial program 98.1%
unpow298.1%
div-inv98.1%
associate-*l*98.1%
Applied egg-rr98.1%
unpow298.1%
clear-num98.1%
un-div-inv98.1%
Applied egg-rr98.1%
associate-*l/98.1%
*-un-lft-identity98.1%
Applied egg-rr98.1%
if 2.00000000000000008e36 < (/.f64 t l) Initial program 75.3%
sqrt-div75.3%
div-inv75.3%
add-sqr-sqrt75.3%
hypot-1-def75.3%
*-commutative75.3%
sqrt-prod75.1%
unpow275.1%
sqrt-prod98.4%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in Om around 0 97.8%
Taylor expanded in t around inf 98.7%
Final simplification98.6%
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.002)
(asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(asin (/ l (* t (sqrt 2.0)))))))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.002) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((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) :: tmp
if ((t / l) <= (-200.0d0)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 0.002d0) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((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 tmp;
if ((t / l) <= -200.0) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 0.002) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
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.002: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) 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.002) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); 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.002) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((l / (t * sqrt(2.0)))); 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.002], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $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.002:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -200Initial program 63.0%
Taylor expanded in t around -inf 90.2%
associate-*r*90.2%
*-commutative90.2%
unpow290.2%
unpow290.2%
times-frac99.4%
unpow299.4%
associate-/l*99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
if -200 < (/.f64 t l) < 2e-3Initial program 98.0%
Taylor expanded in t around 0 85.1%
unpow285.1%
unpow285.1%
times-frac96.3%
unpow296.3%
Simplified96.3%
unpow298.0%
clear-num98.0%
un-div-inv98.0%
Applied egg-rr96.3%
if 2e-3 < (/.f64 t l) Initial program 78.7%
sqrt-div78.8%
div-inv78.8%
add-sqr-sqrt78.8%
hypot-1-def78.8%
*-commutative78.8%
sqrt-prod78.5%
unpow278.5%
sqrt-prod98.5%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.6%
Taylor expanded in t around inf 96.0%
Final simplification97.0%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (* t (sqrt 2.0))))
(if (<= (/ t l) -200.0)
(asin (/ (- l) t_1))
(if (<= (/ t l) 0.002)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ l t_1))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = t * sqrt(2.0);
double tmp;
if ((t / l) <= -200.0) {
tmp = asin((-l / t_1));
} else if ((t / l) <= 0.002) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((l / 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 = t * sqrt(2.0d0)
if ((t / l) <= (-200.0d0)) then
tmp = asin((-l / t_1))
else if ((t / l) <= 0.002d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((l / 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 = t * Math.sqrt(2.0);
double tmp;
if ((t / l) <= -200.0) {
tmp = Math.asin((-l / t_1));
} else if ((t / l) <= 0.002) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l / t_1));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = t * math.sqrt(2.0) tmp = 0 if (t / l) <= -200.0: tmp = math.asin((-l / t_1)) elif (t / l) <= 0.002: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l / t_1)) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(t * sqrt(2.0)) tmp = 0.0 if (Float64(t / l) <= -200.0) tmp = asin(Float64(Float64(-l) / t_1)); elseif (Float64(t / l) <= 0.002) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l / t_1)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = t * sqrt(2.0); tmp = 0.0; if ((t / l) <= -200.0) tmp = asin((-l / t_1)); elseif ((t / l) <= 0.002) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l / 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[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -200.0], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -200:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -200Initial program 63.0%
sqrt-div62.9%
div-inv62.9%
add-sqr-sqrt62.9%
hypot-1-def62.9%
*-commutative62.9%
sqrt-prod62.8%
unpow262.8%
sqrt-prod0.0%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in Om around 0 98.5%
Taylor expanded in t around -inf 99.6%
associate-*r/99.6%
mul-1-neg99.6%
Simplified99.6%
if -200 < (/.f64 t l) < 2e-3Initial program 98.0%
sqrt-div98.0%
div-inv98.0%
add-sqr-sqrt98.0%
hypot-1-def98.0%
*-commutative98.0%
sqrt-prod98.0%
unpow298.0%
sqrt-prod54.8%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in Om around 0 96.8%
expm1-log1p-u96.0%
expm1-udef96.0%
associate-/l*96.0%
Applied egg-rr96.0%
expm1-def96.0%
expm1-log1p96.8%
associate-/r/96.8%
*-commutative96.8%
associate-*r/96.8%
*-commutative96.8%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in t around 0 86.7%
associate-*r/86.7%
*-commutative86.7%
unpow286.7%
rem-square-sqrt86.7%
associate-*r*86.7%
metadata-eval86.7%
associate-*r/86.7%
mul-1-neg86.7%
unsub-neg86.7%
unpow286.7%
unpow286.7%
times-frac95.7%
unpow295.7%
Simplified95.7%
if 2e-3 < (/.f64 t l) Initial program 78.7%
sqrt-div78.8%
div-inv78.8%
add-sqr-sqrt78.8%
hypot-1-def78.8%
*-commutative78.8%
sqrt-prod78.5%
unpow278.5%
sqrt-prod98.5%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.6%
Taylor expanded in t around inf 96.0%
Final simplification96.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.002)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ l (* t (sqrt 2.0)))))))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.002) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((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) :: tmp
if ((t / l) <= (-200.0d0)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 0.002d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((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 tmp;
if ((t / l) <= -200.0) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 0.002) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
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.002: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) 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.002) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); 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.002) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l / (t * sqrt(2.0)))); 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.002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $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.002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -200Initial program 63.0%
Taylor expanded in t around -inf 90.2%
associate-*r*90.2%
*-commutative90.2%
unpow290.2%
unpow290.2%
times-frac99.4%
unpow299.4%
associate-/l*99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
Taylor expanded in Om around 0 99.5%
if -200 < (/.f64 t l) < 2e-3Initial program 98.0%
sqrt-div98.0%
div-inv98.0%
add-sqr-sqrt98.0%
hypot-1-def98.0%
*-commutative98.0%
sqrt-prod98.0%
unpow298.0%
sqrt-prod54.8%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate-*l/98.0%
Simplified98.0%
Taylor expanded in Om around 0 96.8%
expm1-log1p-u96.0%
expm1-udef96.0%
associate-/l*96.0%
Applied egg-rr96.0%
expm1-def96.0%
expm1-log1p96.8%
associate-/r/96.8%
*-commutative96.8%
associate-*r/96.8%
*-commutative96.8%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in t around 0 86.7%
associate-*r/86.7%
*-commutative86.7%
unpow286.7%
rem-square-sqrt86.7%
associate-*r*86.7%
metadata-eval86.7%
associate-*r/86.7%
mul-1-neg86.7%
unsub-neg86.7%
unpow286.7%
unpow286.7%
times-frac95.7%
unpow295.7%
Simplified95.7%
if 2e-3 < (/.f64 t l) Initial program 78.7%
sqrt-div78.8%
div-inv78.8%
add-sqr-sqrt78.8%
hypot-1-def78.8%
*-commutative78.8%
sqrt-prod78.5%
unpow278.5%
sqrt-prod98.5%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.6%
Taylor expanded in t around inf 96.0%
Final simplification96.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= l -4.2e-158) (asin 1.0) (if (<= l 8.5e+73) (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 <= -4.2e-158) {
tmp = asin(1.0);
} else if (l <= 8.5e+73) {
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 <= (-4.2d-158)) then
tmp = asin(1.0d0)
else if (l <= 8.5d+73) 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 <= -4.2e-158) {
tmp = Math.asin(1.0);
} else if (l <= 8.5e+73) {
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 <= -4.2e-158: tmp = math.asin(1.0) elif l <= 8.5e+73: 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 <= -4.2e-158) tmp = asin(1.0); elseif (l <= 8.5e+73) 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 <= -4.2e-158) tmp = asin(1.0); elseif (l <= 8.5e+73) 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, -4.2e-158], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 8.5e+73], 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 -4.2 \cdot 10^{-158}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+73}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -4.19999999999999983e-158 or 8.4999999999999998e73 < l Initial program 90.7%
Taylor expanded in t around 0 60.0%
unpow260.0%
unpow260.0%
times-frac66.4%
unpow266.4%
Simplified66.4%
Taylor expanded in Om around 0 65.5%
if -4.19999999999999983e-158 < l < 8.4999999999999998e73Initial program 73.5%
sqrt-div73.5%
div-inv73.5%
add-sqr-sqrt73.5%
hypot-1-def73.5%
*-commutative73.5%
sqrt-prod73.4%
unpow273.4%
sqrt-prod42.8%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in Om around 0 97.9%
Taylor expanded in t around inf 51.5%
Final simplification60.0%
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 83.9%
Taylor expanded in t around 0 42.9%
unpow242.9%
unpow242.9%
times-frac48.6%
unpow248.6%
Simplified48.6%
Taylor expanded in Om around 0 48.0%
Final simplification48.0%
herbie shell --seed 2023300
(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)))))))