
(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}
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= (/ t_m l) -5e+89)
(asin (/ (- l) (* t_m (sqrt 2.0))))
(if (<= (/ t_m l) 1e+153)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (* t_m (/ t_m l)) (/ 1.0 l)))))))
(asin (* (/ 1.0 t_m) (/ l (sqrt 2.0)))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -5e+89) {
tmp = asin((-l / (t_m * sqrt(2.0))));
} else if ((t_m / l) <= 1e+153) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l)) * (1.0 / l)))))));
} else {
tmp = asin(((1.0 / t_m) * (l / sqrt(2.0))));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l) <= (-5d+89)) then
tmp = asin((-l / (t_m * sqrt(2.0d0))))
else if ((t_m / l) <= 1d+153) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m * (t_m / l)) * (1.0d0 / l)))))))
else
tmp = asin(((1.0d0 / t_m) * (l / sqrt(2.0d0))))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -5e+89) {
tmp = Math.asin((-l / (t_m * Math.sqrt(2.0))));
} else if ((t_m / l) <= 1e+153) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l)) * (1.0 / l)))))));
} else {
tmp = Math.asin(((1.0 / t_m) * (l / Math.sqrt(2.0))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if (t_m / l) <= -5e+89: tmp = math.asin((-l / (t_m * math.sqrt(2.0)))) elif (t_m / l) <= 1e+153: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l)) * (1.0 / l))))))) else: tmp = math.asin(((1.0 / t_m) * (l / math.sqrt(2.0)))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (Float64(t_m / l) <= -5e+89) tmp = asin(Float64(Float64(-l) / Float64(t_m * sqrt(2.0)))); elseif (Float64(t_m / l) <= 1e+153) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t_m * Float64(t_m / l)) * Float64(1.0 / l))))))); else tmp = asin(Float64(Float64(1.0 / t_m) * Float64(l / sqrt(2.0)))); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if ((t_m / l) <= -5e+89) tmp = asin((-l / (t_m * sqrt(2.0)))); elseif ((t_m / l) <= 1e+153) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l)) * (1.0 / l))))))); else tmp = asin(((1.0 / t_m) * (l / sqrt(2.0)))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l), $MachinePrecision], -5e+89], N[ArcSin[N[((-l) / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 1e+153], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t$95$m * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 / t$95$m), $MachinePrecision] * N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t_m}{\ell} \leq -5 \cdot 10^{+89}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_m \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 10^{+153}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\left(t_m \cdot \frac{t_m}{\ell}\right) \cdot \frac{1}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{t_m} \cdot \frac{\ell}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.99999999999999983e89Initial program 53.6%
sqrt-div53.6%
div-inv53.6%
add-sqr-sqrt53.6%
hypot-1-def53.6%
*-commutative53.6%
sqrt-prod53.6%
unpow253.6%
sqrt-prod0.0%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around -inf 99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
if -4.99999999999999983e89 < (/.f64 t l) < 1e153Initial program 99.0%
unpow299.0%
div-inv99.0%
associate-*r*97.9%
Applied egg-rr97.9%
unpow297.9%
clear-num97.9%
un-div-inv97.9%
Applied egg-rr97.9%
if 1e153 < (/.f64 t l) Initial program 58.9%
sqrt-div58.9%
div-inv58.9%
add-sqr-sqrt58.9%
hypot-1-def58.9%
*-commutative58.9%
sqrt-prod58.9%
unpow258.9%
sqrt-prod95.9%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
associate-*r/96.1%
*-rgt-identity96.1%
Simplified96.1%
Taylor expanded in Om around 0 96.1%
Taylor expanded in t around inf 99.8%
*-un-lft-identity99.8%
times-frac99.8%
Applied egg-rr99.8%
Final simplification98.4%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t_m l) (sqrt 2.0))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t_m / l) * sqrt(2.0)))));
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t_m / l) * Math.sqrt(2.0)))));
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t_m / l) * math.sqrt(2.0)))))
t_m = abs(t) function code(t_m, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t_m / l) * sqrt(2.0))))) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t_m / l) * sqrt(2.0))))); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, 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$95$m / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t_m}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 87.0%
sqrt-div87.0%
div-inv87.0%
add-sqr-sqrt87.0%
hypot-1-def87.0%
*-commutative87.0%
sqrt-prod86.9%
unpow286.9%
sqrt-prod53.1%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
Simplified98.4%
Final simplification98.4%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= (pow (/ t_m l) 2.0) 5e+188)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (* t_m (/ t_m l)) (/ 1.0 l)))))))
(fabs (asin (/ l (/ t_m (sqrt 0.5)))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (pow((t_m / l), 2.0) <= 5e+188) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l)) * (1.0 / l)))))));
} else {
tmp = fabs(asin((l / (t_m / sqrt(0.5)))));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (((t_m / l) ** 2.0d0) <= 5d+188) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m * (t_m / l)) * (1.0d0 / l)))))))
else
tmp = abs(asin((l / (t_m / sqrt(0.5d0)))))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (Math.pow((t_m / l), 2.0) <= 5e+188) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l)) * (1.0 / l)))))));
} else {
tmp = Math.abs(Math.asin((l / (t_m / Math.sqrt(0.5)))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if math.pow((t_m / l), 2.0) <= 5e+188: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l)) * (1.0 / l))))))) else: tmp = math.fabs(math.asin((l / (t_m / math.sqrt(0.5))))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if ((Float64(t_m / l) ^ 2.0) <= 5e+188) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t_m * Float64(t_m / l)) * Float64(1.0 / l))))))); else tmp = abs(asin(Float64(l / Float64(t_m / sqrt(0.5))))); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if (((t_m / l) ^ 2.0) <= 5e+188) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m * (t_m / l)) * (1.0 / l))))))); else tmp = abs(asin((l / (t_m / sqrt(0.5))))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[Power[N[(t$95$m / l), $MachinePrecision], 2.0], $MachinePrecision], 5e+188], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t$95$m * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Abs[N[ArcSin[N[(l / N[(t$95$m / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;{\left(\frac{t_m}{\ell}\right)}^{2} \leq 5 \cdot 10^{+188}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\left(t_m \cdot \frac{t_m}{\ell}\right) \cdot \frac{1}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\sin^{-1} \left(\frac{\ell}{\frac{t_m}{\sqrt{0.5}}}\right)\right|\\
\end{array}
\end{array}
if (pow.f64 (/.f64 t l) 2) < 5.0000000000000001e188Initial program 98.9%
unpow298.9%
div-inv98.9%
associate-*r*98.9%
Applied egg-rr98.9%
unpow298.9%
clear-num98.9%
un-div-inv98.9%
Applied egg-rr98.9%
if 5.0000000000000001e188 < (pow.f64 (/.f64 t l) 2) Initial program 59.3%
Taylor expanded in t around inf 55.6%
*-commutative55.6%
unpow255.6%
unpow255.6%
times-frac66.0%
unpow266.0%
*-commutative66.0%
associate-/l*64.6%
Simplified64.6%
add-sqr-sqrt62.6%
sqrt-unprod60.9%
pow260.9%
associate-*r/60.9%
div-inv60.8%
sqrt-unprod60.8%
clear-num60.9%
Applied egg-rr60.9%
unpow260.9%
rem-sqrt-square99.6%
*-commutative99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in Om around 0 99.6%
associate-/l*99.6%
Simplified99.6%
Final simplification99.1%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (let* ((t_1 (pow (/ t_m l) 2.0))) (if (<= t_1 0.005) (asin (- 1.0 t_1)) (asin (/ l (* t_m (sqrt 2.0)))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double t_1 = pow((t_m / l), 2.0);
double tmp;
if (t_1 <= 0.005) {
tmp = asin((1.0 - t_1));
} else {
tmp = asin((l / (t_m * sqrt(2.0))));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
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_m / l) ** 2.0d0
if (t_1 <= 0.005d0) then
tmp = asin((1.0d0 - t_1))
else
tmp = asin((l / (t_m * sqrt(2.0d0))))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double t_1 = Math.pow((t_m / l), 2.0);
double tmp;
if (t_1 <= 0.005) {
tmp = Math.asin((1.0 - t_1));
} else {
tmp = Math.asin((l / (t_m * Math.sqrt(2.0))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): t_1 = math.pow((t_m / l), 2.0) tmp = 0 if t_1 <= 0.005: tmp = math.asin((1.0 - t_1)) else: tmp = math.asin((l / (t_m * math.sqrt(2.0)))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(t_m / l) ^ 2.0 tmp = 0.0 if (t_1 <= 0.005) tmp = asin(Float64(1.0 - t_1)); else tmp = asin(Float64(l / Float64(t_m * sqrt(2.0)))); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) t_1 = (t_m / l) ^ 2.0; tmp = 0.0; if (t_1 <= 0.005) tmp = asin((1.0 - t_1)); else tmp = asin((l / (t_m * sqrt(2.0)))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(t$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t$95$1, 0.005], N[ArcSin[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := {\left(\frac{t_m}{\ell}\right)}^{2}\\
\mathbf{if}\;t_1 \leq 0.005:\\
\;\;\;\;\sin^{-1} \left(1 - t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (pow.f64 (/.f64 t l) 2) < 0.0050000000000000001Initial program 98.7%
sqrt-div98.7%
div-inv98.7%
add-sqr-sqrt98.7%
hypot-1-def98.7%
*-commutative98.7%
sqrt-prod98.7%
unpow298.7%
sqrt-prod57.7%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate-*r/98.7%
*-rgt-identity98.7%
Simplified98.7%
Taylor expanded in Om around 0 98.0%
Taylor expanded in t around 0 98.0%
Taylor expanded in t around 0 83.9%
associate-*r/83.9%
*-commutative83.9%
unpow283.9%
rem-square-sqrt83.9%
associate-*r*83.9%
metadata-eval83.9%
associate-*r/83.9%
mul-1-neg83.9%
unsub-neg83.9%
unpow283.9%
unpow283.9%
times-frac97.6%
unpow297.6%
Simplified97.6%
if 0.0050000000000000001 < (pow.f64 (/.f64 t l) 2) Initial program 73.0%
sqrt-div73.0%
div-inv73.0%
add-sqr-sqrt73.0%
hypot-1-def73.0%
*-commutative73.0%
sqrt-prod72.9%
unpow272.9%
sqrt-prod47.5%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate-*r/98.0%
*-rgt-identity98.0%
Simplified98.0%
Taylor expanded in Om around 0 98.0%
Taylor expanded in t around inf 58.4%
Final simplification79.7%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t_m l) (sqrt 2.0))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t_m / l) * sqrt(2.0)))));
}
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t_m / l) * Math.sqrt(2.0)))));
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t_m / l) * math.sqrt(2.0)))))
t_m = abs(t) function code(t_m, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t_m / l) * sqrt(2.0))))) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t_m / l) * sqrt(2.0))))); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t$95$m / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t_m}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 87.0%
sqrt-div87.0%
div-inv87.0%
add-sqr-sqrt87.0%
hypot-1-def87.0%
*-commutative87.0%
sqrt-prod86.9%
unpow286.9%
sqrt-prod53.1%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in Om around 0 98.0%
Final simplification98.0%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= (/ t_m l) -5e+89)
(asin (/ (- l) (* t_m (sqrt 2.0))))
(if (<= (/ t_m l) 1e+153)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t_m l) (/ t_m l)))))))
(asin (* (/ 1.0 t_m) (/ l (sqrt 2.0)))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -5e+89) {
tmp = asin((-l / (t_m * sqrt(2.0))));
} else if ((t_m / l) <= 1e+153) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l)))))));
} else {
tmp = asin(((1.0 / t_m) * (l / sqrt(2.0))));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l) <= (-5d+89)) then
tmp = asin((-l / (t_m * sqrt(2.0d0))))
else if ((t_m / l) <= 1d+153) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m / l) * (t_m / l)))))))
else
tmp = asin(((1.0d0 / t_m) * (l / sqrt(2.0d0))))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= -5e+89) {
tmp = Math.asin((-l / (t_m * Math.sqrt(2.0))));
} else if ((t_m / l) <= 1e+153) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l)))))));
} else {
tmp = Math.asin(((1.0 / t_m) * (l / Math.sqrt(2.0))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if (t_m / l) <= -5e+89: tmp = math.asin((-l / (t_m * math.sqrt(2.0)))) elif (t_m / l) <= 1e+153: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l))))))) else: tmp = math.asin(((1.0 / t_m) * (l / math.sqrt(2.0)))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (Float64(t_m / l) <= -5e+89) tmp = asin(Float64(Float64(-l) / Float64(t_m * sqrt(2.0)))); elseif (Float64(t_m / l) <= 1e+153) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t_m / l) * Float64(t_m / l))))))); else tmp = asin(Float64(Float64(1.0 / t_m) * Float64(l / sqrt(2.0)))); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if ((t_m / l) <= -5e+89) tmp = asin((-l / (t_m * sqrt(2.0)))); elseif ((t_m / l) <= 1e+153) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l))))))); else tmp = asin(((1.0 / t_m) * (l / sqrt(2.0)))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l), $MachinePrecision], -5e+89], N[ArcSin[N[((-l) / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 1e+153], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(1.0 / t$95$m), $MachinePrecision] * N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t_m}{\ell} \leq -5 \cdot 10^{+89}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_m \cdot \sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 10^{+153}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \left(\frac{t_m}{\ell} \cdot \frac{t_m}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{t_m} \cdot \frac{\ell}{\sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -4.99999999999999983e89Initial program 53.6%
sqrt-div53.6%
div-inv53.6%
add-sqr-sqrt53.6%
hypot-1-def53.6%
*-commutative53.6%
sqrt-prod53.6%
unpow253.6%
sqrt-prod0.0%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
Taylor expanded in Om around 0 98.1%
Taylor expanded in t around -inf 99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
if -4.99999999999999983e89 < (/.f64 t l) < 1e153Initial program 99.0%
unpow299.0%
Applied egg-rr99.0%
unpow297.9%
clear-num97.9%
un-div-inv97.9%
Applied egg-rr99.0%
if 1e153 < (/.f64 t l) Initial program 58.9%
sqrt-div58.9%
div-inv58.9%
add-sqr-sqrt58.9%
hypot-1-def58.9%
*-commutative58.9%
sqrt-prod58.9%
unpow258.9%
sqrt-prod95.9%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
associate-*r/96.1%
*-rgt-identity96.1%
Simplified96.1%
Taylor expanded in Om around 0 96.1%
Taylor expanded in t around inf 99.8%
*-un-lft-identity99.8%
times-frac99.8%
Applied egg-rr99.8%
Final simplification99.1%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= l -1.45e-171)
(asin 1.0)
(if (or (<= l 2.3e-183) (and (not (<= l 5.5e-94)) (<= l 1.16e-39)))
(asin (/ l (* t_m (sqrt 2.0))))
(asin 1.0))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (l <= -1.45e-171) {
tmp = asin(1.0);
} else if ((l <= 2.3e-183) || (!(l <= 5.5e-94) && (l <= 1.16e-39))) {
tmp = asin((l / (t_m * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-1.45d-171)) then
tmp = asin(1.0d0)
else if ((l <= 2.3d-183) .or. (.not. (l <= 5.5d-94)) .and. (l <= 1.16d-39)) then
tmp = asin((l / (t_m * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double tmp;
if (l <= -1.45e-171) {
tmp = Math.asin(1.0);
} else if ((l <= 2.3e-183) || (!(l <= 5.5e-94) && (l <= 1.16e-39))) {
tmp = Math.asin((l / (t_m * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if l <= -1.45e-171: tmp = math.asin(1.0) elif (l <= 2.3e-183) or (not (l <= 5.5e-94) and (l <= 1.16e-39)): tmp = math.asin((l / (t_m * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) tmp = 0.0 if (l <= -1.45e-171) tmp = asin(1.0); elseif ((l <= 2.3e-183) || (!(l <= 5.5e-94) && (l <= 1.16e-39))) tmp = asin(Float64(l / Float64(t_m * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) tmp = 0.0; if (l <= -1.45e-171) tmp = asin(1.0); elseif ((l <= 2.3e-183) || (~((l <= 5.5e-94)) && (l <= 1.16e-39))) tmp = asin((l / (t_m * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := If[LessEqual[l, -1.45e-171], N[ArcSin[1.0], $MachinePrecision], If[Or[LessEqual[l, 2.3e-183], And[N[Not[LessEqual[l, 5.5e-94]], $MachinePrecision], LessEqual[l, 1.16e-39]]], N[ArcSin[N[(l / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.45 \cdot 10^{-171}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 2.3 \cdot 10^{-183} \lor \neg \left(\ell \leq 5.5 \cdot 10^{-94}\right) \land \ell \leq 1.16 \cdot 10^{-39}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_m \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.4499999999999999e-171 or 2.30000000000000016e-183 < l < 5.49999999999999989e-94 or 1.16e-39 < l Initial program 92.8%
Taylor expanded in t around 0 68.4%
unpow268.4%
unpow268.4%
times-frac73.2%
unpow273.2%
Simplified73.2%
Taylor expanded in Om around 0 72.6%
if -1.4499999999999999e-171 < l < 2.30000000000000016e-183 or 5.49999999999999989e-94 < l < 1.16e-39Initial program 74.5%
sqrt-div74.5%
div-inv74.5%
add-sqr-sqrt74.5%
hypot-1-def74.5%
*-commutative74.5%
sqrt-prod74.5%
unpow274.5%
sqrt-prod50.3%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
associate-*r/97.2%
*-rgt-identity97.2%
Simplified97.2%
Taylor expanded in Om around 0 97.2%
Taylor expanded in t around inf 56.9%
Final simplification67.7%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(let* ((t_1 (* t_m (sqrt 2.0))))
(if (<= (/ t_m l) -10000.0)
(asin (/ (- l) t_1))
(if (<= (/ t_m l) 0.1)
(asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(asin (/ l t_1))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double t_1 = t_m * sqrt(2.0);
double tmp;
if ((t_m / l) <= -10000.0) {
tmp = asin((-l / t_1));
} else if ((t_m / l) <= 0.1) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((l / t_1));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
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_m * sqrt(2.0d0)
if ((t_m / l) <= (-10000.0d0)) then
tmp = asin((-l / t_1))
else if ((t_m / l) <= 0.1d0) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((l / t_1))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double t_1 = t_m * Math.sqrt(2.0);
double tmp;
if ((t_m / l) <= -10000.0) {
tmp = Math.asin((-l / t_1));
} else if ((t_m / l) <= 0.1) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((l / t_1));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): t_1 = t_m * math.sqrt(2.0) tmp = 0 if (t_m / l) <= -10000.0: tmp = math.asin((-l / t_1)) elif (t_m / l) <= 0.1: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((l / t_1)) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (Float64(t_m / l) <= -10000.0) tmp = asin(Float64(Float64(-l) / t_1)); elseif (Float64(t_m / l) <= 0.1) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64(l / t_1)); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) t_1 = t_m * sqrt(2.0); tmp = 0.0; if ((t_m / l) <= -10000.0) tmp = asin((-l / t_1)); elseif ((t_m / l) <= 0.1) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((l / t_1)); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := Block[{t$95$1 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], -10000.0], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 0.1], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := t_m \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t_m}{\ell} \leq -10000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 0.1:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e4Initial program 67.1%
sqrt-div67.1%
div-inv67.1%
add-sqr-sqrt67.1%
hypot-1-def67.1%
*-commutative67.1%
sqrt-prod66.9%
unpow266.9%
sqrt-prod0.0%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in Om around 0 98.4%
Taylor expanded in t around -inf 99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
if -1e4 < (/.f64 t l) < 0.10000000000000001Initial program 98.8%
Taylor expanded in t around 0 90.2%
unpow290.2%
unpow290.2%
times-frac96.5%
unpow296.5%
Simplified96.5%
unpow298.7%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr96.5%
if 0.10000000000000001 < (/.f64 t l) Initial program 78.2%
sqrt-div78.1%
div-inv78.1%
add-sqr-sqrt78.1%
hypot-1-def78.1%
*-commutative78.1%
sqrt-prod78.1%
unpow278.1%
sqrt-prod97.5%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
associate-*r/97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around inf 98.3%
Final simplification97.6%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(let* ((t_1 (* t_m (sqrt 2.0))))
(if (<= (/ t_m l) -10000.0)
(asin (/ (- l) t_1))
(if (<= (/ t_m l) 0.1)
(asin (fma -0.5 (/ (/ Om Omc) (/ Omc Om)) 1.0))
(asin (/ l t_1))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double t_1 = t_m * sqrt(2.0);
double tmp;
if ((t_m / l) <= -10000.0) {
tmp = asin((-l / t_1));
} else if ((t_m / l) <= 0.1) {
tmp = asin(fma(-0.5, ((Om / Omc) / (Omc / Om)), 1.0));
} else {
tmp = asin((l / t_1));
}
return tmp;
}
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (Float64(t_m / l) <= -10000.0) tmp = asin(Float64(Float64(-l) / t_1)); elseif (Float64(t_m / l) <= 0.1) tmp = asin(fma(-0.5, Float64(Float64(Om / Omc) / Float64(Omc / Om)), 1.0)); else tmp = asin(Float64(l / t_1)); end return tmp end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := Block[{t$95$1 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], -10000.0], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 0.1], N[ArcSin[N[(-0.5 * N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := t_m \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t_m}{\ell} \leq -10000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 0.1:\\
\;\;\;\;\sin^{-1} \left(\mathsf{fma}\left(-0.5, \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}, 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e4Initial program 67.1%
sqrt-div67.1%
div-inv67.1%
add-sqr-sqrt67.1%
hypot-1-def67.1%
*-commutative67.1%
sqrt-prod66.9%
unpow266.9%
sqrt-prod0.0%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in Om around 0 98.4%
Taylor expanded in t around -inf 99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
if -1e4 < (/.f64 t l) < 0.10000000000000001Initial program 98.8%
Taylor expanded in t around 0 90.2%
unpow290.2%
unpow290.2%
times-frac96.5%
unpow296.5%
Simplified96.5%
Taylor expanded in Om around 0 90.2%
+-commutative90.2%
fma-def90.2%
unpow290.2%
unpow290.2%
times-frac96.5%
unpow296.5%
Simplified96.5%
unpow298.7%
clear-num98.7%
un-div-inv98.7%
Applied egg-rr96.5%
if 0.10000000000000001 < (/.f64 t l) Initial program 78.2%
sqrt-div78.1%
div-inv78.1%
add-sqr-sqrt78.1%
hypot-1-def78.1%
*-commutative78.1%
sqrt-prod78.1%
unpow278.1%
sqrt-prod97.5%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
associate-*r/97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around inf 98.3%
Final simplification97.6%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(let* ((t_1 (* t_m (sqrt 2.0))))
(if (<= (/ t_m l) -10000.0)
(asin (/ (- l) t_1))
(if (<= (/ t_m l) 0.1)
(asin (- 1.0 (pow (/ t_m l) 2.0)))
(asin (/ l t_1))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double t_1 = t_m * sqrt(2.0);
double tmp;
if ((t_m / l) <= -10000.0) {
tmp = asin((-l / t_1));
} else if ((t_m / l) <= 0.1) {
tmp = asin((1.0 - pow((t_m / l), 2.0)));
} else {
tmp = asin((l / t_1));
}
return tmp;
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
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_m * sqrt(2.0d0)
if ((t_m / l) <= (-10000.0d0)) then
tmp = asin((-l / t_1))
else if ((t_m / l) <= 0.1d0) then
tmp = asin((1.0d0 - ((t_m / l) ** 2.0d0)))
else
tmp = asin((l / t_1))
end if
code = tmp
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
double t_1 = t_m * Math.sqrt(2.0);
double tmp;
if ((t_m / l) <= -10000.0) {
tmp = Math.asin((-l / t_1));
} else if ((t_m / l) <= 0.1) {
tmp = Math.asin((1.0 - Math.pow((t_m / l), 2.0)));
} else {
tmp = Math.asin((l / t_1));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): t_1 = t_m * math.sqrt(2.0) tmp = 0 if (t_m / l) <= -10000.0: tmp = math.asin((-l / t_1)) elif (t_m / l) <= 0.1: tmp = math.asin((1.0 - math.pow((t_m / l), 2.0))) else: tmp = math.asin((l / t_1)) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (Float64(t_m / l) <= -10000.0) tmp = asin(Float64(Float64(-l) / t_1)); elseif (Float64(t_m / l) <= 0.1) tmp = asin(Float64(1.0 - (Float64(t_m / l) ^ 2.0))); else tmp = asin(Float64(l / t_1)); end return tmp end
t_m = abs(t); function tmp_2 = code(t_m, l, Om, Omc) t_1 = t_m * sqrt(2.0); tmp = 0.0; if ((t_m / l) <= -10000.0) tmp = asin((-l / t_1)); elseif ((t_m / l) <= 0.1) tmp = asin((1.0 - ((t_m / l) ^ 2.0))); else tmp = asin((l / t_1)); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
code[t$95$m_, l_, Om_, Omc_] := Block[{t$95$1 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], -10000.0], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 0.1], N[ArcSin[N[(1.0 - N[Power[N[(t$95$m / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := t_m \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t_m}{\ell} \leq -10000:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\
\mathbf{elif}\;\frac{t_m}{\ell} \leq 0.1:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t_m}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1e4Initial program 67.1%
sqrt-div67.1%
div-inv67.1%
add-sqr-sqrt67.1%
hypot-1-def67.1%
*-commutative67.1%
sqrt-prod66.9%
unpow266.9%
sqrt-prod0.0%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in Om around 0 98.4%
Taylor expanded in t around -inf 99.5%
associate-*r/99.5%
neg-mul-199.5%
Simplified99.5%
if -1e4 < (/.f64 t l) < 0.10000000000000001Initial program 98.8%
sqrt-div98.7%
div-inv98.7%
add-sqr-sqrt98.7%
hypot-1-def98.7%
*-commutative98.7%
sqrt-prod98.7%
unpow298.7%
sqrt-prod56.9%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate-*r/98.7%
*-rgt-identity98.7%
Simplified98.7%
Taylor expanded in Om around 0 98.0%
Taylor expanded in t around 0 98.0%
Taylor expanded in t around 0 82.7%
associate-*r/82.7%
*-commutative82.7%
unpow282.7%
rem-square-sqrt82.7%
associate-*r*82.7%
metadata-eval82.7%
associate-*r/82.7%
mul-1-neg82.7%
unsub-neg82.7%
unpow282.7%
unpow282.7%
times-frac96.2%
unpow296.2%
Simplified96.2%
if 0.10000000000000001 < (/.f64 t l) Initial program 78.2%
sqrt-div78.1%
div-inv78.1%
add-sqr-sqrt78.1%
hypot-1-def78.1%
*-commutative78.1%
sqrt-prod78.1%
unpow278.1%
sqrt-prod97.5%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
associate-*r/97.7%
*-rgt-identity97.7%
Simplified97.7%
Taylor expanded in Om around 0 97.7%
Taylor expanded in t around inf 98.3%
Final simplification97.4%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin 1.0))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin(1.0);
}
t_m = abs(t)
real(8) function code(t_m, l, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(1.0d0)
end function
t_m = Math.abs(t);
public static double code(double t_m, double l, double Om, double Omc) {
return Math.asin(1.0);
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin(1.0)
t_m = abs(t) function code(t_m, l, Om, Omc) return asin(1.0) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin(1.0); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} 1
\end{array}
Initial program 87.0%
Taylor expanded in t around 0 51.6%
unpow251.6%
unpow251.6%
times-frac55.5%
unpow255.5%
Simplified55.5%
Taylor expanded in Om around 0 55.1%
Final simplification55.1%
herbie shell --seed 2024019
(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)))))))