
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(if (<= (/ t_m l) -2e+129)
(asin
(* (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (/ (- (* l (sqrt 0.5))) t_m)))
(if (<= (/ t_m l) 2e+146)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ 1.0 (* (/ l t_m) (/ l t_m))))))))
(asin (* (sqrt t_1) (/ l (* t_m (sqrt 2.0)))))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double t_1 = 1.0 - ((Om / Omc) / (Omc / Om));
double tmp;
if ((t_m / l) <= -2e+129) {
tmp = asin((sqrt((1.0 - pow((Om / Omc), 2.0))) * (-(l * sqrt(0.5)) / t_m)));
} else if ((t_m / l) <= 2e+146) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
} else {
tmp = asin((sqrt(t_1) * (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 = 1.0d0 - ((om / omc) / (omc / om))
if ((t_m / l) <= (-2d+129)) then
tmp = asin((sqrt((1.0d0 - ((om / omc) ** 2.0d0))) * (-(l * sqrt(0.5d0)) / t_m)))
else if ((t_m / l) <= 2d+146) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * (1.0d0 / ((l / t_m) * (l / t_m))))))))
else
tmp = asin((sqrt(t_1) * (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 = 1.0 - ((Om / Omc) / (Omc / Om));
double tmp;
if ((t_m / l) <= -2e+129) {
tmp = Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) * (-(l * Math.sqrt(0.5)) / t_m)));
} else if ((t_m / l) <= 2e+146) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
} else {
tmp = Math.asin((Math.sqrt(t_1) * (l / (t_m * Math.sqrt(2.0)))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): t_1 = 1.0 - ((Om / Omc) / (Omc / Om)) tmp = 0 if (t_m / l) <= -2e+129: tmp = math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) * (-(l * math.sqrt(0.5)) / t_m))) elif (t_m / l) <= 2e+146: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m)))))))) else: tmp = math.asin((math.sqrt(t_1) * (l / (t_m * math.sqrt(2.0))))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) tmp = 0.0 if (Float64(t_m / l) <= -2e+129) tmp = asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) * Float64(Float64(-Float64(l * sqrt(0.5))) / t_m))); elseif (Float64(t_m / l) <= 2e+146) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(1.0 / Float64(Float64(l / t_m) * Float64(l / t_m)))))))); else tmp = asin(Float64(sqrt(t_1) * 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 = 1.0 - ((Om / Omc) / (Omc / Om)); tmp = 0.0; if ((t_m / l) <= -2e+129) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) * (-(l * sqrt(0.5)) / t_m))); elseif ((t_m / l) <= 2e+146) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m)))))))); else tmp = asin((sqrt(t_1) * (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[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], -2e+129], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]) / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 2e+146], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(1.0 / N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[t$95$1], $MachinePrecision] * N[(l / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\\
\mathbf{if}\;\frac{t\_m}{\ell} \leq -2 \cdot 10^{+129}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{-\ell \cdot \sqrt{0.5}}{t\_m}\right)\\
\mathbf{elif}\;\frac{t\_m}{\ell} \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t\_1}{1 + 2 \cdot \frac{1}{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{t\_1} \cdot \frac{\ell}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e129Initial program 57.0%
unpow257.0%
clear-num57.0%
clear-num56.9%
frac-times57.0%
metadata-eval57.0%
Applied egg-rr57.0%
Taylor expanded in t around -inf 94.2%
mul-1-neg94.2%
associate-*l/94.2%
*-commutative94.2%
distribute-rgt-neg-in94.2%
unpow294.2%
unpow294.2%
times-frac99.6%
unpow299.6%
associate-*l/99.6%
Simplified99.6%
if -2e129 < (/.f64 t l) < 1.99999999999999987e146Initial program 98.2%
unpow298.2%
clear-num98.2%
clear-num98.1%
frac-times98.2%
metadata-eval98.2%
Applied egg-rr98.2%
unpow298.2%
clear-num98.2%
un-div-inv98.2%
Applied egg-rr98.2%
if 1.99999999999999987e146 < (/.f64 t l) Initial program 41.0%
sqrt-div41.0%
div-inv41.0%
add-sqr-sqrt41.0%
hypot-1-def41.0%
*-commutative41.0%
sqrt-prod41.0%
unpow241.0%
sqrt-prod95.0%
add-sqr-sqrt95.2%
Applied egg-rr95.2%
associate-*r/95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in t around inf 90.0%
*-commutative90.0%
unpow290.0%
unpow290.0%
times-frac99.6%
unpow299.6%
Simplified99.6%
unpow241.0%
clear-num41.0%
un-div-inv41.0%
Applied egg-rr99.6%
Final simplification98.6%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(let* ((t_1 (* t_m (sqrt 2.0))) (t_2 (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(if (<= (/ t_m l) -2e+134)
(asin (* (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (/ (- l) t_1)))
(if (<= (/ t_m l) 2e+146)
(asin (sqrt (/ t_2 (+ 1.0 (* 2.0 (/ 1.0 (* (/ l t_m) (/ l t_m))))))))
(asin (* (sqrt t_2) (/ 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 t_2 = 1.0 - ((Om / Omc) / (Omc / Om));
double tmp;
if ((t_m / l) <= -2e+134) {
tmp = asin((sqrt((1.0 - pow((Om / Omc), 2.0))) * (-l / t_1)));
} else if ((t_m / l) <= 2e+146) {
tmp = asin(sqrt((t_2 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
} else {
tmp = asin((sqrt(t_2) * (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) :: t_2
real(8) :: tmp
t_1 = t_m * sqrt(2.0d0)
t_2 = 1.0d0 - ((om / omc) / (omc / om))
if ((t_m / l) <= (-2d+134)) then
tmp = asin((sqrt((1.0d0 - ((om / omc) ** 2.0d0))) * (-l / t_1)))
else if ((t_m / l) <= 2d+146) then
tmp = asin(sqrt((t_2 / (1.0d0 + (2.0d0 * (1.0d0 / ((l / t_m) * (l / t_m))))))))
else
tmp = asin((sqrt(t_2) * (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 t_2 = 1.0 - ((Om / Omc) / (Omc / Om));
double tmp;
if ((t_m / l) <= -2e+134) {
tmp = Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) * (-l / t_1)));
} else if ((t_m / l) <= 2e+146) {
tmp = Math.asin(Math.sqrt((t_2 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
} else {
tmp = Math.asin((Math.sqrt(t_2) * (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) t_2 = 1.0 - ((Om / Omc) / (Omc / Om)) tmp = 0 if (t_m / l) <= -2e+134: tmp = math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) * (-l / t_1))) elif (t_m / l) <= 2e+146: tmp = math.asin(math.sqrt((t_2 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m)))))))) else: tmp = math.asin((math.sqrt(t_2) * (l / t_1))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(t_m * sqrt(2.0)) t_2 = Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) tmp = 0.0 if (Float64(t_m / l) <= -2e+134) tmp = asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) * Float64(Float64(-l) / t_1))); elseif (Float64(t_m / l) <= 2e+146) tmp = asin(sqrt(Float64(t_2 / Float64(1.0 + Float64(2.0 * Float64(1.0 / Float64(Float64(l / t_m) * Float64(l / t_m)))))))); else tmp = asin(Float64(sqrt(t_2) * 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); t_2 = 1.0 - ((Om / Omc) / (Omc / Om)); tmp = 0.0; if ((t_m / l) <= -2e+134) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) * (-l / t_1))); elseif ((t_m / l) <= 2e+146) tmp = asin(sqrt((t_2 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m)))))))); else tmp = asin((sqrt(t_2) * (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]}, Block[{t$95$2 = N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], -2e+134], N[ArcSin[N[(N[Sqrt[N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-l) / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 2e+146], N[ArcSin[N[Sqrt[N[(t$95$2 / N[(1.0 + N[(2.0 * N[(1.0 / N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[(l / t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := t\_m \cdot \sqrt{2}\\
t_2 := 1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\\
\mathbf{if}\;\frac{t\_m}{\ell} \leq -2 \cdot 10^{+134}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}} \cdot \frac{-\ell}{t\_1}\right)\\
\mathbf{elif}\;\frac{t\_m}{\ell} \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t\_2}{1 + 2 \cdot \frac{1}{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{t\_2} \cdot \frac{\ell}{t\_1}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.99999999999999984e134Initial program 54.6%
sqrt-div54.6%
div-inv54.6%
add-sqr-sqrt54.6%
hypot-1-def54.6%
*-commutative54.6%
sqrt-prod54.6%
unpow254.6%
sqrt-prod0.0%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
associate-*r/96.9%
*-rgt-identity96.9%
Simplified96.9%
Taylor expanded in t around -inf 93.9%
mul-1-neg93.9%
*-commutative93.9%
distribute-rgt-neg-in93.9%
unpow293.9%
unpow293.9%
times-frac99.6%
unpow299.6%
Simplified99.6%
if -1.99999999999999984e134 < (/.f64 t l) < 1.99999999999999987e146Initial program 98.2%
unpow298.2%
clear-num98.2%
clear-num98.1%
frac-times98.2%
metadata-eval98.2%
Applied egg-rr98.2%
unpow298.2%
clear-num98.2%
un-div-inv98.2%
Applied egg-rr98.2%
if 1.99999999999999987e146 < (/.f64 t l) Initial program 41.0%
sqrt-div41.0%
div-inv41.0%
add-sqr-sqrt41.0%
hypot-1-def41.0%
*-commutative41.0%
sqrt-prod41.0%
unpow241.0%
sqrt-prod95.0%
add-sqr-sqrt95.2%
Applied egg-rr95.2%
associate-*r/95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in t around inf 90.0%
*-commutative90.0%
unpow290.0%
unpow290.0%
times-frac99.6%
unpow299.6%
Simplified99.6%
unpow241.0%
clear-num41.0%
un-div-inv41.0%
Applied egg-rr99.6%
Final simplification98.6%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (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 - ((Om / Omc) / (Omc / Om)))) / 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 - ((Om / Omc) / (Omc / Om)))) / 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 - ((Om / Omc) / (Omc / Om)))) / 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(Float64(Om / Omc) / Float64(Omc / Om)))) / hypot(1.0, Float64(t_m / Float64(l / sqrt(2.0)))))) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / 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[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[1.0 ^ 2 + N[(t$95$m / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \frac{t\_m}{\frac{\ell}{\sqrt{2}}}\right)}\right)
\end{array}
Initial program 85.3%
sqrt-div85.3%
div-inv85.3%
add-sqr-sqrt85.3%
hypot-1-def85.3%
*-commutative85.3%
sqrt-prod85.2%
unpow285.2%
sqrt-prod55.4%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
associate-*r/97.5%
*-rgt-identity97.5%
Simplified97.5%
Taylor expanded in t around 0 97.6%
associate-/l*97.6%
Simplified97.6%
unpow285.3%
clear-num85.3%
un-div-inv85.3%
Applied egg-rr97.6%
Final simplification97.6%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (hypot 1.0 (* (sqrt 2.0) (/ t_m l))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, (sqrt(2.0) * (t_m / l)))));
}
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 - ((Om / Omc) / (Omc / Om)))) / Math.hypot(1.0, (Math.sqrt(2.0) * (t_m / l)))));
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin((math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / math.hypot(1.0, (math.sqrt(2.0) * (t_m / l)))))
t_m = abs(t) function code(t_m, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om)))) / hypot(1.0, Float64(sqrt(2.0) * Float64(t_m / l))))) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) / (Omc / Om)))) / hypot(1.0, (sqrt(2.0) * (t_m / l))))); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, 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[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} \left(\frac{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}{\mathsf{hypot}\left(1, \sqrt{2} \cdot \frac{t\_m}{\ell}\right)}\right)
\end{array}
Initial program 85.3%
sqrt-div85.3%
div-inv85.3%
add-sqr-sqrt85.3%
hypot-1-def85.3%
*-commutative85.3%
sqrt-prod85.2%
unpow285.2%
sqrt-prod55.4%
add-sqr-sqrt97.5%
Applied egg-rr97.5%
associate-*r/97.5%
*-rgt-identity97.5%
Simplified97.5%
unpow285.3%
clear-num85.3%
un-div-inv85.3%
Applied egg-rr97.5%
Final simplification97.5%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (t_2 (sqrt t_1)))
(if (<= (/ t_m l) -2e+134)
(asin (/ t_2 (/ (- t_m) (/ l (sqrt 2.0)))))
(if (<= (/ t_m l) 2e+146)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ 1.0 (* (/ l t_m) (/ l t_m))))))))
(asin (* t_2 (/ l (* t_m (sqrt 2.0)))))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double t_1 = 1.0 - ((Om / Omc) / (Omc / Om));
double t_2 = sqrt(t_1);
double tmp;
if ((t_m / l) <= -2e+134) {
tmp = asin((t_2 / (-t_m / (l / sqrt(2.0)))));
} else if ((t_m / l) <= 2e+146) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
} else {
tmp = asin((t_2 * (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) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - ((om / omc) / (omc / om))
t_2 = sqrt(t_1)
if ((t_m / l) <= (-2d+134)) then
tmp = asin((t_2 / (-t_m / (l / sqrt(2.0d0)))))
else if ((t_m / l) <= 2d+146) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * (1.0d0 / ((l / t_m) * (l / t_m))))))))
else
tmp = asin((t_2 * (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 = 1.0 - ((Om / Omc) / (Omc / Om));
double t_2 = Math.sqrt(t_1);
double tmp;
if ((t_m / l) <= -2e+134) {
tmp = Math.asin((t_2 / (-t_m / (l / Math.sqrt(2.0)))));
} else if ((t_m / l) <= 2e+146) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
} else {
tmp = Math.asin((t_2 * (l / (t_m * Math.sqrt(2.0)))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): t_1 = 1.0 - ((Om / Omc) / (Omc / Om)) t_2 = math.sqrt(t_1) tmp = 0 if (t_m / l) <= -2e+134: tmp = math.asin((t_2 / (-t_m / (l / math.sqrt(2.0))))) elif (t_m / l) <= 2e+146: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m)))))))) else: tmp = math.asin((t_2 * (l / (t_m * math.sqrt(2.0))))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) t_2 = sqrt(t_1) tmp = 0.0 if (Float64(t_m / l) <= -2e+134) tmp = asin(Float64(t_2 / Float64(Float64(-t_m) / Float64(l / sqrt(2.0))))); elseif (Float64(t_m / l) <= 2e+146) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(1.0 / Float64(Float64(l / t_m) * Float64(l / t_m)))))))); else tmp = asin(Float64(t_2 * 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 = 1.0 - ((Om / Omc) / (Omc / Om)); t_2 = sqrt(t_1); tmp = 0.0; if ((t_m / l) <= -2e+134) tmp = asin((t_2 / (-t_m / (l / sqrt(2.0))))); elseif ((t_m / l) <= 2e+146) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m)))))))); else tmp = asin((t_2 * (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[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], -2e+134], N[ArcSin[N[(t$95$2 / N[((-t$95$m) / N[(l / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 2e+146], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(1.0 / N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(t$95$2 * N[(l / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\\
t_2 := \sqrt{t\_1}\\
\mathbf{if}\;\frac{t\_m}{\ell} \leq -2 \cdot 10^{+134}:\\
\;\;\;\;\sin^{-1} \left(\frac{t\_2}{\frac{-t\_m}{\frac{\ell}{\sqrt{2}}}}\right)\\
\mathbf{elif}\;\frac{t\_m}{\ell} \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t\_1}{1 + 2 \cdot \frac{1}{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(t\_2 \cdot \frac{\ell}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.99999999999999984e134Initial program 54.6%
sqrt-div54.6%
div-inv54.6%
add-sqr-sqrt54.6%
hypot-1-def54.6%
*-commutative54.6%
sqrt-prod54.6%
unpow254.6%
sqrt-prod0.0%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
associate-*r/96.9%
*-rgt-identity96.9%
Simplified96.9%
unpow254.6%
clear-num54.6%
un-div-inv54.6%
Applied egg-rr96.9%
Taylor expanded in t around -inf 96.9%
mul-1-neg96.9%
associate-/l*96.9%
Simplified96.9%
if -1.99999999999999984e134 < (/.f64 t l) < 1.99999999999999987e146Initial program 98.2%
unpow298.2%
clear-num98.2%
clear-num98.1%
frac-times98.2%
metadata-eval98.2%
Applied egg-rr98.2%
unpow298.2%
clear-num98.2%
un-div-inv98.2%
Applied egg-rr98.2%
if 1.99999999999999987e146 < (/.f64 t l) Initial program 41.0%
sqrt-div41.0%
div-inv41.0%
add-sqr-sqrt41.0%
hypot-1-def41.0%
*-commutative41.0%
sqrt-prod41.0%
unpow241.0%
sqrt-prod95.0%
add-sqr-sqrt95.2%
Applied egg-rr95.2%
associate-*r/95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in t around inf 90.0%
*-commutative90.0%
unpow290.0%
unpow290.0%
times-frac99.6%
unpow299.6%
Simplified99.6%
unpow241.0%
clear-num41.0%
un-div-inv41.0%
Applied egg-rr99.6%
Final simplification98.2%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (/ (/ Om Omc) (/ Omc Om)))) (t_2 (sqrt t_1)))
(if (<= (/ t_m l) -2e+134)
(asin (/ t_2 (* (sqrt 2.0) (/ (- t_m) l))))
(if (<= (/ t_m l) 2e+146)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (/ 1.0 (* (/ l t_m) (/ l t_m))))))))
(asin (* t_2 (/ l (* t_m (sqrt 2.0)))))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double t_1 = 1.0 - ((Om / Omc) / (Omc / Om));
double t_2 = sqrt(t_1);
double tmp;
if ((t_m / l) <= -2e+134) {
tmp = asin((t_2 / (sqrt(2.0) * (-t_m / l))));
} else if ((t_m / l) <= 2e+146) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
} else {
tmp = asin((t_2 * (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) :: t_2
real(8) :: tmp
t_1 = 1.0d0 - ((om / omc) / (omc / om))
t_2 = sqrt(t_1)
if ((t_m / l) <= (-2d+134)) then
tmp = asin((t_2 / (sqrt(2.0d0) * (-t_m / l))))
else if ((t_m / l) <= 2d+146) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * (1.0d0 / ((l / t_m) * (l / t_m))))))))
else
tmp = asin((t_2 * (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 = 1.0 - ((Om / Omc) / (Omc / Om));
double t_2 = Math.sqrt(t_1);
double tmp;
if ((t_m / l) <= -2e+134) {
tmp = Math.asin((t_2 / (Math.sqrt(2.0) * (-t_m / l))));
} else if ((t_m / l) <= 2e+146) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m))))))));
} else {
tmp = Math.asin((t_2 * (l / (t_m * Math.sqrt(2.0)))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): t_1 = 1.0 - ((Om / Omc) / (Omc / Om)) t_2 = math.sqrt(t_1) tmp = 0 if (t_m / l) <= -2e+134: tmp = math.asin((t_2 / (math.sqrt(2.0) * (-t_m / l)))) elif (t_m / l) <= 2e+146: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m)))))))) else: tmp = math.asin((t_2 * (l / (t_m * math.sqrt(2.0))))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) t_2 = sqrt(t_1) tmp = 0.0 if (Float64(t_m / l) <= -2e+134) tmp = asin(Float64(t_2 / Float64(sqrt(2.0) * Float64(Float64(-t_m) / l)))); elseif (Float64(t_m / l) <= 2e+146) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(1.0 / Float64(Float64(l / t_m) * Float64(l / t_m)))))))); else tmp = asin(Float64(t_2 * 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 = 1.0 - ((Om / Omc) / (Omc / Om)); t_2 = sqrt(t_1); tmp = 0.0; if ((t_m / l) <= -2e+134) tmp = asin((t_2 / (sqrt(2.0) * (-t_m / l)))); elseif ((t_m / l) <= 2e+146) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * (1.0 / ((l / t_m) * (l / t_m)))))))); else tmp = asin((t_2 * (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[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], -2e+134], N[ArcSin[N[(t$95$2 / N[(N[Sqrt[2.0], $MachinePrecision] * N[((-t$95$m) / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t$95$m / l), $MachinePrecision], 2e+146], N[ArcSin[N[Sqrt[N[(t$95$1 / N[(1.0 + N[(2.0 * N[(1.0 / N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(t$95$2 * N[(l / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\\
t_2 := \sqrt{t\_1}\\
\mathbf{if}\;\frac{t\_m}{\ell} \leq -2 \cdot 10^{+134}:\\
\;\;\;\;\sin^{-1} \left(\frac{t\_2}{\sqrt{2} \cdot \frac{-t\_m}{\ell}}\right)\\
\mathbf{elif}\;\frac{t\_m}{\ell} \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t\_1}{1 + 2 \cdot \frac{1}{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(t\_2 \cdot \frac{\ell}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.99999999999999984e134Initial program 54.6%
sqrt-div54.6%
div-inv54.6%
add-sqr-sqrt54.6%
hypot-1-def54.6%
*-commutative54.6%
sqrt-prod54.6%
unpow254.6%
sqrt-prod0.0%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
associate-*r/96.9%
*-rgt-identity96.9%
Simplified96.9%
unpow254.6%
clear-num54.6%
un-div-inv54.6%
Applied egg-rr96.9%
Taylor expanded in t around -inf 96.9%
mul-1-neg96.9%
associate-*l/96.9%
distribute-rgt-neg-in96.9%
Simplified96.9%
if -1.99999999999999984e134 < (/.f64 t l) < 1.99999999999999987e146Initial program 98.2%
unpow298.2%
clear-num98.2%
clear-num98.1%
frac-times98.2%
metadata-eval98.2%
Applied egg-rr98.2%
unpow298.2%
clear-num98.2%
un-div-inv98.2%
Applied egg-rr98.2%
if 1.99999999999999987e146 < (/.f64 t l) Initial program 41.0%
sqrt-div41.0%
div-inv41.0%
add-sqr-sqrt41.0%
hypot-1-def41.0%
*-commutative41.0%
sqrt-prod41.0%
unpow241.0%
sqrt-prod95.0%
add-sqr-sqrt95.2%
Applied egg-rr95.2%
associate-*r/95.3%
*-rgt-identity95.3%
Simplified95.3%
Taylor expanded in t around inf 90.0%
*-commutative90.0%
unpow290.0%
unpow290.0%
times-frac99.6%
unpow299.6%
Simplified99.6%
unpow241.0%
clear-num41.0%
un-div-inv41.0%
Applied egg-rr99.6%
Final simplification98.2%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(if (<= (/ t_m l) 1e+152)
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t_m l) (/ t_m l)))))))
(asin
(* (sqrt (- 1.0 (* (/ Om Omc) (/ Om Omc)))) (/ l (/ t_m (sqrt 0.5)))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double tmp;
if ((t_m / l) <= 1e+152) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l)))))));
} else {
tmp = asin((sqrt((1.0 - ((Om / Omc) * (Om / Omc)))) * (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) <= 1d+152) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m / l) * (t_m / l)))))))
else
tmp = asin((sqrt((1.0d0 - ((om / omc) * (om / omc)))) * (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 ((t_m / l) <= 1e+152) {
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((Math.sqrt((1.0 - ((Om / Omc) * (Om / Omc)))) * (l / (t_m / Math.sqrt(0.5)))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): tmp = 0 if (t_m / l) <= 1e+152: 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((math.sqrt((1.0 - ((Om / Omc) * (Om / Omc)))) * (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) <= 1e+152) 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(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc)))) * 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) <= 1e+152) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l))))))); else tmp = asin((sqrt((1.0 - ((Om / Omc) * (Om / Omc)))) * (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[(t$95$m / l), $MachinePrecision], 1e+152], 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[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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}\;\frac{t\_m}{\ell} \leq 10^{+152}:\\
\;\;\;\;\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(\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}} \cdot \frac{\ell}{\frac{t\_m}{\sqrt{0.5}}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 1e152Initial program 91.5%
unpow291.5%
clear-num91.4%
clear-num91.4%
frac-times91.5%
metadata-eval91.5%
Applied egg-rr91.5%
unpow291.5%
clear-num91.5%
un-div-inv91.5%
Applied egg-rr91.5%
inv-pow91.5%
unpow-prod-down91.4%
inv-pow91.4%
clear-num91.4%
inv-pow91.4%
clear-num91.5%
Applied egg-rr91.5%
if 1e152 < (/.f64 t l) Initial program 39.1%
Taylor expanded in t around inf 92.9%
*-commutative92.9%
associate-/l*92.9%
Simplified92.9%
add-sqr-sqrt92.9%
pow292.9%
sqrt-div92.9%
unpow292.9%
sqrt-prod48.9%
add-sqr-sqrt95.4%
unpow295.4%
sqrt-prod46.5%
add-sqr-sqrt99.6%
unpow299.6%
Applied egg-rr99.6%
Final simplification92.4%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(if (<= (/ t_m l) 1e+143)
(asin (sqrt (/ t_1 (+ 1.0 (* 2.0 (* (/ t_m l) (/ t_m l)))))))
(asin (* (sqrt t_1) (/ l (* t_m (sqrt 2.0))))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
double t_1 = 1.0 - ((Om / Omc) / (Omc / Om));
double tmp;
if ((t_m / l) <= 1e+143) {
tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t_m / l) * (t_m / l)))))));
} else {
tmp = asin((sqrt(t_1) * (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 = 1.0d0 - ((om / omc) / (omc / om))
if ((t_m / l) <= 1d+143) then
tmp = asin(sqrt((t_1 / (1.0d0 + (2.0d0 * ((t_m / l) * (t_m / l)))))))
else
tmp = asin((sqrt(t_1) * (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 = 1.0 - ((Om / Omc) / (Omc / Om));
double tmp;
if ((t_m / l) <= 1e+143) {
tmp = Math.asin(Math.sqrt((t_1 / (1.0 + (2.0 * ((t_m / l) * (t_m / l)))))));
} else {
tmp = Math.asin((Math.sqrt(t_1) * (l / (t_m * Math.sqrt(2.0)))));
}
return tmp;
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): t_1 = 1.0 - ((Om / Omc) / (Omc / Om)) tmp = 0 if (t_m / l) <= 1e+143: tmp = math.asin(math.sqrt((t_1 / (1.0 + (2.0 * ((t_m / l) * (t_m / l))))))) else: tmp = math.asin((math.sqrt(t_1) * (l / (t_m * math.sqrt(2.0))))) return tmp
t_m = abs(t) function code(t_m, l, Om, Omc) t_1 = Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) tmp = 0.0 if (Float64(t_m / l) <= 1e+143) tmp = asin(sqrt(Float64(t_1 / Float64(1.0 + Float64(2.0 * Float64(Float64(t_m / l) * Float64(t_m / l))))))); else tmp = asin(Float64(sqrt(t_1) * 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 = 1.0 - ((Om / Omc) / (Omc / Om)); tmp = 0.0; if ((t_m / l) <= 1e+143) tmp = asin(sqrt((t_1 / (1.0 + (2.0 * ((t_m / l) * (t_m / l))))))); else tmp = asin((sqrt(t_1) * (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[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$m / l), $MachinePrecision], 1e+143], N[ArcSin[N[Sqrt[N[(t$95$1 / 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[Sqrt[t$95$1], $MachinePrecision] * N[(l / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
\begin{array}{l}
t_1 := 1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}\\
\mathbf{if}\;\frac{t\_m}{\ell} \leq 10^{+143}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{t\_1}{1 + 2 \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{t\_1} \cdot \frac{\ell}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 1e143Initial program 91.4%
unpow291.4%
clear-num91.4%
clear-num91.3%
frac-times91.4%
metadata-eval91.4%
Applied egg-rr91.4%
unpow291.4%
clear-num91.4%
un-div-inv91.4%
Applied egg-rr91.4%
inv-pow91.4%
unpow-prod-down91.3%
inv-pow91.3%
clear-num91.4%
inv-pow91.4%
clear-num91.4%
Applied egg-rr91.4%
if 1e143 < (/.f64 t l) Initial program 42.8%
sqrt-div42.8%
div-inv42.8%
add-sqr-sqrt42.8%
hypot-1-def42.8%
*-commutative42.8%
sqrt-prod42.8%
unpow242.8%
sqrt-prod95.1%
add-sqr-sqrt95.3%
Applied egg-rr95.3%
associate-*r/95.4%
*-rgt-identity95.4%
Simplified95.4%
Taylor expanded in t around inf 90.3%
*-commutative90.3%
unpow290.3%
unpow290.3%
times-frac99.6%
unpow299.6%
Simplified99.6%
unpow242.8%
clear-num42.8%
un-div-inv42.8%
Applied egg-rr99.6%
Final simplification92.4%
t_m = (fabs.f64 t)
(FPCore (t_m l Om Omc)
:precision binary64
(asin
(sqrt
(/
(- 1.0 (/ (/ Om Omc) (/ Omc Om)))
(+ 1.0 (* 2.0 (* (/ t_m l) (/ t_m l))))))))t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l)))))));
}
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(sqrt(((1.0d0 - ((om / omc) / (omc / om))) / (1.0d0 + (2.0d0 * ((t_m / l) * (t_m / l)))))))
end function
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 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l)))))));
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l)))))))
t_m = abs(t) function code(t_m, l, Om, Omc) return 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))))))) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t_m / l) * (t_m / l))))))); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := 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]
\begin{array}{l}
t_m = \left|t\right|
\\
\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)
\end{array}
Initial program 85.3%
unpow285.3%
clear-num85.3%
clear-num85.3%
frac-times85.3%
metadata-eval85.3%
Applied egg-rr85.3%
unpow285.3%
clear-num85.3%
un-div-inv85.3%
Applied egg-rr85.3%
inv-pow85.3%
unpow-prod-down85.3%
inv-pow85.3%
clear-num85.3%
inv-pow85.3%
clear-num85.3%
Applied egg-rr85.3%
Final simplification85.3%
t_m = (fabs.f64 t) (FPCore (t_m l Om Omc) :precision binary64 (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))))
t_m = fabs(t);
double code(double t_m, double l, double Om, double Omc) {
return asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
}
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(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
end function
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 - ((Om / Omc) / (Omc / Om)))));
}
t_m = math.fabs(t) def code(t_m, l, Om, Omc): return math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))))
t_m = abs(t) function code(t_m, l, Om, Omc) return asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))) end
t_m = abs(t); function tmp = code(t_m, l, Om, Omc) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); end
t_m = N[Abs[t], $MachinePrecision] code[t$95$m_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)
\end{array}
Initial program 85.3%
Taylor expanded in t around 0 42.7%
unpow242.7%
unpow242.7%
times-frac48.3%
unpow248.3%
Simplified48.3%
unpow285.3%
clear-num85.3%
un-div-inv85.3%
Applied egg-rr48.3%
Final simplification48.3%
herbie shell --seed 2024029
(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)))))))