
(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 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 86.3%
sqrt-div86.2%
add-sqr-sqrt86.2%
hypot-1-def86.2%
*-commutative86.2%
sqrt-prod86.1%
unpow286.1%
sqrt-prod53.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (t l Om Omc)
:precision binary64
(asin
(/
1.0
(/
(hypot 1.0 (* (/ t l) (sqrt 2.0)))
(sqrt (- 1.0 (/ (/ Om Omc) (/ Omc Om))))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / (hypot(1.0, ((t / l) * sqrt(2.0))) / sqrt((1.0 - ((Om / Omc) / (Omc / Om)))))));
}
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))) / Math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / (math.hypot(1.0, ((t / l) * math.sqrt(2.0))) / math.sqrt((1.0 - ((Om / Omc) / (Omc / Om)))))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / Float64(hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))) / sqrt(Float64(1.0 - Float64(Float64(Om / Omc) / Float64(Omc / Om))))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / (hypot(1.0, ((t / l) * sqrt(2.0))) / sqrt((1.0 - ((Om / Omc) / (Omc / Om))))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[Sqrt[N[(1.0 - N[(N[(Om / Omc), $MachinePrecision] / N[(Omc / Om), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\frac{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}{\sqrt{1 - \frac{\frac{Om}{Omc}}{\frac{Omc}{Om}}}}}\right)
\end{array}
Initial program 86.3%
sqrt-div86.2%
clear-num86.2%
add-sqr-sqrt86.2%
hypot-1-def86.2%
*-commutative86.2%
sqrt-prod86.1%
unpow286.1%
sqrt-prod53.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
unpow298.5%
clear-num98.5%
un-div-inv98.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (t l Om Omc) :precision binary64 (asin (/ 1.0 (hypot 1.0 (* (/ t l) (sqrt 2.0))))))
double code(double t, double l, double Om, double Omc) {
return asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0)))));
}
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((1.0 / Math.hypot(1.0, ((t / l) * Math.sqrt(2.0)))));
}
def code(t, l, Om, Omc): return math.asin((1.0 / math.hypot(1.0, ((t / l) * math.sqrt(2.0)))))
function code(t, l, Om, Omc) return asin(Float64(1.0 / hypot(1.0, Float64(Float64(t / l) * sqrt(2.0))))) end
function tmp = code(t, l, Om, Omc) tmp = asin((1.0 / hypot(1.0, ((t / l) * sqrt(2.0))))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(1.0 / N[Sqrt[1.0 ^ 2 + N[(N[(t / l), $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{1}{\mathsf{hypot}\left(1, \frac{t}{\ell} \cdot \sqrt{2}\right)}\right)
\end{array}
Initial program 86.3%
sqrt-div86.2%
add-sqr-sqrt86.2%
hypot-1-def86.2%
*-commutative86.2%
sqrt-prod86.1%
unpow286.1%
sqrt-prod53.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 97.6%
Final simplification97.6%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -2e+168)
(asin (/ (/ (- l) t) (sqrt 2.0)))
(if (<= (/ t l) 2e+152)
(asin (sqrt (/ 1.0 (+ 1.0 (* 2.0 (* (/ t l) (/ t l)))))))
(asin (/ (* l (sqrt 0.5)) t)))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+168) {
tmp = asin(((-l / t) / sqrt(2.0)));
} else if ((t / l) <= 2e+152) {
tmp = asin(sqrt((1.0 / (1.0 + (2.0 * ((t / l) * (t / l)))))));
} 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+168)) then
tmp = asin(((-l / t) / sqrt(2.0d0)))
else if ((t / l) <= 2d+152) 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
public static double code(double t, double l, double Om, double Omc) {
double tmp;
if ((t / l) <= -2e+168) {
tmp = Math.asin(((-l / t) / Math.sqrt(2.0)));
} else if ((t / l) <= 2e+152) {
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;
}
def code(t, l, Om, Omc): tmp = 0 if (t / l) <= -2e+168: tmp = math.asin(((-l / t) / math.sqrt(2.0))) elif (t / l) <= 2e+152: 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
function code(t, l, Om, Omc) tmp = 0.0 if (Float64(t / l) <= -2e+168) tmp = asin(Float64(Float64(Float64(-l) / t) / sqrt(2.0))); elseif (Float64(t / l) <= 2e+152) 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
function tmp_2 = code(t, l, Om, Omc) tmp = 0.0; if ((t / l) <= -2e+168) tmp = asin(((-l / t) / sqrt(2.0))); elseif ((t / l) <= 2e+152) 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
code[t_, l_, Om_, Omc_] := If[LessEqual[N[(t / l), $MachinePrecision], -2e+168], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(t / l), $MachinePrecision], 2e+152], 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}
\\
\begin{array}{l}
\mathbf{if}\;\frac{t}{\ell} \leq -2 \cdot 10^{+168}:\\
\;\;\;\;\sin^{-1} \left(\frac{\frac{-\ell}{t}}{\sqrt{2}}\right)\\
\mathbf{elif}\;\frac{t}{\ell} \leq 2 \cdot 10^{+152}:\\
\;\;\;\;\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) < -1.9999999999999999e168Initial program 45.2%
sqrt-div45.2%
add-sqr-sqrt45.2%
hypot-1-def45.2%
*-commutative45.2%
sqrt-prod45.2%
unpow245.2%
sqrt-prod0.0%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 98.5%
Taylor expanded in t around -inf 99.6%
associate-*r/99.6%
*-commutative99.6%
associate-/r*99.8%
mul-1-neg99.8%
Simplified99.8%
if -1.9999999999999999e168 < (/.f64 t l) < 2.0000000000000001e152Initial program 97.7%
Taylor expanded in Om around 0 72.9%
unpow272.9%
unpow272.9%
Simplified72.9%
times-frac96.5%
Applied egg-rr96.5%
if 2.0000000000000001e152 < (/.f64 t l) Initial program 42.2%
Taylor expanded in Om around 0 42.2%
unpow242.2%
unpow242.2%
Simplified42.2%
Taylor expanded in t around inf 99.6%
Final simplification97.2%
(FPCore (t l Om Omc)
:precision binary64
(if (<= (/ t l) -1e+19)
(asin (* (/ (- l) t) (sqrt 0.5)))
(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) <= -1e+19) {
tmp = asin(((-l / t) * sqrt(0.5)));
} else 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) <= (-1d+19)) then
tmp = asin(((-l / t) * sqrt(0.5d0)))
else 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) <= -1e+19) {
tmp = Math.asin(((-l / t) * Math.sqrt(0.5)));
} else 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) <= -1e+19: tmp = math.asin(((-l / t) * math.sqrt(0.5))) elif (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) <= -1e+19) tmp = asin(Float64(Float64(Float64(-l) / t) * sqrt(0.5))); elseif (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) <= -1e+19) tmp = asin(((-l / t) * sqrt(0.5))); elseif ((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], -1e+19], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 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 -1 \cdot 10^{+19}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t} \cdot \sqrt{0.5}\right)\\
\mathbf{elif}\;\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) < -1e19Initial program 70.5%
Taylor expanded in Om around 0 45.6%
unpow245.6%
unpow245.6%
Simplified45.6%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
*-commutative99.6%
associate-*l/99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -1e19 < (/.f64 t l) < 0.20000000000000001Initial program 98.2%
Taylor expanded in Om around 0 86.4%
unpow286.4%
unpow286.4%
Simplified86.4%
Taylor expanded in t around 0 86.0%
mul-1-neg86.0%
unpow286.0%
unpow286.0%
times-frac95.1%
unpow295.1%
unsub-neg95.1%
Simplified95.1%
if 0.20000000000000001 < (/.f64 t l) Initial program 72.4%
Taylor expanded in Om around 0 39.2%
unpow239.2%
unpow239.2%
Simplified39.2%
Taylor expanded in t around inf 97.5%
Final simplification96.6%
(FPCore (t l Om Omc) :precision binary64 (if (<= l -5e-310) (asin (/ (- l) (* t (sqrt 2.0)))) (asin (/ (* l (sqrt 0.5)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -5e-310) {
tmp = asin((-l / (t * sqrt(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 (l <= (-5d-310)) then
tmp = asin((-l / (t * sqrt(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 (l <= -5e-310) {
tmp = Math.asin((-l / (t * Math.sqrt(2.0))));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -5e-310: tmp = math.asin((-l / (t * math.sqrt(2.0)))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -5e-310) tmp = asin(Float64(Float64(-l) / Float64(t * sqrt(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 (l <= -5e-310) tmp = asin((-l / (t * sqrt(2.0)))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -5e-310], N[ArcSin[N[((-l) / N[(t * N[Sqrt[2.0], $MachinePrecision]), $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}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t \cdot \sqrt{2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 87.2%
sqrt-div87.1%
add-sqr-sqrt87.1%
hypot-1-def87.1%
*-commutative87.1%
sqrt-prod87.0%
unpow287.0%
sqrt-prod54.4%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
Taylor expanded in Om around 0 96.5%
Taylor expanded in t around -inf 29.0%
mul-1-neg29.0%
Simplified29.0%
if -4.999999999999985e-310 < l Initial program 85.5%
Taylor expanded in Om around 0 68.7%
unpow268.7%
unpow268.7%
Simplified68.7%
Taylor expanded in t around inf 26.9%
Final simplification27.9%
(FPCore (t l Om Omc) :precision binary64 (if (<= l -5e-310) (asin (* (/ (- l) t) (sqrt 0.5))) (asin (/ (* l (sqrt 0.5)) t))))
double code(double t, double l, double Om, double Omc) {
double tmp;
if (l <= -5e-310) {
tmp = asin(((-l / t) * sqrt(0.5)));
} 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 (l <= (-5d-310)) then
tmp = asin(((-l / t) * sqrt(0.5d0)))
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 (l <= -5e-310) {
tmp = Math.asin(((-l / t) * Math.sqrt(0.5)));
} else {
tmp = Math.asin(((l * Math.sqrt(0.5)) / t));
}
return tmp;
}
def code(t, l, Om, Omc): tmp = 0 if l <= -5e-310: tmp = math.asin(((-l / t) * math.sqrt(0.5))) else: tmp = math.asin(((l * math.sqrt(0.5)) / t)) return tmp
function code(t, l, Om, Omc) tmp = 0.0 if (l <= -5e-310) tmp = asin(Float64(Float64(Float64(-l) / t) * sqrt(0.5))); 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 (l <= -5e-310) tmp = asin(((-l / t) * sqrt(0.5))); else tmp = asin(((l * sqrt(0.5)) / t)); end tmp_2 = tmp; end
code[t_, l_, Om_, Omc_] := If[LessEqual[l, -5e-310], N[ArcSin[N[(N[((-l) / t), $MachinePrecision] * N[Sqrt[0.5], $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}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sin^{-1} \left(\frac{-\ell}{t} \cdot \sqrt{0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 87.2%
Taylor expanded in Om around 0 64.4%
unpow264.4%
unpow264.4%
Simplified64.4%
Taylor expanded in t around -inf 29.0%
mul-1-neg29.0%
*-commutative29.0%
associate-*l/29.0%
*-commutative29.0%
distribute-rgt-neg-in29.0%
Simplified29.0%
if -4.999999999999985e-310 < l Initial program 85.5%
Taylor expanded in Om around 0 68.7%
unpow268.7%
unpow268.7%
Simplified68.7%
Taylor expanded in t around inf 26.9%
Final simplification27.9%
(FPCore (t l Om Omc) :precision binary64 (asin (* (sqrt 0.5) (/ l t))))
double code(double t, double l, double Om, double Omc) {
return asin((sqrt(0.5) * (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(0.5d0) * (l / t)))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((Math.sqrt(0.5) * (l / t)));
}
def code(t, l, Om, Omc): return math.asin((math.sqrt(0.5) * (l / t)))
function code(t, l, Om, Omc) return asin(Float64(sqrt(0.5) * Float64(l / t))) end
function tmp = code(t, l, Om, Omc) tmp = asin((sqrt(0.5) * (l / t))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[Sqrt[0.5], $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\sqrt{0.5} \cdot \frac{\ell}{t}\right)
\end{array}
Initial program 86.3%
Taylor expanded in Om around 0 66.7%
unpow266.7%
unpow266.7%
Simplified66.7%
Taylor expanded in t around inf 27.3%
*-commutative27.3%
associate-*l/27.2%
*-commutative27.2%
Simplified27.2%
Final simplification27.2%
(FPCore (t l Om Omc) :precision binary64 (asin (/ l (* t (sqrt 2.0)))))
double code(double t, double l, double Om, double Omc) {
return asin((l / (t * sqrt(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((l / (t * sqrt(2.0d0))))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin((l / (t * Math.sqrt(2.0))));
}
def code(t, l, Om, Omc): return math.asin((l / (t * math.sqrt(2.0))))
function code(t, l, Om, Omc) return asin(Float64(l / Float64(t * sqrt(2.0)))) end
function tmp = code(t, l, Om, Omc) tmp = asin((l / (t * sqrt(2.0)))); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(l / N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{\ell}{t \cdot \sqrt{2}}\right)
\end{array}
Initial program 86.3%
sqrt-div86.2%
add-sqr-sqrt86.2%
hypot-1-def86.2%
*-commutative86.2%
sqrt-prod86.1%
unpow286.1%
sqrt-prod53.4%
add-sqr-sqrt98.5%
Applied egg-rr98.5%
Taylor expanded in Om around 0 97.6%
Taylor expanded in t around inf 27.2%
Final simplification27.2%
(FPCore (t l Om Omc) :precision binary64 (asin (/ (* l (sqrt 0.5)) t)))
double code(double t, double l, double Om, double Omc) {
return asin(((l * sqrt(0.5)) / 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(((l * sqrt(0.5d0)) / t))
end function
public static double code(double t, double l, double Om, double Omc) {
return Math.asin(((l * Math.sqrt(0.5)) / t));
}
def code(t, l, Om, Omc): return math.asin(((l * math.sqrt(0.5)) / t))
function code(t, l, Om, Omc) return asin(Float64(Float64(l * sqrt(0.5)) / t)) end
function tmp = code(t, l, Om, Omc) tmp = asin(((l * sqrt(0.5)) / t)); end
code[t_, l_, Om_, Omc_] := N[ArcSin[N[(N[(l * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sin^{-1} \left(\frac{\ell \cdot \sqrt{0.5}}{t}\right)
\end{array}
Initial program 86.3%
Taylor expanded in Om around 0 66.7%
unpow266.7%
unpow266.7%
Simplified66.7%
Taylor expanded in t around inf 27.3%
Final simplification27.3%
herbie shell --seed 2023258
(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)))))))