
(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
(if (<= (/ t l) -5e+155)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e+141)
(asin
(sqrt
(/
(+ 1.0 (+ 1.0 (- -1.0 (/ (/ Om Omc) (/ Omc Om)))))
(+ 1.0 (* 2.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) <= -5e+155) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e+141) {
tmp = asin(sqrt(((1.0 + (1.0 + (-1.0 - ((Om / Omc) / (Omc / Om))))) / (1.0 + (2.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) <= (-5d+155)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d+141) then
tmp = asin(sqrt(((1.0d0 + (1.0d0 + ((-1.0d0) - ((om / omc) / (omc / om))))) / (1.0d0 + (2.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) <= -5e+155) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e+141) {
tmp = Math.asin(Math.sqrt(((1.0 + (1.0 + (-1.0 - ((Om / Omc) / (Omc / Om))))) / (1.0 + (2.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) <= -5e+155: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e+141: tmp = math.asin(math.sqrt(((1.0 + (1.0 + (-1.0 - ((Om / Omc) / (Omc / Om))))) / (1.0 + (2.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) <= -5e+155) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e+141) tmp = asin(sqrt(Float64(Float64(1.0 + Float64(1.0 + Float64(-1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))) / Float64(1.0 + Float64(2.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) <= -5e+155) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e+141) tmp = asin(sqrt(((1.0 + (1.0 + (-1.0 - ((Om / Omc) / (Omc / Om))))) / (1.0 + (2.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], -5e+155], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+141], N[ArcSin[N[Sqrt[N[(N[(1.0 + N[(1.0 + N[(-1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $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 -5 \cdot 10^{+155}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+141}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 + \left(1 + \left(-1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\right)\right)}{1 + 2 \cdot {\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) < -4.9999999999999999e155Initial program 39.3%
Taylor expanded in Om around 0 39.3%
unpow239.3%
unpow239.3%
Simplified39.3%
Taylor expanded in t around -inf 99.6%
if -4.9999999999999999e155 < (/.f64 t l) < 2.00000000000000003e141Initial program 99.1%
expm1-log1p-u99.1%
expm1-udef99.1%
log1p-udef99.1%
add-exp-log99.1%
Applied egg-rr99.1%
unpow299.1%
clear-num99.1%
un-div-inv99.1%
Applied egg-rr99.1%
if 2.00000000000000003e141 < (/.f64 t l) Initial program 61.1%
Taylor expanded in Om around 0 56.7%
unpow256.7%
unpow256.7%
Simplified56.7%
Taylor expanded in t around inf 99.9%
Final simplification99.3%
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(Float64(t / 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[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 84.5%
sqrt-div84.5%
div-inv84.5%
add-sqr-sqrt84.5%
hypot-1-def84.5%
*-commutative84.5%
sqrt-prod84.5%
unpow284.5%
sqrt-prod55.5%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
unpow298.2%
times-frac86.7%
unpow286.7%
unpow286.7%
associate-*r/86.7%
*-rgt-identity86.7%
unpow286.7%
unpow286.7%
times-frac98.2%
unpow298.2%
Simplified98.2%
Final simplification98.2%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+155)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e+141)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.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) <= -5e+155) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e+141) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.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) <= (-5d+155)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d+141) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.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) <= -5e+155) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e+141) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.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) <= -5e+155: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e+141: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.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) <= -5e+155) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e+141) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.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) <= -5e+155) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e+141) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.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], -5e+155], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+141], 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[Power[N[(t / l), $MachinePrecision], 2.0], $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 -5 \cdot 10^{+155}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+141}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot {\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) < -4.9999999999999999e155Initial program 39.3%
Taylor expanded in Om around 0 39.3%
unpow239.3%
unpow239.3%
Simplified39.3%
Taylor expanded in t around -inf 99.6%
if -4.9999999999999999e155 < (/.f64 t l) < 2.00000000000000003e141Initial program 99.1%
unpow299.1%
clear-num99.1%
un-div-inv99.1%
Applied egg-rr99.1%
if 2.00000000000000003e141 < (/.f64 t l) Initial program 61.1%
Taylor expanded in Om around 0 56.7%
unpow256.7%
unpow256.7%
Simplified56.7%
Taylor expanded in t around inf 99.9%
Final simplification99.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+18)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 400000.0)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ (* t (/ t l)) 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) <= -5e+18) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 400000.0) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / 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) <= (-5d+18)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 400000.0d0) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t * (t / l)) / 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) <= -5e+18) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 400000.0) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / 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) <= -5e+18: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 400000.0: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / 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) <= -5e+18) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 400000.0) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / 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) <= -5e+18) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 400000.0) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t * (t / l)) / 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], -5e+18], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 400000.0], 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 * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $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 -5 \cdot 10^{+18}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 400000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5e18Initial program 62.4%
Taylor expanded in Om around 0 41.6%
unpow241.6%
unpow241.6%
Simplified41.6%
Taylor expanded in t around -inf 99.6%
if -5e18 < (/.f64 t l) < 4e5Initial program 99.0%
unpow299.0%
clear-num99.0%
un-div-inv99.0%
Applied egg-rr99.0%
unpow299.0%
times-frac88.4%
associate-/r*92.4%
Applied egg-rr92.4%
Taylor expanded in t around 0 92.4%
unpow292.4%
associate-*l/99.0%
*-commutative99.0%
Simplified99.0%
if 4e5 < (/.f64 t l) Initial program 73.3%
Taylor expanded in Om around 0 53.1%
unpow253.1%
unpow253.1%
Simplified53.1%
Taylor expanded in t around inf 99.7%
Final simplification99.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+155)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e+141)
(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) <= -5e+155) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e+141) {
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) <= (-5d+155)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d+141) 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) <= -5e+155) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e+141) {
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) <= -5e+155: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e+141: 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) <= -5e+155) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e+141) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * 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) <= -5e+155) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e+141) 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], -5e+155], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+141], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(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 -5 \cdot 10^{+155}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+141}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \left(\frac{t}{\ell} \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.9999999999999999e155Initial program 39.3%
Taylor expanded in Om around 0 39.3%
unpow239.3%
unpow239.3%
Simplified39.3%
Taylor expanded in t around -inf 99.6%
if -4.9999999999999999e155 < (/.f64 t l) < 2.00000000000000003e141Initial program 99.1%
Taylor expanded in Om around 0 78.2%
unpow278.2%
unpow278.2%
Simplified78.2%
times-frac98.6%
Applied egg-rr98.6%
if 2.00000000000000003e141 < (/.f64 t l) Initial program 61.1%
Taylor expanded in Om around 0 56.7%
unpow256.7%
unpow256.7%
Simplified56.7%
Taylor expanded in t around inf 99.9%
Final simplification98.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -10000.0)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e-5)
(asin (sqrt (- 1.0 (* Om (/ (/ Om Omc) Omc)))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e-5) {
tmp = asin(sqrt((1.0 - (Om * ((Om / Omc) / Omc)))));
} 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) <= (-10000.0d0)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d-5) then
tmp = asin(sqrt((1.0d0 - (om * ((om / omc) / omc)))))
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) <= -10000.0) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e-5) {
tmp = Math.asin(Math.sqrt((1.0 - (Om * ((Om / Omc) / Omc)))));
} 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) <= -10000.0: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e-5: tmp = math.asin(math.sqrt((1.0 - (Om * ((Om / Omc) / Omc))))) 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) <= -10000.0) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e-5) tmp = asin(sqrt(Float64(1.0 - Float64(Om * Float64(Float64(Om / Omc) / Omc))))); 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) <= -10000.0) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e-5) tmp = asin(sqrt((1.0 - (Om * ((Om / Omc) / Omc))))); 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], -10000.0], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-5], N[ArcSin[N[Sqrt[N[(1.0 - N[(Om * N[(N[(Om / Omc), $MachinePrecision] / Omc), $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 -10000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - Om \cdot \frac{\frac{Om}{Omc}}{Omc}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e4Initial program 64.9%
Taylor expanded in Om around 0 43.8%
unpow243.8%
unpow243.8%
Simplified43.8%
Taylor expanded in t around -inf 99.0%
if -1e4 < (/.f64 t l) < 2.00000000000000016e-5Initial program 99.0%
expm1-log1p-u99.0%
expm1-udef99.0%
log1p-udef99.0%
add-exp-log99.0%
Applied egg-rr99.0%
unpow299.0%
clear-num99.0%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in t around 0 87.8%
unpow287.8%
unpow287.8%
times-frac98.3%
associate-*l/98.3%
associate-*r/98.3%
Simplified98.3%
if 2.00000000000000016e-5 < (/.f64 t l) Initial program 74.1%
Taylor expanded in Om around 0 53.0%
unpow253.0%
unpow253.0%
Simplified53.0%
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) -10000.0)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 2e-5)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 2e-5) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-10000.0d0)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 2d-5) 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) <= -10000.0) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 2e-5) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -10000.0: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 2e-5: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -10000.0) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 2e-5) 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) <= -10000.0) tmp = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 2e-5) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -10000.0], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-5], 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 -10000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\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) < -1e4Initial program 64.9%
Taylor expanded in Om around 0 43.8%
unpow243.8%
unpow243.8%
Simplified43.8%
Taylor expanded in t around -inf 99.0%
*-un-lft-identity99.0%
mul-1-neg99.0%
associate-/l*98.8%
Applied egg-rr98.8%
*-lft-identity98.8%
associate-/r/98.7%
distribute-rgt-neg-in98.7%
Simplified98.7%
if -1e4 < (/.f64 t l) < 2.00000000000000016e-5Initial program 99.0%
Taylor expanded in Om around 0 89.3%
unpow289.3%
unpow289.3%
Simplified89.3%
Taylor expanded in t around 0 89.3%
mul-1-neg89.3%
unpow289.3%
unpow289.3%
times-frac98.2%
unpow298.2%
unsub-neg98.2%
Simplified98.2%
if 2.00000000000000016e-5 < (/.f64 t l) Initial program 74.1%
Taylor expanded in Om around 0 53.0%
unpow253.0%
unpow253.0%
Simplified53.0%
Taylor expanded in t around inf 98.7%
Final simplification98.5%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -10000.0)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e-5)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e-5) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-10000.0d0)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d-5) 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) <= -10000.0) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e-5) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -10000.0: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e-5: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -10000.0) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e-5) 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) <= -10000.0) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e-5) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -10000.0], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-5], 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 -10000:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\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) < -1e4Initial program 64.9%
Taylor expanded in Om around 0 43.8%
unpow243.8%
unpow243.8%
Simplified43.8%
Taylor expanded in t around -inf 99.0%
if -1e4 < (/.f64 t l) < 2.00000000000000016e-5Initial program 99.0%
Taylor expanded in Om around 0 89.3%
unpow289.3%
unpow289.3%
Simplified89.3%
Taylor expanded in t around 0 89.3%
mul-1-neg89.3%
unpow289.3%
unpow289.3%
times-frac98.2%
unpow298.2%
unsub-neg98.2%
Simplified98.2%
if 2.00000000000000016e-5 < (/.f64 t l) Initial program 74.1%
Taylor expanded in Om around 0 53.0%
unpow253.0%
unpow253.0%
Simplified53.0%
Taylor expanded in t around inf 98.7%
Final simplification98.5%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -4.4e-10)
(asin 1.0)
(if (<= l -5e-310)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= l 1.15e-35) (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 <= -4.4e-10) {
tmp = asin(1.0);
} else if (l <= -5e-310) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if (l <= 1.15e-35) {
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 <= (-4.4d-10)) then
tmp = asin(1.0d0)
else if (l <= (-5d-310)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if (l <= 1.15d-35) 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 <= -4.4e-10) {
tmp = Math.asin(1.0);
} else if (l <= -5e-310) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if (l <= 1.15e-35) {
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 <= -4.4e-10: tmp = math.asin(1.0) elif l <= -5e-310: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif l <= 1.15e-35: 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 <= -4.4e-10) tmp = asin(1.0); elseif (l <= -5e-310) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (l <= 1.15e-35) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -4.4e-10) tmp = asin(1.0); elseif (l <= -5e-310) tmp = asin((sqrt(0.5) * (-l / t))); elseif (l <= 1.15e-35) 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, -4.4e-10], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -5e-310], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 1.15e-35], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.4 \cdot 10^{-10}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\ell \leq 1.15 \cdot 10^{-35}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -4.3999999999999998e-10 or 1.1499999999999999e-35 < l Initial program 97.4%
Taylor expanded in Om around 0 81.1%
unpow281.1%
unpow281.1%
Simplified81.1%
Taylor expanded in t around 0 80.3%
if -4.3999999999999998e-10 < l < -4.999999999999985e-310Initial program 68.6%
Taylor expanded in Om around 0 54.6%
unpow254.6%
unpow254.6%
Simplified54.6%
Taylor expanded in t around -inf 57.6%
*-un-lft-identity57.6%
mul-1-neg57.6%
associate-/l*57.5%
Applied egg-rr57.5%
*-lft-identity57.5%
associate-/r/57.5%
distribute-rgt-neg-in57.5%
Simplified57.5%
if -4.999999999999985e-310 < l < 1.1499999999999999e-35Initial program 72.1%
Taylor expanded in Om around 0 57.7%
unpow257.7%
unpow257.7%
Simplified57.7%
Taylor expanded in t around inf 55.8%
Final simplification69.0%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= l -6.6e-146) (asin 1.0) (if (<= l 1.06e-35) (asin (* (sqrt 0.5) (/ l t))) (asin 1.0))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -6.6e-146) {
tmp = asin(1.0);
} else if (l <= 1.06e-35) {
tmp = asin((sqrt(0.5) * (l / 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 <= (-6.6d-146)) then
tmp = asin(1.0d0)
else if (l <= 1.06d-35) then
tmp = asin((sqrt(0.5d0) * (l / 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 <= -6.6e-146) {
tmp = Math.asin(1.0);
} else if (l <= 1.06e-35) {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if l <= -6.6e-146: tmp = math.asin(1.0) elif l <= 1.06e-35: tmp = math.asin((math.sqrt(0.5) * (l / t))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (l <= -6.6e-146) tmp = asin(1.0); elseif (l <= 1.06e-35) tmp = asin(Float64(sqrt(0.5) * Float64(l / 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 <= -6.6e-146) tmp = asin(1.0); elseif (l <= 1.06e-35) tmp = asin((sqrt(0.5) * (l / 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, -6.6e-146], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 1.06e-35], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.6 \cdot 10^{-146}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 1.06 \cdot 10^{-35}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -6.6e-146 or 1.06e-35 < l Initial program 94.0%
Taylor expanded in Om around 0 80.2%
unpow280.2%
unpow280.2%
Simplified80.2%
Taylor expanded in t around 0 73.5%
if -6.6e-146 < l < 1.06e-35Initial program 69.5%
Taylor expanded in Om around 0 51.9%
unpow251.9%
unpow251.9%
Simplified51.9%
Taylor expanded in t around inf 58.6%
associate-/l*58.5%
associate-/r/58.5%
Simplified58.5%
Final simplification67.7%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= l -4e-145) (asin 1.0) (if (<= l 9.5e-36) (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 <= -4e-145) {
tmp = asin(1.0);
} else if (l <= 9.5e-36) {
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 <= (-4d-145)) then
tmp = asin(1.0d0)
else if (l <= 9.5d-36) 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 <= -4e-145) {
tmp = Math.asin(1.0);
} else if (l <= 9.5e-36) {
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 <= -4e-145: tmp = math.asin(1.0) elif l <= 9.5e-36: 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 <= -4e-145) tmp = asin(1.0); elseif (l <= 9.5e-36) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -4e-145) tmp = asin(1.0); elseif (l <= 9.5e-36) 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, -4e-145], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 9.5e-36], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4 \cdot 10^{-145}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 9.5 \cdot 10^{-36}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -3.99999999999999966e-145 or 9.5000000000000003e-36 < l Initial program 94.0%
Taylor expanded in Om around 0 80.2%
unpow280.2%
unpow280.2%
Simplified80.2%
Taylor expanded in t around 0 73.5%
if -3.99999999999999966e-145 < l < 9.5000000000000003e-36Initial program 69.5%
Taylor expanded in Om around 0 51.9%
unpow251.9%
unpow251.9%
Simplified51.9%
Taylor expanded in t around inf 58.6%
Final simplification67.7%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin 1.0))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin(1.0);
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(1.0d0)
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(1.0);
}
t = abs(t) def code(t, l, Om, Omc): return math.asin(1.0)
t = abs(t) function code(t, l, Om, Omc) return asin(1.0) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin(1.0); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} 1
\end{array}
Initial program 84.5%
Taylor expanded in Om around 0 69.2%
unpow269.2%
unpow269.2%
Simplified69.2%
Taylor expanded in t around 0 52.0%
Final simplification52.0%
herbie shell --seed 2023291
(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)))))))