
(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)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(let* ((t_1 (pow (/ Om Omc) 2.0))
(t_2 (- 1.0 t_1))
(t_3 (+ 1.0 (* 2.0 (pow (/ t_m l_m) 2.0)))))
(if (<= (/ t_2 t_3) 0.0)
(asin (* l_m (* (sqrt t_2) (/ (sqrt 0.5) t_m))))
(asin (sqrt (/ (+ 1.0 (+ 1.0 (- -1.0 t_1))) t_3))))))t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = pow((Om / Omc), 2.0);
double t_2 = 1.0 - t_1;
double t_3 = 1.0 + (2.0 * pow((t_m / l_m), 2.0));
double tmp;
if ((t_2 / t_3) <= 0.0) {
tmp = asin((l_m * (sqrt(t_2) * (sqrt(0.5) / t_m))));
} else {
tmp = asin(sqrt(((1.0 + (1.0 + (-1.0 - t_1))) / t_3)));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (om / omc) ** 2.0d0
t_2 = 1.0d0 - t_1
t_3 = 1.0d0 + (2.0d0 * ((t_m / l_m) ** 2.0d0))
if ((t_2 / t_3) <= 0.0d0) then
tmp = asin((l_m * (sqrt(t_2) * (sqrt(0.5d0) / t_m))))
else
tmp = asin(sqrt(((1.0d0 + (1.0d0 + ((-1.0d0) - t_1))) / t_3)))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = Math.pow((Om / Omc), 2.0);
double t_2 = 1.0 - t_1;
double t_3 = 1.0 + (2.0 * Math.pow((t_m / l_m), 2.0));
double tmp;
if ((t_2 / t_3) <= 0.0) {
tmp = Math.asin((l_m * (Math.sqrt(t_2) * (Math.sqrt(0.5) / t_m))));
} else {
tmp = Math.asin(Math.sqrt(((1.0 + (1.0 + (-1.0 - t_1))) / t_3)));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): t_1 = math.pow((Om / Omc), 2.0) t_2 = 1.0 - t_1 t_3 = 1.0 + (2.0 * math.pow((t_m / l_m), 2.0)) tmp = 0 if (t_2 / t_3) <= 0.0: tmp = math.asin((l_m * (math.sqrt(t_2) * (math.sqrt(0.5) / t_m)))) else: tmp = math.asin(math.sqrt(((1.0 + (1.0 + (-1.0 - t_1))) / t_3))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) t_1 = Float64(Om / Omc) ^ 2.0 t_2 = Float64(1.0 - t_1) t_3 = Float64(1.0 + Float64(2.0 * (Float64(t_m / l_m) ^ 2.0))) tmp = 0.0 if (Float64(t_2 / t_3) <= 0.0) tmp = asin(Float64(l_m * Float64(sqrt(t_2) * Float64(sqrt(0.5) / t_m)))); else tmp = asin(sqrt(Float64(Float64(1.0 + Float64(1.0 + Float64(-1.0 - t_1))) / t_3))); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) t_1 = (Om / Omc) ^ 2.0; t_2 = 1.0 - t_1; t_3 = 1.0 + (2.0 * ((t_m / l_m) ^ 2.0)); tmp = 0.0; if ((t_2 / t_3) <= 0.0) tmp = asin((l_m * (sqrt(t_2) * (sqrt(0.5) / t_m)))); else tmp = asin(sqrt(((1.0 + (1.0 + (-1.0 - t_1))) / t_3))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
l_m = N[Abs[l], $MachinePrecision]
code[t$95$m_, l$95$m_, Om_, Omc_] := Block[{t$95$1 = N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 + N[(2.0 * N[Power[N[(t$95$m / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 / t$95$3), $MachinePrecision], 0.0], N[ArcSin[N[(l$95$m * N[(N[Sqrt[t$95$2], $MachinePrecision] * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(N[(1.0 + N[(1.0 + N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := {\left(\frac{Om}{Omc}\right)}^{2}\\
t_2 := 1 - t\_1\\
t_3 := 1 + 2 \cdot {\left(\frac{t\_m}{l\_m}\right)}^{2}\\
\mathbf{if}\;\frac{t\_2}{t\_3} \leq 0:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \left(\sqrt{t\_2} \cdot \frac{\sqrt{0.5}}{t\_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 + \left(1 + \left(-1 - t\_1\right)\right)}{t\_3}}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 1 (pow.f64 (/.f64 Om Omc) 2)) (+.f64 1 (*.f64 2 (pow.f64 (/.f64 t l) 2)))) < 0.0Initial program 45.0%
Taylor expanded in t around inf 66.3%
associate-/l*66.2%
associate-*l*66.2%
unpow266.2%
unpow266.2%
times-frac72.6%
unpow272.6%
Simplified72.6%
if 0.0 < (/.f64 (-.f64 1 (pow.f64 (/.f64 Om Omc) 2)) (+.f64 1 (*.f64 2 (pow.f64 (/.f64 t l) 2)))) Initial program 98.4%
expm1-log1p-u98.4%
expm1-undefine98.4%
log1p-undefine98.4%
add-exp-log98.4%
Applied egg-rr98.4%
Final simplification90.8%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(let* ((t_1 (- 1.0 (pow (/ Om Omc) 2.0)))
(t_2 (+ 1.0 (* 2.0 (pow (/ t_m l_m) 2.0)))))
(if (<= (/ t_1 t_2) 0.0)
(asin (* l_m (* (sqrt t_1) (/ (sqrt 0.5) t_m))))
(asin (sqrt (/ (- 1.0 (/ Om (* Omc (/ Omc Om)))) t_2))))))t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = 1.0 - pow((Om / Omc), 2.0);
double t_2 = 1.0 + (2.0 * pow((t_m / l_m), 2.0));
double tmp;
if ((t_1 / t_2) <= 0.0) {
tmp = asin((l_m * (sqrt(t_1) * (sqrt(0.5) / t_m))));
} else {
tmp = asin(sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / t_2)));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
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) ** 2.0d0)
t_2 = 1.0d0 + (2.0d0 * ((t_m / l_m) ** 2.0d0))
if ((t_1 / t_2) <= 0.0d0) then
tmp = asin((l_m * (sqrt(t_1) * (sqrt(0.5d0) / t_m))))
else
tmp = asin(sqrt(((1.0d0 - (om / (omc * (omc / om)))) / t_2)))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double t_1 = 1.0 - Math.pow((Om / Omc), 2.0);
double t_2 = 1.0 + (2.0 * Math.pow((t_m / l_m), 2.0));
double tmp;
if ((t_1 / t_2) <= 0.0) {
tmp = Math.asin((l_m * (Math.sqrt(t_1) * (Math.sqrt(0.5) / t_m))));
} else {
tmp = Math.asin(Math.sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / t_2)));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): t_1 = 1.0 - math.pow((Om / Omc), 2.0) t_2 = 1.0 + (2.0 * math.pow((t_m / l_m), 2.0)) tmp = 0 if (t_1 / t_2) <= 0.0: tmp = math.asin((l_m * (math.sqrt(t_1) * (math.sqrt(0.5) / t_m)))) else: tmp = math.asin(math.sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / t_2))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) t_1 = Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) t_2 = Float64(1.0 + Float64(2.0 * (Float64(t_m / l_m) ^ 2.0))) tmp = 0.0 if (Float64(t_1 / t_2) <= 0.0) tmp = asin(Float64(l_m * Float64(sqrt(t_1) * Float64(sqrt(0.5) / t_m)))); else tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Om / Float64(Omc * Float64(Omc / Om)))) / t_2))); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) t_1 = 1.0 - ((Om / Omc) ^ 2.0); t_2 = 1.0 + (2.0 * ((t_m / l_m) ^ 2.0)); tmp = 0.0; if ((t_1 / t_2) <= 0.0) tmp = asin((l_m * (sqrt(t_1) * (sqrt(0.5) / t_m)))); else tmp = asin(sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / t_2))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision]
l_m = N[Abs[l], $MachinePrecision]
code[t$95$m_, l$95$m_, Om_, Omc_] := Block[{t$95$1 = N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(2.0 * N[Power[N[(t$95$m / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 / t$95$2), $MachinePrecision], 0.0], N[ArcSin[N[(l$95$m * N[(N[Sqrt[t$95$1], $MachinePrecision] * N[(N[Sqrt[0.5], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := 1 - {\left(\frac{Om}{Omc}\right)}^{2}\\
t_2 := 1 + 2 \cdot {\left(\frac{t\_m}{l\_m}\right)}^{2}\\
\mathbf{if}\;\frac{t\_1}{t\_2} \leq 0:\\
\;\;\;\;\sin^{-1} \left(l\_m \cdot \left(\sqrt{t\_1} \cdot \frac{\sqrt{0.5}}{t\_m}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}{t\_2}}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 1 (pow.f64 (/.f64 Om Omc) 2)) (+.f64 1 (*.f64 2 (pow.f64 (/.f64 t l) 2)))) < 0.0Initial program 45.0%
Taylor expanded in t around inf 66.3%
associate-/l*66.2%
associate-*l*66.2%
unpow266.2%
unpow266.2%
times-frac72.6%
unpow272.6%
Simplified72.6%
if 0.0 < (/.f64 (-.f64 1 (pow.f64 (/.f64 Om Omc) 2)) (+.f64 1 (*.f64 2 (pow.f64 (/.f64 t l) 2)))) Initial program 98.4%
unpow272.8%
clear-num72.8%
frac-times72.8%
*-un-lft-identity72.8%
Applied egg-rr98.4%
Final simplification90.8%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t_m l_m) (sqrt 2.0))))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t_m / l_m) * sqrt(2.0)))));
}
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t_m / l_m) * Math.sqrt(2.0)))));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t_m / l_m) * math.sqrt(2.0)))))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t_m / l_m) * sqrt(2.0))))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t_m / l_m) * sqrt(2.0))))); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, 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$95$m), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t\_m}{l\_m} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 82.7%
sqrt-div82.7%
add-sqr-sqrt82.7%
hypot-1-def82.7%
*-commutative82.7%
sqrt-prod82.7%
unpow282.7%
sqrt-prod55.2%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
Final simplification97.9%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* t_m (/ (sqrt 2.0) l_m))))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, (t_m * (sqrt(2.0) / l_m)))));
}
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, (t_m * (Math.sqrt(2.0) / l_m)))));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, (t_m * (math.sqrt(2.0) / l_m)))))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(t_m * Float64(sqrt(2.0) / l_m))))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, (t_m * (sqrt(2.0) / l_m))))); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, 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[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, t\_m \cdot \frac{\sqrt{2}}{l\_m}\right)}\right)
\end{array}
Initial program 82.7%
sqrt-div82.7%
div-inv82.7%
add-sqr-sqrt82.7%
hypot-1-def82.7%
*-commutative82.7%
sqrt-prod82.7%
unpow282.7%
sqrt-prod55.2%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate-*r/97.9%
*-rgt-identity97.9%
associate-*l/97.9%
associate-/l*97.8%
Simplified97.8%
Final simplification97.8%
t_m = (fabs.f64 t)
l_m = (fabs.f64 l)
(FPCore (t_m l_m Om Omc)
:precision binary64
(if (<= (/ t_m l_m) 2e+148)
(asin
(sqrt
(/
(- 1.0 (/ Om (* Omc (/ Omc Om))))
(+ 1.0 (* 2.0 (pow (/ t_m l_m) 2.0))))))
(asin (/ l_m (* t_m (sqrt 2.0))))))t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((t_m / l_m) <= 2e+148) {
tmp = asin(sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * pow((t_m / l_m), 2.0))))));
} else {
tmp = asin((l_m / (t_m * sqrt(2.0))));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l_m) <= 2d+148) then
tmp = asin(sqrt(((1.0d0 - (om / (omc * (omc / om)))) / (1.0d0 + (2.0d0 * ((t_m / l_m) ** 2.0d0))))))
else
tmp = asin((l_m / (t_m * sqrt(2.0d0))))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((t_m / l_m) <= 2e+148) {
tmp = Math.asin(Math.sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * Math.pow((t_m / l_m), 2.0))))));
} else {
tmp = Math.asin((l_m / (t_m * Math.sqrt(2.0))));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): tmp = 0 if (t_m / l_m) <= 2e+148: tmp = math.asin(math.sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * math.pow((t_m / l_m), 2.0)))))) else: tmp = math.asin((l_m / (t_m * math.sqrt(2.0)))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if (Float64(t_m / l_m) <= 2e+148) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Om / Float64(Omc * Float64(Omc / Om)))) / Float64(1.0 + Float64(2.0 * (Float64(t_m / l_m) ^ 2.0)))))); else tmp = asin(Float64(l_m / Float64(t_m * sqrt(2.0)))); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) tmp = 0.0; if ((t_m / l_m) <= 2e+148) tmp = asin(sqrt(((1.0 - (Om / (Omc * (Omc / Om)))) / (1.0 + (2.0 * ((t_m / l_m) ^ 2.0)))))); else tmp = asin((l_m / (t_m * sqrt(2.0)))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l$95$m), $MachinePrecision], 2e+148], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t$95$m / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l$95$m / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t\_m}{l\_m} \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}{1 + 2 \cdot {\left(\frac{t\_m}{l\_m}\right)}^{2}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.0000000000000001e148Initial program 89.3%
unpow261.6%
clear-num61.6%
frac-times61.6%
*-un-lft-identity61.6%
Applied egg-rr89.4%
if 2.0000000000000001e148 < (/.f64 t l) Initial program 47.1%
sqrt-div47.1%
add-sqr-sqrt47.1%
hypot-1-def47.1%
*-commutative47.1%
sqrt-prod47.1%
unpow247.1%
sqrt-prod95.3%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
Taylor expanded in Om around 0 95.1%
Taylor expanded in t around inf 99.2%
Final simplification90.9%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* t_m (/ (sqrt 2.0) l_m))))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin((1.0 / hypot(1.0, (t_m * (sqrt(2.0) / l_m)))));
}
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, (t_m * (Math.sqrt(2.0) / l_m)))));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((1.0 / math.hypot(1.0, (t_m * (math.sqrt(2.0) / l_m)))))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(t_m * Float64(sqrt(2.0) / l_m))))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((1.0 / hypot(1.0, (t_m * (sqrt(2.0) / l_m))))); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, t\_m \cdot \frac{\sqrt{2}}{l\_m}\right)}\right)
\end{array}
Initial program 82.7%
sqrt-div82.7%
add-sqr-sqrt82.7%
hypot-1-def82.7%
*-commutative82.7%
sqrt-prod82.7%
unpow282.7%
sqrt-prod55.2%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
Taylor expanded in Om around 0 96.6%
metadata-eval96.6%
frac-2neg96.6%
metadata-eval96.6%
div-inv96.6%
Applied egg-rr96.6%
mul-1-neg96.6%
distribute-frac-neg296.6%
unpow-196.6%
exp-to-pow93.8%
remove-double-neg93.8%
exp-to-pow96.6%
unpow-196.6%
associate-*l/96.6%
associate-/l*96.6%
Simplified96.6%
Final simplification96.6%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (/ (* t_m (sqrt 2.0)) l_m)))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t_m * sqrt(2.0)) / l_m))));
}
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t_m * Math.sqrt(2.0)) / l_m))));
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t_m * math.sqrt(2.0)) / l_m))))
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t_m * sqrt(2.0)) / l_m)))) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t_m * sqrt(2.0)) / l_m)))); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t\_m \cdot \sqrt{2}}{l\_m}\right)}\right)
\end{array}
Initial program 82.7%
sqrt-div82.7%
add-sqr-sqrt82.7%
hypot-1-def82.7%
*-commutative82.7%
sqrt-prod82.7%
unpow282.7%
sqrt-prod55.2%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
Taylor expanded in Om around 0 96.6%
metadata-eval96.6%
add-sqr-sqrt96.5%
pow296.5%
inv-pow96.5%
sqrt-pow196.5%
metadata-eval96.5%
Applied egg-rr96.5%
Taylor expanded in t around 0 64.5%
unpow264.5%
pow-sqr64.5%
metadata-eval64.5%
associate-/l*63.5%
unpow263.5%
unpow263.5%
unpow263.5%
times-frac63.5%
swap-sqr81.6%
hypot-undefine96.6%
metadata-eval96.6%
unpow-196.6%
associate-*r/96.6%
Simplified96.6%
Final simplification96.6%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (if (<= (/ t_m l_m) 0.0002) (asin (sqrt (- 1.0 (/ Om (* Omc (/ Omc Om)))))) (asin (/ l_m (* t_m (sqrt 2.0))))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((t_m / l_m) <= 0.0002) {
tmp = asin(sqrt((1.0 - (Om / (Omc * (Omc / Om))))));
} else {
tmp = asin((l_m / (t_m * sqrt(2.0))));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l_m) <= 0.0002d0) then
tmp = asin(sqrt((1.0d0 - (om / (omc * (omc / om))))))
else
tmp = asin((l_m / (t_m * sqrt(2.0d0))))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((t_m / l_m) <= 0.0002) {
tmp = Math.asin(Math.sqrt((1.0 - (Om / (Omc * (Omc / Om))))));
} else {
tmp = Math.asin((l_m / (t_m * Math.sqrt(2.0))));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): tmp = 0 if (t_m / l_m) <= 0.0002: tmp = math.asin(math.sqrt((1.0 - (Om / (Omc * (Omc / Om)))))) else: tmp = math.asin((l_m / (t_m * math.sqrt(2.0)))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if (Float64(t_m / l_m) <= 0.0002) tmp = asin(sqrt(Float64(1.0 - Float64(Om / Float64(Omc * Float64(Omc / Om)))))); else tmp = asin(Float64(l_m / Float64(t_m * sqrt(2.0)))); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) tmp = 0.0; if ((t_m / l_m) <= 0.0002) tmp = asin(sqrt((1.0 - (Om / (Omc * (Omc / Om)))))); else tmp = asin((l_m / (t_m * sqrt(2.0)))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l$95$m), $MachinePrecision], 0.0002], N[ArcSin[N[Sqrt[N[(1.0 - N[(Om / N[(Omc * N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l$95$m / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t\_m}{l\_m} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{Om}{Omc \cdot \frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.0000000000000001e-4Initial program 87.9%
Taylor expanded in t around 0 63.0%
unpow263.0%
unpow263.0%
times-frac69.0%
unpow269.0%
Simplified69.0%
unpow269.0%
clear-num69.0%
frac-times69.0%
*-un-lft-identity69.0%
Applied egg-rr69.0%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 67.8%
sqrt-div67.7%
add-sqr-sqrt67.7%
hypot-1-def67.7%
*-commutative67.7%
sqrt-prod67.7%
unpow267.7%
sqrt-prod96.7%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
Taylor expanded in Om around 0 96.5%
Taylor expanded in t around inf 97.2%
Final simplification76.3%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (if (<= (/ t_m l_m) 0.0002) (asin (- 1.0 (pow (/ t_m l_m) 2.0))) (asin (/ l_m (* t_m (sqrt 2.0))))))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((t_m / l_m) <= 0.0002) {
tmp = asin((1.0 - pow((t_m / l_m), 2.0)));
} else {
tmp = asin((l_m / (t_m * sqrt(2.0))));
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t_m / l_m) <= 0.0002d0) then
tmp = asin((1.0d0 - ((t_m / l_m) ** 2.0d0)))
else
tmp = asin((l_m / (t_m * sqrt(2.0d0))))
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if ((t_m / l_m) <= 0.0002) {
tmp = Math.asin((1.0 - Math.pow((t_m / l_m), 2.0)));
} else {
tmp = Math.asin((l_m / (t_m * Math.sqrt(2.0))));
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): tmp = 0 if (t_m / l_m) <= 0.0002: tmp = math.asin((1.0 - math.pow((t_m / l_m), 2.0))) else: tmp = math.asin((l_m / (t_m * math.sqrt(2.0)))) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if (Float64(t_m / l_m) <= 0.0002) tmp = asin(Float64(1.0 - (Float64(t_m / l_m) ^ 2.0))); else tmp = asin(Float64(l_m / Float64(t_m * sqrt(2.0)))); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) tmp = 0.0; if ((t_m / l_m) <= 0.0002) tmp = asin((1.0 - ((t_m / l_m) ^ 2.0))); else tmp = asin((l_m / (t_m * sqrt(2.0)))); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := If[LessEqual[N[(t$95$m / l$95$m), $MachinePrecision], 0.0002], N[ArcSin[N[(1.0 - N[Power[N[(t$95$m / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l$95$m / N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{t\_m}{l\_m} \leq 0.0002:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t\_m}{l\_m}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_m \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.0000000000000001e-4Initial program 87.9%
sqrt-div87.9%
add-sqr-sqrt87.9%
hypot-1-def87.9%
*-commutative87.9%
sqrt-prod87.9%
unpow287.9%
sqrt-prod40.8%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
Taylor expanded in Om around 0 96.7%
Taylor expanded in t around 0 58.9%
+-commutative58.9%
fma-define58.9%
*-commutative58.9%
unpow258.9%
rem-square-sqrt58.9%
associate-*r/58.9%
unpow258.9%
unpow258.9%
times-frac67.0%
unpow267.0%
Simplified67.0%
Taylor expanded in t around 0 58.9%
mul-1-neg58.9%
sub-neg58.9%
unpow258.9%
unpow258.9%
times-frac67.0%
unpow267.0%
Simplified67.0%
if 2.0000000000000001e-4 < (/.f64 t l) Initial program 67.8%
sqrt-div67.7%
add-sqr-sqrt67.7%
hypot-1-def67.7%
*-commutative67.7%
sqrt-prod67.7%
unpow267.7%
sqrt-prod96.7%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
Taylor expanded in Om around 0 96.5%
Taylor expanded in t around inf 97.2%
Final simplification74.8%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (if (<= l_m 1.16e-36) (asin (/ l_m (* t_m (sqrt 2.0)))) (asin 1.0)))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if (l_m <= 1.16e-36) {
tmp = asin((l_m / (t_m * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l_m <= 1.16d-36) then
tmp = asin((l_m / (t_m * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
double tmp;
if (l_m <= 1.16e-36) {
tmp = Math.asin((l_m / (t_m * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): tmp = 0 if l_m <= 1.16e-36: tmp = math.asin((l_m / (t_m * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) tmp = 0.0 if (l_m <= 1.16e-36) tmp = asin(Float64(l_m / Float64(t_m * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
t_m = abs(t); l_m = abs(l); function tmp_2 = code(t_m, l_m, Om, Omc) tmp = 0.0; if (l_m <= 1.16e-36) tmp = asin((l_m / (t_m * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := If[LessEqual[l$95$m, 1.16e-36], N[ArcSin[N[(l$95$m / 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|
\\
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.16 \cdot 10^{-36}:\\
\;\;\;\;\sin^{-1} \left(\frac{l\_m}{t\_m \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 1.16000000000000002e-36Initial program 78.5%
sqrt-div78.4%
add-sqr-sqrt78.4%
hypot-1-def78.4%
*-commutative78.4%
sqrt-prod78.4%
unpow278.4%
sqrt-prod54.1%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
Taylor expanded in Om around 0 96.4%
Taylor expanded in t around inf 40.0%
if 1.16000000000000002e-36 < l Initial program 92.5%
sqrt-div92.4%
add-sqr-sqrt92.4%
hypot-1-def92.4%
*-commutative92.4%
sqrt-prod92.3%
unpow292.3%
sqrt-prod57.8%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
Taylor expanded in Om around 0 97.1%
Taylor expanded in t around 0 73.5%
Final simplification50.2%
t_m = (fabs.f64 t) l_m = (fabs.f64 l) (FPCore (t_m l_m Om Omc) :precision binary64 (asin 1.0))
t_m = fabs(t);
l_m = fabs(l);
double code(double t_m, double l_m, double Om, double Omc) {
return asin(1.0);
}
t_m = abs(t)
l_m = abs(l)
real(8) function code(t_m, l_m, om, omc)
real(8), intent (in) :: t_m
real(8), intent (in) :: l_m
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(1.0d0)
end function
t_m = Math.abs(t);
l_m = Math.abs(l);
public static double code(double t_m, double l_m, double Om, double Omc) {
return Math.asin(1.0);
}
t_m = math.fabs(t) l_m = math.fabs(l) def code(t_m, l_m, Om, Omc): return math.asin(1.0)
t_m = abs(t) l_m = abs(l) function code(t_m, l_m, Om, Omc) return asin(1.0) end
t_m = abs(t); l_m = abs(l); function tmp = code(t_m, l_m, Om, Omc) tmp = asin(1.0); end
t_m = N[Abs[t], $MachinePrecision] l_m = N[Abs[l], $MachinePrecision] code[t$95$m_, l$95$m_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
l_m = \left|\ell\right|
\\
\sin^{-1} 1
\end{array}
Initial program 82.7%
sqrt-div82.7%
add-sqr-sqrt82.7%
hypot-1-def82.7%
*-commutative82.7%
sqrt-prod82.7%
unpow282.7%
sqrt-prod55.2%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
Taylor expanded in Om around 0 96.6%
Taylor expanded in t around 0 51.8%
Final simplification51.8%
herbie shell --seed 2024043
(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)))))))