
(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 9 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 85.2%
sqrt-div85.2%
div-inv85.2%
add-sqr-sqrt85.2%
hypot-1-def85.2%
*-commutative85.2%
sqrt-prod85.1%
unpow285.1%
sqrt-prod58.5%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
unpow298.5%
times-frac83.8%
unpow283.8%
unpow283.8%
associate-*r/83.8%
*-rgt-identity83.8%
unpow283.8%
unpow283.8%
times-frac98.5%
unpow298.5%
Simplified98.5%
Final simplification98.5%
(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 85.2%
sqrt-div85.2%
div-inv85.2%
add-sqr-sqrt85.2%
hypot-1-def85.2%
*-commutative85.2%
sqrt-prod85.1%
unpow285.1%
sqrt-prod58.5%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
unpow298.5%
times-frac83.8%
unpow283.8%
unpow283.8%
associate-*r/83.8%
*-rgt-identity83.8%
unpow283.8%
unpow283.8%
times-frac98.5%
unpow298.5%
Simplified98.5%
Taylor expanded in Om around 0 97.2%
Final simplification97.2%
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (/ (* t t) (* l l))))))))
(t_2 (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om)))))))
(if (<= l -5.5e+118)
t_2
(if (<= l -1.85e-158)
t_1
(if (<= l 2.5e-161)
(asin (sqrt (* 0.5 (* (/ l t) (/ l t)))))
(if (<= l 2.6e+71) t_1 t_2))))))
double code(double t, double l, double Om, double Omc) {
double t_1 = asin(sqrt((1.0 / (1.0 + (2.0 * ((t * t) / (l * l)))))));
double t_2 = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
double tmp;
if (l <= -5.5e+118) {
tmp = t_2;
} else if (l <= -1.85e-158) {
tmp = t_1;
} else if (l <= 2.5e-161) {
tmp = asin(sqrt((0.5 * ((l / t) * (l / t)))));
} else if (l <= 2.6e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t * t) / (l * l)))))))
t_2 = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
if (l <= (-5.5d+118)) then
tmp = t_2
else if (l <= (-1.85d-158)) then
tmp = t_1
else if (l <= 2.5d-161) then
tmp = asin(sqrt((0.5d0 * ((l / t) * (l / t)))))
else if (l <= 2.6d+71) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t * t) / (l * l)))))));
double t_2 = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
double tmp;
if (l <= -5.5e+118) {
tmp = t_2;
} else if (l <= -1.85e-158) {
tmp = t_1;
} else if (l <= 2.5e-161) {
tmp = Math.asin(Math.sqrt((0.5 * ((l / t) * (l / t)))));
} else if (l <= 2.6e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(t, l, Om, Omc): t_1 = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t * t) / (l * l))))))) t_2 = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) tmp = 0 if l <= -5.5e+118: tmp = t_2 elif l <= -1.85e-158: tmp = t_1 elif l <= 2.5e-161: tmp = math.asin(math.sqrt((0.5 * ((l / t) * (l / t))))) elif l <= 2.6e+71: tmp = t_1 else: tmp = t_2 return tmp
function code(t, l, Om, Omc) t_1 = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t * t) / Float64(l * l))))))) t_2 = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))) tmp = 0.0 if (l <= -5.5e+118) tmp = t_2; elseif (l <= -1.85e-158) tmp = t_1; elseif (l <= 2.5e-161) tmp = asin(sqrt(Float64(0.5 * Float64(Float64(l / t) * Float64(l / t))))); elseif (l <= 2.6e+71) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(t, l, Om, Omc) t_1 = asin(sqrt((1.0 / (1.0 + (2.0 * ((t * t) / (l * l))))))); t_2 = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); tmp = 0.0; if (l <= -5.5e+118) tmp = t_2; elseif (l <= -1.85e-158) tmp = t_1; elseif (l <= 2.5e-161) tmp = asin(sqrt((0.5 * ((l / t) * (l / t))))); elseif (l <= 2.6e+71) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[ArcSin[N[Sqrt[N[(1.0 / N[(1.0 + N[(2.0 * N[(N[(t * t), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -5.5e+118], t$95$2, If[LessEqual[l, -1.85e-158], t$95$1, If[LessEqual[l, 2.5e-161], N[ArcSin[N[Sqrt[N[(0.5 * N[(N[(l / t), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 2.6e+71], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \frac{t \cdot t}{\ell \cdot \ell}}}\right)\\
t_2 := \sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{if}\;\ell \leq -5.5 \cdot 10^{+118}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq -1.85 \cdot 10^{-158}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-161}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{t}\right)}\right)\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if l < -5.5000000000000003e118 or 2.59999999999999991e71 < l Initial program 98.2%
Taylor expanded in t around 0 69.4%
unpow269.4%
unpow269.4%
times-frac84.0%
unpow284.0%
Simplified84.0%
unpow284.0%
clear-num84.0%
un-div-inv84.0%
Applied egg-rr84.0%
if -5.5000000000000003e118 < l < -1.85e-158 or 2.5e-161 < l < 2.59999999999999991e71Initial program 77.0%
unpow277.0%
clear-num77.0%
un-div-inv77.0%
Applied egg-rr77.0%
Taylor expanded in Om around 0 73.0%
*-commutative73.0%
associate-*l/73.0%
rem-square-sqrt72.9%
unpow272.9%
*-commutative72.9%
*-commutative72.9%
unpow272.9%
rem-square-sqrt73.0%
associate-*l/73.0%
*-commutative73.0%
unpow273.0%
unpow273.0%
Simplified73.0%
if -1.85e-158 < l < 2.5e-161Initial program 78.4%
unpow278.4%
clear-num78.5%
un-div-inv78.5%
Applied egg-rr78.5%
Taylor expanded in t around inf 35.3%
associate-/l*35.3%
unpow235.3%
unpow235.3%
unpow235.3%
unpow235.3%
Simplified35.3%
Taylor expanded in Om around 0 40.7%
unpow240.7%
unpow240.7%
times-frac72.4%
Simplified72.4%
Final simplification76.9%
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (/ (/ Om Omc) (/ Omc Om))) (+ 1.0 (* 2.0 (/ (/ t l) (/ l t))))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
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) / (omc / om))) / (1.0d0 + (2.0d0 * ((t / l) / (l / t)))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t)))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t)))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) / (Omc / Om))) / (1.0 + (2.0 * ((t / l) / (l / t))))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}{1 + 2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}}}}\right)
\end{array}
Initial program 85.2%
unpow285.2%
clear-num85.3%
un-div-inv85.2%
Applied egg-rr85.2%
unpow252.0%
clear-num52.0%
un-div-inv52.0%
Applied egg-rr85.2%
Final simplification85.2%
(FPCore (t l Om Omc) :precision binary64 (if (or (<= l -2.75e-93) (not (<= l 1.22e-104))) (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))) (asin (sqrt (* 0.5 (* (/ l t) (/ l t)))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -2.75e-93) || !(l <= 1.22e-104)) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = asin(sqrt((0.5 * ((l / t) * (l / 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 ((l <= (-2.75d-93)) .or. (.not. (l <= 1.22d-104))) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
else
tmp = asin(sqrt((0.5d0 * ((l / t) * (l / t)))))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((l <= -2.75e-93) || !(l <= 1.22e-104)) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin(Math.sqrt((0.5 * ((l / t) * (l / t)))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (l <= -2.75e-93) or not (l <= 1.22e-104): tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin(math.sqrt((0.5 * ((l / t) * (l / t))))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if ((l <= -2.75e-93) || !(l <= 1.22e-104)) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); else tmp = asin(sqrt(Float64(0.5 * Float64(Float64(l / t) * Float64(l / t))))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((l <= -2.75e-93) || ~((l <= 1.22e-104))) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin(sqrt((0.5 * ((l / t) * (l / t))))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[Or[LessEqual[l, -2.75e-93], N[Not[LessEqual[l, 1.22e-104]], $MachinePrecision]], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(0.5 * N[(N[(l / t), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.75 \cdot 10^{-93} \lor \neg \left(\ell \leq 1.22 \cdot 10^{-104}\right):\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{t}\right)}\right)\\
\end{array}
\end{array}
if l < -2.74999999999999984e-93 or 1.21999999999999997e-104 < l Initial program 88.8%
Taylor expanded in t around 0 62.3%
unpow262.3%
unpow262.3%
times-frac72.5%
unpow272.5%
Simplified72.5%
unpow272.5%
clear-num72.5%
un-div-inv72.5%
Applied egg-rr72.5%
if -2.74999999999999984e-93 < l < 1.21999999999999997e-104Initial program 78.5%
unpow278.5%
clear-num78.5%
un-div-inv78.5%
Applied egg-rr78.5%
Taylor expanded in t around inf 39.4%
associate-/l*39.4%
unpow239.4%
unpow239.4%
unpow239.4%
unpow239.4%
Simplified39.4%
Taylor expanded in Om around 0 44.7%
unpow244.7%
unpow244.7%
times-frac68.8%
Simplified68.8%
Final simplification71.3%
(FPCore (t l Om Omc) :precision binary64 (if (<= l -5.7e-96) (asin 1.0) (if (<= l 1.3e-103) (asin (sqrt (* 0.5 (* (/ l t) (/ l t))))) (asin 1.0))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -5.7e-96) {
tmp = asin(1.0);
} else if (l <= 1.3e-103) {
tmp = asin(sqrt((0.5 * ((l / t) * (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 <= (-5.7d-96)) then
tmp = asin(1.0d0)
else if (l <= 1.3d-103) then
tmp = asin(sqrt((0.5d0 * ((l / t) * (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 <= -5.7e-96) {
tmp = Math.asin(1.0);
} else if (l <= 1.3e-103) {
tmp = Math.asin(Math.sqrt((0.5 * ((l / t) * (l / t)))));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -5.7e-96: tmp = math.asin(1.0) elif l <= 1.3e-103: tmp = math.asin(math.sqrt((0.5 * ((l / t) * (l / t))))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -5.7e-96) tmp = asin(1.0); elseif (l <= 1.3e-103) tmp = asin(sqrt(Float64(0.5 * Float64(Float64(l / t) * 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 <= -5.7e-96) tmp = asin(1.0); elseif (l <= 1.3e-103) tmp = asin(sqrt((0.5 * ((l / t) * (l / t))))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -5.7e-96], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 1.3e-103], N[ArcSin[N[Sqrt[N[(0.5 * N[(N[(l / t), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.7 \cdot 10^{-96}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 1.3 \cdot 10^{-103}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{0.5 \cdot \left(\frac{\ell}{t} \cdot \frac{\ell}{t}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -5.70000000000000009e-96 or 1.29999999999999998e-103 < l Initial program 88.8%
Taylor expanded in t around 0 62.3%
unpow262.3%
unpow262.3%
times-frac72.5%
unpow272.5%
Simplified72.5%
Taylor expanded in Om around 0 71.4%
if -5.70000000000000009e-96 < l < 1.29999999999999998e-103Initial program 78.5%
unpow278.5%
clear-num78.5%
un-div-inv78.5%
Applied egg-rr78.5%
Taylor expanded in t around inf 39.4%
associate-/l*39.4%
unpow239.4%
unpow239.4%
unpow239.4%
unpow239.4%
Simplified39.4%
Taylor expanded in Om around 0 44.7%
unpow244.7%
unpow244.7%
times-frac68.8%
Simplified68.8%
Final simplification70.5%
(FPCore (t l Om Omc) :precision binary64 (if (<= l -3.8e-96) (asin 1.0) (if (<= l 2.15e-116) (asin (* (/ l t) (sqrt 0.5))) (asin 1.0))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -3.8e-96) {
tmp = asin(1.0);
} else if (l <= 2.15e-116) {
tmp = asin(((l / t) * sqrt(0.5)));
} 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 <= (-3.8d-96)) then
tmp = asin(1.0d0)
else if (l <= 2.15d-116) then
tmp = asin(((l / t) * sqrt(0.5d0)))
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 <= -3.8e-96) {
tmp = Math.asin(1.0);
} else if (l <= 2.15e-116) {
tmp = Math.asin(((l / t) * Math.sqrt(0.5)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -3.8e-96: tmp = math.asin(1.0) elif l <= 2.15e-116: tmp = math.asin(((l / t) * math.sqrt(0.5))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -3.8e-96) tmp = asin(1.0); elseif (l <= 2.15e-116) tmp = asin(Float64(Float64(l / t) * sqrt(0.5))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= -3.8e-96) tmp = asin(1.0); elseif (l <= 2.15e-116) tmp = asin(((l / t) * sqrt(0.5))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -3.8e-96], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 2.15e-116], N[ArcSin[N[(N[(l / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3.8 \cdot 10^{-96}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 2.15 \cdot 10^{-116}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -3.8000000000000001e-96 or 2.1499999999999999e-116 < l Initial program 89.0%
Taylor expanded in t around 0 61.8%
unpow261.8%
unpow261.8%
times-frac71.9%
unpow271.9%
Simplified71.9%
Taylor expanded in Om around 0 70.8%
if -3.8000000000000001e-96 < l < 2.1499999999999999e-116Initial program 77.7%
unpow277.7%
clear-num77.8%
un-div-inv77.8%
Applied egg-rr77.8%
Taylor expanded in t around inf 39.6%
associate-/l*39.6%
unpow239.6%
unpow239.6%
unpow239.6%
unpow239.6%
Simplified39.6%
Taylor expanded in Om around 0 67.4%
associate-*r/67.4%
Simplified67.4%
Final simplification69.7%
(FPCore (t l Om Omc) :precision binary64 (if (<= l -2.1e-94) (asin 1.0) (if (<= l 2.6e-114) (asin (/ l (* t (sqrt 2.0)))) (asin 1.0))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -2.1e-94) {
tmp = asin(1.0);
} else if (l <= 2.6e-114) {
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 <= (-2.1d-94)) then
tmp = asin(1.0d0)
else if (l <= 2.6d-114) 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 <= -2.1e-94) {
tmp = Math.asin(1.0);
} else if (l <= 2.6e-114) {
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 <= -2.1e-94: tmp = math.asin(1.0) elif l <= 2.6e-114: 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 <= -2.1e-94) tmp = asin(1.0); elseif (l <= 2.6e-114) 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 <= -2.1e-94) tmp = asin(1.0); elseif (l <= 2.6e-114) 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, -2.1e-94], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, 2.6e-114], 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 -2.1 \cdot 10^{-94}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-114}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -2.1000000000000001e-94 or 2.60000000000000013e-114 < l Initial program 89.0%
Taylor expanded in t around 0 61.8%
unpow261.8%
unpow261.8%
times-frac71.9%
unpow271.9%
Simplified71.9%
Taylor expanded in Om around 0 70.8%
if -2.1000000000000001e-94 < l < 2.60000000000000013e-114Initial program 77.7%
sqrt-div77.7%
div-inv77.7%
add-sqr-sqrt77.7%
hypot-1-def77.7%
*-commutative77.7%
sqrt-prod77.6%
unpow277.6%
sqrt-prod57.0%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
unpow297.9%
times-frac84.0%
unpow284.0%
unpow284.0%
associate-*r/84.0%
*-rgt-identity84.0%
unpow284.0%
unpow284.0%
times-frac97.9%
unpow297.9%
Simplified97.9%
Taylor expanded in Om around 0 97.2%
Taylor expanded in t around inf 67.4%
Final simplification69.7%
(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 85.2%
Taylor expanded in t around 0 45.0%
unpow245.0%
unpow245.0%
times-frac52.0%
unpow252.0%
Simplified52.0%
Taylor expanded in Om around 0 51.2%
Final simplification51.2%
herbie shell --seed 2023189
(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)))))))