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 2.1709653990804656 \cdot 10^{+23}:\\ \;\;\;\;\left(\sqrt{\sqrt{\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right) + 1}}\right)}} \cdot \sqrt{\sqrt{\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right) + 1}}\right)}}\right) \cdot \sqrt{\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right) + 1}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\sqrt{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}}{\frac{\sqrt{2} \cdot t}{\ell}}\right)\\ \end{array}\]

Error

Bits error versus t

Bits error versus l

Bits error versus Om

Bits error versus Omc

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (/ t l) < 2.1709653990804656e+23

    1. Initial program 7.2

      \[\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.2

      \[\leadsto \sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt7.8

      \[\leadsto \color{blue}{\sqrt{\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)} \cdot \sqrt{\sin^{-1} \left(\sqrt{\frac{1 - \frac{Om}{Omc} \cdot \frac{Om}{Omc}}{1 + 2 \cdot \left(\frac{t}{\ell} \cdot \frac{t}{\ell}\right)}}\right)}}\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt7.3

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

    if 2.1709653990804656e+23 < (/ t l)

    1. Initial program 21.4

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

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

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

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

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

Reproduce

herbie shell --seed 2018365 
(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: 57.4s)Debug log

start260.0ms

Algorithm
intervals

setup208.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 12.0b

localize31.0ms

Local error

Found 4 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 91
Calls

4 calls. Slowest were:

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

series166.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

90.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))
51.0ms
(/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l)))))
14.0ms
(* (/ t l) (/ t l))
11.0ms
(asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l)))))))

simplify10.1s

Counts
75 → 103
Calls

75 calls. Slowest were:

910.0ms
(* (* (* (/ t l) (/ t l)) (/ t l)) (* (* (/ t l) (/ t l)) (/ t l)))
587.0ms
(+ (* 1 1) (- (* (* 2 (* (/ t l) (/ t l))) (* 2 (* (/ t l) (/ t l)))) (* 1 (* 2 (* (/ t l) (/ t l))))))
492.0ms
(sqrt (/ 1 (* (cbrt (+ 1 (* 2 (* (/ t l) (/ t l))))) (cbrt (+ 1 (* 2 (* (/ t l) (/ t l))))))))

prune1.8s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 11.9b

localize10.0ms

Local error

Found 4 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 112
Calls

4 calls. Slowest were:

5.0ms
(/ (sqrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (sqrt (+ 1 (* 2 (* (/ t l) (/ t l))))))
3.0ms
(* (/ t l) (/ t l))
1.0ms
(sqrt (+ 1 (* 2 (* (/ t l) (/ t l)))))

series210.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

123.0ms
(/ (sqrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (sqrt (+ 1 (* 2 (* (/ t l) (/ t l))))))
57.0ms
(sqrt (+ 1 (* 2 (* (/ t l) (/ t l)))))
16.0ms
(asin (/ (sqrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (sqrt (+ 1 (* 2 (* (/ t l) (/ t l)))))))
14.0ms
(* (/ t l) (/ t l))

simplify15.2s

Counts
123 → 124
Calls

123 calls. Slowest were:

1.0s
(* (* (* (/ t l) (/ t l)) (/ t l)) (* (* (/ t l) (/ t l)) (/ t l)))
526.0ms
(asin (sqrt (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (+ (* 2 (/ (pow t 2) (pow l 2))) 1))))
487.0ms
(sqrt (+ (* 1 1) (- (* (* 2 (* (/ t l) (/ t l))) (* 2 (* (/ t l) (/ t l)))) (* 1 (* 2 (* (/ t l) (/ t l)))))))

prune2.3s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 7.3b

localize57.0ms

Local error

Found 4 expressions with local error:

18.3b
(cbrt (+ (* (* (/ t l) (/ t l)) 2) 1))
18.3b
(cbrt (+ 1 (* 2 (* (/ t l) (/ t l)))))
2.0b
(sqrt (/ (cbrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (cbrt (+ 1 (* 2 (* (/ t l) (/ t l)))))))
0.5b
(asin (* (fabs (/ (cbrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (cbrt (+ (* (* (/ t l) (/ t l)) 2) 1)))) (sqrt (/ (cbrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (cbrt (+ 1 (* 2 (* (/ t l) (/ t l)))))))))

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
4 → 90
Calls

4 calls. Slowest were:

17.0ms
(cbrt (+ (* (* (/ t l) (/ t l)) 2) 1))
5.0ms
(sqrt (/ (cbrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (cbrt (+ 1 (* 2 (* (/ t l) (/ t l)))))))
1.0ms
(cbrt (+ 1 (* 2 (* (/ t l) (/ t l)))))

series529.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

216.0ms
(sqrt (/ (cbrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (cbrt (+ 1 (* 2 (* (/ t l) (/ t l)))))))
140.0ms
(cbrt (+ 1 (* 2 (* (/ t l) (/ t l)))))
134.0ms
(cbrt (+ (* (* (/ t l) (/ t l)) 2) 1))
39.0ms
(asin (* (fabs (/ (cbrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (cbrt (+ (* (* (/ t l) (/ t l)) 2) 1)))) (sqrt (/ (cbrt (- 1 (* (/ Om Omc) (/ Om Omc)))) (cbrt (+ 1 (* 2 (* (/ t l) (/ t l)))))))))

simplify10.4s

Counts
70 → 102
Calls

70 calls. Slowest were:

830.0ms
(exp (* 1/6 (- (+ (* 2 (log (/ 1 t))) (+ (* 2 (log (/ 1 Omc))) (log -1/2))) (+ (* 2 (log (/ 1 Om))) (* 2 (log (/ 1 l)))))))
473.0ms
(asin (* (pow (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (+ (* 2 (/ (pow t 2) (pow l 2))) 1)) 1/6) (fabs (pow (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (+ (* 2 (/ (pow t 2) (pow l 2))) 1)) 1/3))))
465.0ms
(cbrt (+ (pow (* (* (/ t l) (/ t l)) 2) 3) (pow 1 3)))

prune2.4s

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 7.3b

localize11.0ms

Local error

Found 4 expressions with local error:

10.9b
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))
10.9b
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))
9.0b
(sqrt (asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))))
9.0b
(sqrt (asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))))

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

4.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))
4.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))
3.0ms
(sqrt (asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))))

series285.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

112.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))
111.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))
32.0ms
(sqrt (asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))))
30.0ms
(sqrt (asin (sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ 1 (* 2 (* (/ t l) (/ t l))))))))

simplify10.8s

Counts
56 → 88
Calls

56 calls. Slowest were:

549.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ (pow 1 3) (pow (* 2 (* (/ t l) (/ t l))) 3))))
517.0ms
(sqrt (/ (- 1 (* (/ Om Omc) (/ Om Omc))) (+ (pow 1 3) (pow (* 2 (* (/ t l) (/ t l))) 3))))
485.0ms
(sqrt (asin (sqrt (/ (- 1 (/ (pow Om 2) (pow Omc 2))) (+ (* 2 (/ (pow t 2) (pow l 2))) 1)))))

prune2.0s

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 7.3b

regimes710.0ms

Accuracy

96.6% (0.2b remaining)

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

bsearch11.0ms