
(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 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (pow (/ Om Omc) 2.0))))
(if (<= (/ t l) -1e+151)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 5e+92)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* l (/ (sqrt (* t_1 0.5)) t)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 - pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -1e+151) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 5e+92) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l * (sqrt((t_1 * 0.5)) / t)));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((om / omc) ** 2.0d0)
if ((t / l) <= (-1d+151)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 5d+92) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l * (sqrt((t_1 * 0.5d0)) / t)))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double t_1 = 1.0 - Math.pow((Om / Omc), 2.0);
double tmp;
if ((t / l) <= -1e+151) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 5e+92) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l * (Math.sqrt((t_1 * 0.5)) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = 1.0 - math.pow((Om / Omc), 2.0) tmp = 0 if (t / l) <= -1e+151: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 5e+92: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l * (math.sqrt((t_1 * 0.5)) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) tmp = 0.0 if (Float64(t / l) <= -1e+151) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 5e+92) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l * Float64(sqrt(Float64(t_1 * 0.5)) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = 1.0 - ((Om / Omc) ^ 2.0); tmp = 0.0; if ((t / l) <= -1e+151) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 5e+92) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l * (sqrt((t_1 * 0.5)) / t))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -1e+151], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+92], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[N[(t$95$1 * 0.5), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+151}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+92}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t_1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{t_1 \cdot 0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.00000000000000002e151Initial program 28.1%
sqrt-div28.1%
div-inv28.1%
add-sqr-sqrt28.1%
hypot-1-def28.1%
*-commutative28.1%
sqrt-prod28.1%
unpow228.1%
sqrt-prod0.0%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
unpow296.9%
times-frac80.4%
unpow280.4%
unpow280.4%
associate-*r/80.4%
*-rgt-identity80.4%
unpow280.4%
unpow280.4%
times-frac97.0%
unpow297.0%
Simplified97.0%
Taylor expanded in t around -inf 82.7%
mul-1-neg82.7%
*-commutative82.7%
unpow282.7%
unpow282.7%
times-frac99.4%
unpow299.4%
unpow299.4%
times-frac82.7%
Simplified82.7%
Taylor expanded in Om around 0 98.0%
if -1.00000000000000002e151 < (/.f64 t l) < 5.00000000000000022e92Initial program 99.1%
unpow299.1%
Applied egg-rr99.1%
if 5.00000000000000022e92 < (/.f64 t l) Initial program 54.3%
Taylor expanded in t around inf 93.1%
*-commutative93.1%
unpow293.1%
unpow293.1%
times-frac99.5%
unpow299.5%
associate-/l*96.8%
Simplified96.8%
expm1-log1p-u96.8%
expm1-udef33.7%
associate-*r/33.7%
pow1/233.7%
pow1/233.7%
pow-prod-down33.7%
Applied egg-rr33.7%
expm1-def96.8%
expm1-log1p96.8%
associate-/r/99.5%
unpow1/299.5%
*-commutative99.5%
Simplified99.5%
Final simplification99.0%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, ((t / l) * sqrt(2.0))))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 81.0%
sqrt-div81.0%
div-inv81.0%
add-sqr-sqrt81.0%
hypot-1-def81.0%
*-commutative81.0%
sqrt-prod81.0%
unpow281.0%
sqrt-prod54.9%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
unpow298.3%
times-frac86.7%
unpow286.7%
unpow286.7%
associate-*r/86.7%
*-rgt-identity86.7%
unpow286.7%
unpow286.7%
times-frac98.3%
unpow298.3%
Simplified98.3%
unpow298.3%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr98.3%
Final simplification98.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+123)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e+44)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (/ t (* l (/ l t))))))))
(asin (* l (/ (sqrt (* (- 1.0 (pow (/ Om Omc) 2.0)) 0.5)) t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+123) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e+44) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t / (l * (l / t))))))));
} else {
tmp = asin((l * (sqrt(((1.0 - pow((Om / Omc), 2.0)) * 0.5)) / t)));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-1d+123)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d+44) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * (t / (l * (l / t))))))))
else
tmp = asin((l * (sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) * 0.5d0)) / t)))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+123) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e+44) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t / (l * (l / t))))))));
} else {
tmp = Math.asin((l * (Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) * 0.5)) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+123: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e+44: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t / (l * (l / t)))))))) else: tmp = math.asin((l * (math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) * 0.5)) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+123) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e+44) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(t / Float64(l * Float64(l / t)))))))); else tmp = asin(Float64(l * Float64(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) * 0.5)) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+123) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e+44) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * (t / (l * (l / t)))))))); else tmp = asin((l * (sqrt(((1.0 - ((Om / Omc) ^ 2.0)) * 0.5)) / t))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -1e+123], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+44], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(t / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+123}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t}{\ell \cdot \frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{\left(1 - {\left(\frac{Om}{Omc}\right)}^{2}\right) \cdot 0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999978e122Initial program 31.9%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
*-commutative83.8%
distribute-rgt-neg-in83.8%
unpow283.8%
unpow283.8%
times-frac99.5%
unpow299.5%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in Om around 0 98.2%
if -9.99999999999999978e122 < (/.f64 t l) < 2.0000000000000002e44Initial program 99.0%
unpow299.0%
clear-num99.0%
frac-times98.4%
*-un-lft-identity98.4%
Applied egg-rr98.4%
unpow299.0%
clear-num99.0%
un-div-inv99.0%
Applied egg-rr98.4%
if 2.0000000000000002e44 < (/.f64 t l) Initial program 59.6%
Taylor expanded in t around inf 91.8%
*-commutative91.8%
unpow291.8%
unpow291.8%
times-frac99.4%
unpow299.4%
associate-/l*97.0%
Simplified97.0%
expm1-log1p-u97.0%
expm1-udef30.2%
associate-*r/30.2%
pow1/230.2%
pow1/230.2%
pow-prod-down30.2%
Applied egg-rr30.2%
expm1-def97.0%
expm1-log1p97.0%
associate-/r/99.5%
unpow1/299.5%
*-commutative99.5%
Simplified99.5%
Final simplification98.6%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+123)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 2e+44)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 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) <= -1e+123) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 2e+44) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (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) <= (-1d+123)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 2d+44) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (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) <= -1e+123) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 2e+44) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (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) <= -1e+123: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 2e+44: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (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) <= -1e+123) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 2e+44) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(t / Float64(l * Float64(l / t)))))))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+123) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 2e+44) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (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], -1e+123], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+44], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(t / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+123}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+44}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{t}{\ell \cdot \frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -9.99999999999999978e122Initial program 31.9%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
*-commutative83.8%
distribute-rgt-neg-in83.8%
unpow283.8%
unpow283.8%
times-frac99.5%
unpow299.5%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in Om around 0 98.2%
if -9.99999999999999978e122 < (/.f64 t l) < 2.0000000000000002e44Initial program 99.0%
unpow299.0%
clear-num99.0%
frac-times98.4%
*-un-lft-identity98.4%
Applied egg-rr98.4%
unpow299.0%
clear-num99.0%
un-div-inv99.0%
Applied egg-rr98.4%
if 2.0000000000000002e44 < (/.f64 t l) Initial program 59.6%
sqrt-div59.5%
div-inv59.5%
add-sqr-sqrt59.5%
hypot-1-def59.5%
*-commutative59.5%
sqrt-prod59.6%
unpow259.6%
sqrt-prod96.8%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
unpow297.1%
times-frac89.5%
unpow289.5%
unpow289.5%
associate-*r/89.5%
*-rgt-identity89.5%
unpow289.5%
unpow289.5%
times-frac97.1%
unpow297.1%
Simplified97.1%
unpow297.1%
clear-num97.1%
un-div-inv97.1%
Applied egg-rr97.1%
Taylor expanded in Om around 0 42.8%
*-commutative42.8%
unpow242.8%
unpow242.8%
swap-sqr42.8%
associate-*l*42.8%
unpow242.8%
times-frac59.5%
*-commutative59.5%
associate-*r*59.5%
rem-square-sqrt59.6%
Simplified59.6%
Taylor expanded in t around inf 99.4%
associate-*l/99.5%
Simplified99.5%
Final simplification98.6%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+151)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 5e+92)
(asin (sqrt (/ 1.0 (+ 1.0 (* (/ t l) (/ (* t 2.0) l))))))
(asin (* l (/ (sqrt 0.5) t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+151) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 5e+92) {
tmp = asin(sqrt((1.0 / (1.0 + ((t / l) * ((t * 2.0) / l))))));
} else {
tmp = asin((l * (sqrt(0.5) / t)));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-1d+151)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 5d+92) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + ((t / l) * ((t * 2.0d0) / l))))))
else
tmp = asin((l * (sqrt(0.5d0) / t)))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+151) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 5e+92) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + ((t / l) * ((t * 2.0) / l))))));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+151: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 5e+92: tmp = math.asin(math.sqrt((1.0 / (1.0 + ((t / l) * ((t * 2.0) / l)))))) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+151) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 5e+92) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(Float64(t / l) * Float64(Float64(t * 2.0) / l)))))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+151) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 5e+92) tmp = asin(sqrt((1.0 / (1.0 + ((t / l) * ((t * 2.0) / l)))))); else tmp = asin((l * (sqrt(0.5) / t))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -1e+151], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+92], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(N[(t / l), $MachinePrecision] * N[(N[(t * 2.0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+151}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+92}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + \frac{t}{\ell} \cdot \frac{t \cdot 2}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.00000000000000002e151Initial program 28.1%
sqrt-div28.1%
div-inv28.1%
add-sqr-sqrt28.1%
hypot-1-def28.1%
*-commutative28.1%
sqrt-prod28.1%
unpow228.1%
sqrt-prod0.0%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
unpow296.9%
times-frac80.4%
unpow280.4%
unpow280.4%
associate-*r/80.4%
*-rgt-identity80.4%
unpow280.4%
unpow280.4%
times-frac97.0%
unpow297.0%
Simplified97.0%
Taylor expanded in t around -inf 82.7%
mul-1-neg82.7%
*-commutative82.7%
unpow282.7%
unpow282.7%
times-frac99.4%
unpow299.4%
unpow299.4%
times-frac82.7%
Simplified82.7%
Taylor expanded in Om around 0 98.0%
if -1.00000000000000002e151 < (/.f64 t l) < 5.00000000000000022e92Initial program 99.1%
sqrt-div99.0%
div-inv99.0%
add-sqr-sqrt99.0%
hypot-1-def99.0%
*-commutative99.0%
sqrt-prod99.0%
unpow299.0%
sqrt-prod55.3%
add-sqr-sqrt99.0%
Applied egg-rr99.0%
unpow299.0%
times-frac87.1%
unpow287.1%
unpow287.1%
associate-*r/87.1%
*-rgt-identity87.1%
unpow287.1%
unpow287.1%
times-frac99.0%
unpow299.0%
Simplified99.0%
unpow299.0%
clear-num99.0%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in Om around 0 76.7%
*-commutative76.7%
unpow276.7%
unpow276.7%
swap-sqr76.8%
associate-*l*76.8%
unpow276.8%
times-frac98.0%
*-commutative98.0%
associate-*r*97.9%
rem-square-sqrt98.1%
Simplified98.1%
if 5.00000000000000022e92 < (/.f64 t l) Initial program 54.3%
sqrt-div54.3%
div-inv54.3%
add-sqr-sqrt54.3%
hypot-1-def54.3%
*-commutative54.3%
sqrt-prod54.3%
unpow254.3%
sqrt-prod96.6%
add-sqr-sqrt96.8%
Applied egg-rr96.8%
unpow296.8%
times-frac90.3%
unpow290.3%
unpow290.3%
associate-*r/90.3%
*-rgt-identity90.3%
unpow290.3%
unpow290.3%
times-frac96.8%
unpow296.8%
Simplified96.8%
unpow296.8%
clear-num96.8%
un-div-inv96.8%
Applied egg-rr96.8%
Taylor expanded in Om around 0 43.9%
*-commutative43.9%
unpow243.9%
unpow243.9%
swap-sqr44.0%
associate-*l*43.9%
unpow243.9%
times-frac54.3%
*-commutative54.3%
associate-*r*54.3%
rem-square-sqrt54.3%
Simplified54.3%
Taylor expanded in t around inf 99.5%
associate-*l/99.5%
Simplified99.5%
Final simplification98.3%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -40.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 5e-6)
(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) <= -40.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 5e-6) {
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) <= (-40.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 5d-6) 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) <= -40.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 5e-6) {
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) <= -40.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 5e-6: 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) <= -40.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 5e-6) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -40.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 5e-6) 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], -40.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e-6], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -40:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -40Initial program 57.5%
sqrt-div57.3%
div-inv57.3%
add-sqr-sqrt57.3%
hypot-1-def57.3%
*-commutative57.3%
sqrt-prod57.3%
unpow257.3%
sqrt-prod0.0%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
unpow297.9%
times-frac81.7%
unpow281.7%
unpow281.7%
associate-*r/81.7%
*-rgt-identity81.7%
unpow281.7%
unpow281.7%
times-frac98.0%
unpow298.0%
Simplified98.0%
Taylor expanded in t around -inf 81.2%
mul-1-neg81.2%
*-commutative81.2%
unpow281.2%
unpow281.2%
times-frac97.6%
unpow297.6%
unpow297.6%
times-frac81.2%
Simplified81.2%
Taylor expanded in Om around 0 96.9%
if -40 < (/.f64 t l) < 5.00000000000000041e-6Initial program 99.0%
sqrt-div99.0%
div-inv99.0%
add-sqr-sqrt99.0%
hypot-1-def99.0%
*-commutative99.0%
sqrt-prod99.0%
unpow299.0%
sqrt-prod60.3%
add-sqr-sqrt99.0%
Applied egg-rr99.0%
unpow299.0%
times-frac87.0%
unpow287.0%
unpow287.0%
associate-*r/87.0%
*-rgt-identity87.0%
unpow287.0%
unpow287.0%
times-frac99.0%
unpow299.0%
Simplified99.0%
unpow299.0%
clear-num99.0%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in Om around 0 90.1%
*-commutative90.1%
unpow290.1%
unpow290.1%
swap-sqr90.1%
associate-*l*90.1%
unpow290.1%
times-frac98.5%
*-commutative98.5%
associate-*r*98.5%
rem-square-sqrt98.5%
Simplified98.5%
Taylor expanded in t around 0 90.1%
mul-1-neg90.1%
unsub-neg90.1%
unpow290.1%
unpow290.1%
times-frac98.1%
unpow298.1%
Simplified98.1%
if 5.00000000000000041e-6 < (/.f64 t l) Initial program 66.3%
sqrt-div66.2%
div-inv66.2%
add-sqr-sqrt66.2%
hypot-1-def66.3%
*-commutative66.3%
sqrt-prod66.3%
unpow266.3%
sqrt-prod96.9%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
unpow297.3%
times-frac91.0%
unpow291.0%
unpow291.0%
associate-*r/91.0%
*-rgt-identity91.0%
unpow291.0%
unpow291.0%
times-frac97.3%
unpow297.3%
Simplified97.3%
unpow297.3%
clear-num97.3%
un-div-inv97.3%
Applied egg-rr97.3%
Taylor expanded in Om around 0 37.5%
*-commutative37.5%
unpow237.5%
unpow237.5%
swap-sqr37.5%
associate-*l*37.5%
unpow237.5%
times-frac64.5%
*-commutative64.5%
associate-*r*64.4%
rem-square-sqrt64.5%
Simplified64.5%
Taylor expanded in t around inf 94.4%
associate-*l/94.5%
Simplified94.5%
Final simplification96.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -4.3e+57)
(asin 1.0)
(if (<= l -2.9e-300)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= l 28500.0) (asin (* l (/ (sqrt 0.5) t))) (asin 1.0)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -4.3e+57) {
tmp = asin(1.0);
} else if (l <= -2.9e-300) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if (l <= 28500.0) {
tmp = asin((l * (sqrt(0.5) / t)));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-4.3d+57)) then
tmp = asin(1.0d0)
else if (l <= (-2.9d-300)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if (l <= 28500.0d0) then
tmp = asin((l * (sqrt(0.5d0) / t)))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -4.3e+57) {
tmp = Math.asin(1.0);
} else if (l <= -2.9e-300) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if (l <= 28500.0) {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if l <= -4.3e+57: tmp = math.asin(1.0) elif l <= -2.9e-300: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif l <= 28500.0: tmp = math.asin((l * (math.sqrt(0.5) / t))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (l <= -4.3e+57) tmp = asin(1.0); elseif (l <= -2.9e-300) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (l <= 28500.0) tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -4.3e+57) tmp = asin(1.0); elseif (l <= -2.9e-300) tmp = asin((-l / (t * sqrt(2.0)))); elseif (l <= 28500.0) tmp = asin((l * (sqrt(0.5) / t))); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[l, -4.3e+57], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -2.9e-300], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 28500.0], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.3 \cdot 10^{+57}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -2.9 \cdot 10^{-300}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\ell \leq 28500:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -4.30000000000000033e57 or 28500 < l Initial program 96.2%
sqrt-div96.2%
div-inv96.2%
add-sqr-sqrt96.2%
hypot-1-def96.2%
*-commutative96.2%
sqrt-prod96.2%
unpow296.2%
sqrt-prod63.3%
add-sqr-sqrt99.1%
Applied egg-rr99.1%
unpow299.1%
times-frac87.7%
unpow287.7%
unpow287.7%
associate-*r/87.7%
*-rgt-identity87.7%
unpow287.7%
unpow287.7%
times-frac99.1%
unpow299.1%
Simplified99.1%
unpow299.1%
clear-num99.1%
un-div-inv99.1%
Applied egg-rr99.1%
Taylor expanded in Om around 0 79.5%
*-commutative79.5%
unpow279.5%
unpow279.5%
swap-sqr79.5%
associate-*l*79.5%
unpow279.5%
times-frac95.6%
*-commutative95.6%
associate-*r*95.6%
rem-square-sqrt95.7%
Simplified95.7%
Taylor expanded in t around 0 80.0%
if -4.30000000000000033e57 < l < -2.89999999999999992e-300Initial program 65.9%
sqrt-div65.8%
div-inv65.8%
add-sqr-sqrt65.8%
hypot-1-def65.8%
*-commutative65.8%
sqrt-prod65.9%
unpow265.9%
sqrt-prod45.1%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
unpow297.2%
times-frac85.9%
unpow285.9%
unpow285.9%
associate-*r/85.9%
*-rgt-identity85.9%
unpow285.9%
unpow285.9%
times-frac97.2%
unpow297.2%
Simplified97.2%
Taylor expanded in t around -inf 40.6%
mul-1-neg40.6%
*-commutative40.6%
unpow240.6%
unpow240.6%
times-frac46.3%
unpow246.3%
unpow246.3%
times-frac40.6%
Simplified40.6%
Taylor expanded in Om around 0 46.3%
if -2.89999999999999992e-300 < l < 28500Initial program 64.8%
sqrt-div64.7%
div-inv64.7%
add-sqr-sqrt64.7%
hypot-1-def64.7%
*-commutative64.7%
sqrt-prod64.8%
unpow264.8%
sqrt-prod47.9%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
unpow298.1%
times-frac85.5%
unpow285.5%
unpow285.5%
associate-*r/85.5%
*-rgt-identity85.5%
unpow285.5%
unpow285.5%
times-frac98.1%
unpow298.1%
Simplified98.1%
unpow298.1%
clear-num98.1%
un-div-inv98.1%
Applied egg-rr98.1%
Taylor expanded in Om around 0 47.4%
*-commutative47.4%
unpow247.4%
unpow247.4%
swap-sqr47.5%
associate-*l*47.5%
unpow247.5%
times-frac62.6%
*-commutative62.6%
associate-*r*62.6%
rem-square-sqrt62.7%
Simplified62.7%
Taylor expanded in t around inf 48.0%
associate-*l/48.1%
Simplified48.1%
Final simplification63.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= l -8.6e-108) (asin 1.0) (if (<= l 23500.0) (asin (* l (/ (sqrt 0.5) t))) (asin 1.0))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -8.6e-108) {
tmp = asin(1.0);
} else if (l <= 23500.0) {
tmp = asin((l * (sqrt(0.5) / t)));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-8.6d-108)) then
tmp = asin(1.0d0)
else if (l <= 23500.0d0) then
tmp = asin((l * (sqrt(0.5d0) / t)))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -8.6e-108) {
tmp = Math.asin(1.0);
} else if (l <= 23500.0) {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if l <= -8.6e-108: tmp = math.asin(1.0) elif l <= 23500.0: tmp = math.asin((l * (math.sqrt(0.5) / t))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (l <= -8.6e-108) tmp = asin(1.0); elseif (l <= 23500.0) tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -8.6e-108) tmp = asin(1.0); elseif (l <= 23500.0) tmp = asin((l * (sqrt(0.5) / t))); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[l, -8.6e-108], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 23500.0], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -8.6 \cdot 10^{-108}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 23500:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -8.6000000000000001e-108 or 23500 < l Initial program 91.5%
sqrt-div91.5%
div-inv91.5%
add-sqr-sqrt91.5%
hypot-1-def91.5%
*-commutative91.5%
sqrt-prod91.5%
unpow291.5%
sqrt-prod59.2%
add-sqr-sqrt99.2%
Applied egg-rr99.2%
unpow299.2%
times-frac88.0%
unpow288.0%
unpow288.0%
associate-*r/88.0%
*-rgt-identity88.0%
unpow288.0%
unpow288.0%
times-frac99.2%
unpow299.2%
Simplified99.2%
unpow299.2%
clear-num99.2%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in Om around 0 77.9%
*-commutative77.9%
unpow277.9%
unpow277.9%
swap-sqr77.9%
associate-*l*77.9%
unpow277.9%
times-frac91.1%
*-commutative91.1%
associate-*r*91.0%
rem-square-sqrt91.2%
Simplified91.2%
Taylor expanded in t around 0 73.5%
if -8.6000000000000001e-108 < l < 23500Initial program 63.8%
sqrt-div63.8%
div-inv63.8%
add-sqr-sqrt63.8%
hypot-1-def63.8%
*-commutative63.8%
sqrt-prod63.8%
unpow263.8%
sqrt-prod47.9%
add-sqr-sqrt97.0%
Applied egg-rr97.0%
unpow297.0%
times-frac84.7%
unpow284.7%
unpow284.7%
associate-*r/84.7%
*-rgt-identity84.7%
unpow284.7%
unpow284.7%
times-frac97.0%
unpow297.0%
Simplified97.0%
unpow297.0%
clear-num97.0%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in Om around 0 41.3%
*-commutative41.3%
unpow241.3%
unpow241.3%
swap-sqr41.3%
associate-*l*41.3%
unpow241.3%
times-frac62.6%
*-commutative62.6%
associate-*r*62.6%
rem-square-sqrt62.7%
Simplified62.7%
Taylor expanded in t around inf 51.8%
associate-*l/51.8%
Simplified51.8%
Final simplification65.3%
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 81.0%
sqrt-div81.0%
div-inv81.0%
add-sqr-sqrt81.0%
hypot-1-def81.0%
*-commutative81.0%
sqrt-prod81.0%
unpow281.0%
sqrt-prod54.9%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
unpow298.3%
times-frac86.7%
unpow286.7%
unpow286.7%
associate-*r/86.7%
*-rgt-identity86.7%
unpow286.7%
unpow286.7%
times-frac98.3%
unpow298.3%
Simplified98.3%
unpow298.3%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in Om around 0 64.0%
*-commutative64.0%
unpow264.0%
unpow264.0%
swap-sqr64.0%
associate-*l*64.0%
unpow264.0%
times-frac80.3%
*-commutative80.3%
associate-*r*80.2%
rem-square-sqrt80.4%
Simplified80.4%
Taylor expanded in t around 0 52.9%
Final simplification52.9%
herbie shell --seed 2023274
(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)))))))