
(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}
(FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt((1.0 - Math.pow((Om / Omc), 2.0))) / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, 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 / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 83.6%
sqrt-div83.5%
add-sqr-sqrt83.5%
hypot-1-def83.5%
*-commutative83.5%
sqrt-prod83.5%
unpow283.5%
sqrt-prod59.5%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 83.6%
Taylor expanded in Om around 0 66.2%
unpow266.2%
unpow266.2%
Simplified66.2%
expm1-log1p-u66.2%
expm1-udef58.3%
sqrt-div58.3%
metadata-eval58.3%
+-commutative58.3%
times-frac65.4%
unpow265.4%
fma-udef65.4%
Applied egg-rr65.4%
expm1-def82.9%
expm1-log1p82.9%
fma-udef82.9%
rem-square-sqrt82.8%
unpow282.8%
swap-sqr82.9%
*-commutative82.9%
*-commutative82.9%
+-commutative82.9%
hypot-1-def97.7%
*-commutative97.7%
Simplified97.7%
Final simplification97.7%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (* t (sqrt 2.0))))
(if (<= (/ t l) -4e+157)
(asin (/ (- l) t_1))
(if (<= (/ t l) 2e+73)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ l t_1))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = t * sqrt(2.0);
double tmp;
if ((t / l) <= -4e+157) {
tmp = asin((-l / t_1));
} else if ((t / l) <= 2e+73) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l / t_1));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = t * sqrt(2.0d0)
if ((t / l) <= (-4d+157)) then
tmp = asin((-l / t_1))
else if ((t / l) <= 2d+73) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l / t_1))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = t * Math.sqrt(2.0);
double tmp;
if ((t / l) <= -4e+157) {
tmp = Math.asin((-l / t_1));
} else if ((t / l) <= 2e+73) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l / t_1));
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = t * math.sqrt(2.0) tmp = 0 if (t / l) <= -4e+157: tmp = math.asin((-l / t_1)) elif (t / l) <= 2e+73: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l / t_1)) return tmp
function code(t, l, Om, Omc) t_1 = Float64(t * sqrt(2.0)) tmp = 0.0 if (Float64(t / l) <= -4e+157) tmp = asin(Float64(Float64(-l) / t_1)); elseif (Float64(t / l) <= 2e+73) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l / t_1)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = t * sqrt(2.0); tmp = 0.0; if ((t / l) <= -4e+157) tmp = asin((-l / t_1)); elseif ((t / l) <= 2e+73) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l / t_1)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -4e+157], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+73], N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -4 \cdot 10^{+157}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+73}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -3.99999999999999993e157Initial program 51.2%
Taylor expanded in Om around 0 51.2%
unpow251.2%
unpow251.2%
Simplified51.2%
expm1-log1p-u51.2%
expm1-udef51.2%
sqrt-div51.2%
metadata-eval51.2%
+-commutative51.2%
times-frac51.2%
unpow251.2%
fma-udef51.2%
Applied egg-rr51.2%
expm1-def51.2%
expm1-log1p51.2%
fma-udef51.2%
rem-square-sqrt51.2%
unpow251.2%
swap-sqr51.2%
*-commutative51.2%
*-commutative51.2%
+-commutative51.2%
hypot-1-def97.5%
*-commutative97.5%
Simplified97.5%
Taylor expanded in t around -inf 99.7%
associate-*r/99.7%
mul-1-neg99.7%
Simplified99.7%
if -3.99999999999999993e157 < (/.f64 t l) < 1.99999999999999997e73Initial program 97.7%
Taylor expanded in Om around 0 76.6%
unpow276.6%
unpow276.6%
Simplified76.6%
times-frac96.9%
Applied egg-rr96.9%
if 1.99999999999999997e73 < (/.f64 t l) Initial program 54.5%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
expm1-log1p-u40.9%
expm1-udef28.9%
sqrt-div28.9%
metadata-eval28.9%
+-commutative28.9%
times-frac28.9%
unpow228.9%
fma-udef28.9%
Applied egg-rr28.9%
expm1-def54.4%
expm1-log1p54.4%
fma-udef54.4%
rem-square-sqrt54.3%
unpow254.3%
swap-sqr54.4%
*-commutative54.4%
*-commutative54.4%
+-commutative54.4%
hypot-1-def98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in t around inf 99.6%
Final simplification97.8%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (* t (sqrt 2.0))))
(if (<= (/ t l) -10.0)
(asin (/ (- l) t_1))
(if (<= (/ t l) 0.0001)
(asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))
(asin (/ l t_1))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = t * sqrt(2.0);
double tmp;
if ((t / l) <= -10.0) {
tmp = asin((-l / t_1));
} else if ((t / l) <= 0.0001) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin((l / t_1));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = t * sqrt(2.0d0)
if ((t / l) <= (-10.0d0)) then
tmp = asin((-l / t_1))
else if ((t / l) <= 0.0001d0) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin((l / t_1))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = t * Math.sqrt(2.0);
double tmp;
if ((t / l) <= -10.0) {
tmp = Math.asin((-l / t_1));
} else if ((t / l) <= 0.0001) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((l / t_1));
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = t * math.sqrt(2.0) tmp = 0 if (t / l) <= -10.0: tmp = math.asin((-l / t_1)) elif (t / l) <= 0.0001: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((l / t_1)) return tmp
function code(t, l, Om, Omc) t_1 = Float64(t * sqrt(2.0)) tmp = 0.0 if (Float64(t / l) <= -10.0) tmp = asin(Float64(Float64(-l) / t_1)); elseif (Float64(t / l) <= 0.0001) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(Float64(l / t_1)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = t * sqrt(2.0); tmp = 0.0; if ((t / l) <= -10.0) tmp = asin((-l / t_1)); elseif ((t / l) <= 0.0001) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((l / t_1)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -10.0], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0001], 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}
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -10:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0001:\\
\;\;\;\;\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) < -10Initial program 71.3%
Taylor expanded in Om around 0 51.4%
unpow251.4%
unpow251.4%
Simplified51.4%
expm1-log1p-u51.4%
expm1-udef35.3%
sqrt-div35.3%
metadata-eval35.3%
+-commutative35.3%
times-frac36.9%
unpow236.9%
fma-udef36.9%
Applied egg-rr36.9%
expm1-def71.3%
expm1-log1p71.3%
fma-udef71.3%
rem-square-sqrt71.1%
unpow271.1%
swap-sqr71.3%
*-commutative71.3%
*-commutative71.3%
+-commutative71.3%
hypot-1-def98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in t around -inf 95.4%
associate-*r/95.4%
mul-1-neg95.4%
Simplified95.4%
if -10 < (/.f64 t l) < 1.00000000000000005e-4Initial program 97.9%
Taylor expanded in t around 0 87.5%
unpow287.5%
unpow287.5%
times-frac96.6%
unpow296.6%
Simplified96.6%
unpow296.6%
clear-num96.6%
un-div-inv96.6%
Applied egg-rr96.6%
if 1.00000000000000005e-4 < (/.f64 t l) Initial program 64.6%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
expm1-log1p-u40.9%
expm1-udef23.4%
sqrt-div23.4%
metadata-eval23.4%
+-commutative23.4%
times-frac25.0%
unpow225.0%
fma-udef25.0%
Applied egg-rr25.0%
expm1-def64.5%
expm1-log1p64.5%
fma-udef64.5%
rem-square-sqrt64.2%
unpow264.2%
swap-sqr64.4%
*-commutative64.4%
*-commutative64.4%
+-commutative64.4%
hypot-1-def99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 98.7%
Final simplification96.9%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -10.0)
(asin (* (sqrt 0.5) (/ (- l) t)))
(if (<= (/ t l) 0.0001)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ l (* t (sqrt 2.0)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10.0) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 0.0001) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-10.0d0)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 0.0001d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10.0) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 0.0001) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -10.0: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 0.0001: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -10.0) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 0.0001) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -10.0) tmp = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 0.0001) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -10.0], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0001], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -10:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0001:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -10Initial program 71.3%
Taylor expanded in Om around 0 51.4%
unpow251.4%
unpow251.4%
Simplified51.4%
Taylor expanded in t around -inf 95.2%
mul-1-neg95.2%
*-commutative95.2%
associate-*l/95.2%
*-commutative95.2%
Simplified95.2%
if -10 < (/.f64 t l) < 1.00000000000000005e-4Initial program 97.9%
Taylor expanded in Om around 0 84.8%
unpow284.8%
unpow284.8%
Simplified84.8%
Taylor expanded in t around 0 84.8%
mul-1-neg84.8%
unpow284.8%
unpow284.8%
times-frac96.4%
unpow296.4%
unsub-neg96.4%
Simplified96.4%
if 1.00000000000000005e-4 < (/.f64 t l) Initial program 64.6%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
expm1-log1p-u40.9%
expm1-udef23.4%
sqrt-div23.4%
metadata-eval23.4%
+-commutative23.4%
times-frac25.0%
unpow225.0%
fma-udef25.0%
Applied egg-rr25.0%
expm1-def64.5%
expm1-log1p64.5%
fma-udef64.5%
rem-square-sqrt64.2%
unpow264.2%
swap-sqr64.4%
*-commutative64.4%
*-commutative64.4%
+-commutative64.4%
hypot-1-def99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 98.7%
Final simplification96.8%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (* t (sqrt 2.0))))
(if (<= (/ t l) -10.0)
(asin (/ (- l) t_1))
(if (<= (/ t l) 0.0001)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ l t_1))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = t * sqrt(2.0);
double tmp;
if ((t / l) <= -10.0) {
tmp = asin((-l / t_1));
} else if ((t / l) <= 0.0001) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((l / t_1));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: t_1
real(8) :: tmp
t_1 = t * sqrt(2.0d0)
if ((t / l) <= (-10.0d0)) then
tmp = asin((-l / t_1))
else if ((t / l) <= 0.0001d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((l / t_1))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = t * Math.sqrt(2.0);
double tmp;
if ((t / l) <= -10.0) {
tmp = Math.asin((-l / t_1));
} else if ((t / l) <= 0.0001) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l / t_1));
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = t * math.sqrt(2.0) tmp = 0 if (t / l) <= -10.0: tmp = math.asin((-l / t_1)) elif (t / l) <= 0.0001: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l / t_1)) return tmp
function code(t, l, Om, Omc) t_1 = Float64(t * sqrt(2.0)) tmp = 0.0 if (Float64(t / l) <= -10.0) tmp = asin(Float64(Float64(-l) / t_1)); elseif (Float64(t / l) <= 0.0001) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l / t_1)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = t * sqrt(2.0); tmp = 0.0; if ((t / l) <= -10.0) tmp = asin((-l / t_1)); elseif ((t / l) <= 0.0001) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l / t_1)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -10.0], N[ArcSin[N[((-l) / t$95$1), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0001], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l / t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{2}\\
\mathbf{if}\;\frac{t}{\ell} \leq -10:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t_1}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0001:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t_1}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -10Initial program 71.3%
Taylor expanded in Om around 0 51.4%
unpow251.4%
unpow251.4%
Simplified51.4%
expm1-log1p-u51.4%
expm1-udef35.3%
sqrt-div35.3%
metadata-eval35.3%
+-commutative35.3%
times-frac36.9%
unpow236.9%
fma-udef36.9%
Applied egg-rr36.9%
expm1-def71.3%
expm1-log1p71.3%
fma-udef71.3%
rem-square-sqrt71.1%
unpow271.1%
swap-sqr71.3%
*-commutative71.3%
*-commutative71.3%
+-commutative71.3%
hypot-1-def98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in t around -inf 95.4%
associate-*r/95.4%
mul-1-neg95.4%
Simplified95.4%
if -10 < (/.f64 t l) < 1.00000000000000005e-4Initial program 97.9%
Taylor expanded in Om around 0 84.8%
unpow284.8%
unpow284.8%
Simplified84.8%
Taylor expanded in t around 0 84.8%
mul-1-neg84.8%
unpow284.8%
unpow284.8%
times-frac96.4%
unpow296.4%
unsub-neg96.4%
Simplified96.4%
if 1.00000000000000005e-4 < (/.f64 t l) Initial program 64.6%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
expm1-log1p-u40.9%
expm1-udef23.4%
sqrt-div23.4%
metadata-eval23.4%
+-commutative23.4%
times-frac25.0%
unpow225.0%
fma-udef25.0%
Applied egg-rr25.0%
expm1-def64.5%
expm1-log1p64.5%
fma-udef64.5%
rem-square-sqrt64.2%
unpow264.2%
swap-sqr64.4%
*-commutative64.4%
*-commutative64.4%
+-commutative64.4%
hypot-1-def99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 98.7%
Final simplification96.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -2e+214) (asin (/ (sqrt 0.5) (/ t l))) (if (<= (/ t l) 0.0001) (asin 1.0) (asin (/ l (* t (sqrt 2.0)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+214) {
tmp = asin((sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.0001) {
tmp = asin(1.0);
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-2d+214)) then
tmp = asin((sqrt(0.5d0) / (t / l)))
else if ((t / l) <= 0.0001d0) then
tmp = asin(1.0d0)
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+214) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else if ((t / l) <= 0.0001) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+214: tmp = math.asin((math.sqrt(0.5) / (t / l))) elif (t / l) <= 0.0001: tmp = math.asin(1.0) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2e+214) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); elseif (Float64(t / l) <= 0.0001) tmp = asin(1.0); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+214) tmp = asin((sqrt(0.5) / (t / l))); elseif ((t / l) <= 0.0001) tmp = asin(1.0); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+214], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0001], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+214}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0001:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.9999999999999999e214Initial program 68.1%
Taylor expanded in Om around 0 68.1%
unpow268.1%
unpow268.1%
Simplified68.1%
Taylor expanded in t around inf 67.4%
associate-/l*67.6%
Simplified67.6%
if -1.9999999999999999e214 < (/.f64 t l) < 1.00000000000000005e-4Initial program 93.6%
Taylor expanded in Om around 0 77.0%
unpow277.0%
unpow277.0%
Simplified77.0%
expm1-log1p-u77.0%
expm1-udef72.3%
sqrt-div72.3%
metadata-eval72.3%
+-commutative72.3%
times-frac82.7%
unpow282.7%
fma-udef82.7%
Applied egg-rr82.7%
expm1-def92.7%
expm1-log1p92.7%
fma-udef92.7%
rem-square-sqrt92.6%
unpow292.6%
swap-sqr92.7%
*-commutative92.7%
*-commutative92.7%
+-commutative92.7%
hypot-1-def97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in t around 0 79.9%
if 1.00000000000000005e-4 < (/.f64 t l) Initial program 64.6%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
expm1-log1p-u40.9%
expm1-udef23.4%
sqrt-div23.4%
metadata-eval23.4%
+-commutative23.4%
times-frac25.0%
unpow225.0%
fma-udef25.0%
Applied egg-rr25.0%
expm1-def64.5%
expm1-log1p64.5%
fma-udef64.5%
rem-square-sqrt64.2%
unpow264.2%
swap-sqr64.4%
*-commutative64.4%
*-commutative64.4%
+-commutative64.4%
hypot-1-def99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 98.7%
Final simplification84.3%
(FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -10.0) (asin (* (sqrt 0.5) (/ (- l) t))) (if (<= (/ t l) 0.0001) (asin 1.0) (asin (/ l (* t (sqrt 2.0)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10.0) {
tmp = asin((sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 0.0001) {
tmp = asin(1.0);
} else {
tmp = asin((l / (t * sqrt(2.0))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-10.0d0)) then
tmp = asin((sqrt(0.5d0) * (-l / t)))
else if ((t / l) <= 0.0001d0) then
tmp = asin(1.0d0)
else
tmp = asin((l / (t * sqrt(2.0d0))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -10.0) {
tmp = Math.asin((Math.sqrt(0.5) * (-l / t)));
} else if ((t / l) <= 0.0001) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -10.0: tmp = math.asin((math.sqrt(0.5) * (-l / t))) elif (t / l) <= 0.0001: tmp = math.asin(1.0) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -10.0) tmp = asin(Float64(sqrt(0.5) * Float64(Float64(-l) / t))); elseif (Float64(t / l) <= 0.0001) tmp = asin(1.0); else tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -10.0) tmp = asin((sqrt(0.5) * (-l / t))); elseif ((t / l) <= 0.0001) tmp = asin(1.0); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -10.0], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[((-l) / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.0001], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -10:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{-\ell}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.0001:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -10Initial program 71.3%
Taylor expanded in Om around 0 51.4%
unpow251.4%
unpow251.4%
Simplified51.4%
Taylor expanded in t around -inf 95.2%
mul-1-neg95.2%
*-commutative95.2%
associate-*l/95.2%
*-commutative95.2%
Simplified95.2%
if -10 < (/.f64 t l) < 1.00000000000000005e-4Initial program 97.9%
Taylor expanded in Om around 0 84.8%
unpow284.8%
unpow284.8%
Simplified84.8%
expm1-log1p-u84.8%
expm1-udef84.8%
sqrt-div84.8%
metadata-eval84.8%
+-commutative84.8%
times-frac96.8%
unpow296.8%
fma-udef96.8%
Applied egg-rr96.8%
expm1-def96.8%
expm1-log1p96.8%
fma-udef96.8%
rem-square-sqrt96.8%
unpow296.8%
swap-sqr96.8%
*-commutative96.8%
*-commutative96.8%
+-commutative96.8%
hypot-1-def96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 95.5%
if 1.00000000000000005e-4 < (/.f64 t l) Initial program 64.6%
Taylor expanded in Om around 0 40.9%
unpow240.9%
unpow240.9%
Simplified40.9%
expm1-log1p-u40.9%
expm1-udef23.4%
sqrt-div23.4%
metadata-eval23.4%
+-commutative23.4%
times-frac25.0%
unpow225.0%
fma-udef25.0%
Applied egg-rr25.0%
expm1-def64.5%
expm1-log1p64.5%
fma-udef64.5%
rem-square-sqrt64.2%
unpow264.2%
swap-sqr64.4%
*-commutative64.4%
*-commutative64.4%
+-commutative64.4%
hypot-1-def99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 98.7%
Final simplification96.3%
(FPCore (t l Om Omc) :precision binary64 (if (<= l -2.35e-203) (asin 1.0) (if (<= l 2.1e-19) (asin (* (sqrt 0.5) (/ l t))) (asin 1.0))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -2.35e-203) {
tmp = asin(1.0);
} else if (l <= 2.1e-19) {
tmp = asin((sqrt(0.5) * (l / t)));
} else {
tmp = asin(1.0);
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-2.35d-203)) then
tmp = asin(1.0d0)
else if (l <= 2.1d-19) then
tmp = asin((sqrt(0.5d0) * (l / t)))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -2.35e-203) {
tmp = Math.asin(1.0);
} else if (l <= 2.1e-19) {
tmp = Math.asin((Math.sqrt(0.5) * (l / t)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -2.35e-203: tmp = math.asin(1.0) elif l <= 2.1e-19: tmp = math.asin((math.sqrt(0.5) * (l / t))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -2.35e-203) tmp = asin(1.0); elseif (l <= 2.1e-19) tmp = asin(Float64(sqrt(0.5) * Float64(l / t))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -2.35e-203) tmp = asin(1.0); elseif (l <= 2.1e-19) tmp = asin((sqrt(0.5) * (l / t))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -2.35e-203], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 2.1e-19], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.35 \cdot 10^{-203}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 2.1 \cdot 10^{-19}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -2.35000000000000003e-203 or 2.0999999999999999e-19 < l Initial program 89.5%
Taylor expanded in Om around 0 72.2%
unpow272.2%
unpow272.2%
Simplified72.2%
expm1-log1p-u72.2%
expm1-udef66.0%
sqrt-div66.0%
metadata-eval66.0%
+-commutative66.0%
times-frac74.2%
unpow274.2%
fma-udef74.2%
Applied egg-rr74.2%
expm1-def89.0%
expm1-log1p89.0%
fma-udef89.0%
rem-square-sqrt88.8%
unpow288.8%
swap-sqr89.0%
*-commutative89.0%
*-commutative89.0%
+-commutative89.0%
hypot-1-def97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in t around 0 70.0%
if -2.35000000000000003e-203 < l < 2.0999999999999999e-19Initial program 70.5%
Taylor expanded in Om around 0 52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
Taylor expanded in t around inf 61.2%
*-commutative61.2%
associate-*l/61.1%
*-commutative61.1%
Simplified61.1%
Final simplification67.2%
(FPCore (t l Om Omc) :precision binary64 (if (<= l -9.8e-200) (asin 1.0) (if (<= l 8.5e-22) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -9.8e-200) {
tmp = asin(1.0);
} else if (l <= 8.5e-22) {
tmp = asin((l / (t * sqrt(2.0))));
} else {
tmp = asin(1.0);
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (l <= (-9.8d-200)) then
tmp = asin(1.0d0)
else if (l <= 8.5d-22) then
tmp = asin((l / (t * sqrt(2.0d0))))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -9.8e-200) {
tmp = Math.asin(1.0);
} else if (l <= 8.5e-22) {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -9.8e-200: tmp = math.asin(1.0) elif l <= 8.5e-22: tmp = math.asin((l / (t * math.sqrt(2.0)))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -9.8e-200) tmp = asin(1.0); elseif (l <= 8.5e-22) tmp = asin(Float64(l / Float64(t * sqrt(2.0)))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -9.8e-200) tmp = asin(1.0); elseif (l <= 8.5e-22) tmp = asin((l / (t * sqrt(2.0)))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -9.8e-200], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 8.5e-22], N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -9.8 \cdot 10^{-200}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{-22}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -9.7999999999999999e-200 or 8.5000000000000001e-22 < l Initial program 89.5%
Taylor expanded in Om around 0 72.2%
unpow272.2%
unpow272.2%
Simplified72.2%
expm1-log1p-u72.2%
expm1-udef66.0%
sqrt-div66.0%
metadata-eval66.0%
+-commutative66.0%
times-frac74.2%
unpow274.2%
fma-udef74.2%
Applied egg-rr74.2%
expm1-def89.0%
expm1-log1p89.0%
fma-udef89.0%
rem-square-sqrt88.8%
unpow288.8%
swap-sqr89.0%
*-commutative89.0%
*-commutative89.0%
+-commutative89.0%
hypot-1-def97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in t around 0 70.0%
if -9.7999999999999999e-200 < l < 8.5000000000000001e-22Initial program 70.5%
Taylor expanded in Om around 0 52.9%
unpow252.9%
unpow252.9%
Simplified52.9%
expm1-log1p-u52.9%
expm1-udef41.2%
sqrt-div41.2%
metadata-eval41.2%
+-commutative41.2%
times-frac46.1%
unpow246.1%
fma-udef46.1%
Applied egg-rr46.1%
expm1-def69.7%
expm1-log1p69.6%
fma-udef69.6%
rem-square-sqrt69.5%
unpow269.5%
swap-sqr69.6%
*-commutative69.6%
*-commutative69.6%
+-commutative69.6%
hypot-1-def97.3%
*-commutative97.3%
Simplified97.3%
Taylor expanded in t around inf 61.3%
Final simplification67.3%
(FPCore (t l Om Omc) :precision binary64 (asin 1.0))
double code(double t, double l, double Om, double Omc) {
return asin(1.0);
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(1.0d0)
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(1.0);
}
def code(t, l, Om, Omc): return math.asin(1.0)
function code(t, l, Om, Omc) return asin(1.0) end
function tmp = code(t, l, Om, Omc) tmp = asin(1.0); end
code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} 1
\end{array}
Initial program 83.6%
Taylor expanded in Om around 0 66.2%
unpow266.2%
unpow266.2%
Simplified66.2%
expm1-log1p-u66.2%
expm1-udef58.3%
sqrt-div58.3%
metadata-eval58.3%
+-commutative58.3%
times-frac65.4%
unpow265.4%
fma-udef65.4%
Applied egg-rr65.4%
expm1-def82.9%
expm1-log1p82.9%
fma-udef82.9%
rem-square-sqrt82.8%
unpow282.8%
swap-sqr82.9%
*-commutative82.9%
*-commutative82.9%
+-commutative82.9%
hypot-1-def97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in t around 0 53.1%
Final simplification53.1%
herbie shell --seed 2023279
(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)))))))