
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0)))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0))))));
}
real(8) function code(t, l, om, omc)
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: om
real(8), intent (in) :: omc
code = asin(sqrt(((1.0d0 - ((om / omc) ** 2.0d0)) / (1.0d0 + (2.0d0 * ((t / l) ** 2.0d0))))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(Math.sqrt(((1.0 - Math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * Math.pow((t / l), 2.0))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * math.pow((t / l), 2.0))))))
function code(t, l, Om, Omc) return asin(sqrt(Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * ((t / l) ^ 2.0)))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(N[(1.0 - N[Power[N[(Om / Omc), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\end{array}
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 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}
Initial program 81.7%
(FPCore (t l Om Omc)
:precision binary64
(if (<=
(/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0))))
2e-159)
(asin (sqrt (/ 1.0 (fma (/ 2.0 (* l l)) t 1.0))))
(asin (sqrt (* (/ (- Omc Om) Omc) (/ (+ Om Omc) Omc))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0)))) <= 2e-159) {
tmp = asin(sqrt((1.0 / fma((2.0 / (l * l)), t, 1.0))));
} else {
tmp = asin(sqrt((((Omc - Om) / Omc) * ((Om + Omc) / Omc))));
}
return tmp;
}
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))) <= 2e-159) tmp = asin(sqrt(Float64(1.0 / fma(Float64(2.0 / Float64(l * l)), t, 1.0)))); else tmp = asin(sqrt(Float64(Float64(Float64(Omc - Om) / Omc) * Float64(Float64(Om + Omc) / Omc)))); end return tmp end
code[t_, l_, Om_, Omc_] := If[LessEqual[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], 2e-159], N[ArcSin[N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(l * l), $MachinePrecision]), $MachinePrecision] * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(N[(N[(Omc - Om), $MachinePrecision] / Omc), $MachinePrecision] * N[(N[(Om + Omc), $MachinePrecision] / Omc), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}} \leq 2 \cdot 10^{-159}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{\mathsf{fma}\left(\frac{2}{\ell \cdot \ell}, t, 1\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{Omc - Om}{Omc} \cdot \frac{Om + Omc}{Omc}}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 #s(literal 1 binary64) (pow.f64 (/.f64 Om Omc) #s(literal 2 binary64))) (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) (pow.f64 (/.f64 t l) #s(literal 2 binary64))))) < 1.99999999999999998e-159Initial program 58.0%
Taylor expanded in Om around 0
Simplified58.0%
lift-/.f64N/A
unpow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr53.4%
Taylor expanded in l around 0
lower-/.f64N/A
unpow2N/A
lower-*.f6434.2
Simplified34.2%
if 1.99999999999999998e-159 < (/.f64 (-.f64 #s(literal 1 binary64) (pow.f64 (/.f64 Om Omc) #s(literal 2 binary64))) (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) (pow.f64 (/.f64 t l) #s(literal 2 binary64))))) Initial program 97.5%
Applied egg-rr73.6%
Taylor expanded in Omc around 0
lower-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.5
Simplified37.5%
Taylor expanded in t around 0
Simplified37.6%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l/N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
*-commutativeN/A
neg-mul-1N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-+.f6478.7
Applied egg-rr78.7%
Final simplification61.0%
(FPCore (t l Om Omc)
:precision binary64
(if (<=
(/ (- 1.0 (pow (/ Om Omc) 2.0)) (+ 1.0 (* 2.0 (pow (/ t l) 2.0))))
0.0)
(asin (/ 1.0 (fma (* t t) (/ t (* l l)) 1.0)))
(asin 1.0)))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * pow((t / l), 2.0)))) <= 0.0) {
tmp = asin((1.0 / fma((t * t), (t / (l * l)), 1.0)));
} else {
tmp = asin(1.0);
}
return tmp;
}
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(Float64(1.0 - (Float64(Om / Omc) ^ 2.0)) / Float64(1.0 + Float64(2.0 * (Float64(t / l) ^ 2.0)))) <= 0.0) tmp = asin(Float64(1.0 / fma(Float64(t * t), Float64(t / Float64(l * l)), 1.0))); else tmp = asin(1.0); end return tmp end
code[t_, l_, Om_, Omc_] := If[LessEqual[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], 0.0], N[ArcSin[N[(1.0 / N[(N[(t * t), $MachinePrecision] * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}} \leq 0:\\
\;\;\;\;\sin^{-1} \left(\frac{1}{\mathsf{fma}\left(t \cdot t, \frac{t}{\ell \cdot \ell}, 1\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if (/.f64 (-.f64 #s(literal 1 binary64) (pow.f64 (/.f64 Om Omc) #s(literal 2 binary64))) (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) (pow.f64 (/.f64 t l) #s(literal 2 binary64))))) < 0.0Initial program 44.6%
Taylor expanded in Om around 0
Simplified44.6%
Applied egg-rr44.6%
Taylor expanded in t around 0
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-/l*N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6444.6
Simplified44.6%
Taylor expanded in t around 0
lower-/.f64N/A
unpow2N/A
lower-*.f6444.6
Simplified44.6%
if 0.0 < (/.f64 (-.f64 #s(literal 1 binary64) (pow.f64 (/.f64 Om Omc) #s(literal 2 binary64))) (+.f64 #s(literal 1 binary64) (*.f64 #s(literal 2 binary64) (pow.f64 (/.f64 t l) #s(literal 2 binary64))))) Initial program 97.7%
Taylor expanded in Om around 0
Simplified96.7%
Taylor expanded in t around 0
Simplified67.4%
(FPCore (t l Om Omc)
:precision binary64
(asin
(sqrt
(/
(- 1.0 (pow (/ Om Omc) 2.0))
(+ 1.0 (* 2.0 (/ 1.0 (* (/ l t) (/ l t)))))))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt(((1.0 - pow((Om / Omc), 2.0)) / (1.0 + (2.0 * (1.0 / ((l / t) * (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) ** 2.0d0)) / (1.0d0 + (2.0d0 * (1.0d0 / ((l / t) * (l / t))))))))
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 * (1.0 / ((l / t) * (l / t))))))));
}
def code(t, l, Om, Omc): return math.asin(math.sqrt(((1.0 - math.pow((Om / Omc), 2.0)) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t))))))))
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(1.0 / Float64(Float64(l / t) * Float64(l / t)))))))) end
function tmp = code(t, l, Om, Omc) tmp = asin(sqrt(((1.0 - ((Om / Omc) ^ 2.0)) / (1.0 + (2.0 * (1.0 / ((l / t) * (l / t)))))))); 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[(1.0 / N[(N[(l / t), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot \frac{1}{\frac{\ell}{t} \cdot \frac{\ell}{t}}}}\right)
\end{array}
Initial program 81.7%
lift-/.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
clear-numN/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6481.7
Applied egg-rr81.7%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 7.6e-125) (asin (sqrt (* (/ (- Omc Om) Omc) (/ (+ Om Omc) Omc)))) (asin (sqrt (/ 1.0 (fma (* 2.0 t) (/ t (* l l)) 1.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 7.6e-125) {
tmp = asin(sqrt((((Omc - Om) / Omc) * ((Om + Omc) / Omc))));
} else {
tmp = asin(sqrt((1.0 / fma((2.0 * t), (t / (l * l)), 1.0))));
}
return tmp;
}
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 7.6e-125) tmp = asin(sqrt(Float64(Float64(Float64(Omc - Om) / Omc) * Float64(Float64(Om + Omc) / Omc)))); else tmp = asin(sqrt(Float64(1.0 / fma(Float64(2.0 * t), Float64(t / Float64(l * l)), 1.0)))); end return tmp end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 7.6e-125], N[ArcSin[N[Sqrt[N[(N[(N[(Omc - Om), $MachinePrecision] / Omc), $MachinePrecision] * N[(N[(Om + Omc), $MachinePrecision] / Omc), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[Sqrt[N[(1.0 / N[(N[(2.0 * t), $MachinePrecision] * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.6 \cdot 10^{-125}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{Omc - Om}{Omc} \cdot \frac{Om + Omc}{Omc}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{\mathsf{fma}\left(2 \cdot t, \frac{t}{\ell \cdot \ell}, 1\right)}}\right)\\
\end{array}
\end{array}
if t < 7.6000000000000002e-125Initial program 85.4%
Applied egg-rr64.8%
Taylor expanded in Omc around 0
lower-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6434.4
Simplified34.4%
Taylor expanded in t around 0
Simplified28.6%
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l/N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
*-commutativeN/A
neg-mul-1N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-+.f6457.9
Applied egg-rr57.9%
if 7.6000000000000002e-125 < t Initial program 76.4%
Taylor expanded in Om around 0
Simplified75.8%
lift-/.f64N/A
unpow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lift-*.f64N/A
lower-/.f6469.5
Applied egg-rr69.5%
Final simplification62.6%
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ 1.0 (fma (/ t l) (* 2.0 (/ t l)) 1.0)))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt((1.0 / fma((t / l), (2.0 * (t / l)), 1.0))));
}
function code(t, l, Om, Omc) return asin(sqrt(Float64(1.0 / fma(Float64(t / l), Float64(2.0 * Float64(t / l)), 1.0)))) end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(1.0 / N[(N[(t / l), $MachinePrecision] * N[(2.0 * N[(t / l), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1}{\mathsf{fma}\left(\frac{t}{\ell}, 2 \cdot \frac{t}{\ell}, 1\right)}}\right)
\end{array}
Initial program 81.7%
Taylor expanded in Om around 0
Simplified81.0%
lift-/.f64N/A
unpow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr81.0%
Final simplification81.0%
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ 1.0 (fma (/ 2.0 (* l (/ l t))) t 1.0)))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt((1.0 / fma((2.0 / (l * (l / t))), t, 1.0))));
}
function code(t, l, Om, Omc) return asin(sqrt(Float64(1.0 / fma(Float64(2.0 / Float64(l * Float64(l / t))), t, 1.0)))) end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1}{\mathsf{fma}\left(\frac{2}{\ell \cdot \frac{\ell}{t}}, t, 1\right)}}\right)
\end{array}
Initial program 81.7%
Taylor expanded in Om around 0
Simplified81.0%
lift-/.f64N/A
unpow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr78.8%
(FPCore (t l Om Omc) :precision binary64 (asin (sqrt (/ 1.0 (fma (* (/ t l) (/ 2.0 l)) t 1.0)))))
double code(double t, double l, double Om, double Omc) {
return asin(sqrt((1.0 / fma(((t / l) * (2.0 / l)), t, 1.0))));
}
function code(t, l, Om, Omc) return asin(sqrt(Float64(1.0 / fma(Float64(Float64(t / l) * Float64(2.0 / l)), t, 1.0)))) end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[Sqrt[N[(1.0 / N[(N[(N[(t / l), $MachinePrecision] * N[(2.0 / l), $MachinePrecision]), $MachinePrecision] * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{\frac{1}{\mathsf{fma}\left(\frac{t}{\ell} \cdot \frac{2}{\ell}, t, 1\right)}}\right)
\end{array}
Initial program 81.7%
Taylor expanded in Om around 0
Simplified81.0%
lift-/.f64N/A
unpow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr78.8%
lift-/.f64N/A
associate-/r*N/A
div-invN/A
lift-/.f64N/A
clear-numN/A
times-fracN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6478.8
Applied egg-rr78.8%
(FPCore (t l Om Omc) :precision binary64 (if (<= t 1.3e-43) (asin 1.0) (asin (sqrt (/ 1.0 (fma (/ 2.0 (* l l)) t 1.0))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.3e-43) {
tmp = asin(1.0);
} else {
tmp = asin(sqrt((1.0 / fma((2.0 / (l * l)), t, 1.0))));
}
return tmp;
}
function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.3e-43) tmp = asin(1.0); else tmp = asin(sqrt(Float64(1.0 / fma(Float64(2.0 / Float64(l * l)), t, 1.0)))); end return tmp end
code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.3e-43], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(l * l), $MachinePrecision]), $MachinePrecision] * t + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.3 \cdot 10^{-43}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{\mathsf{fma}\left(\frac{2}{\ell \cdot \ell}, t, 1\right)}}\right)\\
\end{array}
\end{array}
if t < 1.3e-43Initial program 85.6%
Taylor expanded in Om around 0
Simplified84.9%
Taylor expanded in t around 0
Simplified57.6%
if 1.3e-43 < t Initial program 72.9%
Taylor expanded in Om around 0
Simplified72.1%
lift-/.f64N/A
unpow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
+-commutativeN/A
Applied egg-rr72.1%
Taylor expanded in l around 0
lower-/.f64N/A
unpow2N/A
lower-*.f6451.1
Simplified51.1%
(FPCore (t l Om Omc) :precision binary64 (if (<= (/ t l) 5e+166) (asin 1.0) (asin (/ (* l (* l l)) (* t (* t t))))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= 5e+166) {
tmp = asin(1.0);
} else {
tmp = asin(((l * (l * l)) / (t * (t * 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+166) then
tmp = asin(1.0d0)
else
tmp = asin(((l * (l * l)) / (t * (t * 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+166) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin(((l * (l * l)) / (t * (t * t))));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= 5e+166: tmp = math.asin(1.0) else: tmp = math.asin(((l * (l * l)) / (t * (t * t)))) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= 5e+166) tmp = asin(1.0); else tmp = asin(Float64(Float64(l * Float64(l * l)) / Float64(t * Float64(t * t)))); end return tmp end
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= 5e+166) tmp = asin(1.0); else tmp = asin(((l * (l * l)) / (t * (t * t)))); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], 5e+166], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(t * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq 5 \cdot 10^{+166}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \left(\ell \cdot \ell\right)}{t \cdot \left(t \cdot t\right)}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < 5.0000000000000002e166Initial program 86.7%
Taylor expanded in Om around 0
Simplified85.8%
Taylor expanded in t around 0
Simplified54.6%
if 5.0000000000000002e166 < (/.f64 t l) Initial program 47.1%
Taylor expanded in Om around 0
Simplified47.1%
Applied egg-rr47.1%
Taylor expanded in t around 0
+-commutativeN/A
unpow3N/A
unpow2N/A
associate-/l*N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.1
Simplified47.1%
Taylor expanded in t around inf
lower-/.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.1
Simplified47.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 81.7%
Taylor expanded in Om around 0
Simplified81.0%
Taylor expanded in t around 0
Simplified48.2%
herbie shell --seed 2024214
(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)))))))