
(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) -5e+155)
(- (asin (* (sqrt 0.5) (/ l t))))
(if (<= (/ t l) 1e+133)
(asin
(sqrt
(/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ l (* t (sqrt 2.0)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+155) {
tmp = -asin((sqrt(0.5) * (l / t)));
} else if ((t / l) <= 1e+133) {
tmp = asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+155)) then
tmp = -asin((sqrt(0.5d0) * (l / t)))
else if ((t / l) <= 1d+133) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+155) {
tmp = -Math.asin((Math.sqrt(0.5) * (l / t)));
} else if ((t / l) <= 1e+133) {
tmp = Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+155: tmp = -math.asin((math.sqrt(0.5) * (l / t))) elif (t / l) <= 1e+133: tmp = math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+155) tmp = Float64(-asin(Float64(sqrt(0.5) * Float64(l / t)))); elseif (Float64(t / l) <= 1e+133) tmp = asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+155) tmp = -asin((sqrt(0.5) * (l / t))); elseif ((t / l) <= 1e+133) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+155], (-N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[N[(t / l), $MachinePrecision], 1e+133], 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[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+155}:\\
\;\;\;\;-\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+133}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.9999999999999999e155Initial program 53.8%
clear-num53.8%
inv-pow53.8%
+-commutative53.8%
fma-def53.8%
Applied egg-rr53.8%
Taylor expanded in Om around 0 53.8%
associate-*r/53.8%
rem-square-sqrt53.8%
unpow253.8%
unpow253.8%
rem-square-sqrt53.8%
associate-*r/53.8%
unpow253.8%
unpow253.8%
Simplified53.8%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
associate-/l*97.9%
Simplified97.9%
asin-neg97.9%
associate-/r/99.6%
Applied egg-rr99.6%
associate-*l/99.6%
associate-*r/99.7%
Simplified99.7%
if -4.9999999999999999e155 < (/.f64 t l) < 1e133Initial program 98.5%
unpow298.5%
Applied egg-rr98.5%
if 1e133 < (/.f64 t l) Initial program 56.0%
sqrt-div56.1%
add-sqr-sqrt56.1%
hypot-1-def56.1%
*-commutative56.1%
sqrt-prod56.0%
unpow256.0%
sqrt-prod99.3%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Taylor expanded in Om around 0 99.7%
Taylor expanded in t around inf 99.8%
Final simplification98.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t 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 85.5%
sqrt-div85.5%
add-sqr-sqrt85.5%
hypot-1-def85.5%
*-commutative85.5%
sqrt-prod85.4%
unpow285.4%
sqrt-prod51.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Final simplification98.5%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+20)
(asin (* (/ l t) (- (sqrt (* 0.5 (- 1.0 (/ (/ Om Omc) (/ Omc Om))))))))
(if (<= (/ t l) 2e-9)
(asin (sqrt (- 1.0 (pow (/ Om Omc) 2.0))))
(asin (/ l (* t (sqrt 2.0)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+20) {
tmp = asin(((l / t) * -sqrt((0.5 * (1.0 - ((Om / Omc) / (Omc / Om)))))));
} else if ((t / l) <= 2e-9) {
tmp = asin(sqrt((1.0 - pow((Om / Omc), 2.0))));
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-2d+20)) then
tmp = asin(((l / t) * -sqrt((0.5d0 * (1.0d0 - ((om / omc) / (omc / om)))))))
else if ((t / l) <= 2d-9) then
tmp = asin(sqrt((1.0d0 - ((om / omc) ** 2.0d0))))
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+20) {
tmp = Math.asin(((l / t) * -Math.sqrt((0.5 * (1.0 - ((Om / Omc) / (Omc / Om)))))));
} else if ((t / l) <= 2e-9) {
tmp = Math.asin(Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+20: tmp = math.asin(((l / t) * -math.sqrt((0.5 * (1.0 - ((Om / Omc) / (Omc / Om))))))) elif (t / l) <= 2e-9: tmp = math.asin(math.sqrt((1.0 - math.pow((Om / Omc), 2.0)))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2e+20) tmp = asin(Float64(Float64(l / t) * Float64(-sqrt(Float64(0.5 * Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))))))); elseif (Float64(t / l) <= 2e-9) tmp = asin(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+20) tmp = asin(((l / t) * -sqrt((0.5 * (1.0 - ((Om / Omc) / (Omc / Om))))))); elseif ((t / l) <= 2e-9) tmp = asin(sqrt((1.0 - ((Om / Omc) ^ 2.0)))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+20], N[ArcSin[N[(N[(l / t), $MachinePrecision] * (-N[Sqrt[N[(0.5 * N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-9], N[ArcSin[N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \left(-\sqrt{0.5 \cdot \left(1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\right)}\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e20Initial program 68.4%
Taylor expanded in t around -inf 91.5%
mul-1-neg91.5%
*-commutative91.5%
unpow291.5%
unpow291.5%
associate-/l*90.3%
Simplified90.3%
times-frac98.3%
unpow298.3%
expm1-log1p-u98.3%
expm1-udef37.7%
associate-*r/37.7%
div-inv37.7%
sqrt-unprod37.7%
clear-num37.7%
Applied egg-rr37.7%
expm1-def99.6%
expm1-log1p99.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
unpow299.6%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
if -2e20 < (/.f64 t l) < 2.00000000000000012e-9Initial program 98.1%
Taylor expanded in t around 0 79.9%
unpow279.9%
unpow279.9%
times-frac94.9%
unpow294.9%
Simplified94.9%
if 2.00000000000000012e-9 < (/.f64 t l) Initial program 72.8%
sqrt-div72.7%
add-sqr-sqrt72.7%
hypot-1-def72.7%
*-commutative72.7%
sqrt-prod72.5%
unpow272.5%
sqrt-prod99.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in Om around 0 99.5%
Taylor expanded in t around inf 98.4%
Final simplification96.8%
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 85.5%
sqrt-div85.5%
add-sqr-sqrt85.5%
hypot-1-def85.5%
*-commutative85.5%
sqrt-prod85.4%
unpow285.4%
sqrt-prod51.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 97.4%
Final simplification97.4%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+155)
(- (asin (* (sqrt 0.5) (/ l t))))
(if (<= (/ t l) 1e+133)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ l (* t (sqrt 2.0)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+155) {
tmp = -asin((sqrt(0.5) * (l / t)));
} else if ((t / l) <= 1e+133) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+155)) then
tmp = -asin((sqrt(0.5d0) * (l / t)))
else if ((t / l) <= 1d+133) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+155) {
tmp = -Math.asin((Math.sqrt(0.5) * (l / t)));
} else if ((t / l) <= 1e+133) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+155: tmp = -math.asin((math.sqrt(0.5) * (l / t))) elif (t / l) <= 1e+133: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+155) tmp = Float64(-asin(Float64(sqrt(0.5) * Float64(l / t)))); elseif (Float64(t / l) <= 1e+133) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+155) tmp = -asin((sqrt(0.5) * (l / t))); elseif ((t / l) <= 1e+133) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+155], (-N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[N[(t / l), $MachinePrecision], 1e+133], 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[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+155}:\\
\;\;\;\;-\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+133}:\\
\;\;\;\;\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}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.9999999999999999e155Initial program 53.8%
clear-num53.8%
inv-pow53.8%
+-commutative53.8%
fma-def53.8%
Applied egg-rr53.8%
Taylor expanded in Om around 0 53.8%
associate-*r/53.8%
rem-square-sqrt53.8%
unpow253.8%
unpow253.8%
rem-square-sqrt53.8%
associate-*r/53.8%
unpow253.8%
unpow253.8%
Simplified53.8%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
associate-/l*97.9%
Simplified97.9%
asin-neg97.9%
associate-/r/99.6%
Applied egg-rr99.6%
associate-*l/99.6%
associate-*r/99.7%
Simplified99.7%
if -4.9999999999999999e155 < (/.f64 t l) < 1e133Initial program 98.5%
clear-num98.5%
inv-pow98.5%
+-commutative98.5%
fma-def98.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 73.9%
associate-*r/73.9%
rem-square-sqrt73.8%
unpow273.8%
unpow273.8%
rem-square-sqrt73.9%
associate-*r/73.9%
unpow273.9%
unpow273.9%
Simplified73.9%
*-un-lft-identity73.9%
times-frac96.9%
Applied egg-rr96.9%
*-lft-identity96.9%
Simplified96.9%
if 1e133 < (/.f64 t l) Initial program 56.0%
sqrt-div56.1%
add-sqr-sqrt56.1%
hypot-1-def56.1%
*-commutative56.1%
sqrt-prod56.0%
unpow256.0%
sqrt-prod99.3%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Taylor expanded in Om around 0 99.7%
Taylor expanded in t around inf 99.8%
Final simplification97.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+34)
(asin (* (/ l t) (- (sqrt (* 0.5 (- 1.0 (/ (/ Om Omc) (/ Omc Om))))))))
(if (<= (/ t l) 1e+133)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ l (* t (sqrt 2.0)))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+34) {
tmp = asin(((l / t) * -sqrt((0.5 * (1.0 - ((Om / Omc) / (Omc / Om)))))));
} else if ((t / l) <= 1e+133) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+34)) then
tmp = asin(((l / t) * -sqrt((0.5d0 * (1.0d0 - ((om / omc) / (omc / om)))))))
else if ((t / l) <= 1d+133) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+34) {
tmp = Math.asin(((l / t) * -Math.sqrt((0.5 * (1.0 - ((Om / Omc) / (Omc / Om)))))));
} else if ((t / l) <= 1e+133) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+34: tmp = math.asin(((l / t) * -math.sqrt((0.5 * (1.0 - ((Om / Omc) / (Omc / Om))))))) elif (t / l) <= 1e+133: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+34) tmp = asin(Float64(Float64(l / t) * Float64(-sqrt(Float64(0.5 * Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))))))); elseif (Float64(t / l) <= 1e+133) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+34) tmp = asin(((l / t) * -sqrt((0.5 * (1.0 - ((Om / Omc) / (Omc / Om))))))); elseif ((t / l) <= 1e+133) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+34], N[ArcSin[N[(N[(l / t), $MachinePrecision] * (-N[Sqrt[N[(0.5 * N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+133], 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[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+34}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \left(-\sqrt{0.5 \cdot \left(1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\right)}\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+133}:\\
\;\;\;\;\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}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.9999999999999998e34Initial program 67.4%
Taylor expanded in t around -inf 91.2%
mul-1-neg91.2%
*-commutative91.2%
unpow291.2%
unpow291.2%
associate-/l*90.0%
Simplified90.0%
times-frac98.3%
unpow298.3%
expm1-log1p-u98.3%
expm1-udef38.8%
associate-*r/38.8%
div-inv38.8%
sqrt-unprod38.8%
clear-num38.8%
Applied egg-rr38.8%
expm1-def99.6%
expm1-log1p99.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
unpow299.6%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
if -4.9999999999999998e34 < (/.f64 t l) < 1e133Initial program 98.4%
clear-num98.4%
inv-pow98.4%
+-commutative98.4%
fma-def98.4%
Applied egg-rr98.4%
Taylor expanded in Om around 0 78.0%
associate-*r/78.0%
rem-square-sqrt78.0%
unpow278.0%
unpow278.0%
rem-square-sqrt78.0%
associate-*r/78.0%
unpow278.0%
unpow278.0%
Simplified78.0%
*-un-lft-identity78.0%
times-frac97.1%
Applied egg-rr97.1%
*-lft-identity97.1%
Simplified97.1%
if 1e133 < (/.f64 t l) Initial program 56.0%
sqrt-div56.1%
add-sqr-sqrt56.1%
hypot-1-def56.1%
*-commutative56.1%
sqrt-prod56.0%
unpow256.0%
sqrt-prod99.3%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
Taylor expanded in Om around 0 99.7%
Taylor expanded in t around inf 99.8%
Final simplification98.0%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (or (<= (/ t l) -5e+213) (not (<= (/ t l) 2e-9))) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0)))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (((t / l) <= -5e+213) || !((t / l) <= 2e-9)) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (((t / l) <= (-5d+213)) .or. (.not. ((t / l) <= 2d-9))) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (((t / l) <= -5e+213) || !((t / l) <= 2e-9)) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if ((t / l) <= -5e+213) or not ((t / l) <= 2e-9): tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if ((Float64(t / l) <= -5e+213) || !(Float64(t / l) <= 2e-9)) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (((t / l) <= -5e+213) || ~(((t / l) <= 2e-9))) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[Or[LessEqual[N[(t / l), $MachinePrecision], -5e+213], N[Not[LessEqual[N[(t / l), $MachinePrecision], 2e-9]], $MachinePrecision]], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+213} \lor \neg \left(\frac{t}{\ell} \leq 2 \cdot 10^{-9}\right):\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if (/.f64 t l) < -4.9999999999999998e213 or 2.00000000000000012e-9 < (/.f64 t l) Initial program 71.4%
sqrt-div71.3%
add-sqr-sqrt71.3%
hypot-1-def71.3%
*-commutative71.3%
sqrt-prod71.2%
unpow271.2%
sqrt-prod62.6%
add-sqr-sqrt98.8%
Applied egg-rr98.8%
Taylor expanded in Om around 0 98.8%
Taylor expanded in t around inf 87.4%
if -4.9999999999999998e213 < (/.f64 t l) < 2.00000000000000012e-9Initial program 92.8%
sqrt-div92.8%
add-sqr-sqrt92.8%
hypot-1-def92.8%
*-commutative92.8%
sqrt-prod92.7%
unpow292.7%
sqrt-prod45.7%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
Taylor expanded in Om around 0 96.6%
Taylor expanded in t around 0 77.8%
Final simplification81.1%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -2e+20) (asin (/ (- (sqrt 0.5)) (/ t l))) (if (<= (/ t l) 2e-9) (asin 1.0) (asin (/ l (* t (sqrt 2.0)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+20) {
tmp = asin((-sqrt(0.5) / (t / l)));
} else if ((t / l) <= 2e-9) {
tmp = asin(1.0);
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-2d+20)) then
tmp = asin((-sqrt(0.5d0) / (t / l)))
else if ((t / l) <= 2d-9) then
tmp = asin(1.0d0)
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+20) {
tmp = Math.asin((-Math.sqrt(0.5) / (t / l)));
} else if ((t / l) <= 2e-9) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+20: tmp = math.asin((-math.sqrt(0.5) / (t / l))) elif (t / l) <= 2e-9: tmp = math.asin(1.0) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2e+20) tmp = asin(Float64(Float64(-sqrt(0.5)) / Float64(t / l))); elseif (Float64(t / l) <= 2e-9) tmp = asin(1.0); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+20) tmp = asin((-sqrt(0.5) / (t / l))); elseif ((t / l) <= 2e-9) tmp = asin(1.0); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+20], N[ArcSin[N[((-N[Sqrt[0.5], $MachinePrecision]) / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-9], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+20}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e20Initial program 68.4%
clear-num68.4%
inv-pow68.4%
+-commutative68.4%
fma-def68.4%
Applied egg-rr68.4%
Taylor expanded in Om around 0 48.6%
associate-*r/48.6%
rem-square-sqrt48.5%
unpow248.5%
unpow248.5%
rem-square-sqrt48.6%
associate-*r/48.6%
unpow248.6%
unpow248.6%
Simplified48.6%
Taylor expanded in t around -inf 98.4%
mul-1-neg98.4%
associate-/l*97.2%
Simplified97.2%
if -2e20 < (/.f64 t l) < 2.00000000000000012e-9Initial program 98.1%
sqrt-div98.1%
add-sqr-sqrt98.1%
hypot-1-def98.1%
*-commutative98.1%
sqrt-prod98.1%
unpow298.1%
sqrt-prod55.5%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
Taylor expanded in Om around 0 96.6%
Taylor expanded in t around 0 93.4%
if 2.00000000000000012e-9 < (/.f64 t l) Initial program 72.8%
sqrt-div72.7%
add-sqr-sqrt72.7%
hypot-1-def72.7%
*-commutative72.7%
sqrt-prod72.5%
unpow272.5%
sqrt-prod99.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in Om around 0 99.5%
Taylor expanded in t around inf 98.4%
Final simplification95.4%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -2e+20) (- (asin (* (sqrt 0.5) (/ l t)))) (if (<= (/ t l) 2e-9) (asin 1.0) (asin (/ l (* t (sqrt 2.0)))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+20) {
tmp = -asin((sqrt(0.5) * (l / t)));
} else if ((t / l) <= 2e-9) {
tmp = asin(1.0);
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-2d+20)) then
tmp = -asin((sqrt(0.5d0) * (l / t)))
else if ((t / l) <= 2d-9) then
tmp = asin(1.0d0)
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+20) {
tmp = -Math.asin((Math.sqrt(0.5) * (l / t)));
} else if ((t / l) <= 2e-9) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+20: tmp = -math.asin((math.sqrt(0.5) * (l / t))) elif (t / l) <= 2e-9: tmp = math.asin(1.0) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2e+20) tmp = Float64(-asin(Float64(sqrt(0.5) * Float64(l / t)))); elseif (Float64(t / l) <= 2e-9) tmp = asin(1.0); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+20) tmp = -asin((sqrt(0.5) * (l / t))); elseif ((t / l) <= 2e-9) tmp = asin(1.0); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+20], (-N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[N[(t / l), $MachinePrecision], 2e-9], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+20}:\\
\;\;\;\;-\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e20Initial program 68.4%
clear-num68.4%
inv-pow68.4%
+-commutative68.4%
fma-def68.4%
Applied egg-rr68.4%
Taylor expanded in Om around 0 48.6%
associate-*r/48.6%
rem-square-sqrt48.5%
unpow248.5%
unpow248.5%
rem-square-sqrt48.6%
associate-*r/48.6%
unpow248.6%
unpow248.6%
Simplified48.6%
Taylor expanded in t around -inf 98.4%
mul-1-neg98.4%
associate-/l*97.2%
Simplified97.2%
asin-neg97.2%
associate-/r/98.4%
Applied egg-rr98.4%
associate-*l/98.4%
associate-*r/98.5%
Simplified98.5%
if -2e20 < (/.f64 t l) < 2.00000000000000012e-9Initial program 98.1%
sqrt-div98.1%
add-sqr-sqrt98.1%
hypot-1-def98.1%
*-commutative98.1%
sqrt-prod98.1%
unpow298.1%
sqrt-prod55.5%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
Taylor expanded in Om around 0 96.6%
Taylor expanded in t around 0 93.4%
if 2.00000000000000012e-9 < (/.f64 t l) Initial program 72.8%
sqrt-div72.7%
add-sqr-sqrt72.7%
hypot-1-def72.7%
*-commutative72.7%
sqrt-prod72.5%
unpow272.5%
sqrt-prod99.0%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
Taylor expanded in Om around 0 99.5%
Taylor expanded in t around inf 98.4%
Final simplification95.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 85.5%
sqrt-div85.5%
add-sqr-sqrt85.5%
hypot-1-def85.5%
*-commutative85.5%
sqrt-prod85.4%
unpow285.4%
sqrt-prod51.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 97.4%
Taylor expanded in t around 0 52.8%
Final simplification52.8%
herbie shell --seed 2023254
(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)))))))