
(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 8 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 84.3%
sqrt-div84.2%
div-inv84.2%
add-sqr-sqrt84.2%
hypot-1-def84.2%
*-commutative84.2%
sqrt-prod84.2%
sqrt-pow198.3%
metadata-eval98.3%
pow198.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.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 84.3%
sqrt-div84.2%
div-inv84.2%
add-sqr-sqrt84.2%
hypot-1-def84.2%
*-commutative84.2%
sqrt-prod84.2%
sqrt-pow198.3%
metadata-eval98.3%
pow198.3%
Applied egg-rr98.3%
associate-*r/98.3%
*-rgt-identity98.3%
Simplified98.3%
Taylor expanded in Om around 0 97.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 4.4e+51) (asin (sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))) (asin (/ l (* t (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 4.4e+51) {
tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} 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 <= 4.4d+51) then
tmp = asin(sqrt((1.0d0 - ((om / omc) / (omc / om)))))
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 <= 4.4e+51) {
tmp = Math.asin(Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 4.4e+51: tmp = math.asin(math.sqrt((1.0 - ((Om / Omc) / (Omc / Om))))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 4.4e+51) tmp = asin(sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))); 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 <= 4.4e+51) tmp = asin(sqrt((1.0 - ((Om / Omc) / (Omc / Om))))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 4.4e+51], N[ArcSin[N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $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}\;t \leq 4.4 \cdot 10^{+51}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 4.39999999999999984e51Initial program 86.0%
Taylor expanded in t around 0 50.6%
unpow250.6%
unpow250.6%
times-frac57.0%
unpow257.0%
Simplified57.0%
unpow257.0%
clear-num57.0%
un-div-inv57.0%
Applied egg-rr57.0%
if 4.39999999999999984e51 < t Initial program 77.1%
sqrt-div77.1%
div-inv77.1%
add-sqr-sqrt77.1%
hypot-1-def77.1%
*-commutative77.1%
sqrt-prod77.0%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in Om around 0 97.9%
Taylor expanded in t around inf 49.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 7.5e+50) (asin (+ 1.0 (* (pow (/ Om Omc) 2.0) -0.5))) (asin (/ l (* t (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 7.5e+50) {
tmp = asin((1.0 + (pow((Om / Omc), 2.0) * -0.5)));
} 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 <= 7.5d+50) then
tmp = asin((1.0d0 + (((om / omc) ** 2.0d0) * (-0.5d0))))
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 <= 7.5e+50) {
tmp = Math.asin((1.0 + (Math.pow((Om / Omc), 2.0) * -0.5)));
} else {
tmp = Math.asin((l / (t * Math.sqrt(2.0))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 7.5e+50: tmp = math.asin((1.0 + (math.pow((Om / Omc), 2.0) * -0.5))) else: tmp = math.asin((l / (t * math.sqrt(2.0)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 7.5e+50) tmp = asin(Float64(1.0 + Float64((Float64(Om / Omc) ^ 2.0) * -0.5))); 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 <= 7.5e+50) tmp = asin((1.0 + (((Om / Omc) ^ 2.0) * -0.5))); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 7.5e+50], N[ArcSin[N[(1.0 + N[(N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $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}\;t \leq 7.5 \cdot 10^{+50}:\\
\;\;\;\;\sin^{-1} \left(1 + {\left(\frac{Om}{Omc}\right)}^{2} \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 7.4999999999999999e50Initial program 86.0%
Taylor expanded in t around 0 50.6%
unpow250.6%
unpow250.6%
times-frac57.0%
unpow257.0%
Simplified57.0%
Taylor expanded in Om around 0 50.6%
*-commutative50.6%
unpow250.6%
unpow250.6%
times-frac57.0%
unpow257.0%
Simplified57.0%
if 7.4999999999999999e50 < t Initial program 77.1%
sqrt-div77.1%
div-inv77.1%
add-sqr-sqrt77.1%
hypot-1-def77.1%
*-commutative77.1%
sqrt-prod77.0%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in Om around 0 97.9%
Taylor expanded in t around inf 49.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 6.5e+50) (asin 1.0) (asin (/ l (* t (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 6.5e+50) {
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 <= 6.5d+50) 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 <= 6.5e+50) {
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 <= 6.5e+50: 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 (t <= 6.5e+50) 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 <= 6.5e+50) tmp = asin(1.0); else tmp = asin((l / (t * sqrt(2.0)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 6.5e+50], 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}\;t \leq 6.5 \cdot 10^{+50}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)\\
\end{array}
\end{array}
if t < 6.5000000000000003e50Initial program 86.0%
Taylor expanded in t around 0 50.6%
unpow250.6%
unpow250.6%
times-frac57.0%
unpow257.0%
Simplified57.0%
Taylor expanded in Om around 0 56.8%
if 6.5000000000000003e50 < t Initial program 77.1%
sqrt-div77.1%
div-inv77.1%
add-sqr-sqrt77.1%
hypot-1-def77.1%
*-commutative77.1%
sqrt-prod77.0%
sqrt-pow198.4%
metadata-eval98.4%
pow198.4%
Applied egg-rr98.4%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
Taylor expanded in Om around 0 97.9%
Taylor expanded in t around inf 49.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 6.8e+50) (asin 1.0) (asin (* (/ l t) (sqrt 0.5)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 6.8e+50) {
tmp = asin(1.0);
} else {
tmp = asin(((l / t) * sqrt(0.5)));
}
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 <= 6.8d+50) then
tmp = asin(1.0d0)
else
tmp = asin(((l / t) * sqrt(0.5d0)))
end if
code = tmp
end function
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 6.8e+50) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin(((l / t) * Math.sqrt(0.5)));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if t <= 6.8e+50: tmp = math.asin(1.0) else: tmp = math.asin(((l / t) * math.sqrt(0.5))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 6.8e+50) tmp = asin(1.0); else tmp = asin(Float64(Float64(l / t) * sqrt(0.5))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 6.8e+50) tmp = asin(1.0); else tmp = asin(((l / t) * sqrt(0.5))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 6.8e+50], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[(l / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.8 \cdot 10^{+50}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{t} \cdot \sqrt{0.5}\right)\\
\end{array}
\end{array}
if t < 6.7999999999999997e50Initial program 86.0%
Taylor expanded in t around 0 50.6%
unpow250.6%
unpow250.6%
times-frac57.0%
unpow257.0%
Simplified57.0%
Taylor expanded in Om around 0 56.8%
if 6.7999999999999997e50 < t Initial program 77.1%
Taylor expanded in t around inf 45.5%
*-commutative45.5%
unpow245.5%
unpow245.5%
times-frac49.8%
unpow249.8%
associate-/l*49.8%
Simplified49.8%
Taylor expanded in Om around 0 49.8%
associate-/l*49.8%
Simplified49.8%
clear-num49.8%
un-div-inv49.9%
Applied egg-rr49.9%
associate-/r/49.8%
Simplified49.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 3.8e+51) (asin 1.0) (asin (* l (/ (sqrt 0.5) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 3.8e+51) {
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 <= 3.8d+51) 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 <= 3.8e+51) {
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 <= 3.8e+51: 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 <= 3.8e+51) 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 <= 3.8e+51) 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, 3.8e+51], 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 3.8 \cdot 10^{+51}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 3.7999999999999997e51Initial program 86.0%
Taylor expanded in t around 0 50.6%
unpow250.6%
unpow250.6%
times-frac57.0%
unpow257.0%
Simplified57.0%
Taylor expanded in Om around 0 56.8%
if 3.7999999999999997e51 < t Initial program 77.1%
Taylor expanded in t around inf 45.5%
*-commutative45.5%
unpow245.5%
unpow245.5%
times-frac49.8%
unpow249.8%
associate-/l*49.8%
Simplified49.8%
Taylor expanded in Om around 0 49.8%
associate-/l*49.8%
Simplified49.8%
(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.3%
Taylor expanded in t around 0 44.5%
unpow244.5%
unpow244.5%
times-frac50.4%
unpow250.4%
Simplified50.4%
Taylor expanded in Om around 0 50.2%
herbie shell --seed 2024132
(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)))))))