
(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 12 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 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(t / Float64(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[(t / N[(l / N[Sqrt[2.0], $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}{\frac{\ell}{\sqrt{2}}}\right)}\right)
\end{array}
Initial program 86.5%
sqrt-div86.5%
div-inv86.5%
add-sqr-sqrt86.5%
hypot-1-def86.5%
*-commutative86.5%
sqrt-prod86.4%
unpow286.4%
sqrt-prod51.1%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate-*r/98.7%
*-rgt-identity98.7%
associate-*l/98.7%
associate-/l*98.7%
Simplified98.7%
unpow298.7%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr98.7%
Final simplification98.7%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (/ (/ t l) (pow 2.0 -0.5))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) / pow(2.0, -0.5)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t / l) / Math.pow(2.0, -0.5)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) / math.pow(2.0, -0.5)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) / (2.0 ^ -0.5))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) / (2.0 ^ -0.5))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] / N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{\frac{t}{\ell}}{{2}^{-0.5}}\right)}\right)
\end{array}
Initial program 86.5%
Taylor expanded in Om around 0 70.3%
sqrt-div70.3%
metadata-eval70.3%
add-sqr-sqrt70.3%
hypot-1-def70.3%
sqrt-prod70.2%
sqrt-div72.1%
unpow272.1%
sqrt-prod44.4%
add-sqr-sqrt83.2%
unpow283.2%
sqrt-prod43.4%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
*-commutative97.9%
associate-*l/97.9%
associate-*r/97.9%
Simplified97.9%
clear-num97.9%
div-inv97.9%
div-inv97.9%
associate-/r*97.8%
pow1/297.8%
pow-flip97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Final simplification97.9%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* t (/ (sqrt 2.0) l))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, (t * (sqrt(2.0) / l)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, (t * (Math.sqrt(2.0) / l)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, (t * (math.sqrt(2.0) / l)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(t * Float64(sqrt(2.0) / l))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, (t * (sqrt(2.0) / l))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, t \cdot \frac{\sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 86.5%
Taylor expanded in Om around 0 70.3%
sqrt-div70.3%
metadata-eval70.3%
add-sqr-sqrt70.3%
hypot-1-def70.3%
sqrt-prod70.2%
sqrt-div72.1%
unpow272.1%
sqrt-prod44.4%
add-sqr-sqrt83.2%
unpow283.2%
sqrt-prod43.4%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
*-commutative97.9%
associate-*l/97.9%
associate-*r/97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -6e+141)
(asin (* l (- (/ (sqrt 0.5) t))))
(if (<= (/ t l) 1e+43)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (sqrt 0.5) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -6e+141) {
tmp = asin((l * -(sqrt(0.5) / t)));
} else if ((t / l) <= 1e+43) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((sqrt(0.5) / (t / l)));
}
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) <= (-6d+141)) then
tmp = asin((l * -(sqrt(0.5d0) / t)))
else if ((t / l) <= 1d+43) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((sqrt(0.5d0) / (t / l)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -6e+141) {
tmp = Math.asin((l * -(Math.sqrt(0.5) / t)));
} else if ((t / l) <= 1e+43) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -6e+141: tmp = math.asin((l * -(math.sqrt(0.5) / t))) elif (t / l) <= 1e+43: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -6e+141) tmp = asin(Float64(l * Float64(-Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 1e+43) 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(t / l))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -6e+141) tmp = asin((l * -(sqrt(0.5) / t))); elseif ((t / l) <= 1e+43) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((sqrt(0.5) / (t / l))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -6e+141], N[ArcSin[N[(l * (-N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+43], 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[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -6 \cdot 10^{+141}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(-\frac{\sqrt{0.5}}{t}\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+43}:\\
\;\;\;\;\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{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5.9999999999999998e141Initial program 53.5%
Taylor expanded in Om around 0 51.0%
Taylor expanded in t around -inf 99.5%
mul-1-neg99.5%
associate-/l*99.7%
distribute-neg-frac99.7%
Simplified99.7%
Taylor expanded in l around 0 99.5%
mul-1-neg99.5%
associate-*r/99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
if -5.9999999999999998e141 < (/.f64 t l) < 1.00000000000000001e43Initial program 98.6%
Taylor expanded in Om around 0 79.5%
unpow279.5%
unpow279.5%
frac-times97.9%
Applied egg-rr97.9%
if 1.00000000000000001e43 < (/.f64 t l) Initial program 70.3%
Taylor expanded in Om around 0 53.4%
Taylor expanded in t around inf 97.6%
associate-*l/97.6%
Simplified97.6%
*-commutative97.6%
clear-num96.7%
un-div-inv96.9%
Applied egg-rr96.9%
Final simplification98.0%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -50000000000.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 0.2)
(asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(asin (/ (sqrt 0.5) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.2) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((sqrt(0.5) / (t / l)));
}
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) <= (-50000000000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.2d0) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((sqrt(0.5d0) / (t / l)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.2) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -50000000000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.2: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -50000000000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.2) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -50000000000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.2) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((sqrt(0.5) / (t / l))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -50000000000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.2], 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[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.2:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5e10Initial program 72.6%
Taylor expanded in Om around 0 47.2%
sqrt-div47.2%
metadata-eval47.2%
add-sqr-sqrt47.2%
hypot-1-def47.2%
sqrt-prod47.1%
sqrt-div50.1%
unpow250.1%
sqrt-prod41.1%
add-sqr-sqrt66.5%
unpow266.5%
sqrt-prod35.1%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
*-commutative98.6%
associate-*l/98.6%
associate-*r/98.7%
Simplified98.7%
Taylor expanded in t around -inf 98.8%
neg-mul-198.8%
distribute-neg-frac98.8%
Simplified98.8%
if -5e10 < (/.f64 t l) < 0.20000000000000001Initial program 98.4%
Taylor expanded in t around 0 90.1%
unpow290.1%
unpow290.1%
times-frac97.8%
unpow297.8%
Simplified97.8%
unpow298.4%
clear-num98.4%
un-div-inv98.4%
Applied egg-rr97.8%
if 0.20000000000000001 < (/.f64 t l) Initial program 74.8%
Taylor expanded in Om around 0 50.2%
Taylor expanded in t around inf 97.2%
associate-*l/97.1%
Simplified97.1%
*-commutative97.1%
clear-num96.4%
un-div-inv96.5%
Applied egg-rr96.5%
Final simplification97.8%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -50000000000.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 0.2)
(asin (/ 1.0 (+ 1.0 (pow (/ t l) 2.0))))
(asin (/ (sqrt 0.5) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.2) {
tmp = asin((1.0 / (1.0 + pow((t / l), 2.0))));
} else {
tmp = asin((sqrt(0.5) / (t / l)));
}
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) <= (-50000000000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.2d0) then
tmp = asin((1.0d0 / (1.0d0 + ((t / l) ** 2.0d0))))
else
tmp = asin((sqrt(0.5d0) / (t / l)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.2) {
tmp = Math.asin((1.0 / (1.0 + Math.pow((t / l), 2.0))));
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -50000000000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.2: tmp = math.asin((1.0 / (1.0 + math.pow((t / l), 2.0)))) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -50000000000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.2) tmp = asin(Float64(1.0 / Float64(1.0 + (Float64(t / l) ^ 2.0)))); else tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -50000000000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.2) tmp = asin((1.0 / (1.0 + ((t / l) ^ 2.0)))); else tmp = asin((sqrt(0.5) / (t / l))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -50000000000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.2], N[ArcSin[N[(1.0 / N[(1.0 + N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.2:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{1 + {\left(\frac{t}{\ell}\right)}^{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5e10Initial program 72.6%
Taylor expanded in Om around 0 47.2%
sqrt-div47.2%
metadata-eval47.2%
add-sqr-sqrt47.2%
hypot-1-def47.2%
sqrt-prod47.1%
sqrt-div50.1%
unpow250.1%
sqrt-prod41.1%
add-sqr-sqrt66.5%
unpow266.5%
sqrt-prod35.1%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
*-commutative98.6%
associate-*l/98.6%
associate-*r/98.7%
Simplified98.7%
Taylor expanded in t around -inf 98.8%
neg-mul-198.8%
distribute-neg-frac98.8%
Simplified98.8%
if -5e10 < (/.f64 t l) < 0.20000000000000001Initial program 98.4%
Taylor expanded in Om around 0 90.3%
sqrt-div90.3%
metadata-eval90.3%
add-sqr-sqrt90.3%
hypot-1-def90.3%
sqrt-prod90.3%
sqrt-div90.3%
unpow290.3%
sqrt-prod47.3%
add-sqr-sqrt95.8%
unpow295.8%
sqrt-prod42.8%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
*-commutative97.9%
associate-*l/97.9%
associate-*r/97.9%
Simplified97.9%
clear-num97.9%
div-inv97.9%
div-inv97.9%
associate-/r*97.9%
pow1/297.9%
pow-flip97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Taylor expanded in t around 0 89.8%
associate-*r/89.8%
unpow289.8%
*-commutative89.8%
unpow289.8%
rem-square-sqrt89.8%
associate-*r*89.8%
metadata-eval89.8%
unpow289.8%
associate-*l*89.8%
*-lft-identity89.8%
times-frac97.4%
unpow297.4%
Simplified97.4%
if 0.20000000000000001 < (/.f64 t l) Initial program 74.8%
Taylor expanded in Om around 0 50.2%
Taylor expanded in t around inf 97.2%
associate-*l/97.1%
Simplified97.1%
*-commutative97.1%
clear-num96.4%
un-div-inv96.5%
Applied egg-rr96.5%
Final simplification97.6%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -50000000000.0)
(asin (* l (- (/ (sqrt 0.5) t))))
(if (<= (/ t l) 0.2)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (sqrt 0.5) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = asin((l * -(sqrt(0.5) / t)));
} else if ((t / l) <= 0.2) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((sqrt(0.5) / (t / l)));
}
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) <= (-50000000000.0d0)) then
tmp = asin((l * -(sqrt(0.5d0) / t)))
else if ((t / l) <= 0.2d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((sqrt(0.5d0) / (t / l)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = Math.asin((l * -(Math.sqrt(0.5) / t)));
} else if ((t / l) <= 0.2) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -50000000000.0: tmp = math.asin((l * -(math.sqrt(0.5) / t))) elif (t / l) <= 0.2: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -50000000000.0) tmp = asin(Float64(l * Float64(-Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 0.2) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -50000000000.0) tmp = asin((l * -(sqrt(0.5) / t))); elseif ((t / l) <= 0.2) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((sqrt(0.5) / (t / l))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -50000000000.0], N[ArcSin[N[(l * (-N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.2], 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[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50000000000:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(-\frac{\sqrt{0.5}}{t}\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.2:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5e10Initial program 72.6%
Taylor expanded in Om around 0 47.2%
Taylor expanded in t around -inf 98.7%
mul-1-neg98.7%
associate-/l*98.8%
distribute-neg-frac98.8%
Simplified98.8%
Taylor expanded in l around 0 98.7%
mul-1-neg98.7%
associate-*r/98.8%
*-commutative98.8%
distribute-rgt-neg-in98.8%
Simplified98.8%
if -5e10 < (/.f64 t l) < 0.20000000000000001Initial program 98.4%
Taylor expanded in Om around 0 90.3%
Taylor expanded in t around 0 89.8%
mul-1-neg89.8%
unsub-neg89.8%
unpow289.8%
unpow289.8%
times-frac97.4%
unpow297.4%
Simplified97.4%
if 0.20000000000000001 < (/.f64 t l) Initial program 74.8%
Taylor expanded in Om around 0 50.2%
Taylor expanded in t around inf 97.2%
associate-*l/97.1%
Simplified97.1%
*-commutative97.1%
clear-num96.4%
un-div-inv96.5%
Applied egg-rr96.5%
Final simplification97.6%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -50000000000.0)
(asin (/ (- l) (* t (sqrt 2.0))))
(if (<= (/ t l) 0.2)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (sqrt 0.5) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = asin((-l / (t * sqrt(2.0))));
} else if ((t / l) <= 0.2) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((sqrt(0.5) / (t / l)));
}
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) <= (-50000000000.0d0)) then
tmp = asin((-l / (t * sqrt(2.0d0))))
else if ((t / l) <= 0.2d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((sqrt(0.5d0) / (t / l)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else if ((t / l) <= 0.2) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -50000000000.0: tmp = math.asin((-l / (t * math.sqrt(2.0)))) elif (t / l) <= 0.2: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -50000000000.0) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(2.0)))); elseif (Float64(t / l) <= 0.2) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -50000000000.0) tmp = asin((-l / (t * sqrt(2.0)))); elseif ((t / l) <= 0.2) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((sqrt(0.5) / (t / l))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -50000000000.0], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.2], 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[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50000000000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.2:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5e10Initial program 72.6%
Taylor expanded in Om around 0 47.2%
sqrt-div47.2%
metadata-eval47.2%
add-sqr-sqrt47.2%
hypot-1-def47.2%
sqrt-prod47.1%
sqrt-div50.1%
unpow250.1%
sqrt-prod41.1%
add-sqr-sqrt66.5%
unpow266.5%
sqrt-prod35.1%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
*-commutative98.6%
associate-*l/98.6%
associate-*r/98.7%
Simplified98.7%
Taylor expanded in t around -inf 98.8%
neg-mul-198.8%
distribute-neg-frac98.8%
Simplified98.8%
if -5e10 < (/.f64 t l) < 0.20000000000000001Initial program 98.4%
Taylor expanded in Om around 0 90.3%
Taylor expanded in t around 0 89.8%
mul-1-neg89.8%
unsub-neg89.8%
unpow289.8%
unpow289.8%
times-frac97.4%
unpow297.4%
Simplified97.4%
if 0.20000000000000001 < (/.f64 t l) Initial program 74.8%
Taylor expanded in Om around 0 50.2%
Taylor expanded in t around inf 97.2%
associate-*l/97.1%
Simplified97.1%
*-commutative97.1%
clear-num96.4%
un-div-inv96.5%
Applied egg-rr96.5%
Final simplification97.6%
(FPCore (t l Om Omc) :precision binary64 (if (or (<= (/ t l) -5e+211) (not (<= (/ t l) 0.2))) (asin (/ (sqrt 0.5) (/ t l))) (asin 1.0)))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (((t / l) <= -5e+211) || !((t / l) <= 0.2)) {
tmp = asin((sqrt(0.5) / (t / l)));
} 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 (((t / l) <= (-5d+211)) .or. (.not. ((t / l) <= 0.2d0))) then
tmp = asin((sqrt(0.5d0) / (t / l)))
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 (((t / l) <= -5e+211) || !((t / l) <= 0.2)) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if ((t / l) <= -5e+211) or not ((t / l) <= 0.2): tmp = math.asin((math.sqrt(0.5) / (t / l))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if ((Float64(t / l) <= -5e+211) || !(Float64(t / l) <= 0.2)) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (((t / l) <= -5e+211) || ~(((t / l) <= 0.2))) tmp = asin((sqrt(0.5) / (t / l))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[N[(t / l), $MachinePrecision], -5e+211], N[Not[LessEqual[N[(t / l), $MachinePrecision], 0.2]], $MachinePrecision]], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+211} \lor \neg \left(\frac{t}{\ell} \leq 0.2\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) < -4.9999999999999995e211 or 0.20000000000000001 < (/.f64 t l) Initial program 69.8%
Taylor expanded in Om around 0 53.6%
Taylor expanded in t around inf 84.3%
associate-*l/84.2%
Simplified84.2%
*-commutative84.2%
clear-num83.8%
un-div-inv83.9%
Applied egg-rr83.9%
if -4.9999999999999995e211 < (/.f64 t l) < 0.20000000000000001Initial program 95.3%
Taylor expanded in t around 0 72.6%
unpow272.6%
unpow272.6%
times-frac78.8%
unpow278.8%
Simplified78.8%
Taylor expanded in Om around 0 78.4%
Final simplification80.3%
(FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -50000000000.0) (asin (* l (- (/ (sqrt 0.5) t)))) (if (<= (/ t l) 0.2) (asin 1.0) (asin (/ (sqrt 0.5) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = asin((l * -(sqrt(0.5) / t)));
} else if ((t / l) <= 0.2) {
tmp = asin(1.0);
} else {
tmp = asin((sqrt(0.5) / (t / l)));
}
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) <= (-50000000000.0d0)) then
tmp = asin((l * -(sqrt(0.5d0) / t)))
else if ((t / l) <= 0.2d0) then
tmp = asin(1.0d0)
else
tmp = asin((sqrt(0.5d0) / (t / l)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -50000000000.0) {
tmp = Math.asin((l * -(Math.sqrt(0.5) / t)));
} else if ((t / l) <= 0.2) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -50000000000.0: tmp = math.asin((l * -(math.sqrt(0.5) / t))) elif (t / l) <= 0.2: tmp = math.asin(1.0) else: tmp = math.asin((math.sqrt(0.5) / (t / l))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -50000000000.0) tmp = asin(Float64(l * Float64(-Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 0.2) tmp = asin(1.0); else tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -50000000000.0) tmp = asin((l * -(sqrt(0.5) / t))); elseif ((t / l) <= 0.2) tmp = asin(1.0); else tmp = asin((sqrt(0.5) / (t / l))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -50000000000.0], N[ArcSin[N[(l * (-N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.2], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -50000000000:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(-\frac{\sqrt{0.5}}{t}\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.2:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5e10Initial program 72.6%
Taylor expanded in Om around 0 47.2%
Taylor expanded in t around -inf 98.7%
mul-1-neg98.7%
associate-/l*98.8%
distribute-neg-frac98.8%
Simplified98.8%
Taylor expanded in l around 0 98.7%
mul-1-neg98.7%
associate-*r/98.8%
*-commutative98.8%
distribute-rgt-neg-in98.8%
Simplified98.8%
if -5e10 < (/.f64 t l) < 0.20000000000000001Initial program 98.4%
Taylor expanded in t around 0 90.1%
unpow290.1%
unpow290.1%
times-frac97.8%
unpow297.8%
Simplified97.8%
Taylor expanded in Om around 0 97.3%
if 0.20000000000000001 < (/.f64 t l) Initial program 74.8%
Taylor expanded in Om around 0 50.2%
Taylor expanded in t around inf 97.2%
associate-*l/97.1%
Simplified97.1%
*-commutative97.1%
clear-num96.4%
un-div-inv96.5%
Applied egg-rr96.5%
Final simplification97.5%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 1.62e+106) (asin 1.0) (asin (* (sqrt 0.5) (/ l t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.62e+106) {
tmp = asin(1.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 <= 1.62d+106) then
tmp = asin(1.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 <= 1.62e+106) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 1.62e+106: tmp = math.asin(1.0) else: tmp = math.asin((math.sqrt(0.5) * (l / t))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.62e+106) tmp = asin(1.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 <= 1.62e+106) tmp = asin(1.0); else tmp = asin((sqrt(0.5) * (l / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.62e+106], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.62 \cdot 10^{+106}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if t < 1.62e106Initial program 87.4%
Taylor expanded in t around 0 57.1%
unpow257.1%
unpow257.1%
times-frac61.8%
unpow261.8%
Simplified61.8%
Taylor expanded in Om around 0 61.5%
if 1.62e106 < t Initial program 82.3%
Taylor expanded in Om around 0 52.6%
Taylor expanded in t around inf 67.4%
associate-*l/67.4%
Simplified67.4%
Final simplification62.6%
(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 86.5%
Taylor expanded in t around 0 48.9%
unpow248.9%
unpow248.9%
times-frac53.3%
unpow253.3%
Simplified53.3%
Taylor expanded in Om around 0 53.0%
Final simplification53.0%
herbie shell --seed 2024024
(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)))))))