
(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}
(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 82.7%
sqrt-div82.7%
add-sqr-sqrt82.7%
hypot-1-def82.7%
*-commutative82.7%
sqrt-prod82.6%
unpow282.6%
sqrt-prod53.9%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
Final simplification98.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+154)
(asin (* l (- (/ (sqrt 0.5) t))))
(if (<= (/ t l) 5e+140)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* l (pow (/ t (sqrt 0.5)) -1.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+154) {
tmp = asin((l * -(sqrt(0.5) / t)));
} else if ((t / l) <= 5e+140) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l * pow((t / sqrt(0.5)), -1.0)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+154)) then
tmp = asin((l * -(sqrt(0.5d0) / t)))
else if ((t / l) <= 5d+140) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l * ((t / sqrt(0.5d0)) ** (-1.0d0))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+154) {
tmp = Math.asin((l * -(Math.sqrt(0.5) / t)));
} else if ((t / l) <= 5e+140) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l * Math.pow((t / Math.sqrt(0.5)), -1.0)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+154: tmp = math.asin((l * -(math.sqrt(0.5) / t))) elif (t / l) <= 5e+140: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l * math.pow((t / math.sqrt(0.5)), -1.0))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+154) tmp = asin(Float64(l * Float64(-Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 5e+140) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l * (Float64(t / sqrt(0.5)) ^ -1.0))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+154) tmp = asin((l * -(sqrt(0.5) / t))); elseif ((t / l) <= 5e+140) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l * ((t / sqrt(0.5)) ^ -1.0))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+154], N[ArcSin[N[(l * (-N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+140], 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 * N[Power[N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(-\frac{\sqrt{0.5}}{t}\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+140}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot {\left(\frac{t}{\sqrt{0.5}}\right)}^{-1}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5.00000000000000004e154Initial program 50.3%
Taylor expanded in Om around 0 50.3%
unpow250.3%
unpow250.3%
Simplified50.3%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
associate-*l/99.6%
distribute-rgt-neg-in99.6%
Simplified99.6%
if -5.00000000000000004e154 < (/.f64 t l) < 5.00000000000000008e140Initial program 98.6%
Taylor expanded in Om around 0 74.6%
unpow274.6%
unpow274.6%
Simplified74.6%
times-frac97.6%
Applied egg-rr97.6%
if 5.00000000000000008e140 < (/.f64 t l) Initial program 53.8%
Taylor expanded in Om around 0 53.8%
unpow253.8%
unpow253.8%
Simplified53.8%
Taylor expanded in t around inf 99.6%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
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 82.7%
Taylor expanded in Om around 0 66.9%
unpow266.9%
unpow266.9%
Simplified66.9%
sqrt-div66.8%
metadata-eval66.8%
+-commutative66.8%
times-frac82.0%
unpow282.0%
fma-udef82.0%
Applied egg-rr82.0%
unpow282.0%
times-frac66.8%
unpow266.8%
unpow266.8%
fma-def66.8%
+-commutative66.8%
*-commutative66.8%
unpow266.8%
unpow266.8%
times-frac82.0%
rem-square-sqrt81.9%
swap-sqr81.9%
hypot-1-def97.6%
*-commutative97.6%
Simplified97.6%
Final simplification97.6%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+154)
(asin (* l (- (/ (sqrt 0.5) t))))
(if (<= (/ t l) 5e+123)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (* l (* (sqrt 0.5) (/ 1.0 t)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+154) {
tmp = asin((l * -(sqrt(0.5) / t)));
} else if ((t / l) <= 5e+123) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin((l * (sqrt(0.5) * (1.0 / t))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+154)) then
tmp = asin((l * -(sqrt(0.5d0) / t)))
else if ((t / l) <= 5d+123) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin((l * (sqrt(0.5d0) * (1.0d0 / t))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+154) {
tmp = Math.asin((l * -(Math.sqrt(0.5) / t)));
} else if ((t / l) <= 5e+123) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) * (1.0 / t))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+154: tmp = math.asin((l * -(math.sqrt(0.5) / t))) elif (t / l) <= 5e+123: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin((l * (math.sqrt(0.5) * (1.0 / t)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+154) tmp = asin(Float64(l * Float64(-Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 5e+123) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(l * Float64(sqrt(0.5) * Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+154) tmp = asin((l * -(sqrt(0.5) / t))); elseif ((t / l) <= 5e+123) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin((l * (sqrt(0.5) * (1.0 / t)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+154], N[ArcSin[N[(l * (-N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 5e+123], 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 * N[(N[Sqrt[0.5], $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(-\frac{\sqrt{0.5}}{t}\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 5 \cdot 10^{+123}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(\sqrt{0.5} \cdot \frac{1}{t}\right)\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5.00000000000000004e154Initial program 50.3%
Taylor expanded in Om around 0 50.3%
unpow250.3%
unpow250.3%
Simplified50.3%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
associate-*l/99.6%
distribute-rgt-neg-in99.6%
Simplified99.6%
if -5.00000000000000004e154 < (/.f64 t l) < 4.99999999999999974e123Initial program 98.6%
Taylor expanded in Om around 0 75.0%
unpow275.0%
unpow275.0%
Simplified75.0%
times-frac97.5%
Applied egg-rr97.5%
if 4.99999999999999974e123 < (/.f64 t l) Initial program 54.9%
Taylor expanded in Om around 0 52.6%
unpow252.6%
unpow252.6%
Simplified52.6%
Taylor expanded in t around inf 99.6%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
div-inv99.6%
Applied egg-rr99.6%
Final simplification98.3%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+16)
(asin (* l (- (/ (sqrt 0.5) t))))
(if (<= (/ t l) 2e-7)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (* l (* (sqrt 0.5) (/ 1.0 t)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+16) {
tmp = asin((l * -(sqrt(0.5) / t)));
} else if ((t / l) <= 2e-7) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin((l * (sqrt(0.5) * (1.0 / t))));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-2d+16)) then
tmp = asin((l * -(sqrt(0.5d0) / t)))
else if ((t / l) <= 2d-7) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin((l * (sqrt(0.5d0) * (1.0d0 / t))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+16) {
tmp = Math.asin((l * -(Math.sqrt(0.5) / t)));
} else if ((t / l) <= 2e-7) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) * (1.0 / t))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+16: tmp = math.asin((l * -(math.sqrt(0.5) / t))) elif (t / l) <= 2e-7: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin((l * (math.sqrt(0.5) * (1.0 / t)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2e+16) tmp = asin(Float64(l * Float64(-Float64(sqrt(0.5) / t)))); elseif (Float64(t / l) <= 2e-7) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(l * Float64(sqrt(0.5) * Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+16) tmp = asin((l * -(sqrt(0.5) / t))); elseif ((t / l) <= 2e-7) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin((l * (sqrt(0.5) * (1.0 / t)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+16], N[ArcSin[N[(l * (-N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision])), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-7], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] * N[(1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+16}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(-\frac{\sqrt{0.5}}{t}\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(\sqrt{0.5} \cdot \frac{1}{t}\right)\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e16Initial program 68.7%
Taylor expanded in Om around 0 50.5%
unpow250.5%
unpow250.5%
Simplified50.5%
Taylor expanded in t around -inf 98.5%
mul-1-neg98.5%
associate-*l/98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
if -2e16 < (/.f64 t l) < 1.9999999999999999e-7Initial program 98.4%
Taylor expanded in Om around 0 87.7%
unpow287.7%
unpow287.7%
Simplified87.7%
Taylor expanded in t around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
unpow286.8%
unpow286.8%
times-frac95.7%
unpow295.7%
Simplified95.7%
if 1.9999999999999999e-7 < (/.f64 t l) Initial program 70.6%
Taylor expanded in Om around 0 48.0%
unpow248.0%
unpow248.0%
Simplified48.0%
Taylor expanded in t around inf 95.0%
associate-*l/95.0%
*-commutative95.0%
Simplified95.0%
div-inv95.1%
Applied egg-rr95.1%
Final simplification96.4%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (/ (sqrt 0.5) t)))
(if (<= (/ t l) -2e+16)
(asin (* l (- t_1)))
(if (<= (/ t l) 2e-7)
(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 = sqrt(0.5) / t;
double tmp;
if ((t / l) <= -2e+16) {
tmp = asin((l * -t_1));
} else if ((t / l) <= 2e-7) {
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 = sqrt(0.5d0) / t
if ((t / l) <= (-2d+16)) then
tmp = asin((l * -t_1))
else if ((t / l) <= 2d-7) 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 = Math.sqrt(0.5) / t;
double tmp;
if ((t / l) <= -2e+16) {
tmp = Math.asin((l * -t_1));
} else if ((t / l) <= 2e-7) {
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 = math.sqrt(0.5) / t tmp = 0 if (t / l) <= -2e+16: tmp = math.asin((l * -t_1)) elif (t / l) <= 2e-7: 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(sqrt(0.5) / t) tmp = 0.0 if (Float64(t / l) <= -2e+16) tmp = asin(Float64(l * Float64(-t_1))); elseif (Float64(t / l) <= 2e-7) 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 = sqrt(0.5) / t; tmp = 0.0; if ((t / l) <= -2e+16) tmp = asin((l * -t_1)); elseif ((t / l) <= 2e-7) 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[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -2e+16], N[ArcSin[N[(l * (-t$95$1)), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-7], 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 := \frac{\sqrt{0.5}}{t}\\
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+16}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(-t_1\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot t_1\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e16Initial program 68.7%
Taylor expanded in Om around 0 50.5%
unpow250.5%
unpow250.5%
Simplified50.5%
Taylor expanded in t around -inf 98.5%
mul-1-neg98.5%
associate-*l/98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
if -2e16 < (/.f64 t l) < 1.9999999999999999e-7Initial program 98.4%
Taylor expanded in Om around 0 87.7%
unpow287.7%
unpow287.7%
Simplified87.7%
Taylor expanded in t around 0 86.8%
mul-1-neg86.8%
unsub-neg86.8%
unpow286.8%
unpow286.8%
times-frac95.7%
unpow295.7%
Simplified95.7%
if 1.9999999999999999e-7 < (/.f64 t l) Initial program 70.6%
Taylor expanded in Om around 0 48.0%
unpow248.0%
unpow248.0%
Simplified48.0%
Taylor expanded in t around inf 95.0%
associate-*l/95.0%
*-commutative95.0%
Simplified95.0%
Final simplification96.4%
(FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) -5e+206) (asin (/ (sqrt 0.5) (/ t l))) (if (<= (/ t l) 2e-7) (asin 1.0) (asin (* l (/ (sqrt 0.5) t))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+206) {
tmp = asin((sqrt(0.5) / (t / l)));
} else if ((t / l) <= 2e-7) {
tmp = asin(1.0);
} else {
tmp = asin((l * (sqrt(0.5) / t)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if ((t / l) <= (-5d+206)) then
tmp = asin((sqrt(0.5d0) / (t / l)))
else if ((t / l) <= 2d-7) then
tmp = asin(1.0d0)
else
tmp = asin((l * (sqrt(0.5d0) / t)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+206) {
tmp = Math.asin((Math.sqrt(0.5) / (t / l)));
} else if ((t / l) <= 2e-7) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+206: tmp = math.asin((math.sqrt(0.5) / (t / l))) elif (t / l) <= 2e-7: tmp = math.asin(1.0) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+206) tmp = asin(Float64(sqrt(0.5) / Float64(t / l))); elseif (Float64(t / l) <= 2e-7) tmp = asin(1.0); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+206) tmp = asin((sqrt(0.5) / (t / l))); elseif ((t / l) <= 2e-7) tmp = asin(1.0); else tmp = asin((l * (sqrt(0.5) / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+206], N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] / N[(t / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-7], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+206}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{\frac{t}{\ell}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5.0000000000000002e206Initial program 65.7%
Taylor expanded in Om around 0 65.7%
unpow265.7%
unpow265.7%
Simplified65.7%
Taylor expanded in t around inf 65.1%
associate-*l/65.1%
*-commutative65.1%
Simplified65.1%
associate-*r/65.1%
*-commutative65.1%
associate-/l*65.2%
Applied egg-rr65.2%
if -5.0000000000000002e206 < (/.f64 t l) < 1.9999999999999999e-7Initial program 91.5%
Taylor expanded in Om around 0 74.8%
unpow274.8%
unpow274.8%
Simplified74.8%
times-frac90.5%
Applied egg-rr90.5%
Taylor expanded in t around 0 72.7%
if 1.9999999999999999e-7 < (/.f64 t l) Initial program 70.6%
Taylor expanded in Om around 0 48.0%
unpow248.0%
unpow248.0%
Simplified48.0%
Taylor expanded in t around inf 95.0%
associate-*l/95.0%
*-commutative95.0%
Simplified95.0%
Final simplification77.3%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (/ (sqrt 0.5) t)))
(if (<= (/ t l) -2e+16)
(asin (* l (- t_1)))
(if (<= (/ t l) 2e-7) (asin 1.0) (asin (* l t_1))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = sqrt(0.5) / t;
double tmp;
if ((t / l) <= -2e+16) {
tmp = asin((l * -t_1));
} else if ((t / l) <= 2e-7) {
tmp = asin(1.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 = sqrt(0.5d0) / t
if ((t / l) <= (-2d+16)) then
tmp = asin((l * -t_1))
else if ((t / l) <= 2d-7) then
tmp = asin(1.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 = Math.sqrt(0.5) / t;
double tmp;
if ((t / l) <= -2e+16) {
tmp = Math.asin((l * -t_1));
} else if ((t / l) <= 2e-7) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l * t_1));
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = math.sqrt(0.5) / t tmp = 0 if (t / l) <= -2e+16: tmp = math.asin((l * -t_1)) elif (t / l) <= 2e-7: tmp = math.asin(1.0) else: tmp = math.asin((l * t_1)) return tmp
function code(t, l, Om, Omc) t_1 = Float64(sqrt(0.5) / t) tmp = 0.0 if (Float64(t / l) <= -2e+16) tmp = asin(Float64(l * Float64(-t_1))); elseif (Float64(t / l) <= 2e-7) tmp = asin(1.0); else tmp = asin(Float64(l * t_1)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = sqrt(0.5) / t; tmp = 0.0; if ((t / l) <= -2e+16) tmp = asin((l * -t_1)); elseif ((t / l) <= 2e-7) tmp = asin(1.0); else tmp = asin((l * t_1)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[N[(t / l), $MachinePrecision], -2e+16], N[ArcSin[N[(l * (-t$95$1)), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e-7], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l * t$95$1), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\sqrt{0.5}}{t}\\
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+16}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \left(-t_1\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{-7}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot t_1\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -2e16Initial program 68.7%
Taylor expanded in Om around 0 50.5%
unpow250.5%
unpow250.5%
Simplified50.5%
Taylor expanded in t around -inf 98.5%
mul-1-neg98.5%
associate-*l/98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
if -2e16 < (/.f64 t l) < 1.9999999999999999e-7Initial program 98.4%
Taylor expanded in Om around 0 87.7%
unpow287.7%
unpow287.7%
Simplified87.7%
times-frac97.6%
Applied egg-rr97.6%
Taylor expanded in t around 0 95.5%
if 1.9999999999999999e-7 < (/.f64 t l) Initial program 70.6%
Taylor expanded in Om around 0 48.0%
unpow248.0%
unpow248.0%
Simplified48.0%
Taylor expanded in t around inf 95.0%
associate-*l/95.0%
*-commutative95.0%
Simplified95.0%
Final simplification96.3%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 2.8e+110) (asin 1.0) (asin (* l (/ (sqrt 0.5) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 2.8e+110) {
tmp = asin(1.0);
} else {
tmp = asin((l * (sqrt(0.5) / t)));
}
return tmp;
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
real(8) :: tmp
if (t <= 2.8d+110) then
tmp = asin(1.0d0)
else
tmp = asin((l * (sqrt(0.5d0) / t)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 2.8e+110) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 2.8e+110: tmp = math.asin(1.0) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 2.8e+110) tmp = asin(1.0); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 2.8e+110) tmp = asin(1.0); else tmp = asin((l * (sqrt(0.5) / t))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 2.8e+110], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.8 \cdot 10^{+110}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 2.79999999999999987e110Initial program 83.6%
Taylor expanded in Om around 0 68.5%
unpow268.5%
unpow268.5%
Simplified68.5%
times-frac83.0%
Applied egg-rr83.0%
Taylor expanded in t around 0 55.1%
if 2.79999999999999987e110 < t Initial program 79.2%
Taylor expanded in Om around 0 59.8%
unpow259.8%
unpow259.8%
Simplified59.8%
Taylor expanded in t around inf 75.0%
associate-*l/75.0%
*-commutative75.0%
Simplified75.0%
Final simplification58.9%
(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 82.7%
Taylor expanded in Om around 0 66.9%
unpow266.9%
unpow266.9%
Simplified66.9%
times-frac82.0%
Applied egg-rr82.0%
Taylor expanded in t around 0 46.4%
Final simplification46.4%
herbie shell --seed 2023252
(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)))))))