
(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 13 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) -2e+103)
(asin (* (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (/ (- (sqrt 0.5)) (/ t l))))
(if (<= (/ t l) 2e+143)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+103) {
tmp = asin((sqrt((1.0 - pow((Om / Omc), 2.0))) * (-sqrt(0.5) / (t / l))));
} else if ((t / l) <= 2e+143) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} 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) <= (-2d+103)) then
tmp = asin((sqrt((1.0d0 - ((om / omc) ** 2.0d0))) * (-sqrt(0.5d0) / (t / l))))
else if ((t / l) <= 2d+143) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
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) <= -2e+103) {
tmp = Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) * (-Math.sqrt(0.5) / (t / l))));
} else if ((t / l) <= 2e+143) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} 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) <= -2e+103: tmp = math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) * (-math.sqrt(0.5) / (t / l)))) elif (t / l) <= 2e+143: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t))))))) 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) <= -2e+103) tmp = asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) * Float64(Float64(-sqrt(0.5)) / Float64(t / l)))); elseif (Float64(t / l) <= 2e+143) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); 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) <= -2e+103) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) * (-sqrt(0.5) / (t / l)))); elseif ((t / l) <= 2e+143) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t))))))); 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], -2e+103], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[0.5], $MachinePrecision]) / N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+143], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $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[(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 -2 \cdot 10^{+103}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{-\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+143}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e103Initial program 54.6%
Taylor expanded in t around -inf 91.3%
mul-1-neg91.3%
*-commutative91.3%
distribute-rgt-neg-in91.3%
unpow291.3%
unpow291.3%
times-frac99.7%
unpow299.7%
associate-/l*98.1%
Simplified98.1%
if -2e103 < (/.f64 t l) < 2e143Initial program 98.6%
unpow298.6%
clear-num98.6%
un-div-inv98.6%
Applied egg-rr98.6%
unpow298.6%
Applied egg-rr98.6%
if 2e143 < (/.f64 t l) Initial program 50.0%
sqrt-div50.0%
div-inv50.0%
add-sqr-sqrt50.0%
hypot-1-def50.0%
*-commutative50.0%
sqrt-prod50.0%
unpow250.0%
sqrt-prod96.0%
add-sqr-sqrt96.2%
Applied egg-rr96.2%
associate-*r/96.2%
*-rgt-identity96.2%
associate-*l/96.4%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in Om around 0 47.2%
unpow247.2%
rem-square-sqrt47.2%
unpow247.2%
times-frac47.2%
unpow247.2%
Simplified47.2%
Taylor expanded in l around 0 99.8%
Final simplification98.7%
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 84.0%
sqrt-div84.0%
div-inv84.0%
add-sqr-sqrt84.0%
hypot-1-def84.0%
*-commutative84.0%
sqrt-prod83.9%
unpow283.9%
sqrt-prod53.2%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate-*l/98.0%
associate-/l*98.0%
Simplified98.0%
Final simplification98.0%
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 (* (sqrt 2.0) (/ t 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, (sqrt(2.0) * (t / 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, (Math.sqrt(2.0) * (t / 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, (math.sqrt(2.0) * (t / 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(sqrt(2.0) * Float64(t / l))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, (sqrt(2.0) * (t / 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[Sqrt[2.0], $MachinePrecision] * N[(t / l), $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, \sqrt{2} \cdot \frac{t}{\ell}\right)}\right)
\end{array}
Initial program 84.0%
sqrt-div84.0%
add-sqr-sqrt84.0%
hypot-1-def84.0%
*-commutative84.0%
sqrt-prod83.9%
unpow283.9%
sqrt-prod53.2%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
Final simplification98.0%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= Om 3.7e+127)
(asin
(/
(sqrt (- 1.0 (/ (/ (* Om Om) Omc) Omc)))
(hypot 1.0 (/ t (/ l (sqrt 2.0))))))
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (Om <= 3.7e+127) {
tmp = asin((sqrt((1.0 - (((Om * Om) / Omc) / Omc))) / hypot(1.0, (t / (l / sqrt(2.0))))));
} else {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
return tmp;
}
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (Om <= 3.7e+127) {
tmp = Math.asin((Math.sqrt((1.0 - (((Om * Om) / Omc) / Omc))) / Math.hypot(1.0, (t / (l / Math.sqrt(2.0))))));
} else {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if Om <= 3.7e+127: tmp = math.asin((math.sqrt((1.0 - (((Om * Om) / Omc) / Omc))) / math.hypot(1.0, (t / (l / math.sqrt(2.0)))))) else: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t))))))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Om <= 3.7e+127) tmp = asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Float64(Om * Om) / Omc) / Omc))) / hypot(1.0, Float64(t / Float64(l / sqrt(2.0)))))); else tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (Om <= 3.7e+127) tmp = asin((sqrt((1.0 - (((Om * Om) / Omc) / Omc))) / hypot(1.0, (t / (l / sqrt(2.0)))))); else tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t))))))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[Om, 3.7e+127], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(N[(Om * Om), $MachinePrecision] / Omc), $MachinePrecision] / Omc), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(t / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;Om \leq 3.7 \cdot 10^{+127}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om \cdot Om}{Omc}}{Omc}}}{\mathsf{hypot}\left(1, \frac{t}{\frac{\ell}{\sqrt{2}}}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\end{array}
\end{array}
if Om < 3.6999999999999998e127Initial program 83.6%
sqrt-div83.6%
div-inv83.6%
add-sqr-sqrt83.6%
hypot-1-def83.6%
*-commutative83.6%
sqrt-prod83.5%
unpow283.5%
sqrt-prod52.9%
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%
unpow298.1%
times-frac91.3%
associate-/r*95.0%
Applied egg-rr95.0%
if 3.6999999999999998e127 < Om Initial program 91.0%
unpow291.0%
clear-num91.0%
un-div-inv91.0%
Applied egg-rr91.0%
unpow291.0%
Applied egg-rr91.0%
Final simplification94.7%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+103)
(asin (/ (* (sqrt 0.5) (- l)) t))
(if (<= (/ t l) 2e+143)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ (/ t l) (/ l t)))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+103) {
tmp = asin(((sqrt(0.5) * -l) / t));
} else if ((t / l) <= 2e+143) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} 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) <= (-2d+103)) then
tmp = asin(((sqrt(0.5d0) * -l) / t))
else if ((t / l) <= 2d+143) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
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) <= -2e+103) {
tmp = Math.asin(((Math.sqrt(0.5) * -l) / t));
} else if ((t / l) <= 2e+143) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
} 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) <= -2e+103: tmp = math.asin(((math.sqrt(0.5) * -l) / t)) elif (t / l) <= 2e+143: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t))))))) 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) <= -2e+103) tmp = asin(Float64(Float64(sqrt(0.5) * Float64(-l)) / t)); elseif (Float64(t / l) <= 2e+143) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))); 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) <= -2e+103) tmp = asin(((sqrt(0.5) * -l) / t)); elseif ((t / l) <= 2e+143) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) / (l / t))))))); 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], -2e+103], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+143], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $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[(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 -2 \cdot 10^{+103}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+143}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e103Initial program 54.6%
Taylor expanded in t around -inf 91.3%
mul-1-neg91.3%
*-commutative91.3%
unpow291.3%
unpow291.3%
associate-/l*89.6%
Simplified89.6%
Taylor expanded in Om around 0 88.3%
unpow23.6%
unpow23.6%
times-frac4.0%
unpow24.0%
Simplified96.8%
Taylor expanded in Om around 0 98.2%
if -2e103 < (/.f64 t l) < 2e143Initial program 98.6%
unpow298.6%
clear-num98.6%
un-div-inv98.6%
Applied egg-rr98.6%
unpow298.6%
Applied egg-rr98.6%
if 2e143 < (/.f64 t l) Initial program 50.0%
sqrt-div50.0%
div-inv50.0%
add-sqr-sqrt50.0%
hypot-1-def50.0%
*-commutative50.0%
sqrt-prod50.0%
unpow250.0%
sqrt-prod96.0%
add-sqr-sqrt96.2%
Applied egg-rr96.2%
associate-*r/96.2%
*-rgt-identity96.2%
associate-*l/96.4%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in Om around 0 47.2%
unpow247.2%
rem-square-sqrt47.2%
unpow247.2%
times-frac47.2%
unpow247.2%
Simplified47.2%
Taylor expanded in l around 0 99.8%
Final simplification98.7%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -4e+27)
(asin (* (/ (sqrt 0.5) t) (- l)))
(if (<= (/ t l) 2e+44)
(asin (sqrt (/ 1.0 (+ 1.0 (* (/ 2.0 l) (* t (/ 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) <= -4e+27) {
tmp = asin(((sqrt(0.5) / t) * -l));
} else if ((t / l) <= 2e+44) {
tmp = asin(sqrt((1.0 / (1.0 + ((2.0 / l) * (t * (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) <= (-4d+27)) then
tmp = asin(((sqrt(0.5d0) / t) * -l))
else if ((t / l) <= 2d+44) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + ((2.0d0 / l) * (t * (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) <= -4e+27) {
tmp = Math.asin(((Math.sqrt(0.5) / t) * -l));
} else if ((t / l) <= 2e+44) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + ((2.0 / l) * (t * (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) <= -4e+27: tmp = math.asin(((math.sqrt(0.5) / t) * -l)) elif (t / l) <= 2e+44: tmp = math.asin(math.sqrt((1.0 / (1.0 + ((2.0 / l) * (t * (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) <= -4e+27) tmp = asin(Float64(Float64(sqrt(0.5) / t) * Float64(-l))); elseif (Float64(t / l) <= 2e+44) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(Float64(2.0 / l) * Float64(t * Float64(t / l))))))); 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) <= -4e+27) tmp = asin(((sqrt(0.5) / t) * -l)); elseif ((t / l) <= 2e+44) tmp = asin(sqrt((1.0 / (1.0 + ((2.0 / l) * (t * (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], -4e+27], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision] * (-l)), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+44], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(N[(2.0 / l), $MachinePrecision] * N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -4 \cdot 10^{+27}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{t} \cdot \left(-\ell\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + \frac{2}{\ell} \cdot \left(t \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.0000000000000001e27Initial program 65.5%
Taylor expanded in t around -inf 93.2%
mul-1-neg93.2%
*-commutative93.2%
distribute-rgt-neg-in93.2%
unpow293.2%
unpow293.2%
times-frac99.6%
unpow299.6%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in Om around 0 98.4%
mul-1-neg98.4%
associate-*l/98.5%
*-commutative98.5%
distribute-rgt-neg-in98.5%
distribute-frac-neg98.5%
Simplified98.5%
if -4.0000000000000001e27 < (/.f64 t l) < 2.0000000000000002e44Initial program 98.3%
sqrt-div98.3%
div-inv98.3%
add-sqr-sqrt98.3%
hypot-1-def98.3%
*-commutative98.3%
sqrt-prod98.3%
unpow298.3%
sqrt-prod61.0%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
associate-*l/98.3%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in Om around 0 76.2%
unpow276.2%
rem-square-sqrt76.2%
unpow276.2%
times-frac84.3%
unpow284.3%
Simplified84.3%
Taylor expanded in t around 0 84.3%
unpow284.3%
associate-*l/96.0%
*-commutative96.0%
Simplified96.0%
if 2.0000000000000002e44 < (/.f64 t l) Initial program 65.8%
sqrt-div65.8%
div-inv65.8%
add-sqr-sqrt65.8%
hypot-1-def65.8%
*-commutative65.8%
sqrt-prod65.7%
unpow265.7%
sqrt-prod96.9%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate-*r/97.1%
*-rgt-identity97.1%
associate-*l/97.3%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in Om around 0 48.2%
unpow248.2%
rem-square-sqrt48.3%
unpow248.3%
times-frac50.8%
unpow250.8%
Simplified50.8%
Taylor expanded in l around 0 99.5%
Final simplification97.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -4e+27)
(asin (* (/ (sqrt 0.5) t) (- l)))
(if (<= (/ t l) 2e+44)
(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) <= -4e+27) {
tmp = asin(((sqrt(0.5) / t) * -l));
} else if ((t / l) <= 2e+44) {
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) <= (-4d+27)) then
tmp = asin(((sqrt(0.5d0) / t) * -l))
else if ((t / l) <= 2d+44) 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) <= -4e+27) {
tmp = Math.asin(((Math.sqrt(0.5) / t) * -l));
} else if ((t / l) <= 2e+44) {
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) <= -4e+27: tmp = math.asin(((math.sqrt(0.5) / t) * -l)) elif (t / l) <= 2e+44: 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) <= -4e+27) tmp = asin(Float64(Float64(sqrt(0.5) / t) * Float64(-l))); elseif (Float64(t / l) <= 2e+44) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(Float64(2.0 * Float64(t / Float64(l / t))) / l))))); 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) <= -4e+27) tmp = asin(((sqrt(0.5) / t) * -l)); elseif ((t / l) <= 2e+44) 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], -4e+27], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision] * (-l)), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+44], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(N[(2.0 * N[(t / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $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 -4 \cdot 10^{+27}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{t} \cdot \left(-\ell\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + \frac{2 \cdot \frac{t}{\frac{\ell}{t}}}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.0000000000000001e27Initial program 65.5%
Taylor expanded in t around -inf 93.2%
mul-1-neg93.2%
*-commutative93.2%
distribute-rgt-neg-in93.2%
unpow293.2%
unpow293.2%
times-frac99.6%
unpow299.6%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in Om around 0 98.4%
mul-1-neg98.4%
associate-*l/98.5%
*-commutative98.5%
distribute-rgt-neg-in98.5%
distribute-frac-neg98.5%
Simplified98.5%
if -4.0000000000000001e27 < (/.f64 t l) < 2.0000000000000002e44Initial program 98.3%
sqrt-div98.3%
div-inv98.3%
add-sqr-sqrt98.3%
hypot-1-def98.3%
*-commutative98.3%
sqrt-prod98.3%
unpow298.3%
sqrt-prod61.0%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
associate-*l/98.3%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in Om around 0 76.2%
unpow276.2%
rem-square-sqrt76.2%
unpow276.2%
times-frac84.3%
unpow284.3%
Simplified84.3%
associate-*l/84.3%
associate-/l*96.1%
Applied egg-rr96.1%
if 2.0000000000000002e44 < (/.f64 t l) Initial program 65.8%
sqrt-div65.8%
div-inv65.8%
add-sqr-sqrt65.8%
hypot-1-def65.8%
*-commutative65.8%
sqrt-prod65.7%
unpow265.7%
sqrt-prod96.9%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate-*r/97.1%
*-rgt-identity97.1%
associate-*l/97.3%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in Om around 0 48.2%
unpow248.2%
rem-square-sqrt48.3%
unpow248.3%
times-frac50.8%
unpow250.8%
Simplified50.8%
Taylor expanded in l around 0 99.5%
Final simplification97.3%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (or (<= (/ t l) -2e+209) (not (<= (/ t l) 0.0004))) (asin (/ (sqrt 0.5) (/ t l))) (asin (+ 1.0 (* (* (/ Om Omc) (/ Om Omc)) -0.5)))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (((t / l) <= -2e+209) || !((t / l) <= 0.0004)) {
tmp = asin((sqrt(0.5) / (t / l)));
} else {
tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
}
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) <= (-2d+209)) .or. (.not. ((t / l) <= 0.0004d0))) then
tmp = asin((sqrt(0.5d0) / (t / l)))
else
tmp = asin((1.0d0 + (((om / omc) * (om / omc)) * (-0.5d0))))
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) <= -2e+209) || !((t / l) <= 0.0004)) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else {
tmp = Math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if ((t / l) <= -2e+209) or not ((t / l) <= 0.0004): tmp = math.asin((math.sqrt(0.5) / (t / l))) else: tmp = math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if ((Float64(t / l) <= -2e+209) || !(Float64(t / l) <= 0.0004)) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); else tmp = asin(Float64(1.0 + Float64(Float64(Float64(Om / Omc) * Float64(Om / Omc)) * -0.5))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (((t / l) <= -2e+209) || ~(((t / l) <= 0.0004))) tmp = asin((sqrt(0.5) / (t / l))); else tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[Or[LessEqual[N[(t / l), $MachinePrecision], -2e+209], N[Not[LessEqual[N[(t / l), $MachinePrecision], 0.0004]], $MachinePrecision]], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+209} \lor \neg \left(\frac{t}{\ell} \leq 0.0004\right):\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(1 + \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right) \cdot -0.5\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2.0000000000000001e209 or 4.00000000000000019e-4 < (/.f64 t l) Initial program 65.6%
sqrt-div65.6%
div-inv65.6%
add-sqr-sqrt65.6%
hypot-1-def65.6%
*-commutative65.6%
sqrt-prod65.5%
unpow265.5%
sqrt-prod67.2%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
associate-*r/97.2%
*-rgt-identity97.2%
associate-*l/97.3%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in Om around 0 47.7%
unpow247.7%
rem-square-sqrt47.8%
unpow247.8%
times-frac50.2%
unpow250.2%
Simplified50.2%
Taylor expanded in l around 0 83.4%
associate-/l*82.2%
Simplified82.2%
if -2.0000000000000001e209 < (/.f64 t l) < 4.00000000000000019e-4Initial program 93.0%
Taylor expanded in t around 0 62.0%
unpow262.0%
unpow262.0%
Simplified62.0%
Taylor expanded in Om around 0 62.0%
unpow262.0%
unpow262.0%
times-frac72.9%
unpow272.9%
Simplified72.9%
unpow293.1%
Applied egg-rr72.9%
Final simplification76.0%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+209)
(asin (/ (sqrt 0.5) (/ t l)))
(if (<= (/ t l) 0.0004)
(asin (+ 1.0 (* (* (/ Om Omc) (/ Om Omc)) -0.5)))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+209) {
tmp = asin((sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.0004) {
tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
} 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) <= (-2d+209)) then
tmp = asin((sqrt(0.5d0) / (t / l)))
else if ((t / l) <= 0.0004d0) then
tmp = asin((1.0d0 + (((om / omc) * (om / omc)) * (-0.5d0))))
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) <= -2e+209) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.0004) {
tmp = Math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
} 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) <= -2e+209: tmp = math.asin((math.sqrt(0.5) / (t / l))) elif (t / l) <= 0.0004: tmp = math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))) 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) <= -2e+209) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); elseif (Float64(t / l) <= 0.0004) tmp = asin(Float64(1.0 + Float64(Float64(Float64(Om / Omc) * Float64(Om / Omc)) * -0.5))); 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) <= -2e+209) tmp = asin((sqrt(0.5) / (t / l))); elseif ((t / l) <= 0.0004) tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))); 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], -2e+209], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0004], N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision] * -0.5), $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 -2 \cdot 10^{+209}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0004:\\
\;\;\;\;\sin^{-1} \left(1 + \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2.0000000000000001e209Initial program 54.6%
sqrt-div54.6%
div-inv54.6%
add-sqr-sqrt54.6%
hypot-1-def54.6%
*-commutative54.6%
sqrt-prod54.6%
unpow254.6%
sqrt-prod0.0%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate-*r/96.7%
*-rgt-identity96.7%
associate-*l/96.6%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in Om around 0 54.6%
unpow254.6%
rem-square-sqrt54.6%
unpow254.6%
times-frac54.6%
unpow254.6%
Simplified54.6%
Taylor expanded in l around 0 53.7%
associate-/l*53.9%
Simplified53.9%
if -2.0000000000000001e209 < (/.f64 t l) < 4.00000000000000019e-4Initial program 93.0%
Taylor expanded in t around 0 62.0%
unpow262.0%
unpow262.0%
Simplified62.0%
Taylor expanded in Om around 0 62.0%
unpow262.0%
unpow262.0%
times-frac72.9%
unpow272.9%
Simplified72.9%
unpow293.1%
Applied egg-rr72.9%
if 4.00000000000000019e-4 < (/.f64 t l) Initial program 70.5%
sqrt-div70.5%
div-inv70.5%
add-sqr-sqrt70.5%
hypot-1-def70.5%
*-commutative70.5%
sqrt-prod70.3%
unpow270.3%
sqrt-prod97.3%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
associate-*r/97.5%
*-rgt-identity97.5%
associate-*l/97.6%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in Om around 0 44.7%
unpow244.7%
rem-square-sqrt44.8%
unpow244.8%
times-frac48.3%
unpow248.3%
Simplified48.3%
Taylor expanded in l around 0 96.7%
Final simplification76.4%
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.0004)
(asin (+ 1.0 (* (* (/ Om Omc) (/ Om Omc)) -0.5)))
(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.0004) {
tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
} 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.0004d0) then
tmp = asin((1.0d0 + (((om / omc) * (om / omc)) * (-0.5d0))))
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.0004) {
tmp = Math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
} 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.0004: tmp = math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))) 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(sqrt(0.5) * Float64(-l)) / t)); elseif (Float64(t / l) <= 0.0004) tmp = asin(Float64(1.0 + Float64(Float64(Float64(Om / Omc) * Float64(Om / Omc)) * -0.5))); 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) <= -200.0) tmp = asin(((sqrt(0.5) * -l) / t)); elseif ((t / l) <= 0.0004) tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))); 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[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0004], N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision] * -0.5), $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 -200:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0004:\\
\;\;\;\;\sin^{-1} \left(1 + \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -200Initial program 69.8%
Taylor expanded in t around -inf 91.0%
mul-1-neg91.0%
*-commutative91.0%
unpow291.0%
unpow291.0%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in Om around 0 88.7%
unpow25.1%
unpow25.1%
times-frac5.5%
unpow25.5%
Simplified95.7%
Taylor expanded in Om around 0 96.4%
if -200 < (/.f64 t l) < 4.00000000000000019e-4Initial program 98.2%
Taylor expanded in t around 0 81.6%
unpow281.6%
unpow281.6%
Simplified81.6%
Taylor expanded in Om around 0 81.7%
unpow281.7%
unpow281.7%
times-frac96.4%
unpow296.4%
Simplified96.4%
unpow298.2%
Applied egg-rr96.4%
if 4.00000000000000019e-4 < (/.f64 t l) Initial program 70.5%
sqrt-div70.5%
div-inv70.5%
add-sqr-sqrt70.5%
hypot-1-def70.5%
*-commutative70.5%
sqrt-prod70.3%
unpow270.3%
sqrt-prod97.3%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
associate-*r/97.5%
*-rgt-identity97.5%
associate-*l/97.6%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in Om around 0 44.7%
unpow244.7%
rem-square-sqrt44.8%
unpow244.8%
times-frac48.3%
unpow248.3%
Simplified48.3%
Taylor expanded in l around 0 96.7%
Final simplification96.5%
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) t) (- l)))
(if (<= (/ t l) 0.0004)
(asin (+ 1.0 (* (* (/ Om Omc) (/ Om Omc)) -0.5)))
(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) / t) * -l));
} else if ((t / l) <= 0.0004) {
tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
} 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) / t) * -l))
else if ((t / l) <= 0.0004d0) then
tmp = asin((1.0d0 + (((om / omc) * (om / omc)) * (-0.5d0))))
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) / t) * -l));
} else if ((t / l) <= 0.0004) {
tmp = Math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
} 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) / t) * -l)) elif (t / l) <= 0.0004: tmp = math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))) 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(sqrt(0.5) / t) * Float64(-l))); elseif (Float64(t / l) <= 0.0004) tmp = asin(Float64(1.0 + Float64(Float64(Float64(Om / Omc) * Float64(Om / Omc)) * -0.5))); 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) <= -200.0) tmp = asin(((sqrt(0.5) / t) * -l)); elseif ((t / l) <= 0.0004) tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))); 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[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision] * (-l)), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0004], N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision] * -0.5), $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 -200:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{t} \cdot \left(-\ell\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0004:\\
\;\;\;\;\sin^{-1} \left(1 + \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right) \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -200Initial program 69.8%
Taylor expanded in t around -inf 91.0%
mul-1-neg91.0%
*-commutative91.0%
distribute-rgt-neg-in91.0%
unpow291.0%
unpow291.0%
times-frac98.0%
unpow298.0%
associate-/l*96.9%
Simplified96.9%
Taylor expanded in Om around 0 96.4%
mul-1-neg96.4%
associate-*l/96.4%
*-commutative96.4%
distribute-rgt-neg-in96.4%
distribute-frac-neg96.4%
Simplified96.4%
if -200 < (/.f64 t l) < 4.00000000000000019e-4Initial program 98.2%
Taylor expanded in t around 0 81.6%
unpow281.6%
unpow281.6%
Simplified81.6%
Taylor expanded in Om around 0 81.7%
unpow281.7%
unpow281.7%
times-frac96.4%
unpow296.4%
Simplified96.4%
unpow298.2%
Applied egg-rr96.4%
if 4.00000000000000019e-4 < (/.f64 t l) Initial program 70.5%
sqrt-div70.5%
div-inv70.5%
add-sqr-sqrt70.5%
hypot-1-def70.5%
*-commutative70.5%
sqrt-prod70.3%
unpow270.3%
sqrt-prod97.3%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
associate-*r/97.5%
*-rgt-identity97.5%
associate-*l/97.6%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in Om around 0 44.7%
unpow244.7%
rem-square-sqrt44.8%
unpow244.8%
times-frac48.3%
unpow248.3%
Simplified48.3%
Taylor expanded in l around 0 96.7%
Final simplification96.5%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (+ 1.0 (* (* (/ Om Omc) (/ Om Omc)) -0.5))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
}
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 + (((om / omc) * (om / omc)) * (-0.5d0))))
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5)))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 + Float64(Float64(Float64(Om / Omc) * Float64(Om / Omc)) * -0.5))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 + (((Om / Omc) * (Om / Omc)) * -0.5))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 + N[(N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(1 + \left(\frac{Om}{Omc} \cdot \frac{Om}{Omc}\right) \cdot -0.5\right)
\end{array}
Initial program 84.0%
Taylor expanded in t around 0 43.0%
unpow243.0%
unpow243.0%
Simplified43.0%
Taylor expanded in Om around 0 43.0%
unpow243.0%
unpow243.0%
times-frac50.5%
unpow250.5%
Simplified50.5%
unpow284.1%
Applied egg-rr50.5%
Final simplification50.5%
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 84.0%
sqrt-div84.0%
div-inv84.0%
add-sqr-sqrt84.0%
hypot-1-def84.0%
*-commutative84.0%
sqrt-prod83.9%
unpow283.9%
sqrt-prod53.2%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate-*l/98.0%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in Om around 0 62.8%
unpow262.8%
rem-square-sqrt62.9%
unpow262.9%
times-frac69.5%
unpow269.5%
Simplified69.5%
Taylor expanded in l around inf 49.9%
Final simplification49.9%
herbie shell --seed 2023230
(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)))))))