
(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}
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+57)
(asin (/ (* (sqrt 0.5) (- l)) t))
(if (<= (/ t l) 4e+63)
(asin
(sqrt
(/
(- 1.0 (* (/ Om Omc) (/ Om Omc)))
(+ 1.0 (* 2.0 (/ (* t (/ t l)) l))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+57) {
tmp = asin(((sqrt(0.5) * -l) / t));
} else if ((t / l) <= 4e+63) {
tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
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) <= (-1d+57)) then
tmp = asin(((sqrt(0.5d0) * -l) / t))
else if ((t / l) <= 4d+63) then
tmp = asin(sqrt(((1.0d0 - ((om / omc) * (om / omc))) / (1.0d0 + (2.0d0 * ((t * (t / l)) / l))))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -1e+57) {
tmp = Math.asin(((Math.sqrt(0.5) * -l) / t));
} else if ((t / l) <= 4e+63) {
tmp = Math.asin(Math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t * (t / l)) / l))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -1e+57: tmp = math.asin(((math.sqrt(0.5) * -l) / t)) elif (t / l) <= 4e+63: tmp = math.asin(math.sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t * (t / l)) / l)))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -1e+57) tmp = asin(Float64(Float64(sqrt(0.5) * Float64(-l)) / t)); elseif (Float64(t / l) <= 4e+63) tmp = asin(sqrt(Float64(Float64(1.0 - Float64(Float64(Om / Omc) * Float64(Om / Omc))) / Float64(1.0 + Float64(2.0 * Float64(Float64(t * Float64(t / l)) / l)))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -1e+57) tmp = asin(((sqrt(0.5) * -l) / t)); elseif ((t / l) <= 4e+63) tmp = asin(sqrt(((1.0 - ((Om / Omc) * (Om / Omc))) / (1.0 + (2.0 * ((t * (t / l)) / l)))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -1e+57], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 4e+63], N[ArcSin[N[Sqrt[N[(N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] * N[(Om / Omc), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(2.0 * N[(N[(t * N[(t / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -1 \cdot 10^{+57}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 4 \cdot 10^{+63}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \frac{t \cdot \frac{t}{\ell}}{\ell}}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -1.00000000000000005e57Initial program 68.1%
unpow268.1%
associate-*r/58.0%
Applied egg-rr58.0%
Taylor expanded in Om around 0 45.7%
*-commutative45.7%
associate-*l/45.7%
rem-square-sqrt45.7%
unpow245.7%
*-commutative45.7%
*-commutative45.7%
unpow245.7%
rem-square-sqrt45.7%
associate-*l/45.7%
*-commutative45.7%
unpow245.7%
unpow245.7%
Simplified45.7%
Taylor expanded in t around -inf 99.5%
if -1.00000000000000005e57 < (/.f64 t l) < 4.00000000000000023e63Initial program 98.8%
unpow298.8%
associate-*r/98.2%
Applied egg-rr98.2%
unpow298.2%
Applied egg-rr98.2%
if 4.00000000000000023e63 < (/.f64 t l) Initial program 65.0%
unpow265.0%
associate-*r/60.2%
Applied egg-rr60.2%
Taylor expanded in Om around 0 48.8%
*-commutative48.8%
associate-*l/48.8%
rem-square-sqrt48.6%
unpow248.6%
*-commutative48.6%
*-commutative48.6%
unpow248.6%
rem-square-sqrt48.8%
associate-*l/48.8%
*-commutative48.8%
unpow248.8%
unpow248.8%
Simplified48.8%
Taylor expanded in t around inf 99.5%
Final simplification98.8%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ (sqrt (- 1.0 (pow (/ Om Omc) 2.0))) (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
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)))));
}
t = Math.abs(t);
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)))));
}
t = abs(t) 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)))))
t = abs(t) 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
t = abs(t) 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
NOTE: t should be positive before calling this function 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}
t = |t|\\
\\
\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.3%
add-sqr-sqrt84.3%
hypot-1-def84.3%
*-commutative84.3%
sqrt-prod84.2%
unpow284.2%
sqrt-prod53.9%
add-sqr-sqrt98.4%
Applied egg-rr98.4%
Final simplification98.4%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
t = Math.abs(t);
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)))));
}
t = abs(t) def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
t = abs(t) function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end
NOTE: t should be positive before calling this function 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}
t = |t|\\
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 84.3%
unpow284.3%
associate-*r/80.7%
Applied egg-rr80.7%
Taylor expanded in Om around 0 64.9%
*-commutative64.9%
associate-*l/64.9%
rem-square-sqrt64.8%
unpow264.8%
*-commutative64.8%
*-commutative64.8%
unpow264.8%
rem-square-sqrt64.9%
associate-*l/64.9%
*-commutative64.9%
unpow264.9%
unpow264.9%
Simplified64.9%
sqrt-div64.9%
metadata-eval64.9%
add-sqr-sqrt64.9%
hypot-1-def64.9%
times-frac83.8%
unpow283.8%
*-commutative83.8%
sqrt-prod83.8%
unpow283.8%
sqrt-prod53.8%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
Final simplification97.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -5e+143)
(asin (/ (* (sqrt 0.5) (- l)) t))
(if (<= (/ t l) 1e+76)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+143) {
tmp = asin(((sqrt(0.5) * -l) / t));
} else if ((t / l) <= 1e+76) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
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+143)) then
tmp = asin(((sqrt(0.5d0) * -l) / t))
else if ((t / l) <= 1d+76) then
tmp = asin(sqrt((1.0d0 / (1.0d0 + (2.0d0 * ((t / l) * (t / l)))))))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -5e+143) {
tmp = Math.asin(((Math.sqrt(0.5) * -l) / t));
} else if ((t / l) <= 1e+76) {
tmp = Math.asin(Math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -5e+143: tmp = math.asin(((math.sqrt(0.5) * -l) / t)) elif (t / l) <= 1e+76: tmp = math.asin(math.sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -5e+143) tmp = asin(Float64(Float64(sqrt(0.5) * Float64(-l)) / t)); elseif (Float64(t / l) <= 1e+76) tmp = asin(sqrt(Float64(1.0 / Float64(1.0 + Float64(2.0 * Float64(Float64(t / l) * Float64(t / l))))))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -5e+143) tmp = asin(((sqrt(0.5) * -l) / t)); elseif ((t / l) <= 1e+76) tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l))))))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -5e+143], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 1e+76], 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[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -5 \cdot 10^{+143}:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 10^{+76}:\\
\;\;\;\;\sin^{-1} \left(\sqrt{\frac{1}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if (/.f64 t l) < -5.00000000000000012e143Initial program 55.6%
unpow255.6%
associate-*r/50.9%
Applied egg-rr50.9%
Taylor expanded in Om around 0 50.9%
*-commutative50.9%
associate-*l/50.9%
rem-square-sqrt50.9%
unpow250.9%
*-commutative50.9%
*-commutative50.9%
unpow250.9%
rem-square-sqrt50.9%
associate-*l/50.9%
*-commutative50.9%
unpow250.9%
unpow250.9%
Simplified50.9%
Taylor expanded in t around -inf 99.7%
if -5.00000000000000012e143 < (/.f64 t l) < 1e76Initial program 98.9%
unpow298.9%
associate-*r/96.1%
Applied egg-rr96.1%
Taylor expanded in Om around 0 73.7%
*-commutative73.7%
associate-*l/73.7%
rem-square-sqrt73.6%
unpow273.6%
*-commutative73.6%
*-commutative73.6%
unpow273.6%
rem-square-sqrt73.7%
associate-*l/73.7%
*-commutative73.7%
unpow273.7%
unpow273.7%
Simplified73.7%
times-frac98.2%
Applied egg-rr98.2%
if 1e76 < (/.f64 t l) Initial program 61.1%
unpow261.1%
associate-*r/55.7%
Applied egg-rr55.7%
Taylor expanded in Om around 0 48.4%
*-commutative48.4%
associate-*l/48.4%
rem-square-sqrt48.3%
unpow248.3%
*-commutative48.3%
*-commutative48.3%
unpow248.3%
rem-square-sqrt48.4%
associate-*l/48.4%
*-commutative48.4%
unpow248.4%
unpow248.4%
Simplified48.4%
Taylor expanded in t around inf 99.5%
Final simplification98.7%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -40.0)
(asin (* (/ (sqrt 0.5) t) (- l)))
(if (<= (/ t l) 0.04)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -40.0) {
tmp = asin(((sqrt(0.5) / t) * -l));
} else if ((t / l) <= 0.04) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
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) <= (-40.0d0)) then
tmp = asin(((sqrt(0.5d0) / t) * -l))
else if ((t / l) <= 0.04d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -40.0) {
tmp = Math.asin(((Math.sqrt(0.5) / t) * -l));
} else if ((t / l) <= 0.04) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -40.0: tmp = math.asin(((math.sqrt(0.5) / t) * -l)) elif (t / l) <= 0.04: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -40.0) tmp = asin(Float64(Float64(sqrt(0.5) / t) * Float64(-l))); elseif (Float64(t / l) <= 0.04) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -40.0) tmp = asin(((sqrt(0.5) / t) * -l)); elseif ((t / l) <= 0.04) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -40.0], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision] * (-l)), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.04], 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}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -40:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5}}{t} \cdot \left(-\ell\right)\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.04:\\
\;\;\;\;\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) < -40Initial program 74.1%
unpow274.1%
associate-*r/65.9%
Applied egg-rr65.9%
Taylor expanded in Om around 0 47.2%
*-commutative47.2%
associate-*l/47.2%
rem-square-sqrt47.1%
unpow247.1%
*-commutative47.1%
*-commutative47.1%
unpow247.1%
rem-square-sqrt47.2%
associate-*l/47.2%
*-commutative47.2%
unpow247.2%
unpow247.2%
Simplified47.2%
Taylor expanded in t around -inf 98.2%
mul-1-neg98.2%
associate-*l/98.0%
distribute-rgt-neg-in98.0%
Simplified98.0%
if -40 < (/.f64 t l) < 0.0400000000000000008Initial program 98.7%
unpow298.7%
associate-*r/98.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 83.8%
*-commutative83.8%
associate-*l/83.8%
rem-square-sqrt83.8%
unpow283.8%
*-commutative83.8%
*-commutative83.8%
unpow283.8%
rem-square-sqrt83.8%
associate-*l/83.8%
*-commutative83.8%
unpow283.8%
unpow283.8%
Simplified83.8%
Taylor expanded in t around 0 83.4%
mul-1-neg83.4%
unpow283.4%
unpow283.4%
times-frac97.3%
unpow297.3%
unsub-neg97.3%
Simplified97.3%
if 0.0400000000000000008 < (/.f64 t l) Initial program 69.6%
unpow269.6%
associate-*r/64.0%
Applied egg-rr64.0%
Taylor expanded in Om around 0 49.7%
*-commutative49.7%
associate-*l/49.7%
rem-square-sqrt49.4%
unpow249.4%
*-commutative49.4%
*-commutative49.4%
unpow249.4%
rem-square-sqrt49.7%
associate-*l/49.7%
*-commutative49.7%
unpow249.7%
unpow249.7%
Simplified49.7%
Taylor expanded in t around inf 98.6%
Final simplification97.8%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -40.0)
(asin (/ (* (sqrt 0.5) (- l)) t))
(if (<= (/ t l) 0.04)
(asin (- 1.0 (pow (/ t l) 2.0)))
(asin (/ (* l (sqrt 0.5)) t)))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -40.0) {
tmp = asin(((sqrt(0.5) * -l) / t));
} else if ((t / l) <= 0.04) {
tmp = asin((1.0 - pow((t / l), 2.0)));
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
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) <= (-40.0d0)) then
tmp = asin(((sqrt(0.5d0) * -l) / t))
else if ((t / l) <= 0.04d0) then
tmp = asin((1.0d0 - ((t / l) ** 2.0d0)))
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -40.0) {
tmp = Math.asin(((Math.sqrt(0.5) * -l) / t));
} else if ((t / l) <= 0.04) {
tmp = Math.asin((1.0 - Math.pow((t / l), 2.0)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -40.0: tmp = math.asin(((math.sqrt(0.5) * -l) / t)) elif (t / l) <= 0.04: tmp = math.asin((1.0 - math.pow((t / l), 2.0))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -40.0) tmp = asin(Float64(Float64(sqrt(0.5) * Float64(-l)) / t)); elseif (Float64(t / l) <= 0.04) tmp = asin(Float64(1.0 - (Float64(t / l) ^ 2.0))); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -40.0) tmp = asin(((sqrt(0.5) * -l) / t)); elseif ((t / l) <= 0.04) tmp = asin((1.0 - ((t / l) ^ 2.0))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -40.0], N[ArcSin[N[(N[(N[Sqrt[0.5], $MachinePrecision] * (-l)), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 0.04], 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}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -40:\\
\;\;\;\;\sin^{-1} \left(\frac{\sqrt{0.5} \cdot \left(-\ell\right)}{t}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 0.04:\\
\;\;\;\;\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) < -40Initial program 74.1%
unpow274.1%
associate-*r/65.9%
Applied egg-rr65.9%
Taylor expanded in Om around 0 47.2%
*-commutative47.2%
associate-*l/47.2%
rem-square-sqrt47.1%
unpow247.1%
*-commutative47.1%
*-commutative47.1%
unpow247.1%
rem-square-sqrt47.2%
associate-*l/47.2%
*-commutative47.2%
unpow247.2%
unpow247.2%
Simplified47.2%
Taylor expanded in t around -inf 98.2%
if -40 < (/.f64 t l) < 0.0400000000000000008Initial program 98.7%
unpow298.7%
associate-*r/98.7%
Applied egg-rr98.7%
Taylor expanded in Om around 0 83.8%
*-commutative83.8%
associate-*l/83.8%
rem-square-sqrt83.8%
unpow283.8%
*-commutative83.8%
*-commutative83.8%
unpow283.8%
rem-square-sqrt83.8%
associate-*l/83.8%
*-commutative83.8%
unpow283.8%
unpow283.8%
Simplified83.8%
Taylor expanded in t around 0 83.4%
mul-1-neg83.4%
unpow283.4%
unpow283.4%
times-frac97.3%
unpow297.3%
unsub-neg97.3%
Simplified97.3%
if 0.0400000000000000008 < (/.f64 t l) Initial program 69.6%
unpow269.6%
associate-*r/64.0%
Applied egg-rr64.0%
Taylor expanded in Om around 0 49.7%
*-commutative49.7%
associate-*l/49.7%
rem-square-sqrt49.4%
unpow249.4%
*-commutative49.4%
*-commutative49.4%
unpow249.4%
rem-square-sqrt49.7%
associate-*l/49.7%
*-commutative49.7%
unpow249.7%
unpow249.7%
Simplified49.7%
Taylor expanded in t around inf 98.6%
Final simplification97.9%
NOTE: t should be positive before calling this function
(FPCore (t l Om Omc)
:precision binary64
(let* ((t_1 (/ (sqrt 0.5) t)))
(if (<= l -1.4e+76)
(asin 1.0)
(if (<= l -1e-309)
(asin (* t_1 (- l)))
(if (<= l 3.6e-23) (asin (* l t_1)) (asin 1.0))))))t = abs(t);
double code(double t, double l, double Om, double Omc) {
double t_1 = sqrt(0.5) / t;
double tmp;
if (l <= -1.4e+76) {
tmp = asin(1.0);
} else if (l <= -1e-309) {
tmp = asin((t_1 * -l));
} else if (l <= 3.6e-23) {
tmp = asin((l * t_1));
} else {
tmp = asin(1.0);
}
return tmp;
}
NOTE: t should be positive before calling this function
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 (l <= (-1.4d+76)) then
tmp = asin(1.0d0)
else if (l <= (-1d-309)) then
tmp = asin((t_1 * -l))
else if (l <= 3.6d-23) then
tmp = asin((l * t_1))
else
tmp = asin(1.0d0)
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double t_1 = Math.sqrt(0.5) / t;
double tmp;
if (l <= -1.4e+76) {
tmp = Math.asin(1.0);
} else if (l <= -1e-309) {
tmp = Math.asin((t_1 * -l));
} else if (l <= 3.6e-23) {
tmp = Math.asin((l * t_1));
} else {
tmp = Math.asin(1.0);
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): t_1 = math.sqrt(0.5) / t tmp = 0 if l <= -1.4e+76: tmp = math.asin(1.0) elif l <= -1e-309: tmp = math.asin((t_1 * -l)) elif l <= 3.6e-23: tmp = math.asin((l * t_1)) else: tmp = math.asin(1.0) return tmp
t = abs(t) function code(t, l, Om, Omc) t_1 = Float64(sqrt(0.5) / t) tmp = 0.0 if (l <= -1.4e+76) tmp = asin(1.0); elseif (l <= -1e-309) tmp = asin(Float64(t_1 * Float64(-l))); elseif (l <= 3.6e-23) tmp = asin(Float64(l * t_1)); else tmp = asin(1.0); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) t_1 = sqrt(0.5) / t; tmp = 0.0; if (l <= -1.4e+76) tmp = asin(1.0); elseif (l <= -1e-309) tmp = asin((t_1 * -l)); elseif (l <= 3.6e-23) tmp = asin((l * t_1)); else tmp = asin(1.0); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function
code[t_, l_, Om_, Omc_] := Block[{t$95$1 = N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[l, -1.4e+76], N[ArcSin[1.0], $MachinePrecision], If[LessEqual[l, -1e-309], N[ArcSin[N[(t$95$1 * (-l)), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 3.6e-23], N[ArcSin[N[(l * t$95$1), $MachinePrecision]], $MachinePrecision], N[ArcSin[1.0], $MachinePrecision]]]]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
t_1 := \frac{\sqrt{0.5}}{t}\\
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{+76}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\sin^{-1} \left(t_1 \cdot \left(-\ell\right)\right)\\
\mathbf{elif}\;\ell \leq 3.6 \cdot 10^{-23}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} 1\\
\end{array}
\end{array}
if l < -1.3999999999999999e76 or 3.5999999999999998e-23 < l Initial program 96.8%
unpow296.8%
associate-*r/90.0%
Applied egg-rr90.0%
Taylor expanded in Om around 0 75.5%
*-commutative75.5%
associate-*l/75.5%
rem-square-sqrt75.4%
unpow275.4%
*-commutative75.4%
*-commutative75.4%
unpow275.4%
rem-square-sqrt75.5%
associate-*l/75.5%
*-commutative75.5%
unpow275.5%
unpow275.5%
Simplified75.5%
Taylor expanded in t around 0 77.6%
if -1.3999999999999999e76 < l < -1.000000000000002e-309Initial program 73.9%
unpow273.9%
associate-*r/71.4%
Applied egg-rr71.4%
Taylor expanded in Om around 0 56.2%
*-commutative56.2%
associate-*l/56.2%
rem-square-sqrt56.0%
unpow256.0%
*-commutative56.0%
*-commutative56.0%
unpow256.0%
rem-square-sqrt56.2%
associate-*l/56.2%
*-commutative56.2%
unpow256.2%
unpow256.2%
Simplified56.2%
Taylor expanded in t around -inf 47.1%
mul-1-neg47.1%
associate-*l/47.1%
distribute-rgt-neg-in47.1%
Simplified47.1%
if -1.000000000000002e-309 < l < 3.5999999999999998e-23Initial program 75.2%
unpow275.2%
associate-*r/75.2%
Applied egg-rr75.2%
Taylor expanded in Om around 0 56.9%
*-commutative56.9%
associate-*l/56.9%
rem-square-sqrt56.8%
unpow256.8%
*-commutative56.8%
*-commutative56.8%
unpow256.8%
rem-square-sqrt56.9%
associate-*l/56.9%
*-commutative56.9%
unpow256.9%
unpow256.9%
Simplified56.9%
Taylor expanded in t around inf 55.0%
associate-*l/55.1%
Simplified55.1%
Final simplification62.7%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 1e+49) (asin 1.0) (asin (* l (/ (sqrt 0.5) t)))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1e+49) {
tmp = asin(1.0);
} else {
tmp = asin((l * (sqrt(0.5) / t)));
}
return tmp;
}
NOTE: t should be positive before calling this function
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 <= 1d+49) then
tmp = asin(1.0d0)
else
tmp = asin((l * (sqrt(0.5d0) / t)))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1e+49) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l * (Math.sqrt(0.5) / t)));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 1e+49: tmp = math.asin(1.0) else: tmp = math.asin((l * (math.sqrt(0.5) / t))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1e+49) tmp = asin(1.0); else tmp = asin(Float64(l * Float64(sqrt(0.5) / t))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 1e+49) tmp = asin(1.0); else tmp = asin((l * (sqrt(0.5) / t))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1e+49], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l * N[(N[Sqrt[0.5], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{+49}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\ell \cdot \frac{\sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 9.99999999999999946e48Initial program 85.9%
unpow285.9%
associate-*r/83.2%
Applied egg-rr83.2%
Taylor expanded in Om around 0 67.8%
*-commutative67.8%
associate-*l/67.8%
rem-square-sqrt67.7%
unpow267.7%
*-commutative67.7%
*-commutative67.7%
unpow267.7%
rem-square-sqrt67.8%
associate-*l/67.8%
*-commutative67.8%
unpow267.8%
unpow267.8%
Simplified67.8%
Taylor expanded in t around 0 54.5%
if 9.99999999999999946e48 < t Initial program 77.6%
unpow277.6%
associate-*r/69.9%
Applied egg-rr69.9%
Taylor expanded in Om around 0 52.8%
*-commutative52.8%
associate-*l/52.8%
rem-square-sqrt52.7%
unpow252.7%
*-commutative52.7%
*-commutative52.7%
unpow252.7%
rem-square-sqrt52.8%
associate-*l/52.8%
*-commutative52.8%
unpow252.8%
unpow252.8%
Simplified52.8%
Taylor expanded in t around inf 52.3%
associate-*l/52.3%
Simplified52.3%
Final simplification54.1%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 5.4e+48) (asin 1.0) (asin (/ l (/ t (sqrt 0.5))))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 5.4e+48) {
tmp = asin(1.0);
} else {
tmp = asin((l / (t / sqrt(0.5))));
}
return tmp;
}
NOTE: t should be positive before calling this function
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 <= 5.4d+48) then
tmp = asin(1.0d0)
else
tmp = asin((l / (t / sqrt(0.5d0))))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 5.4e+48) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin((l / (t / Math.sqrt(0.5))));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 5.4e+48: tmp = math.asin(1.0) else: tmp = math.asin((l / (t / math.sqrt(0.5)))) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 5.4e+48) tmp = asin(1.0); else tmp = asin(Float64(l / Float64(t / sqrt(0.5)))); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 5.4e+48) tmp = asin(1.0); else tmp = asin((l / (t / sqrt(0.5)))); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 5.4e+48], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(l / N[(t / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.4 \cdot 10^{+48}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell}{\frac{t}{\sqrt{0.5}}}\right)\\
\end{array}
\end{array}
if t < 5.40000000000000007e48Initial program 85.9%
unpow285.9%
associate-*r/83.2%
Applied egg-rr83.2%
Taylor expanded in Om around 0 67.8%
*-commutative67.8%
associate-*l/67.8%
rem-square-sqrt67.7%
unpow267.7%
*-commutative67.7%
*-commutative67.7%
unpow267.7%
rem-square-sqrt67.8%
associate-*l/67.8%
*-commutative67.8%
unpow267.8%
unpow267.8%
Simplified67.8%
Taylor expanded in t around 0 54.5%
if 5.40000000000000007e48 < t Initial program 77.6%
unpow277.6%
associate-*r/69.9%
Applied egg-rr69.9%
Taylor expanded in Om around 0 52.8%
*-commutative52.8%
associate-*l/52.8%
rem-square-sqrt52.7%
unpow252.7%
*-commutative52.7%
*-commutative52.7%
unpow252.7%
rem-square-sqrt52.8%
associate-*l/52.8%
*-commutative52.8%
unpow252.8%
unpow252.8%
Simplified52.8%
Taylor expanded in t around inf 52.3%
*-commutative52.3%
associate-/l*52.2%
Simplified52.2%
Final simplification54.1%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (if (<= t 1.12e+49) (asin 1.0) (asin (/ (* l (sqrt 0.5)) t))))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.12e+49) {
tmp = asin(1.0);
} else {
tmp = asin(((l * sqrt(0.5)) / t));
}
return tmp;
}
NOTE: t should be positive before calling this function
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 <= 1.12d+49) then
tmp = asin(1.0d0)
else
tmp = asin(((l * sqrt(0.5d0)) / t))
end if
code = tmp
end function
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if (t <= 1.12e+49) {
tmp = Math.asin(1.0);
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
t = abs(t) def code(t, l, Om, Omc): tmp = 0 if t <= 1.12e+49: tmp = math.asin(1.0) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
t = abs(t) function code(t, l, Om, Omc) tmp = 0.0 if (t <= 1.12e+49) tmp = asin(1.0); else tmp = asin(Float64(Float64(l * sqrt(0.5)) / t)); end return tmp end
t = abs(t) function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if (t <= 1.12e+49) tmp = asin(1.0); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := If[LessEqual[t, 1.12e+49], N[ArcSin[1.0], $MachinePrecision], N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
t = |t|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.12 \cdot 10^{+49}:\\
\;\;\;\;\sin^{-1} 1\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if t < 1.12000000000000005e49Initial program 85.9%
unpow285.9%
associate-*r/83.2%
Applied egg-rr83.2%
Taylor expanded in Om around 0 67.8%
*-commutative67.8%
associate-*l/67.8%
rem-square-sqrt67.7%
unpow267.7%
*-commutative67.7%
*-commutative67.7%
unpow267.7%
rem-square-sqrt67.8%
associate-*l/67.8%
*-commutative67.8%
unpow267.8%
unpow267.8%
Simplified67.8%
Taylor expanded in t around 0 54.5%
if 1.12000000000000005e49 < t Initial program 77.6%
unpow277.6%
associate-*r/69.9%
Applied egg-rr69.9%
Taylor expanded in Om around 0 52.8%
*-commutative52.8%
associate-*l/52.8%
rem-square-sqrt52.7%
unpow252.7%
*-commutative52.7%
*-commutative52.7%
unpow252.7%
rem-square-sqrt52.8%
associate-*l/52.8%
*-commutative52.8%
unpow252.8%
unpow252.8%
Simplified52.8%
Taylor expanded in t around inf 52.3%
Final simplification54.1%
NOTE: t should be positive before calling this function (FPCore (t l Om Omc) :precision binary64 (asin 1.0))
t = abs(t);
double code(double t, double l, double Om, double Omc) {
return asin(1.0);
}
NOTE: t should be positive before calling this function
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
t = Math.abs(t);
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(1.0);
}
t = abs(t) def code(t, l, Om, Omc): return math.asin(1.0)
t = abs(t) function code(t, l, Om, Omc) return asin(1.0) end
t = abs(t) function tmp = code(t, l, Om, Omc) tmp = asin(1.0); end
NOTE: t should be positive before calling this function code[t_, l_, Om_, Omc_] := N[ArcSin[1.0], $MachinePrecision]
\begin{array}{l}
t = |t|\\
\\
\sin^{-1} 1
\end{array}
Initial program 84.3%
unpow284.3%
associate-*r/80.7%
Applied egg-rr80.7%
Taylor expanded in Om around 0 64.9%
*-commutative64.9%
associate-*l/64.9%
rem-square-sqrt64.8%
unpow264.8%
*-commutative64.8%
*-commutative64.8%
unpow264.8%
rem-square-sqrt64.9%
associate-*l/64.9%
*-commutative64.9%
unpow264.9%
unpow264.9%
Simplified64.9%
Taylor expanded in t around 0 47.7%
Final simplification47.7%
herbie shell --seed 2023244
(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)))))))