Average Error: 10.8 → 6.0
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 1.3887045418649217 \cdot 10^{+143}:\\ \;\;\;\;\sin^{-1} \left(\sqrt{\frac{1 - {\left(\frac{Om}{Omc}\right)}^{2}}{2 \cdot {\left(\frac{t}{\ell}\right)}^{2} + 1}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin^{-1} \left(\frac{\sqrt{1 - {\left(\frac{Om}{Omc}\right)}^{2}}}{\frac{t \cdot \sqrt{2}}{\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) < 1.3887045418649217e+143

    1. Initial program 6.8

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

    if 1.3887045418649217e+143 < (/ t l)

    1. Initial program 33.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-div33.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. Taylor expanded around -inf 1.9

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

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

Reproduce

herbie shell --seed 2019004 +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: 1.0m)Debug log

sample188.0ms

Algorithm
intervals

simplify259.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

259.0ms
(asin (sqrt (/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2))))))

prune19.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 12.2b

localize35.0ms

Local error

Found 4 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 89
Calls

4 calls. Slowest were:

6.0ms
(/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2))))
4.0ms
(sqrt (/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2)))))
1.0ms
(pow (/ t l) 2)

series199.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

96.0ms
(sqrt (/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2)))))
76.0ms
(/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2))))
18.0ms
(asin (sqrt (/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2))))))
9.0ms
(pow (/ t l) 2)

simplify6.0s

Counts
66 → 101
Calls

66 calls. Slowest were:

397.0ms
(- (* 1 1) (* (pow (/ Om Omc) 2) (pow (/ Om Omc) 2)))
381.0ms
(- (pow 1 3) (pow (pow (/ Om Omc) 2) 3))
241.0ms
(sqrt (* (cbrt (/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2))))) (cbrt (/ (- 1 (pow (/ Om Omc) 2)) (+ 1 (* 2 (pow (/ t l) 2)))))))

prune1.6s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 12.2b

localize11.0ms

Local error

Found 4 expressions with local error:

11.5b
(sqrt (+ 1 (* 2 (pow (/ t l) 2))))
0.5b
(asin (/ (sqrt (- 1 (pow (/ Om Omc) 2))) (sqrt (+ 1 (* 2 (pow (/ t l) 2))))))
0.3b
(/ (sqrt (- 1 (pow (/ Om Omc) 2))) (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))
0.2b
(pow (/ t l) 2)

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 110
Calls

4 calls. Slowest were:

7.0ms
(/ (sqrt (- 1 (pow (/ Om Omc) 2))) (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))
1.0ms
(pow (/ t l) 2)
1.0ms
(sqrt (+ 1 (* 2 (pow (/ t l) 2))))

series151.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

85.0ms
(/ (sqrt (- 1 (pow (/ Om Omc) 2))) (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))
45.0ms
(sqrt (+ 1 (* 2 (pow (/ t l) 2))))
11.0ms
(asin (/ (sqrt (- 1 (pow (/ Om Omc) 2))) (sqrt (+ 1 (* 2 (pow (/ t l) 2))))))
10.0ms
(pow (/ t l) 2)

simplify8.2s

Counts
114 → 122
Calls

114 calls. Slowest were:

310.0ms
(sqrt (- (* 1 1) (* (pow (/ Om Omc) 2) (pow (/ Om Omc) 2))))
234.0ms
(sqrt (- (pow 1 3) (pow (pow (/ Om Omc) 2) 3)))
165.0ms
(/ (* (* (sqrt (- 1 (pow (/ Om Omc) 2))) (sqrt (- 1 (pow (/ Om Omc) 2)))) (sqrt (- 1 (pow (/ Om Omc) 2)))) (* (* (sqrt (+ 1 (* 2 (pow (/ t l) 2)))) (sqrt (+ 1 (* 2 (pow (/ t l) 2))))) (sqrt (+ 1 (* 2 (pow (/ t l) 2))))))

prune1.7s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 7.1b

localize13.0ms

Local error

Found 4 expressions with local error:

11.5b
(sqrt (+ 1 (* 2 (pow (/ t l) 2))))
11.5b
(sqrt (+ 1 (* 2 (pow (/ t l) 2))))
4.9b
(sqrt (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))
4.9b
(sqrt (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
4 → 72
Calls

4 calls. Slowest were:

1.0ms
(sqrt (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))
1.0ms
(sqrt (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))
1.0ms
(sqrt (+ 1 (* 2 (pow (/ t l) 2))))

series269.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

103.0ms
(sqrt (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))
102.0ms
(sqrt (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))
33.0ms
(sqrt (+ 1 (* 2 (pow (/ t l) 2))))
30.0ms
(sqrt (+ 1 (* 2 (pow (/ t l) 2))))

simplify2.9s

Counts
44 → 84
Calls

44 calls. Slowest were:

299.0ms
(exp (* 1/4 (- (+ (log 2) (* 2 (log (/ -1 l)))) (* 2 (log (/ -1 t))))))
252.0ms
(exp (* 1/4 (- (+ (log 2) (* 2 (log (/ -1 l)))) (* 2 (log (/ -1 t))))))
179.0ms
(exp (* 1/4 (- (+ (log 2) (* 2 (log (/ 1 l)))) (* 2 (log (/ 1 t))))))

prune1.6s

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 7.1b

localize25.0ms

Local error

Found 4 expressions with local error:

14.8b
(cbrt (+ 1 (* 2 (pow (/ t l) 2))))
14.8b
(cbrt (+ 1 (* 2 (pow (/ t l) 2))))
14.8b
(cbrt (+ 1 (* 2 (pow (/ t l) 2))))
11.1b
(sqrt (/ (/ (- 1 (pow (/ Om Omc) 2)) (* (cbrt (+ 1 (* 2 (pow (/ t l) 2)))) (cbrt (+ 1 (* 2 (pow (/ t l) 2)))))) (cbrt (+ 1 (* 2 (pow (/ t l) 2))))))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 157
Calls

4 calls. Slowest were:

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

series528.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

155.0ms
(cbrt (+ 1 (* 2 (pow (/ t l) 2))))
142.0ms
(sqrt (/ (/ (- 1 (pow (/ Om Omc) 2)) (* (cbrt (+ 1 (* 2 (pow (/ t l) 2)))) (cbrt (+ 1 (* 2 (pow (/ t l) 2)))))) (cbrt (+ 1 (* 2 (pow (/ t l) 2))))))
119.0ms
(cbrt (+ 1 (* 2 (pow (/ t l) 2))))
112.0ms
(cbrt (+ 1 (* 2 (pow (/ t l) 2))))

simplify27.7s

Counts
129 → 169
Calls

129 calls. Slowest were:

737.0ms
(/ (sqrt (/ (- 1 (pow (/ Om Omc) 2)) (* (cbrt (+ 1 (* 2 (pow (/ t l) 2)))) (cbrt (+ 1 (* 2 (pow (/ t l) 2))))))) (cbrt (sqrt (+ 1 (* 2 (pow (/ t l) 2))))))
477.0ms
(sqrt (/ (/ (- 1 (pow (/ Om Omc) 2)) (* (cbrt (+ (pow 1 3) (pow (* 2 (pow (/ t l) 2)) 3))) (cbrt (- (* 1 1) (* (* 2 (pow (/ t l) 2)) (* 2 (pow (/ t l) 2))))))) (cbrt (* (cbrt (+ 1 (* 2 (pow (/ t l) 2)))) (cbrt (+ 1 (* 2 (pow (/ t l) 2))))))))
449.0ms
(sqrt (/ (/ (- 1 (pow (/ Om Omc) 2)) (* (cbrt (+ (pow 1 3) (pow (* 2 (pow (/ t l) 2)) 3))) (cbrt (- (* 1 1) (* (* 2 (pow (/ t l) 2)) (* 2 (pow (/ t l) 2))))))) (cbrt (sqrt (+ 1 (* 2 (pow (/ t l) 2)))))))

prune3.8s

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 7.1b

regimes1.7s

Accuracy

98.7% (0.1b remaining)

Error of 6.0b against oracle of 6.0b and baseline of 10.8b

bsearch5.0ms

end0.0ms

sample5.9s

Algorithm
intervals