
(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 13 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}
(FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (hypot 1.0 (/ t (* l (sqrt 0.5)))))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, (t / (l * sqrt(0.5))))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / Math.hypot(1.0, (t / (l * Math.sqrt(0.5))))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / math.hypot(1.0, (t / (l * math.sqrt(0.5))))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))) / hypot(1.0, Float64(t / Float64(l * sqrt(0.5)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, (t / (l * sqrt(0.5)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(t / N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell \cdot \sqrt{0.5}}\right)}\right)
\end{array}
Initial program 83.6%
sqrt-div83.6%
div-inv83.6%
add-sqr-sqrt83.6%
hypot-1-def83.6%
*-commutative83.6%
sqrt-prod83.9%
unpow283.9%
sqrt-prod55.2%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
associate-*l/98.0%
associate-/l*98.0%
Simplified98.0%
*-un-lft-identity98.0%
div-inv98.0%
times-frac98.0%
pow1/298.0%
pow-flip98.0%
metadata-eval98.0%
Applied egg-rr98.0%
associate-*r/98.0%
associate-*l/98.1%
*-lft-identity98.1%
Simplified98.1%
unpow298.1%
clear-num98.1%
un-div-inv98.1%
Applied egg-rr98.1%
add-sqr-sqrt97.6%
sqrt-unprod98.1%
pow-prod-up98.1%
metadata-eval98.1%
metadata-eval98.1%
expm1-log1p-u73.5%
associate-/r*73.5%
expm1-udef73.5%
Applied egg-rr73.5%
expm1-def73.5%
expm1-log1p98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 83.6%
sqrt-div83.6%
add-sqr-sqrt83.6%
hypot-1-def83.6%
*-commutative83.6%
sqrt-prod83.9%
unpow283.9%
sqrt-prod55.2%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
unpow298.1%
clear-num98.1%
un-div-inv98.1%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (t l Om Omc) :precision binary64 (let* ((t_1 (pow (/ t l) 2.0))) (if (<= t_1 0.1) (asin (- 1.0 t_1)) (asin (* l (/ (sqrt 0.5) t))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = pow((t / l), 2.0);
double tmp;
if (t_1 <= 0.1) {
tmp = asin((1.0 - t_1));
} else {
tmp = asin((l * (sqrt(0.5) / t)));
}
return tmp;
}
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 <= 0.1d0) then
tmp = asin((1.0d0 - t_1))
else
tmp = asin((l * (sqrt(0.5d0) / t)))
end if
code = tmp
end function
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 <= 0.1) {
tmp = Math.asin((1.0 - t_1));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = math.pow((t / l), 2.0) tmp = 0 if t_1 <= 0.1: tmp = math.asin((1.0 - t_1)) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
function code(t, l, Om, Omc) t_1 = Float64(t / l) ^ 2.0 tmp = 0.0 if (t_1 <= 0.1) tmp = asin(Float64(1.0 - t_1)); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = (t / l) ^ 2.0; tmp = 0.0; if (t_1 <= 0.1) tmp = asin((1.0 - t_1)); else tmp = asin((l * (sqrt(0.5) / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, 0.1], N[ArcSin[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(\frac{t}{\ell}\right)}^{2}\\
\mathbf{if}\;t_1 \leq 0.1:\\
\;\;\;\;\sin^{-1} \left(1 - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (pow.f64 (/.f64 t l) 2) < 0.10000000000000001Initial program 97.8%
Taylor expanded in Om around 0 82.4%
Taylor expanded in t around 0 82.3%
mul-1-neg82.3%
unpow282.3%
unpow282.3%
times-frac94.3%
unpow294.3%
unsub-neg94.3%
Simplified94.3%
if 0.10000000000000001 < (pow.f64 (/.f64 t l) 2) Initial program 68.2%
Taylor expanded in Om around 0 43.1%
Taylor expanded in t around inf 62.8%
*-commutative62.8%
associate-*l/62.8%
Simplified62.8%
Final simplification79.2%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
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)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end
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}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 83.6%
Taylor expanded in Om around 0 63.5%
sqrt-div63.5%
metadata-eval63.5%
add-sqr-sqrt63.5%
hypot-1-def63.5%
*-commutative63.5%
sqrt-prod63.4%
sqrt-div65.4%
unpow265.4%
sqrt-prod42.9%
add-sqr-sqrt79.2%
unpow279.2%
sqrt-prod52.2%
add-sqr-sqrt96.3%
Applied egg-rr96.3%
Final simplification96.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -4e+82)
(- (asin (* l (/ (sqrt 0.5) t))))
(if (<= (/ t l) 2e+105)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* (sqrt 0.5) (/ l t))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -4e+82) {
tmp = -asin((l * (sqrt(0.5) / t)));
} else if ((t / l) <= 2e+105) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((sqrt(0.5) * (l / t)));
}
return tmp;
}
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+82)) then
tmp = -asin((l * (sqrt(0.5d0) / t)))
else if ((t / l) <= 2d+105) 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
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -4e+82) {
tmp = -Math.asin((l * (Math.sqrt(0.5) / t)));
} else if ((t / l) <= 2e+105) {
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;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -4e+82: tmp = -math.asin((l * (math.sqrt(0.5) / t))) elif (t / l) <= 2e+105: 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
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -4e+82) tmp = Float64(-asin(Float64(l * Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 2e+105) tmp = asin(sqrt(Float64(1.0 / 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
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -4e+82) tmp = -asin((l * (sqrt(0.5) / t))); elseif ((t / l) <= 2e+105) 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
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -4e+82], (-N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[N[(t / l), $MachinePrecision], 2e+105], 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[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+82}:\\
\;\;\;\;-\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+105}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{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) < -3.9999999999999999e82Initial program 59.4%
Taylor expanded in Om around 0 44.3%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
asin-neg99.6%
Applied egg-rr99.6%
associate-*r/99.5%
Simplified99.5%
if -3.9999999999999999e82 < (/.f64 t l) < 1.9999999999999999e105Initial program 98.2%
Taylor expanded in Om around 0 74.6%
add-sqr-sqrt74.6%
pow274.6%
sqrt-div74.6%
unpow274.6%
sqrt-prod43.7%
add-sqr-sqrt83.2%
unpow283.2%
sqrt-prod49.5%
add-sqr-sqrt96.5%
unpow296.5%
Applied egg-rr96.5%
if 1.9999999999999999e105 < (/.f64 t l) Initial program 49.9%
Taylor expanded in Om around 0 38.6%
Taylor expanded in t around -inf 32.9%
add-sqr-sqrt32.9%
sqrt-unprod33.7%
sqr-neg33.7%
mul-1-neg33.7%
mul-1-neg33.7%
sqrt-unprod28.6%
add-sqr-sqrt95.8%
*-commutative95.8%
Applied egg-rr95.8%
*-commutative95.8%
neg-mul-195.8%
associate-*l/95.9%
*-commutative95.9%
distribute-rgt-neg-in95.9%
Simplified95.9%
Final simplification96.9%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -10000.0)
(- (asin (* l (/ (sqrt 0.5) t))))
(if (<= (/ t l) 0.0002)
(asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(asin (* (sqrt 0.5) (/ l t))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = -asin((l * (sqrt(0.5) / t)));
} else if ((t / l) <= 0.0002) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((sqrt(0.5) * (l / t)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-10000.0d0)) then
tmp = -asin((l * (sqrt(0.5d0) / t)))
else if ((t / l) <= 0.0002d0) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((sqrt(0.5d0) * (l / t)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = -Math.asin((l * (Math.sqrt(0.5) / t)));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -10000.0: tmp = -math.asin((l * (math.sqrt(0.5) / t))) elif (t / l) <= 0.0002: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -10000.0) tmp = Float64(-asin(Float64(l * Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 0.0002) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -10000.0) tmp = -asin((l * (sqrt(0.5) / t))); elseif ((t / l) <= 0.0002) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((sqrt(0.5) * (l / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -10000.0], (-N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -10000:\\
\;\;\;\;-\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e4Initial program 69.6%
Taylor expanded in Om around 0 46.7%
Taylor expanded in t around -inf 98.7%
mul-1-neg98.7%
asin-neg98.7%
Applied egg-rr98.7%
associate-*r/98.7%
Simplified98.7%
if -1e4 < (/.f64 t l) < 2.0000000000000001e-4Initial program 97.8%
Taylor expanded in t around 0 82.6%
unpow282.6%
unpow282.6%
times-frac95.8%
unpow295.8%
Simplified95.8%
unpow297.8%
clear-num97.8%
un-div-inv97.8%
Applied egg-rr95.8%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 66.9%
Taylor expanded in Om around 0 39.8%
Taylor expanded in t around -inf 22.3%
add-sqr-sqrt22.3%
sqrt-unprod22.8%
sqr-neg22.8%
mul-1-neg22.8%
mul-1-neg22.8%
sqrt-unprod18.8%
add-sqr-sqrt94.9%
*-commutative94.9%
Applied egg-rr94.9%
*-commutative94.9%
neg-mul-194.9%
associate-*l/94.9%
*-commutative94.9%
distribute-rgt-neg-in94.9%
Simplified94.9%
Final simplification96.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -10000.0)
(asin (/ (- l) (/ t (sqrt 0.5))))
(if (<= (/ t l) 0.0002)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (* l (/ (sqrt 0.5) t))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = asin((-l / (t / sqrt(0.5))));
} else if ((t / l) <= 0.0002) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((l * (sqrt(0.5) / t)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-10000.0d0)) then
tmp = asin((-l / (t / sqrt(0.5d0))))
else if ((t / l) <= 0.0002d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((l * (sqrt(0.5d0) / t)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = Math.asin((-l / (t / Math.sqrt(0.5))));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -10000.0: tmp = math.asin((-l / (t / math.sqrt(0.5)))) elif (t / l) <= 0.0002: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -10000.0) tmp = asin(Float64(Float64(-l) / Float64(t / sqrt(0.5)))); elseif (Float64(t / l) <= 0.0002) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -10000.0) tmp = asin((-l / (t / sqrt(0.5)))); elseif ((t / l) <= 0.0002) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l * (sqrt(0.5) / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -10000.0], N[ArcSin[N[((-l) / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -10000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e4Initial program 69.6%
Taylor expanded in Om around 0 46.7%
Taylor expanded in t around -inf 98.7%
mul-1-neg98.7%
associate-/l*98.7%
distribute-neg-frac98.7%
Simplified98.7%
if -1e4 < (/.f64 t l) < 2.0000000000000001e-4Initial program 97.8%
Taylor expanded in Om around 0 82.4%
Taylor expanded in t around 0 82.3%
mul-1-neg82.3%
unpow282.3%
unpow282.3%
times-frac94.3%
unpow294.3%
unsub-neg94.3%
Simplified94.3%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 66.9%
Taylor expanded in Om around 0 39.8%
Taylor expanded in t around inf 94.9%
*-commutative94.9%
associate-*l/95.0%
Simplified95.0%
Final simplification95.5%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (asin (* l (/ (sqrt 0.5) t)))))
(if (<= (/ t l) -10000.0)
(- t_1)
(if (<= (/ t l) 0.0002) (asin (- 1.0 (pow (/ t l) 2.0))) t_1))))
double code(double t, double l, double Om, double Omc) {
double t_1 = asin((l * (sqrt(0.5) / t)));
double tmp;
if ((t / l) <= -10000.0) {
tmp = -t_1;
} else if ((t / l) <= 0.0002) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
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 = asin((l * (sqrt(0.5d0) / t)))
if ((t / l) <= (-10000.0d0)) then
tmp = -t_1
else if ((t / l) <= 0.0002d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.asin((l * (Math.sqrt(0.5) / t)));
double tmp;
if ((t / l) <= -10000.0) {
tmp = -t_1;
} else if ((t / l) <= 0.0002) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = math.asin((l * (math.sqrt(0.5) / t))) tmp = 0 if (t / l) <= -10000.0: tmp = -t_1 elif (t / l) <= 0.0002: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = t_1 return tmp
function code(t, l, Om, Omc) t_1 = asin(Float64(l * Float64(sqrt(0.5) / t))) tmp = 0.0 if (Float64(t / l) <= -10000.0) tmp = Float64(-t_1); elseif (Float64(t / l) <= 0.0002) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = asin((l * (sqrt(0.5) / t))); tmp = 0.0; if ((t / l) <= -10000.0) tmp = -t_1; elseif ((t / l) <= 0.0002) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = t_1; end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -10000.0], (-t$95$1), If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{if}\;\frac{t}{\ell} \leq -10000:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 t l) < -1e4Initial program 69.6%
Taylor expanded in Om around 0 46.7%
Taylor expanded in t around -inf 98.7%
mul-1-neg98.7%
asin-neg98.7%
Applied egg-rr98.7%
associate-*r/98.7%
Simplified98.7%
if -1e4 < (/.f64 t l) < 2.0000000000000001e-4Initial program 97.8%
Taylor expanded in Om around 0 82.4%
Taylor expanded in t around 0 82.3%
mul-1-neg82.3%
unpow282.3%
unpow282.3%
times-frac94.3%
unpow294.3%
unsub-neg94.3%
Simplified94.3%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 66.9%
Taylor expanded in Om around 0 39.8%
Taylor expanded in t around inf 94.9%
*-commutative94.9%
associate-*l/95.0%
Simplified95.0%
Final simplification95.5%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -10000.0)
(- (asin (* l (/ (sqrt 0.5) t))))
(if (<= (/ t l) 0.0002)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (* (sqrt 0.5) (/ l t))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = -asin((l * (sqrt(0.5) / t)));
} else if ((t / l) <= 0.0002) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((sqrt(0.5) * (l / t)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-10000.0d0)) then
tmp = -asin((l * (sqrt(0.5d0) / t)))
else if ((t / l) <= 0.0002d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((sqrt(0.5d0) * (l / t)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10000.0) {
tmp = -Math.asin((l * (Math.sqrt(0.5) / t)));
} else if ((t / l) <= 0.0002) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -10000.0: tmp = -math.asin((l * (math.sqrt(0.5) / t))) elif (t / l) <= 0.0002: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -10000.0) tmp = Float64(-asin(Float64(l * Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 0.0002) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -10000.0) tmp = -asin((l * (sqrt(0.5) / t))); elseif ((t / l) <= 0.0002) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((sqrt(0.5) * (l / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -10000.0], (-N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[N[(t / l), $MachinePrecision], 0.0002], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -10000:\\
\;\;\;\;-\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e4Initial program 69.6%
Taylor expanded in Om around 0 46.7%
Taylor expanded in t around -inf 98.7%
mul-1-neg98.7%
asin-neg98.7%
Applied egg-rr98.7%
associate-*r/98.7%
Simplified98.7%
if -1e4 < (/.f64 t l) < 2.0000000000000001e-4Initial program 97.8%
Taylor expanded in Om around 0 82.4%
Taylor expanded in t around 0 82.3%
mul-1-neg82.3%
unpow282.3%
unpow282.3%
times-frac94.3%
unpow294.3%
unsub-neg94.3%
Simplified94.3%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 66.9%
Taylor expanded in Om around 0 39.8%
Taylor expanded in t around -inf 22.3%
add-sqr-sqrt22.3%
sqrt-unprod22.8%
sqr-neg22.8%
mul-1-neg22.8%
mul-1-neg22.8%
sqrt-unprod18.8%
add-sqr-sqrt94.9%
*-commutative94.9%
Applied egg-rr94.9%
*-commutative94.9%
neg-mul-194.9%
associate-*l/94.9%
*-commutative94.9%
distribute-rgt-neg-in94.9%
Simplified94.9%
Final simplification95.5%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -1.1e-164)
(asin 1.0)
(if (or (<= l 2.45e-58) (and (not (<= l 3.4e+101)) (<= l 5.6e+110)))
(asin (* l (/ (sqrt 0.5) t)))
(asin 1.0))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.1e-164) {
tmp = asin(1.0);
} else if ((l <= 2.45e-58) || (!(l <= 3.4e+101) && (l <= 5.6e+110))) {
tmp = asin((l * (sqrt(0.5) / t)));
} else {
tmp = asin(1.0);
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-1.1d-164)) then
tmp = asin(1.0d0)
else if ((l <= 2.45d-58) .or. (.not. (l <= 3.4d+101)) .and. (l <= 5.6d+110)) then
tmp = asin((l * (sqrt(0.5d0) / t)))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.1e-164) {
tmp = Math.asin(1.0);
} else if ((l <= 2.45e-58) || (!(l <= 3.4e+101) && (l <= 5.6e+110))) {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -1.1e-164: tmp = math.asin(1.0) elif (l <= 2.45e-58) or (not (l <= 3.4e+101) and (l <= 5.6e+110)): tmp = math.asin((l * (math.sqrt(0.5) / t))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -1.1e-164) tmp = asin(1.0); elseif ((l <= 2.45e-58) || (!(l <= 3.4e+101) && (l <= 5.6e+110))) tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -1.1e-164) tmp = asin(1.0); elseif ((l <= 2.45e-58) || (~((l <= 3.4e+101)) && (l <= 5.6e+110))) tmp = asin((l * (sqrt(0.5) / t))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -1.1e-164], N[ArcSin[1.0], $MachinePrecision], If[Or[LessEqual[l, 2.45e-58], And[N[Not[LessEqual[l, 3.4e+101]], $MachinePrecision], LessEqual[l, 5.6e+110]]], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.1 \cdot 10^{-164}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 2.45 \cdot 10^{-58} \lor \neg \left(\ell \leq 3.4 \cdot 10^{+101}\right) \land \ell \leq 5.6 \cdot 10^{+110}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.09999999999999994e-164 or 2.45000000000000015e-58 < l < 3.40000000000000017e101 or 5.59999999999999973e110 < l Initial program 88.4%
Taylor expanded in Om around 0 74.6%
Taylor expanded in t around 0 70.3%
if -1.09999999999999994e-164 < l < 2.45000000000000015e-58 or 3.40000000000000017e101 < l < 5.59999999999999973e110Initial program 74.0%
Taylor expanded in Om around 0 41.5%
Taylor expanded in t around inf 60.7%
*-commutative60.7%
associate-*l/60.7%
Simplified60.7%
Final simplification67.1%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -6.5e-164)
(asin 1.0)
(if (<= l 2.45e-58)
(asin (* l (/ (sqrt 0.5) t)))
(if (<= l 3.4e+101)
(asin 1.0)
(if (<= l 5.6e+110) (asin (/ l (/ t (sqrt 0.5)))) (asin 1.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -6.5e-164) {
tmp = asin(1.0);
} else if (l <= 2.45e-58) {
tmp = asin((l * (sqrt(0.5) / t)));
} else if (l <= 3.4e+101) {
tmp = asin(1.0);
} else if (l <= 5.6e+110) {
tmp = asin((l / (t / sqrt(0.5))));
} else {
tmp = asin(1.0);
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-6.5d-164)) then
tmp = asin(1.0d0)
else if (l <= 2.45d-58) then
tmp = asin((l * (sqrt(0.5d0) / t)))
else if (l <= 3.4d+101) then
tmp = asin(1.0d0)
else if (l <= 5.6d+110) then
tmp = asin((l / (t / sqrt(0.5d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -6.5e-164) {
tmp = Math.asin(1.0);
} else if (l <= 2.45e-58) {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
} else if (l <= 3.4e+101) {
tmp = Math.asin(1.0);
} else if (l <= 5.6e+110) {
tmp = Math.asin((l / (t / Math.sqrt(0.5))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -6.5e-164: tmp = math.asin(1.0) elif l <= 2.45e-58: tmp = math.asin((l * (math.sqrt(0.5) / t))) elif l <= 3.4e+101: tmp = math.asin(1.0) elif l <= 5.6e+110: tmp = math.asin((l / (t / math.sqrt(0.5)))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -6.5e-164) tmp = asin(1.0); elseif (l <= 2.45e-58) tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); elseif (l <= 3.4e+101) tmp = asin(1.0); elseif (l <= 5.6e+110) tmp = asin(Float64(l / Float64(t / sqrt(0.5)))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -6.5e-164) tmp = asin(1.0); elseif (l <= 2.45e-58) tmp = asin((l * (sqrt(0.5) / t))); elseif (l <= 3.4e+101) tmp = asin(1.0); elseif (l <= 5.6e+110) tmp = asin((l / (t / sqrt(0.5)))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -6.5e-164], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 2.45e-58], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 3.4e+101], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 5.6e+110], N[ArcSin[N[(l / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -6.5 \cdot 10^{-164}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 2.45 \cdot 10^{-58}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{elif}\;\ell \leq 3.4 \cdot 10^{+101}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{+110}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -6.50000000000000004e-164 or 2.45000000000000015e-58 < l < 3.40000000000000017e101 or 5.59999999999999973e110 < l Initial program 88.4%
Taylor expanded in Om around 0 74.6%
Taylor expanded in t around 0 70.3%
if -6.50000000000000004e-164 < l < 2.45000000000000015e-58Initial program 72.1%
Taylor expanded in Om around 0 44.1%
Taylor expanded in t around inf 60.3%
*-commutative60.3%
associate-*l/60.3%
Simplified60.3%
if 3.40000000000000017e101 < l < 5.59999999999999973e110Initial program 99.2%
Taylor expanded in Om around 0 7.8%
Taylor expanded in t around inf 66.6%
associate-/l*66.6%
Simplified66.6%
Final simplification67.1%
(FPCore (t l Om Omc)
:precision binary64
(if (<= l -1.4e-165)
(asin 1.0)
(if (<= l 5.8e-59)
(asin (* l (/ (sqrt 0.5) t)))
(if (<= l 2.7e+101)
(asin 1.0)
(if (<= l 5.6e+110) (asin (/ (* l (sqrt 0.5)) t)) (asin 1.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.4e-165) {
tmp = asin(1.0);
} else if (l <= 5.8e-59) {
tmp = asin((l * (sqrt(0.5) / t)));
} else if (l <= 2.7e+101) {
tmp = asin(1.0);
} else if (l <= 5.6e+110) {
tmp = asin(((l * sqrt(0.5)) / t));
} else {
tmp = asin(1.0);
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-1.4d-165)) then
tmp = asin(1.0d0)
else if (l <= 5.8d-59) then
tmp = asin((l * (sqrt(0.5d0) / t)))
else if (l <= 2.7d+101) then
tmp = asin(1.0d0)
else if (l <= 5.6d+110) then
tmp = asin(((l * sqrt(0.5d0)) / t))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -1.4e-165) {
tmp = Math.asin(1.0);
} else if (l <= 5.8e-59) {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
} else if (l <= 2.7e+101) {
tmp = Math.asin(1.0);
} else if (l <= 5.6e+110) {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -1.4e-165: tmp = math.asin(1.0) elif l <= 5.8e-59: tmp = math.asin((l * (math.sqrt(0.5) / t))) elif l <= 2.7e+101: tmp = math.asin(1.0) elif l <= 5.6e+110: tmp = math.asin(((l * math.sqrt(0.5)) / t)) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -1.4e-165) tmp = asin(1.0); elseif (l <= 5.8e-59) tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); elseif (l <= 2.7e+101) tmp = asin(1.0); elseif (l <= 5.6e+110) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -1.4e-165) tmp = asin(1.0); elseif (l <= 5.8e-59) tmp = asin((l * (sqrt(0.5) / t))); elseif (l <= 2.7e+101) tmp = asin(1.0); elseif (l <= 5.6e+110) tmp = asin(((l * sqrt(0.5)) / t)); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -1.4e-165], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 5.8e-59], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.7e+101], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 5.6e+110], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{-165}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 5.8 \cdot 10^{-59}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{elif}\;\ell \leq 2.7 \cdot 10^{+101}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{+110}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.4e-165 or 5.80000000000000033e-59 < l < 2.70000000000000006e101 or 5.59999999999999973e110 < l Initial program 88.4%
Taylor expanded in Om around 0 74.6%
Taylor expanded in t around 0 70.3%
if -1.4e-165 < l < 5.80000000000000033e-59Initial program 72.1%
Taylor expanded in Om around 0 44.1%
Taylor expanded in t around inf 60.3%
*-commutative60.3%
associate-*l/60.3%
Simplified60.3%
if 2.70000000000000006e101 < l < 5.59999999999999973e110Initial program 99.2%
Taylor expanded in Om around 0 7.8%
Taylor expanded in t around inf 66.6%
Final simplification67.1%
(FPCore (t l Om Omc) :precision binary64 (asin 1.0))
double code(double t, double l, double Om, double Omc) {
return asin(1.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(1.0d0)
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(1.0);
}
def code(t, l, Om, Omc): return math.asin(1.0)
function code(t, l, Om, Omc) return asin(1.0) end
function tmp = code(t, l, Om, Omc) tmp = asin(1.0); end
code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} 1
\end{array}
Initial program 83.6%
Taylor expanded in Om around 0 63.5%
Taylor expanded in t around 0 51.1%
Final simplification51.1%
herbie shell --seed 2023322
(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)))))))