
(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 (sqrt 2.0)) l)))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
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 * Math.sqrt(2.0)) / l))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, ((t * math.sqrt(2.0)) / l))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l)))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, ((t * sqrt(2.0)) / l)))); 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 * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $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 \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 84.7%
sqrt-div84.7%
frac-2neg84.7%
add-sqr-sqrt84.7%
hypot-1-def84.7%
*-commutative84.7%
sqrt-prod84.7%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*l/98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (sqrt 2.0) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt((1.0 - pow((Om / Omc), 2.0))) / hypot(1.0, (sqrt(2.0) * (t / l)))));
}
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, (Math.sqrt(2.0) * (t / l)))));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt((1.0 - math.pow((Om / Omc), 2.0))) / math.hypot(1.0, (math.sqrt(2.0) * (t / l)))))
function code(t, l, Om, Omc) return asin(Float64(sqrt(Float64(1.0 - (Float64(Om / Omc) ^ 2.0))) / hypot(1.0, Float64(sqrt(2.0) * Float64(t / l))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt((1.0 - ((Om / Omc) ^ 2.0))) / hypot(1.0, (sqrt(2.0) * (t / l))))); 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[Sqrt[2.0], $MachinePrecision] * N[(t / l), $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, \sqrt{2} \cdot \frac{t}{\ell}\right)}\right)
\end{array}
Initial program 84.7%
sqrt-div84.7%
div-inv84.7%
add-sqr-sqrt84.7%
hypot-1-def84.7%
*-commutative84.7%
sqrt-prod84.7%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (/ (* t (sqrt 2.0)) l)))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t * Math.sqrt(2.0)) / l))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t * math.sqrt(2.0)) / l))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t * sqrt(2.0)) / l)))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t * sqrt(2.0)) / l)))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t \cdot \sqrt{2}}{\ell}\right)}\right)
\end{array}
Initial program 84.7%
sqrt-div84.7%
frac-2neg84.7%
add-sqr-sqrt84.7%
hypot-1-def84.7%
*-commutative84.7%
sqrt-prod84.7%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in Om around 0 97.8%
Final simplification97.8%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (sqrt 2.0) (/ t l))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, (sqrt(2.0) * (t / l)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, (Math.sqrt(2.0) * (t / l)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, (math.sqrt(2.0) * (t / l)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(sqrt(2.0) * Float64(t / l))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, (sqrt(2.0) * (t / l))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \sqrt{2} \cdot \frac{t}{\ell}\right)}\right)
\end{array}
Initial program 84.7%
sqrt-div84.7%
div-inv84.7%
add-sqr-sqrt84.7%
hypot-1-def84.7%
*-commutative84.7%
sqrt-prod84.7%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*r/98.4%
*-rgt-identity98.4%
Simplified98.4%
Taylor expanded in Om around 0 97.8%
Final simplification97.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) 2e+71) (asin (sqrt (/ 1.0 (+ (* 2.0 (/ 1.0 (* l (/ (/ l t) t)))) 1.0)))) (asin (* l (/ (sqrt 0.5) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= 2e+71) {
tmp = asin(sqrt((1.0 / ((2.0 * (1.0 / (l * ((l / t) / t)))) + 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) <= 2d+71) then
tmp = asin(sqrt((1.0d0 / ((2.0d0 * (1.0d0 / (l * ((l / t) / t)))) + 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) <= 2e+71) {
tmp = Math.asin(Math.sqrt((1.0 / ((2.0 * (1.0 / (l * ((l / t) / t)))) + 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) <= 2e+71: tmp = math.asin(math.sqrt((1.0 / ((2.0 * (1.0 / (l * ((l / t) / t)))) + 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) <= 2e+71) tmp = asin(sqrt(Float64(1.0 / Float64(Float64(2.0 * Float64(1.0 / Float64(l * Float64(Float64(l / t) / t)))) + 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) <= 2e+71) tmp = asin(sqrt((1.0 / ((2.0 * (1.0 / (l * ((l / t) / t)))) + 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], 2e+71], N[ArcSin[N[Sqrt[N[(1.0 / N[(N[(2.0 * N[(1.0 / N[(l * N[(N[(l / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $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 2 \cdot 10^{+71}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{2 \cdot \frac{1}{\ell \cdot \frac{\frac{\ell}{t}}{t}} + 1}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.0000000000000001e71Initial program 88.5%
unpow288.5%
clear-num88.5%
un-div-inv88.5%
Applied egg-rr88.5%
Taylor expanded in Om around 0 88.0%
clear-num88.0%
inv-pow88.0%
Applied egg-rr88.0%
unpow-188.0%
associate-/r/87.6%
Simplified87.6%
if 2.0000000000000001e71 < (/.f64 t l) Initial program 63.1%
Taylor expanded in t around inf 78.6%
Taylor expanded in Om around 0 99.6%
associate-*r/99.7%
Simplified99.7%
Final simplification89.4%
(FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) 2e+95) (asin (sqrt (/ 1.0 (+ (* 2.0 (/ (/ t l) (/ l t))) 1.0)))) (asin (* l (/ (sqrt 0.5) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= 2e+95) {
tmp = asin(sqrt((1.0 / ((2.0 * ((t / l) / (l / t))) + 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) <= 2d+95) then
tmp = asin(sqrt((1.0d0 / ((2.0d0 * ((t / l) / (l / t))) + 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) <= 2e+95) {
tmp = Math.asin(Math.sqrt((1.0 / ((2.0 * ((t / l) / (l / t))) + 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) <= 2e+95: tmp = math.asin(math.sqrt((1.0 / ((2.0 * ((t / l) / (l / t))) + 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) <= 2e+95) tmp = asin(sqrt(Float64(1.0 / Float64(Float64(2.0 * Float64(Float64(t / l) / Float64(l / t))) + 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) <= 2e+95) tmp = asin(sqrt((1.0 / ((2.0 * ((t / l) / (l / t))) + 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], 2e+95], N[ArcSin[N[Sqrt[N[(1.0 / N[(N[(2.0 * N[(N[(t / l), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $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 2 \cdot 10^{+95}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{2 \cdot \frac{\frac{t}{\ell}}{\frac{\ell}{t}} + 1}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 2.00000000000000004e95Initial program 88.7%
unpow288.7%
clear-num88.7%
un-div-inv88.7%
Applied egg-rr88.7%
Taylor expanded in Om around 0 88.1%
if 2.00000000000000004e95 < (/.f64 t l) Initial program 59.9%
Taylor expanded in t around inf 76.8%
Taylor expanded in Om around 0 99.6%
associate-*r/99.7%
Simplified99.7%
Final simplification89.7%
(FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) 0.2) (asin (- 1.0 (pow (/ t l) 2.0))) (asin (/ (* l (sqrt 0.5)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= 0.2) {
tmp = asin((1.0 - pow((t / l), 2.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) <= 0.2d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.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) <= 0.2) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= 0.2: tmp = math.asin((1.0 - math.pow((t / l), 2.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) <= 0.2) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= 0.2) tmp = asin((1.0 - ((t / l) ^ 2.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], 0.2], N[ArcSin[N[(1.0 - N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq 0.2:\\
\;\;\;\;\sin^{-1} \left(1 - {\left(\frac{t}{\ell}\right)}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 0.20000000000000001Initial program 87.9%
unpow287.9%
clear-num87.9%
un-div-inv87.9%
Applied egg-rr87.9%
Taylor expanded in Om around 0 87.3%
Taylor expanded in t around 0 64.5%
mul-1-neg64.5%
unsub-neg64.5%
unpow264.5%
unpow264.5%
times-frac71.4%
unpow271.4%
Simplified71.4%
if 0.20000000000000001 < (/.f64 t l) Initial program 71.9%
Taylor expanded in t around inf 78.6%
Taylor expanded in Om around 0 96.5%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 1.42e-58) (asin (/ (* l (sqrt 0.5)) t)) (asin 1.0)))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 1.42e-58) {
tmp = asin(((l * sqrt(0.5)) / 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 <= 1.42d-58) then
tmp = asin(((l * sqrt(0.5d0)) / 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 <= 1.42e-58) {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 1.42e-58: tmp = math.asin(((l * math.sqrt(0.5)) / t)) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 1.42e-58) tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 1.42e-58) tmp = asin(((l * sqrt(0.5)) / t)); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 1.42e-58], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.42 \cdot 10^{-58}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 1.4199999999999999e-58Initial program 82.7%
Taylor expanded in t around inf 22.8%
Taylor expanded in Om around 0 29.0%
if 1.4199999999999999e-58 < l Initial program 89.5%
Taylor expanded in t around 0 69.4%
unpow269.4%
unpow269.4%
times-frac77.3%
unpow277.3%
Simplified77.3%
Taylor expanded in Om around 0 76.1%
(FPCore (t l Om Omc) :precision binary64 (if (<= l 9.5e-60) (asin (* l (/ (sqrt 0.5) t))) (asin 1.0)))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= 9.5e-60) {
tmp = asin((l * (sqrt(0.5) / 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 <= 9.5d-60) then
tmp = asin((l * (sqrt(0.5d0) / 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 <= 9.5e-60) {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= 9.5e-60: tmp = math.asin((l * (math.sqrt(0.5) / t))) else: tmp = math.asin(1.0) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= 9.5e-60) tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); else tmp = asin(1.0); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (l <= 9.5e-60) tmp = asin((l * (sqrt(0.5) / t))); else tmp = asin(1.0); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, 9.5e-60], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 9.5 \cdot 10^{-60}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < 9.49999999999999958e-60Initial program 82.7%
Taylor expanded in t around inf 22.8%
Taylor expanded in Om around 0 29.0%
associate-*r/29.0%
Simplified29.0%
if 9.49999999999999958e-60 < l Initial program 89.5%
Taylor expanded in t around 0 69.4%
unpow269.4%
unpow269.4%
times-frac77.3%
unpow277.3%
Simplified77.3%
Taylor expanded in Om around 0 76.1%
(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 84.7%
Taylor expanded in t around 0 52.3%
unpow252.3%
unpow252.3%
times-frac59.4%
unpow259.4%
Simplified59.4%
Taylor expanded in Om around 0 59.0%
herbie shell --seed 2024113
(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)))))))