
(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 10 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) -1.5e+117)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 5e+113)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(fabs (asin (* (sqrt 0.5) (/ l t)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1.5e+117) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 5e+113) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = fabs(asin((sqrt(0.5) * (l / 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) <= (-1.5d+117)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 5d+113) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = abs(asin((sqrt(0.5d0) * (l / 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) <= -1.5e+117) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 5e+113) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.abs(Math.asin((Math.sqrt(0.5) * (l / t))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1.5e+117: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 5e+113: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.fabs(math.asin((math.sqrt(0.5) * (l / t)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1.5e+117) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 5e+113) 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(t / l))))))); else tmp = abs(asin(Float64(sqrt(0.5) * Float64(l / t)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1.5e+117) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 5e+113) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = abs(asin((sqrt(0.5) * (l / 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], -1.5e+117], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+113], 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[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Abs[N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1.5 \cdot 10^{+117}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+113}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\right|\\
\end{array}
\end{array}
if (/.f64 t l) < -1.5e117Initial program 68.5%
sqrt-div68.4%
add-sqr-sqrt68.4%
hypot-1-def68.4%
*-commutative68.4%
sqrt-prod68.4%
unpow268.4%
sqrt-prod0.0%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
Taylor expanded in Om around 0 99.6%
Taylor expanded in t around -inf 99.7%
associate-*r/99.7%
neg-mul-199.7%
Simplified99.7%
if -1.5e117 < (/.f64 t l) < 5e113Initial program 98.7%
unpow298.7%
Applied egg-rr98.7%
unpow298.7%
Applied egg-rr98.7%
if 5e113 < (/.f64 t l) Initial program 43.7%
Taylor expanded in t around inf 85.8%
*-commutative85.8%
unpow285.8%
unpow285.8%
times-frac99.4%
unpow299.4%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in Om around 0 98.1%
add-sqr-sqrt97.9%
sqrt-unprod43.7%
pow243.7%
*-un-lft-identity43.7%
div-inv43.7%
clear-num43.7%
Applied egg-rr43.7%
unpow243.7%
rem-sqrt-square99.4%
Simplified99.4%
Final simplification99.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 (* (/ 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.4%
sqrt-div84.4%
add-sqr-sqrt84.4%
hypot-1-def84.4%
*-commutative84.4%
sqrt-prod84.3%
unpow284.3%
sqrt-prod54.2%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Final simplification98.7%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.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((1.0 / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.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[(1.0 / 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{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 84.4%
sqrt-div84.4%
add-sqr-sqrt84.4%
hypot-1-def84.4%
*-commutative84.4%
sqrt-prod84.3%
unpow284.3%
sqrt-prod54.2%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 98.2%
Final simplification98.2%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1.5e+117)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 5e+113)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* (sqrt 0.5) (/ l t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1.5e+117) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 5e+113) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((sqrt(0.5) * (l / 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) <= (-1.5d+117)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 5d+113) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((sqrt(0.5d0) * (l / 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) <= -1.5e+117) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 5e+113) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1.5e+117: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 5e+113: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1.5e+117) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 5e+113) 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(t / l))))))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1.5e+117) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 5e+113) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((sqrt(0.5) * (l / 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], -1.5e+117], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+113], 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[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1.5 \cdot 10^{+117}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+113}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.5e117Initial program 68.5%
sqrt-div68.4%
add-sqr-sqrt68.4%
hypot-1-def68.4%
*-commutative68.4%
sqrt-prod68.4%
unpow268.4%
sqrt-prod0.0%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
Taylor expanded in Om around 0 99.6%
Taylor expanded in t around -inf 99.7%
associate-*r/99.7%
neg-mul-199.7%
Simplified99.7%
if -1.5e117 < (/.f64 t l) < 5e113Initial program 98.7%
unpow298.7%
Applied egg-rr98.7%
unpow298.7%
Applied egg-rr98.7%
if 5e113 < (/.f64 t l) Initial program 43.7%
Taylor expanded in t around inf 85.8%
*-commutative85.8%
unpow285.8%
unpow285.8%
times-frac99.4%
unpow299.4%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around 0 99.4%
associate-*r/99.4%
Simplified99.4%
Final simplification99.0%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+62)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 2e+78)
(asin (sqrt (/ 1.0 (+ 1.0 (/ (* 2.0 (/ t (/ l t))) l)))))
(asin (* (sqrt 0.5) (/ l t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+62) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 2e+78) {
tmp = asin(sqrt((1.0 / (1.0 + ((2.0 * (t / (l / t))) / l)))));
} else {
tmp = asin((sqrt(0.5) * (l / 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+62)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 2d+78) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + ((2.0d0 * (t / (l / t))) / l)))))
else
tmp = asin((sqrt(0.5d0) * (l / 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+62) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 2e+78) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + ((2.0 * (t / (l / t))) / l)))));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+62: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 2e+78: tmp = math.asin(math.sqrt((1.0 / (1.0 + ((2.0 * (t / (l / t))) / l))))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+62) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 2e+78) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(Float64(2.0 * Float64(t / Float64(l / t))) / l))))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+62) tmp = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 2e+78) tmp = asin(sqrt((1.0 / (1.0 + ((2.0 * (t / (l / t))) / l))))); else tmp = asin((sqrt(0.5) * (l / 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+62], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+78], 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[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+62}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+78}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + \frac{2 \cdot \frac{t}{\frac{\ell}{t}}}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.00000000000000004e62Initial program 74.6%
sqrt-div74.6%
add-sqr-sqrt74.6%
hypot-1-def74.6%
*-commutative74.6%
sqrt-prod74.4%
unpow274.4%
sqrt-prod0.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
add-sqr-sqrt99.3%
pow299.3%
Applied egg-rr99.3%
Taylor expanded in Om around 0 57.0%
unpow257.0%
rem-square-sqrt57.0%
unpow257.0%
times-frac63.5%
unpow263.5%
Simplified63.5%
Taylor expanded in t around -inf 99.1%
mul-1-neg99.1%
associate-*r/99.2%
distribute-rgt-neg-in99.2%
Simplified99.2%
if -1.00000000000000004e62 < (/.f64 t l) < 2.00000000000000002e78Initial program 98.6%
sqrt-div98.5%
add-sqr-sqrt98.5%
hypot-1-def98.5%
*-commutative98.5%
sqrt-prod98.5%
unpow298.5%
sqrt-prod58.9%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
add-sqr-sqrt98.5%
pow298.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 76.1%
unpow276.1%
rem-square-sqrt76.1%
unpow276.1%
times-frac82.5%
unpow282.5%
Simplified82.5%
associate-*l/82.5%
associate-/l*98.0%
Applied egg-rr98.0%
if 2.00000000000000002e78 < (/.f64 t l) Initial program 46.2%
Taylor expanded in t around inf 86.4%
*-commutative86.4%
unpow286.4%
unpow286.4%
times-frac99.4%
unpow299.4%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in Om around 0 98.2%
Taylor expanded in t around 0 99.4%
associate-*r/99.5%
Simplified99.5%
Final simplification98.5%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (or (<= (/ t l) -4e+206) (not (<= (/ t l) 0.0002))) (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 (((t / l) <= -4e+206) || !((t / l) <= 0.0002)) {
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 (((t / l) <= (-4d+206)) .or. (.not. ((t / l) <= 0.0002d0))) 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 (((t / l) <= -4e+206) || !((t / l) <= 0.0002)) {
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 ((t / l) <= -4e+206) or not ((t / l) <= 0.0002): 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 ((Float64(t / l) <= -4e+206) || !(Float64(t / l) <= 0.0002)) 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 (((t / l) <= -4e+206) || ~(((t / l) <= 0.0002))) 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[Or[LessEqual[N[(t / l), $MachinePrecision], -4e+206], N[Not[LessEqual[N[(t / l), $MachinePrecision], 0.0002]], $MachinePrecision]], 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}\;\frac{t}{\ell} \leq -4 \cdot 10^{+206} \lor \neg \left(\frac{t}{\ell} \leq 0.0002\right):\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if (/.f64 t l) < -4.0000000000000002e206 or 2.0000000000000001e-4 < (/.f64 t l) Initial program 66.6%
Taylor expanded in t around inf 83.1%
*-commutative83.1%
unpow283.1%
unpow283.1%
times-frac91.1%
unpow291.1%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in Om around 0 90.1%
Taylor expanded in t around 0 90.6%
associate-*r/90.7%
Simplified90.7%
if -4.0000000000000002e206 < (/.f64 t l) < 2.0000000000000001e-4Initial program 95.6%
sqrt-div95.6%
add-sqr-sqrt95.6%
hypot-1-def95.6%
*-commutative95.6%
sqrt-prod95.5%
unpow295.5%
sqrt-prod45.8%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around 0 79.4%
Final simplification83.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -4e+206) (asin (* l (/ (sqrt 0.5) t))) (if (<= (/ t l) 0.0002) (asin 1.0) (asin (* (sqrt 0.5) (/ l t))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -4e+206) {
tmp = asin((l * (sqrt(0.5) / t)));
} else if ((t / l) <= 0.0002) {
tmp = asin(1.0);
} else {
tmp = asin((sqrt(0.5) * (l / 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+206)) then
tmp = asin((l * (sqrt(0.5d0) / t)))
else if ((t / l) <= 0.0002d0) then
tmp = asin(1.0d0)
else
tmp = asin((sqrt(0.5d0) * (l / 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+206) {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -4e+206: tmp = math.asin((l * (math.sqrt(0.5) / t))) elif (t / l) <= 0.0002: tmp = math.asin(1.0) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -4e+206) tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); elseif (Float64(t / l) <= 0.0002) tmp = asin(1.0); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -4e+206) tmp = asin((l * (sqrt(0.5) / t))); elseif ((t / l) <= 0.0002) tmp = asin(1.0); else tmp = asin((sqrt(0.5) * (l / 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+206], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+206}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.0000000000000002e206Initial program 73.6%
Taylor expanded in t around inf 69.9%
*-commutative69.9%
unpow269.9%
unpow269.9%
times-frac73.1%
unpow273.1%
associate-/l*73.2%
Simplified73.2%
expm1-log1p-u73.2%
expm1-udef73.6%
associate-*r/73.6%
pow1/273.6%
pow1/273.6%
pow-prod-down73.6%
Applied egg-rr73.6%
expm1-def73.2%
expm1-log1p73.2%
associate-/r/73.1%
unpow1/273.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in Om around 0 73.1%
if -4.0000000000000002e206 < (/.f64 t l) < 2.0000000000000001e-4Initial program 95.6%
sqrt-div95.6%
add-sqr-sqrt95.6%
hypot-1-def95.6%
*-commutative95.6%
sqrt-prod95.5%
unpow295.5%
sqrt-prod45.8%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around 0 79.4%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 63.5%
Taylor expanded in t around inf 89.1%
*-commutative89.1%
unpow289.1%
unpow289.1%
times-frac99.3%
unpow299.3%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.8%
Taylor expanded in t around 0 98.6%
associate-*r/98.7%
Simplified98.7%
Final simplification83.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+15)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 0.0002)
(asin (- 1.0 (* (/ t l) (/ t l))))
(asin (* (sqrt 0.5) (/ l t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+15) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 0.0002) {
tmp = asin((1.0 - ((t / l) * (t / l))));
} else {
tmp = asin((sqrt(0.5) * (l / 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+15)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 0.0002d0) then
tmp = asin((1.0d0 - ((t / l) * (t / l))))
else
tmp = asin((sqrt(0.5d0) * (l / 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+15) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin((1.0 - ((t / l) * (t / l))));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+15: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 0.0002: tmp = math.asin((1.0 - ((t / l) * (t / l)))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+15) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 0.0002) tmp = asin(Float64(1.0 - Float64(Float64(t / l) * Float64(t / l)))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+15) tmp = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 0.0002) tmp = asin((1.0 - ((t / l) * (t / l)))); else tmp = asin((sqrt(0.5) * (l / 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+15], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[(1.0 - N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+15}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(1 - \frac{t}{\ell} \cdot \frac{t}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e15Initial program 78.4%
sqrt-div78.3%
add-sqr-sqrt78.3%
hypot-1-def78.3%
*-commutative78.3%
sqrt-prod78.1%
unpow278.1%
sqrt-prod0.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
add-sqr-sqrt99.3%
pow299.3%
Applied egg-rr99.3%
Taylor expanded in Om around 0 56.5%
unpow256.5%
rem-square-sqrt56.6%
unpow256.6%
times-frac62.7%
unpow262.7%
Simplified62.7%
Taylor expanded in t around -inf 98.3%
mul-1-neg98.3%
associate-*r/98.5%
distribute-rgt-neg-in98.5%
Simplified98.5%
if -1e15 < (/.f64 t l) < 2.0000000000000001e-4Initial program 98.4%
sqrt-div98.3%
add-sqr-sqrt98.3%
hypot-1-def98.3%
*-commutative98.3%
sqrt-prod98.4%
unpow298.4%
sqrt-prod56.2%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
add-sqr-sqrt98.3%
pow298.3%
Applied egg-rr98.3%
Taylor expanded in Om around 0 85.6%
unpow285.6%
rem-square-sqrt85.6%
unpow285.6%
times-frac91.9%
unpow291.9%
Simplified91.9%
Taylor expanded in l around inf 83.9%
mul-1-neg83.9%
unsub-neg83.9%
unpow283.9%
unpow283.9%
times-frac96.7%
Simplified96.7%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 63.5%
Taylor expanded in t around inf 89.1%
*-commutative89.1%
unpow289.1%
unpow289.1%
times-frac99.3%
unpow299.3%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.8%
Taylor expanded in t around 0 98.6%
associate-*r/98.7%
Simplified98.7%
Final simplification97.6%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+15)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 0.0002)
(asin (- 1.0 (* (/ t l) (/ t l))))
(asin (* (sqrt 0.5) (/ l t))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+15) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.0002) {
tmp = asin((1.0 - ((t / l) * (t / l))));
} else {
tmp = asin((sqrt(0.5) * (l / 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+15)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.0002d0) then
tmp = asin((1.0d0 - ((t / l) * (t / l))))
else
tmp = asin((sqrt(0.5d0) * (l / 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+15) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin((1.0 - ((t / l) * (t / l))));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+15: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.0002: tmp = math.asin((1.0 - ((t / l) * (t / l)))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+15) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.0002) tmp = asin(Float64(1.0 - Float64(Float64(t / l) * Float64(t / l)))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+15) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.0002) tmp = asin((1.0 - ((t / l) * (t / l)))); else tmp = asin((sqrt(0.5) * (l / 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+15], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[(1.0 - N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+15}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(1 - \frac{t}{\ell} \cdot \frac{t}{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e15Initial program 78.4%
sqrt-div78.3%
add-sqr-sqrt78.3%
hypot-1-def78.3%
*-commutative78.3%
sqrt-prod78.1%
unpow278.1%
sqrt-prod0.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in Om around 0 98.3%
Taylor expanded in t around -inf 98.4%
associate-*r/98.4%
neg-mul-198.4%
Simplified98.4%
if -1e15 < (/.f64 t l) < 2.0000000000000001e-4Initial program 98.4%
sqrt-div98.3%
add-sqr-sqrt98.3%
hypot-1-def98.3%
*-commutative98.3%
sqrt-prod98.4%
unpow298.4%
sqrt-prod56.2%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
add-sqr-sqrt98.3%
pow298.3%
Applied egg-rr98.3%
Taylor expanded in Om around 0 85.6%
unpow285.6%
rem-square-sqrt85.6%
unpow285.6%
times-frac91.9%
unpow291.9%
Simplified91.9%
Taylor expanded in l around inf 83.9%
mul-1-neg83.9%
unsub-neg83.9%
unpow283.9%
unpow283.9%
times-frac96.7%
Simplified96.7%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 63.5%
Taylor expanded in t around inf 89.1%
*-commutative89.1%
unpow289.1%
unpow289.1%
times-frac99.3%
unpow299.3%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in Om around 0 97.8%
Taylor expanded in t around 0 98.6%
associate-*r/98.7%
Simplified98.7%
Final simplification97.6%
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.4%
sqrt-div84.4%
add-sqr-sqrt84.4%
hypot-1-def84.4%
*-commutative84.4%
sqrt-prod84.3%
unpow284.3%
sqrt-prod54.2%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 98.2%
Taylor expanded in t around 0 50.5%
Final simplification50.5%
herbie shell --seed 2023203
(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)))))))