
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+98)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 10000000.0)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ t (* l (/ l t))))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+98) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 10000000.0) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t))))))));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-2d+98)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 10000000.0d0) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * (t / (l * (l / t))))))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+98) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 10000000.0) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t))))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+98: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 10000000.0: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t)))))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2e+98) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 10000000.0) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(t / Float64(l * Float64(l / t)))))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+98) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 10000000.0) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * (t / (l * (l / t)))))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+98], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 10000000.0], 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[(t / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+98}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10000000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{t}{\ell \cdot \frac{\ell}{t}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e98Initial program 55.1%
unpow255.1%
clear-num55.2%
frac-times55.1%
*-un-lft-identity55.1%
Applied egg-rr55.1%
Taylor expanded in Om around 0 51.1%
unpow251.1%
unpow251.1%
Simplified51.1%
frac-times55.1%
Applied egg-rr55.1%
Taylor expanded in t around -inf 99.7%
associate-*r/99.7%
mul-1-neg99.7%
*-commutative99.7%
Simplified99.7%
if -2e98 < (/.f64 t l) < 1e7Initial program 99.1%
unpow299.1%
clear-num99.1%
frac-times98.4%
*-un-lft-identity98.4%
Applied egg-rr98.4%
unpow298.4%
Applied egg-rr98.4%
if 1e7 < (/.f64 t l) Initial program 72.0%
unpow272.0%
clear-num71.9%
frac-times64.3%
*-un-lft-identity64.3%
Applied egg-rr64.3%
Taylor expanded in Om around 0 40.6%
unpow240.6%
unpow240.6%
Simplified40.6%
Taylor expanded in t around inf 99.1%
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 (sqrt 2.0)) l)))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t * Math.sqrt(2.0)) / l))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t * math.sqrt(2.0)) / l))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l)))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l)))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 84.3%
sqrt-div84.3%
div-inv84.3%
add-sqr-sqrt84.3%
hypot-1-def84.3%
*-commutative84.3%
sqrt-prod84.2%
unpow284.2%
sqrt-prod52.4%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
associate-*r/98.6%
*-rgt-identity98.6%
associate-*l/98.6%
Simplified98.6%
Final simplification98.6%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (let* ((t_1 (pow (/ t l) 2.0))) (if (<= t_1 4e-5) (asin (- 1.0 t_1)) (asin (/ (* l (sqrt 0.5)) t)))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = pow((t / l), 2.0);
double tmp;
if (t_1 <= 4e-5) {
tmp = asin((1.0 - t_1));
} 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) :: t_1
real(8) :: tmp
t_1 = (t / l) ** 2.0d0
if (t_1 <= 4d-5) then
tmp = asin((1.0d0 - t_1))
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 t_1 = Math.pow((t / l), 2.0);
double tmp;
if (t_1 <= 4e-5) {
tmp = Math.asin((1.0 - t_1));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.pow((t / l), 2.0) tmp = 0 if t_1 <= 4e-5: tmp = math.asin((1.0 - t_1)) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(t / l) ^ 2.0 tmp = 0.0 if (t_1 <= 4e-5) tmp = asin(Float64(1.0 - t_1)); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = (t / l) ^ 2.0; tmp = 0.0; if (t_1 <= 4e-5) tmp = asin((1.0 - t_1)); 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_] := Block[{t$95$1 = N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, 4e-5], N[ArcSin[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := {\left(\frac{t}{\ell}\right)}^{2}\\
\mathbf{if}\;t_1 \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\sin^{-1} \left(1 - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (pow.f64 (/.f64 t l) 2) < 4.00000000000000033e-5Initial program 99.0%
unpow299.0%
clear-num99.0%
frac-times99.0%
*-un-lft-identity99.0%
Applied egg-rr99.0%
Taylor expanded in Om around 0 88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Taylor expanded in t around 0 87.8%
mul-1-neg87.8%
unpow287.8%
unpow287.8%
times-frac97.4%
unpow297.4%
unsub-neg97.4%
Simplified97.4%
if 4.00000000000000033e-5 < (pow.f64 (/.f64 t l) 2) Initial program 70.4%
unpow270.4%
clear-num70.4%
frac-times66.2%
*-un-lft-identity66.2%
Applied egg-rr66.2%
Taylor expanded in Om around 0 43.1%
unpow243.1%
unpow243.1%
Simplified43.1%
Taylor expanded in t around inf 63.6%
Final simplification80.0%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (sqrt 2.0) (/ t l))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, (sqrt(2.0) * (t / l)))));
}
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, (Math.sqrt(2.0) * (t / l)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, (math.sqrt(2.0) * (t / l)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(sqrt(2.0) * Float64(t / l))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, (sqrt(2.0) * (t / l))))); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \sqrt{2} \cdot \frac{t}{\ell}\right)}\right)
\end{array}
Initial program 84.3%
unpow284.3%
clear-num84.3%
frac-times82.1%
*-un-lft-identity82.1%
Applied egg-rr82.1%
Taylor expanded in Om around 0 64.9%
unpow264.9%
unpow264.9%
Simplified64.9%
expm1-log1p-u64.9%
expm1-udef59.4%
pow1/259.4%
inv-pow59.4%
frac-times65.4%
pow-pow65.4%
+-commutative65.4%
fma-def65.4%
pow265.4%
metadata-eval65.4%
Applied egg-rr65.4%
expm1-def83.7%
expm1-log1p83.7%
Simplified83.7%
metadata-eval83.7%
sqrt-pow183.7%
fma-udef83.7%
pow283.7%
+-commutative83.7%
inv-pow83.7%
sqrt-div83.7%
metadata-eval83.7%
add-sqr-sqrt83.7%
hypot-1-def83.7%
*-commutative83.7%
sqrt-prod83.6%
sqrt-prod51.7%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
Final simplification97.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+33)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 10000000.0)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+33) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 10000000.0) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+33)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 10000000.0d0) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+33) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 10000000.0) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+33: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 10000000.0: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+33) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 10000000.0) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+33) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 10000000.0) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+33], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 10000000.0], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+33}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10000000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.99999999999999973e33Initial program 65.1%
unpow265.1%
clear-num65.2%
frac-times63.7%
*-un-lft-identity63.7%
Applied egg-rr63.7%
Taylor expanded in Om around 0 44.6%
unpow244.6%
unpow244.6%
Simplified44.6%
frac-times65.1%
Applied egg-rr65.1%
Taylor expanded in t around -inf 99.7%
associate-*r/99.7%
mul-1-neg99.7%
*-commutative99.7%
Simplified99.7%
if -4.99999999999999973e33 < (/.f64 t l) < 1e7Initial program 99.0%
unpow299.0%
clear-num99.0%
frac-times99.0%
*-un-lft-identity99.0%
Applied egg-rr99.0%
Taylor expanded in Om around 0 85.7%
unpow285.7%
unpow285.7%
Simplified85.7%
frac-times97.9%
Applied egg-rr97.9%
if 1e7 < (/.f64 t l) Initial program 72.0%
unpow272.0%
clear-num71.9%
frac-times64.3%
*-un-lft-identity64.3%
Applied egg-rr64.3%
Taylor expanded in Om around 0 40.6%
unpow240.6%
unpow240.6%
Simplified40.6%
Taylor expanded in t around inf 99.1%
Final simplification98.6%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+33)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 10000000.0)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (/ (* t (/ t l)) l))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+33) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 10000000.0) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t * (t / l)) / l))))));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+33)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 10000000.0d0) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t * (t / l)) / l))))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+33) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 10000000.0) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t * (t / l)) / l))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+33: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 10000000.0: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t * (t / l)) / l)))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+33) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 10000000.0) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / l)))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+33) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 10000000.0) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t * (t / l)) / l)))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+33], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 10000000.0], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+33}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10000000:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.99999999999999973e33Initial program 65.1%
unpow265.1%
clear-num65.2%
frac-times63.7%
*-un-lft-identity63.7%
Applied egg-rr63.7%
Taylor expanded in Om around 0 44.6%
unpow244.6%
unpow244.6%
Simplified44.6%
frac-times65.1%
Applied egg-rr65.1%
Taylor expanded in t around -inf 99.7%
associate-*r/99.7%
mul-1-neg99.7%
*-commutative99.7%
Simplified99.7%
if -4.99999999999999973e33 < (/.f64 t l) < 1e7Initial program 99.0%
unpow299.0%
clear-num99.0%
frac-times99.0%
*-un-lft-identity99.0%
Applied egg-rr99.0%
Taylor expanded in Om around 0 85.7%
unpow285.7%
unpow285.7%
Simplified85.7%
frac-times97.9%
Applied egg-rr97.9%
associate-*r/97.9%
Applied egg-rr97.9%
if 1e7 < (/.f64 t l) Initial program 72.0%
unpow272.0%
clear-num71.9%
frac-times64.3%
*-un-lft-identity64.3%
Applied egg-rr64.3%
Taylor expanded in Om around 0 40.6%
unpow240.6%
unpow240.6%
Simplified40.6%
Taylor expanded in t around inf 99.1%
Final simplification98.6%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -500.0)
(asin (/ (- (sqrt 0.5)) (/ t l)))
(if (<= (/ t l) 0.005)
(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) <= -500.0) {
tmp = asin((-sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.005) {
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) <= (-500.0d0)) then
tmp = asin((-sqrt(0.5d0) / (t / l)))
else if ((t / l) <= 0.005d0) 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) <= -500.0) {
tmp = Math.asin((-Math.sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.005) {
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) <= -500.0: tmp = math.asin((-math.sqrt(0.5) / (t / l))) elif (t / l) <= 0.005: 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) <= -500.0) tmp = asin(Float64(Float64(-sqrt(0.5)) / Float64(t / l))); elseif (Float64(t / l) <= 0.005) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -500.0) tmp = asin((-sqrt(0.5) / (t / l))); elseif ((t / l) <= 0.005) 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], -500.0], N[ArcSin[N[((-N[Sqrt[0.5], $MachinePrecision]) / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.005], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -500:\\
\;\;\;\;\sin^{-1} \left(\frac{-\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.005:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -500Initial program 68.2%
unpow268.2%
clear-num68.2%
frac-times66.8%
*-un-lft-identity66.8%
Applied egg-rr66.8%
Taylor expanded in Om around 0 45.1%
unpow245.1%
unpow245.1%
Simplified45.1%
Taylor expanded in t around -inf 98.4%
mul-1-neg98.4%
associate-/l*96.6%
distribute-neg-frac96.6%
Simplified96.6%
if -500 < (/.f64 t l) < 0.0050000000000000001Initial program 99.0%
unpow299.0%
clear-num99.0%
frac-times99.0%
*-un-lft-identity99.0%
Applied egg-rr99.0%
Taylor expanded in Om around 0 88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Taylor expanded in t around 0 87.8%
mul-1-neg87.8%
unpow287.8%
unpow287.8%
times-frac97.4%
unpow297.4%
unsub-neg97.4%
Simplified97.4%
if 0.0050000000000000001 < (/.f64 t l) Initial program 72.8%
unpow272.8%
clear-num72.8%
frac-times65.5%
*-un-lft-identity65.5%
Applied egg-rr65.5%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
Taylor expanded in t around inf 98.9%
Final simplification97.6%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -500.0)
(asin (/ (* l (- (sqrt 0.5))) t))
(if (<= (/ t l) 0.005)
(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) <= -500.0) {
tmp = asin(((l * -sqrt(0.5)) / t));
} else if ((t / l) <= 0.005) {
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) <= (-500.0d0)) then
tmp = asin(((l * -sqrt(0.5d0)) / t))
else if ((t / l) <= 0.005d0) 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) <= -500.0) {
tmp = Math.asin(((l * -Math.sqrt(0.5)) / t));
} else if ((t / l) <= 0.005) {
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) <= -500.0: tmp = math.asin(((l * -math.sqrt(0.5)) / t)) elif (t / l) <= 0.005: 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) <= -500.0) tmp = asin(Float64(Float64(l * Float64(-sqrt(0.5))) / t)); elseif (Float64(t / l) <= 0.005) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -500.0) tmp = asin(((l * -sqrt(0.5)) / t)); elseif ((t / l) <= 0.005) 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], -500.0], N[ArcSin[N[(N[(l * (-N[Sqrt[0.5], $MachinePrecision])), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.005], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -500:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(-\sqrt{0.5}\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.005:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -500Initial program 68.2%
unpow268.2%
clear-num68.2%
frac-times66.8%
*-un-lft-identity66.8%
Applied egg-rr66.8%
Taylor expanded in Om around 0 45.1%
unpow245.1%
unpow245.1%
Simplified45.1%
frac-times68.2%
Applied egg-rr68.2%
Taylor expanded in t around -inf 98.4%
associate-*r/98.4%
mul-1-neg98.4%
*-commutative98.4%
Simplified98.4%
if -500 < (/.f64 t l) < 0.0050000000000000001Initial program 99.0%
unpow299.0%
clear-num99.0%
frac-times99.0%
*-un-lft-identity99.0%
Applied egg-rr99.0%
Taylor expanded in Om around 0 88.1%
unpow288.1%
unpow288.1%
Simplified88.1%
Taylor expanded in t around 0 87.8%
mul-1-neg87.8%
unpow287.8%
unpow287.8%
times-frac97.4%
unpow297.4%
unsub-neg97.4%
Simplified97.4%
if 0.0050000000000000001 < (/.f64 t l) Initial program 72.8%
unpow272.8%
clear-num72.8%
frac-times65.5%
*-un-lft-identity65.5%
Applied egg-rr65.5%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
Taylor expanded in t around inf 98.9%
Final simplification98.1%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (or (<= (/ t l) -2e+211) (not (<= (/ t l) 0.005))) (asin (/ (sqrt 0.5) (/ t l))) (asin 1.0)))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (((t / l) <= -2e+211) || !((t / l) <= 0.005)) {
tmp = asin((sqrt(0.5) / (t / l)));
} 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) <= (-2d+211)) .or. (.not. ((t / l) <= 0.005d0))) then
tmp = asin((sqrt(0.5d0) / (t / l)))
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) <= -2e+211) || !((t / l) <= 0.005)) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if ((t / l) <= -2e+211) or not ((t / l) <= 0.005): tmp = math.asin((math.sqrt(0.5) / (t / l))) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if ((Float64(t / l) <= -2e+211) || !(Float64(t / l) <= 0.005)) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); 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) <= -2e+211) || ~(((t / l) <= 0.005))) tmp = asin((sqrt(0.5) / (t / l))); 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], -2e+211], N[Not[LessEqual[N[(t / l), $MachinePrecision], 0.005]], $MachinePrecision]], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+211} \lor \neg \left(\frac{t}{\ell} \leq 0.005\right):\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if (/.f64 t l) < -1.9999999999999999e211 or 0.0050000000000000001 < (/.f64 t l) Initial program 67.4%
unpow267.4%
clear-num67.4%
frac-times62.7%
*-un-lft-identity62.7%
Applied egg-rr62.7%
Taylor expanded in Om around 0 46.8%
unpow246.8%
unpow246.8%
Simplified46.8%
Taylor expanded in t around inf 84.0%
associate-/l*83.6%
Simplified83.6%
if -1.9999999999999999e211 < (/.f64 t l) < 0.0050000000000000001Initial program 94.9%
unpow294.9%
clear-num94.9%
frac-times94.3%
*-un-lft-identity94.3%
Applied egg-rr94.3%
Taylor expanded in Om around 0 76.2%
unpow276.2%
unpow276.2%
Simplified76.2%
Taylor expanded in t around 0 77.8%
Final simplification80.1%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -2e+211) (asin (/ (sqrt 0.5) (/ t l))) (if (<= (/ t l) 0.005) (asin 1.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) <= -2e+211) {
tmp = asin((sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.005) {
tmp = asin(1.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) <= (-2d+211)) then
tmp = asin((sqrt(0.5d0) / (t / l)))
else if ((t / l) <= 0.005d0) then
tmp = asin(1.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) <= -2e+211) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.005) {
tmp = Math.asin(1.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) <= -2e+211: tmp = math.asin((math.sqrt(0.5) / (t / l))) elif (t / l) <= 0.005: tmp = math.asin(1.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) <= -2e+211) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); elseif (Float64(t / l) <= 0.005) tmp = asin(1.0); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+211) tmp = asin((sqrt(0.5) / (t / l))); elseif ((t / l) <= 0.005) tmp = asin(1.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], -2e+211], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.005], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+211}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.005:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.9999999999999999e211Initial program 57.6%
unpow257.6%
clear-num57.6%
frac-times57.6%
*-un-lft-identity57.6%
Applied egg-rr57.6%
Taylor expanded in Om around 0 57.6%
unpow257.6%
unpow257.6%
Simplified57.6%
Taylor expanded in t around inf 56.8%
associate-/l*56.9%
Simplified56.9%
if -1.9999999999999999e211 < (/.f64 t l) < 0.0050000000000000001Initial program 94.9%
unpow294.9%
clear-num94.9%
frac-times94.3%
*-un-lft-identity94.3%
Applied egg-rr94.3%
Taylor expanded in Om around 0 76.2%
unpow276.2%
unpow276.2%
Simplified76.2%
Taylor expanded in t around 0 77.8%
if 0.0050000000000000001 < (/.f64 t l) Initial program 72.8%
unpow272.8%
clear-num72.8%
frac-times65.5%
*-un-lft-identity65.5%
Applied egg-rr65.5%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
Taylor expanded in t around inf 98.9%
Final simplification80.2%
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.3%
unpow284.3%
clear-num84.3%
frac-times82.1%
*-un-lft-identity82.1%
Applied egg-rr82.1%
Taylor expanded in Om around 0 64.9%
unpow264.9%
unpow264.9%
Simplified64.9%
Taylor expanded in t around 0 49.4%
Final simplification49.4%
herbie shell --seed 2023229
(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)))))))