Average Error: 10.1 → 10.1
Time: 46.3s
Precision: 64
\[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)\]
\[\sin^{-1} \left(\sqrt{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}\right)\right)}\right)\]
\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)
\sin^{-1} \left(\sqrt{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}\right)\right)}\right)
double f(double t, double l, double Om, double Omc) {
        double r55109 = 1.0;
        double r55110 = Om;
        double r55111 = Omc;
        double r55112 = r55110 / r55111;
        double r55113 = 2.0;
        double r55114 = pow(r55112, r55113);
        double r55115 = r55109 - r55114;
        double r55116 = t;
        double r55117 = l;
        double r55118 = r55116 / r55117;
        double r55119 = pow(r55118, r55113);
        double r55120 = r55113 * r55119;
        double r55121 = r55109 + r55120;
        double r55122 = r55115 / r55121;
        double r55123 = sqrt(r55122);
        double r55124 = asin(r55123);
        return r55124;
}

double f(double t, double l, double Om, double Omc) {
        double r55125 = 1.0;
        double r55126 = Om;
        double r55127 = Omc;
        double r55128 = r55126 / r55127;
        double r55129 = 2.0;
        double r55130 = pow(r55128, r55129);
        double r55131 = r55125 - r55130;
        double r55132 = t;
        double r55133 = l;
        double r55134 = r55132 / r55133;
        double r55135 = pow(r55134, r55129);
        double r55136 = fma(r55129, r55135, r55125);
        double r55137 = r55131 / r55136;
        double r55138 = expm1(r55137);
        double r55139 = log1p(r55138);
        double r55140 = sqrt(r55139);
        double r55141 = asin(r55140);
        return r55141;
}

Error

Bits error versus t

Bits error versus l

Bits error versus Om

Bits error versus Omc

Derivation

  1. Initial program 10.1

    \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)\]
  2. Using strategy rm
  3. Applied log1p-expm1-u10.1

    \[\leadsto \sin^{-1} \left(\sqrt{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}\right)\right)}}\right)\]
  4. Simplified10.1

    \[\leadsto \sin^{-1} \left(\sqrt{\mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}\right)}\right)}\right)\]
  5. Final simplification10.1

    \[\leadsto \sin^{-1} \left(\sqrt{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}\right)\right)}\right)\]

Reproduce

herbie shell --seed 2019323 +o rules:numerics
(FPCore (t l Om Omc)
  :name "Toniolo and Linder, Equation (2)"
  :precision binary64
  (asin (sqrt (/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2)))))))