Average Error: 10.1 → 10.2
Time: 16.4s
Precision: 64
\[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)\]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{\mathsf{fma}\left(2, {\left(\frac{\frac{-1}{\ell}}{\frac{-1}{t}}\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)
\mathsf{expm1}\left(\mathsf{log1p}\left(\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{\mathsf{fma}\left(2, {\left(\frac{\frac{-1}{\ell}}{\frac{-1}{t}}\right)}^{2}, 1\right)}}\right)\right)\right)
double f(double t, double l, double Om, double Omc) {
        double r61443 = 1.0;
        double r61444 = Om;
        double r61445 = Omc;
        double r61446 = r61444 / r61445;
        double r61447 = 2.0;
        double r61448 = pow(r61446, r61447);
        double r61449 = r61443 - r61448;
        double r61450 = t;
        double r61451 = l;
        double r61452 = r61450 / r61451;
        double r61453 = pow(r61452, r61447);
        double r61454 = r61447 * r61453;
        double r61455 = r61443 + r61454;
        double r61456 = r61449 / r61455;
        double r61457 = sqrt(r61456);
        double r61458 = asin(r61457);
        return r61458;
}

double f(double t, double l, double Om, double Omc) {
        double r61459 = 1.0;
        double r61460 = Om;
        double r61461 = Omc;
        double r61462 = r61460 / r61461;
        double r61463 = 2.0;
        double r61464 = pow(r61462, r61463);
        double r61465 = r61459 - r61464;
        double r61466 = -1.0;
        double r61467 = l;
        double r61468 = r61466 / r61467;
        double r61469 = t;
        double r61470 = r61466 / r61469;
        double r61471 = r61468 / r61470;
        double r61472 = pow(r61471, r61463);
        double r61473 = fma(r61463, r61472, r61459);
        double r61474 = r61465 / r61473;
        double r61475 = sqrt(r61474);
        double r61476 = asin(r61475);
        double r61477 = log1p(r61476);
        double r61478 = expm1(r61477);
        return r61478;
}

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. Simplified10.1

    \[\leadsto \color{blue}{\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{\mathsf{fma}\left(2, {\left(\frac{t}{\ell}\right)}^{2}, 1\right)}}\right)}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u10.1

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

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

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

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

Reproduce

herbie shell --seed 2019351 +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)))))))