Average Error: 10.5 → 5.8
Time: 1.1m
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{t}{\ell} \le 5.521943502452571 \cdot 10^{+42}:\\ \;\;\;\;(e^{\log_* (1 + \sin^{-1} \left(\frac{\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}}{\sqrt{(\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right) \cdot 2 + 1)_*}}\right))} - 1)^*\\ \mathbf{else}:\\ \;\;\;\;(e^{\log_* (1 + \sin^{-1} \left(\frac{\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}}{\frac{t \cdot \sqrt{2}}{\ell}}\right))} - 1)^*\\ \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 (/ t l) < 5.521943502452571e+42

    1. Initial program 7.1

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)\]
    2. Initial simplification7.1

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

      \[\leadsto \color{blue}{(e^{\log_* (1 + \sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{(\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right) \cdot 2 + 1)_*}}\right))} - 1)^*}\]
    5. Using strategy rm
    6. Applied sqrt-div7.1

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

    if 5.521943502452571e+42 < (/ t l)

    1. Initial program 22.8

      \[\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{1 + 2 \cdot {\left(\frac{t}{\ell}\right)}^{2}}}\right)\]
    2. Initial simplification22.8

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

      \[\leadsto \color{blue}{(e^{\log_* (1 + \sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{(\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right) \cdot 2 + 1)_*}}\right))} - 1)^*}\]
    5. Using strategy rm
    6. Applied sqrt-div22.8

      \[\leadsto (e^{\log_* (1 + \sin^{-1} \color{blue}{\left(\frac{\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}}{\sqrt{(\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right) \cdot 2 + 1)_*}}\right)})} - 1)^*\]
    7. Taylor expanded around -inf 1.1

      \[\leadsto (e^{\log_* (1 + \sin^{-1} \left(\frac{\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}}{\color{blue}{\frac{t \cdot \sqrt{2}}{\ell}}}\right))} - 1)^*\]
  3. Recombined 2 regimes into one program.
  4. Final simplification5.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{t}{\ell} \le 5.521943502452571 \cdot 10^{+42}:\\ \;\;\;\;(e^{\log_* (1 + \sin^{-1} \left(\frac{\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}}{\sqrt{(\left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right) \cdot 2 + 1)_*}}\right))} - 1)^*\\ \mathbf{else}:\\ \;\;\;\;(e^{\log_* (1 + \sin^{-1} \left(\frac{\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}}{\frac{t \cdot \sqrt{2}}{\ell}}\right))} - 1)^*\\ \end{array}\]

Reproduce

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

Details

Time bar (total: 53.7s)Debug log

start324.0ms

Algorithm
intervals

setup178.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 12.0b

localize51.0ms

Local error

Found 4 expressions with local error:

10.9b
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))
0.5b
(asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))
0.4b
(/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))
0.2b
(* (/ t l) (/ t l))

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 95
Calls

4 calls. Slowest were:

15.0ms
(/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))
7.0ms
(* (/ t l) (/ t l))
4.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))

series224.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

123.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))
61.0ms
(/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))
20.0ms
(asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))
19.0ms
(* (/ t l) (/ t l))

simplify8.1s

Counts
71 → 107
Calls

71 calls. Slowest were:

935.0ms
(* (* (* (/ t l) (/ t l)) (/ t l)) (* (* (/ t l) (/ t l)) (/ t l)))
442.0ms
(asin (sqrt (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (fma (/ (pow t 2) (pow l 2)) 2 1))))
440.0ms
(asin (sqrt (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (fma (/ (pow t 2) (pow l 2)) 2 1))))

prune1.8s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 12.0b

localize10.0ms

Local error

Found 4 expressions with local error:

10.9b
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))
0.5b
(asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))
0.4b
(/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))
0.2b
(* (/ t l) (/ t l))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 95
Calls

4 calls. Slowest were:

4.0ms
(/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))
3.0ms
(* (/ t l) (/ t l))
2.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))

series250.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

133.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))
82.0ms
(/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))
25.0ms
(* (/ t l) (/ t l))
10.0ms
(asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))

simplify8.3s

Counts
71 → 107
Calls

71 calls. Slowest were:

972.0ms
(* (* (* (/ t l) (/ t l)) (/ t l)) (* (* (/ t l) (/ t l)) (/ t l)))
441.0ms
(asin (sqrt (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (fma (/ (pow t 2) (pow l 2)) 2 1))))
406.0ms
(/ (* (* (- 1 (* (/ Om Omc) (/ Om Omc))) (- 1 (* (/ Om Omc) (/ Om Omc)))) (- 1 (* (/ Om Omc) (/ Om Omc)))) (* (* (fma (* (/ t l) (/ t l)) 2 1) (fma (* (/ t l) (/ t l)) 2 1)) (fma (* (/ t l) (/ t l)) 2 1)))

prune2.0s

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 12.0b

localize28.0ms

Local error

Found 4 expressions with local error:

11.0b
(sqrt (fma (* (/ t l) (/ t l)) 2 1))
0.6b
(/ (sqrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (sqrt (fma (* (/ t l) (/ t l)) 2 1)))
0.5b
(asin (/ (sqrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (sqrt (fma (* (/ t l) (/ t l)) 2 1))))
0.2b
(* (/ t l) (/ t l))

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
4 → 116
Calls

4 calls. Slowest were:

14.0ms
(/ (sqrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (sqrt (fma (* (/ t l) (/ t l)) 2 1)))
6.0ms
(* (/ t l) (/ t l))
1.0ms
(sqrt (fma (* (/ t l) (/ t l)) 2 1))

series249.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

152.0ms
(/ (sqrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (sqrt (fma (* (/ t l) (/ t l)) 2 1)))
53.0ms
(sqrt (fma (* (/ t l) (/ t l)) 2 1))
24.0ms
(* (/ t l) (/ t l))
20.0ms
(asin (/ (sqrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (sqrt (fma (* (/ t l) (/ t l)) 2 1))))

simplify12.8s

Counts
119 → 128
Calls

119 calls. Slowest were:

935.0ms
(* (* (* (/ t l) (/ t l)) (/ t l)) (* (* (/ t l) (/ t l)) (/ t l)))
534.0ms
(asin (sqrt (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (fma (/ (pow t 2) (pow l 2)) 2 1))))
501.0ms
(asin (sqrt (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (fma (/ (pow t 2) (pow l 2)) 2 1))))

prune2.7s

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 7.3b

localize10.0ms

Local error

Found 4 expressions with local error:

10.9b
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))
10.9b
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))
8.5b
(sqrt (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))
8.5b
(sqrt (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 112
Calls

4 calls. Slowest were:

2.0ms
(sqrt (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))
2.0ms
(sqrt (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))
2.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))

series650.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

225.0ms
(sqrt (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))
191.0ms
(sqrt (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1))))
137.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))
97.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (fma (* (/ t l) (/ t l)) 2 1)))

simplify12.6s

Counts
84 → 124
Calls

84 calls. Slowest were:

627.0ms
(exp (* 1/4 (- (+ (* 2 (log (/ 1 t))) (+ (* 2 (log (/ 1 Omc))) (log -1/2))) (+ (* 2 (log (/ 1 Om))) (* 2 (log (/ 1 l)))))))
595.0ms
(exp (* 1/4 (- (+ (* 2 (log (/ 1 t))) (+ (* 2 (log (/ 1 Omc))) (log -1/2))) (+ (* 2 (log (/ 1 Om))) (* 2 (log (/ 1 l)))))))
428.0ms
(exp (* 1/4 (- (+ (* 2 (log (/ -1 t))) (+ (* 2 (log (/ -1 Omc))) (log -1/2))) (+ (* 2 (log (/ -1 l))) (* 2 (log (/ -1 Om)))))))

prune2.6s

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 7.3b

regimes612.0ms

Accuracy

97.8% (0.1b remaining)

Error of 5.8b against oracle of 5.7b and baseline of 10.5b

bsearch6.0ms