Average Error: 46.8 → 18.7
Time: 1.5m
Precision: 64
Internal Precision: 128
\[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}\]
\[\begin{array}{l} \mathbf{if}\;\ell \le -7.250906796774142 \cdot 10^{-162} \lor \neg \left(\ell \le 8.585813453833051 \cdot 10^{-192}\right):\\ \;\;\;\;\frac{2}{\frac{k \cdot \left(t \cdot k\right)}{\frac{\cos k \cdot {\ell}^{2}}{{\left(\sin k\right)}^{2}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\sqrt[3]{{\left(\left(\frac{\sin k}{\ell} \cdot \frac{\sin k}{\ell}\right) \cdot \frac{t}{\frac{\cos k}{k \cdot k}}\right)}^{3}}}\\ \end{array}\]

Error

Bits error versus t

Bits error versus l

Bits error versus k

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if l < -7.250906796774142e-162 or 8.585813453833051e-192 < l

    1. Initial program 47.2

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}\]
    2. Taylor expanded around inf 24.6

      \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)}{{\ell}^{2} \cdot \cos k}}}\]
    3. Using strategy rm
    4. Applied associate-*r*23.2

      \[\leadsto \frac{2}{\frac{\color{blue}{\left(t \cdot {k}^{2}\right) \cdot {\left(\sin k\right)}^{2}}}{{\ell}^{2} \cdot \cos k}}\]
    5. Using strategy rm
    6. Applied unpow223.2

      \[\leadsto \frac{2}{\frac{\left(t \cdot \color{blue}{\left(k \cdot k\right)}\right) \cdot {\left(\sin k\right)}^{2}}{{\ell}^{2} \cdot \cos k}}\]
    7. Applied associate-*r*20.4

      \[\leadsto \frac{2}{\frac{\color{blue}{\left(\left(t \cdot k\right) \cdot k\right)} \cdot {\left(\sin k\right)}^{2}}{{\ell}^{2} \cdot \cos k}}\]
    8. Using strategy rm
    9. Applied associate-/l*19.2

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot k\right) \cdot k}{\frac{{\ell}^{2} \cdot \cos k}{{\left(\sin k\right)}^{2}}}}}\]

    if -7.250906796774142e-162 < l < 8.585813453833051e-192

    1. Initial program 46.0

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}\]
    2. Taylor expanded around inf 20.9

      \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)}{{\ell}^{2} \cdot \cos k}}}\]
    3. Using strategy rm
    4. Applied add-cbrt-cube20.9

      \[\leadsto \frac{2}{\frac{t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)}{\color{blue}{\sqrt[3]{\left(\left({\ell}^{2} \cdot \cos k\right) \cdot \left({\ell}^{2} \cdot \cos k\right)\right) \cdot \left({\ell}^{2} \cdot \cos k\right)}}}}\]
    5. Applied add-cbrt-cube23.0

      \[\leadsto \frac{2}{\frac{\color{blue}{\sqrt[3]{\left(\left(t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)\right) \cdot \left(t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)\right)\right) \cdot \left(t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)\right)}}}{\sqrt[3]{\left(\left({\ell}^{2} \cdot \cos k\right) \cdot \left({\ell}^{2} \cdot \cos k\right)\right) \cdot \left({\ell}^{2} \cdot \cos k\right)}}}\]
    6. Applied cbrt-undiv23.0

      \[\leadsto \frac{2}{\color{blue}{\sqrt[3]{\frac{\left(\left(t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)\right) \cdot \left(t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)\right)\right) \cdot \left(t \cdot \left({k}^{2} \cdot {\left(\sin k\right)}^{2}\right)\right)}{\left(\left({\ell}^{2} \cdot \cos k\right) \cdot \left({\ell}^{2} \cdot \cos k\right)\right) \cdot \left({\ell}^{2} \cdot \cos k\right)}}}}\]
    7. Simplified17.4

      \[\leadsto \frac{2}{\sqrt[3]{\color{blue}{{\left(\frac{t}{\frac{\cos k}{k \cdot k}} \cdot \left(\frac{\sin k}{\ell} \cdot \frac{\sin k}{\ell}\right)\right)}^{3}}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification18.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \le -7.250906796774142 \cdot 10^{-162} \lor \neg \left(\ell \le 8.585813453833051 \cdot 10^{-192}\right):\\ \;\;\;\;\frac{2}{\frac{k \cdot \left(t \cdot k\right)}{\frac{\cos k \cdot {\ell}^{2}}{{\left(\sin k\right)}^{2}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\sqrt[3]{{\left(\left(\frac{\sin k}{\ell} \cdot \frac{\sin k}{\ell}\right) \cdot \frac{t}{\frac{\cos k}{k \cdot k}}\right)}^{3}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019005 +o rules:numerics
(FPCore (t l k)
  :name "Toniolo and Linder, Equation (10-)"
  (/ 2 (* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1))))

Details

Time bar (total: 1.5m)Debug log

sample1.3s

Algorithm
intervals

simplify121.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

121.0ms
(/ 2 (* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1)))

prune17.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 46.1b

localize76.0ms

Local error

Found 4 expressions with local error:

31.5b
(* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1))
13.4b
(/ (pow t 3) (* l l))
1.8b
(- (+ 1 (pow (/ k t) 2)) 1)
1.6b
(* (* (/ (pow t 3) (* l l)) (sin k)) (tan k))

rewrite132.0ms

Algorithm
rewrite-expression-head
Counts
4 → 115
Calls

4 calls. Slowest were:

83.0ms
(* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1))
24.0ms
(* (* (/ (pow t 3) (* l l)) (sin k)) (tan k))
16.0ms
(- (+ 1 (pow (/ k t) 2)) 1)

series626.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

428.0ms
(* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1))
148.0ms
(* (* (/ (pow t 3) (* l l)) (sin k)) (tan k))
27.0ms
(/ (pow t 3) (* l l))
23.0ms
(- (+ 1 (pow (/ k t) 2)) 1)

simplify18.3s

Counts
89 → 127
Calls

89 calls. Slowest were:

1.3s
(* (* (* (pow t 3) (sin k)) (sin k)) (- (+ 1 (pow (/ k t) 2)) 1))
1.1s
(cbrt (- (+ 1 (pow (/ k t) 2)) 1))
894.0ms
(sqrt (- (+ 1 (pow (/ k t) 2)) 1))

prune2.3s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 15.9b

localize27.0ms

Local error

Found 4 expressions with local error:

17.8b
(/ (* t (* (pow k 2) (pow (sin k) 2))) (* (pow l 2) (cos k)))
8.2b
(* t (* (pow k 2) (pow (sin k) 2)))
0.4b
(pow (sin k) 2)
0.2b
(* (pow l 2) (cos k))

rewrite34.0ms

Algorithm
rewrite-expression-head
Counts
4 → 67
Calls

4 calls. Slowest were:

15.0ms
(* t (* (pow k 2) (pow (sin k) 2)))
9.0ms
(/ (* t (* (pow k 2) (pow (sin k) 2))) (* (pow l 2) (cos k)))
7.0ms
(* (pow l 2) (cos k))

series346.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

188.0ms
(/ (* t (* (pow k 2) (pow (sin k) 2))) (* (pow l 2) (cos k)))
75.0ms
(* t (* (pow k 2) (pow (sin k) 2)))
58.0ms
(* (pow l 2) (cos k))
25.0ms
(pow (sin k) 2)

simplify4.3s

Counts
34 → 79
Calls

34 calls. Slowest were:

537.0ms
(/ (* (* (* t (* (pow k 2) (pow (sin k) 2))) (* t (* (pow k 2) (pow (sin k) 2)))) (* t (* (pow k 2) (pow (sin k) 2)))) (* (* (* (pow l 2) (pow l 2)) (pow l 2)) (* (* (cos k) (cos k)) (cos k))))
520.0ms
(/ (* t (* (pow k 2) (pow (sin k) 2))) (* (pow l 2) (cos k)))
493.0ms
(- (log (* t (* (pow k 2) (pow (sin k) 2)))) (log (* (pow l 2) (cos k))))

prune1.2s

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 12.0b

localize20.0ms

Local error

Found 4 expressions with local error:

17.8b
(/ (* (* t (pow k 2)) (pow (sin k) 2)) (* (pow l 2) (cos k)))
7.6b
(* t (pow k 2))
0.6b
(* (* t (pow k 2)) (pow (sin k) 2))
0.4b
(pow (sin k) 2)

rewrite38.0ms

Algorithm
rewrite-expression-head
Counts
4 → 83
Calls

4 calls. Slowest were:

20.0ms
(/ (* (* t (pow k 2)) (pow (sin k) 2)) (* (pow l 2) (cos k)))
12.0ms
(* (* t (pow k 2)) (pow (sin k) 2))
2.0ms
(* t (pow k 2))

series401.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

252.0ms
(/ (* (* t (pow k 2)) (pow (sin k) 2)) (* (pow l 2) (cos k)))
99.0ms
(* (* t (pow k 2)) (pow (sin k) 2))
27.0ms
(* t (pow k 2))
23.0ms
(pow (sin k) 2)

simplify6.5s

Counts
51 → 95
Calls

51 calls. Slowest were:

832.0ms
(/ (* (* (* (* t (pow k 2)) (pow (sin k) 2)) (* (* t (pow k 2)) (pow (sin k) 2))) (* (* t (pow k 2)) (pow (sin k) 2))) (* (* (* (pow l 2) (cos k)) (* (pow l 2) (cos k))) (* (pow l 2) (cos k))))
679.0ms
(* (* (* (* t (pow k 2)) (* t (pow k 2))) (* t (pow k 2))) (* (* (pow (sin k) 2) (pow (sin k) 2)) (pow (sin k) 2)))
576.0ms
(/ (* (* (* (* t (pow k 2)) (* t (pow k 2))) (* t (pow k 2))) (* (* (pow (sin k) 2) (pow (sin k) 2)) (pow (sin k) 2))) (* (* (* (pow l 2) (pow l 2)) (pow l 2)) (* (* (cos k) (cos k)) (cos k))))

prune1.3s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 10.0b

localize28.0ms

Local error

Found 4 expressions with local error:

17.8b
(/ (* (* (* t k) k) (pow (sin k) 2)) (* (pow l 2) (cos k)))
0.6b
(* (* (* t k) k) (pow (sin k) 2))
0.4b
(pow (sin k) 2)
0.2b
(* (pow l 2) (cos k))

rewrite45.0ms

Algorithm
rewrite-expression-head
Counts
4 → 89
Calls

4 calls. Slowest were:

23.0ms
(/ (* (* (* t k) k) (pow (sin k) 2)) (* (pow l 2) (cos k)))
15.0ms
(* (* (* t k) k) (pow (sin k) 2))
3.0ms
(* (pow l 2) (cos k))

series377.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

230.0ms
(/ (* (* (* t k) k) (pow (sin k) 2)) (* (pow l 2) (cos k)))
79.0ms
(* (* (* t k) k) (pow (sin k) 2))
43.0ms
(* (pow l 2) (cos k))
25.0ms
(pow (sin k) 2)

simplify7.0s

Counts
57 → 101
Calls

57 calls. Slowest were:

550.0ms
(/ (* t (* (pow k 2) (pow (sin k) 2))) (* (pow l 2) (cos k)))
543.0ms
(/ (* (* (* (* (* t k) k) (* (* t k) k)) (* (* t k) k)) (* (* (pow (sin k) 2) (pow (sin k) 2)) (pow (sin k) 2))) (* (* (* (pow l 2) (pow l 2)) (pow l 2)) (* (* (cos k) (cos k)) (cos k))))
530.0ms
(/ (* (* (* (* (* t k) k) (* (* t k) k)) (* (* t k) k)) (* (* (pow (sin k) 2) (pow (sin k) 2)) (pow (sin k) 2))) (* (* (* (pow l 2) (cos k)) (* (pow l 2) (cos k))) (* (pow l 2) (cos k))))

prune1.5s

Pruning

18 alts after pruning (18 fresh and 0 done)

Merged error: 10.0b

regimes646.0ms

Accuracy

10.7% (6.2b remaining)

Error of 18.7b against oracle of 12.5b and baseline of 19.5b

bsearch1.3s

end0.0ms

sample41.5s

Algorithm
intervals