Average Error: 10.3 → 5.7
Time: 47.6s
Precision: 64
Internal precision: 128
\[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^2}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^2}}\right)\]
\[\begin{array}{l} \mathbf{if}\;\frac{1 - {\left(\frac{Om}{Omc}\right)}^2}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^2} \le 0.0:\\ \;\;\;\;\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^2}}{\frac{t \cdot \sqrt{2}}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^2} \cdot \sqrt{\frac{1}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^2}}\right)\\ \end{array}\]

Error

Bits error versus t

Bits error versus l

Bits error versus Om

Bits error versus Omc

Derivation

  1. Split input into 2 regimes.
  2. if (/ (- 1 (sqr (/ Om Omc))) (+ 1 (* 2 (sqr (/ t l))))) < 0.0

    1. Initial program 35.0

      \[\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 sqrt-div 35.0

      \[\leadsto \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^2}}{\sqrt{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^2}}\right)}\]
    4. Applied taylor 18.2

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^2}}{\frac{t \cdot \sqrt{2}}{\ell}}\right)\]
    5. Taylor expanded around inf 18.2

      \[\leadsto \sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^2}}{\color{blue}{\frac{t \cdot \sqrt{2}}{\ell}}}\right)\]

    if 0.0 < (/ (- 1 (sqr (/ Om Omc))) (+ 1 (* 2 (sqr (/ t l)))))

    1. Initial program 0.9

      \[\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 div-inv 0.9

      \[\leadsto \sin^{-1} \left(\sqrt{\color{blue}{\left(1 - {\left(\frac{Om}{Omc}\right)}^2\right) \cdot \frac{1}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^2}}}\right)\]
    4. Applied sqrt-prod 0.9

      \[\leadsto \sin^{-1} \color{blue}{\left(\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^2} \cdot \sqrt{\frac{1}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^2}}\right)}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 47.6s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1810863310 657348890 3238550162 4250187101 535398006 2243867212)'
(FPCore (t l Om Omc)
  :name "Toniolo and Linder, Equation (2)"
  (asin (sqrt (/ (- 1 (sqr (/ Om Omc))) (+ 1 (* 2 (sqr (/ t l))))))))