Average Error: 32.3 → 8.7
Time: 1.8m
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}\;t \le -5.965711922169134 \cdot 10^{+21} \lor \neg \left(t \le 1.0053774240332047 \cdot 10^{-91}\right):\\ \;\;\;\;\frac{2}{\left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right) \cdot \left(\left(t \cdot \left(\left(t \cdot \sin k\right) \cdot \frac{1}{\ell}\right)\right) \cdot \tan k\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{t} \cdot \frac{2}{\frac{\sin k}{\frac{\cos k}{\sin k}} \cdot \left(\frac{2 \cdot t}{\frac{\ell}{t}} + \frac{k \cdot k}{\ell}\right)}\\ \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 t < -5.965711922169134e+21 or 1.0053774240332047e-91 < t

    1. Initial program 22.8

      \[\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. Using strategy rm
    3. Applied cube-mult22.8

      \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    4. Applied times-frac16.1

      \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{t}{\ell} \cdot \frac{t \cdot t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    5. Applied associate-*l*14.2

      \[\leadsto \frac{2}{\left(\color{blue}{\left(\frac{t}{\ell} \cdot \left(\frac{t \cdot t}{\ell} \cdot \sin k\right)\right)} \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    6. Using strategy rm
    7. Applied associate-/l*8.6

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

      \[\leadsto \frac{2}{\left(\left(\frac{t}{\ell} \cdot \color{blue}{\frac{t \cdot \sin k}{\frac{\ell}{t}}}\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    10. Applied associate-*r/7.4

      \[\leadsto \frac{2}{\left(\color{blue}{\frac{\frac{t}{\ell} \cdot \left(t \cdot \sin k\right)}{\frac{\ell}{t}}} \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    11. Applied associate-*l/4.5

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(\frac{t}{\ell} \cdot \left(t \cdot \sin k\right)\right) \cdot \tan k}{\frac{\ell}{t}}} \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    12. Applied associate-*l/3.9

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(\left(\frac{t}{\ell} \cdot \left(t \cdot \sin k\right)\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}{\frac{\ell}{t}}}}\]
    13. Applied associate-/r/3.7

      \[\leadsto \color{blue}{\frac{2}{\left(\left(\frac{t}{\ell} \cdot \left(t \cdot \sin k\right)\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \cdot \frac{\ell}{t}}\]
    14. Using strategy rm
    15. Applied div-inv3.7

      \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(t \cdot \frac{1}{\ell}\right)} \cdot \left(t \cdot \sin k\right)\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \cdot \frac{\ell}{t}\]
    16. Applied associate-*l*3.6

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

    if -5.965711922169134e+21 < t < 1.0053774240332047e-91

    1. Initial program 51.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. Using strategy rm
    3. Applied cube-mult51.2

      \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    4. Applied times-frac43.7

      \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{t}{\ell} \cdot \frac{t \cdot t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    5. Applied associate-*l*42.4

      \[\leadsto \frac{2}{\left(\color{blue}{\left(\frac{t}{\ell} \cdot \left(\frac{t \cdot t}{\ell} \cdot \sin k\right)\right)} \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    6. Using strategy rm
    7. Applied associate-/l*36.7

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

      \[\leadsto \frac{2}{\left(\left(\frac{t}{\ell} \cdot \color{blue}{\frac{t \cdot \sin k}{\frac{\ell}{t}}}\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    10. Applied associate-*r/37.1

      \[\leadsto \frac{2}{\left(\color{blue}{\frac{\frac{t}{\ell} \cdot \left(t \cdot \sin k\right)}{\frac{\ell}{t}}} \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    11. Applied associate-*l/37.8

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(\frac{t}{\ell} \cdot \left(t \cdot \sin k\right)\right) \cdot \tan k}{\frac{\ell}{t}}} \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\]
    12. Applied associate-*l/34.7

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(\left(\frac{t}{\ell} \cdot \left(t \cdot \sin k\right)\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}{\frac{\ell}{t}}}}\]
    13. Applied associate-/r/34.7

      \[\leadsto \color{blue}{\frac{2}{\left(\left(\frac{t}{\ell} \cdot \left(t \cdot \sin k\right)\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \cdot \frac{\ell}{t}}\]
    14. Taylor expanded around -inf 21.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -5.965711922169134 \cdot 10^{+21} \lor \neg \left(t \le 1.0053774240332047 \cdot 10^{-91}\right):\\ \;\;\;\;\frac{2}{\left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right) \cdot \left(\left(t \cdot \left(\left(t \cdot \sin k\right) \cdot \frac{1}{\ell}\right)\right) \cdot \tan k\right)} \cdot \frac{\ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{t} \cdot \frac{2}{\frac{\sin k}{\frac{\cos k}{\sin k}} \cdot \left(\frac{2 \cdot t}{\frac{\ell}{t}} + \frac{k \cdot k}{\ell}\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019022 
(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.8m)Debug log

sample417.0ms

Algorithm
intervals
Results
176.0ms63×body1280valid
73.0ms204×body80valid
69.0ms46×body640valid
66.0ms35×body320valid
8.0ms11×body160valid

simplify149.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
149.0ms
(/ 2 (* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1)))

prune11.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 32.4b

localize64.0ms

Local error

Found 4 expressions with local error:

17.3b
(/ (pow t 3) (* l l))
12.2b
(* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
4.1b
(* (/ (pow t 3) (* l l)) (sin k))
3.9b
(* (* (/ (pow t 3) (* l l)) (sin k)) (tan k))

rewrite96.0ms

Algorithm
rewrite-expression-head
Rules
44×add-exp-log
34×add-cbrt-cube
22×prod-exp
20×pow1
16×cbrt-unprod
16×associate-*l/
11×add-cube-cbrt
11×associate-*l*
11×*-un-lft-identity
11×add-sqr-sqrt
10×pow-prod-down
10×times-frac
10×frac-times
associate-*r*
tan-quot
div-exp
associate-*r/
associate-/l*
add-log-exp
flip-+
flip3-+
cbrt-undiv
pow-to-exp
*-commutative
unpow3
cube-mult
div-inv
distribute-lft-in
frac-2neg
associate-/r*
clear-num
distribute-rgt-in
Counts
4 → 112
Calls
4 calls:
Slowest
53.0ms
(* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
23.0ms
(* (* (/ (pow t 3) (* l l)) (sin k)) (tan k))
14.0ms
(* (/ (pow t 3) (* l l)) (sin k))
3.0ms
(/ (pow t 3) (* l l))

series631.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
394.0ms
(* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
143.0ms
(* (* (/ (pow t 3) (* l l)) (sin k)) (tan k))
67.0ms
(* (/ (pow t 3) (* l l)) (sin k))
27.0ms
(/ (pow t 3) (* l l))

simplify15.1s

Counts
98 → 124
Calls
98 calls:
Slowest
943.0ms
(* (* (* (/ (* (* (pow t 3) (pow t 3)) (pow t 3)) (* (* (* l l) (* l l)) (* l l))) (* (* (sin k) (sin k)) (sin k))) (* (* (tan k) (tan k)) (tan k))) (* (* (+ (+ 1 (pow (/ k t) 2)) 1) (+ (+ 1 (pow (/ k t) 2)) 1)) (+ (+ 1 (pow (/ k t) 2)) 1)))
702.0ms
(* (* l l) (+ (* (+ 1 (pow (/ k t) 2)) (+ 1 (pow (/ k t) 2))) (- (* 1 1) (* (+ 1 (pow (/ k t) 2)) 1))))
664.0ms
(* (* (* (pow t 3) (sin k)) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
637.0ms
(* (* l l) (- (+ 1 (pow (/ k t) 2)) 1))
611.0ms
(- (+ 1 (pow (/ k t) 2)) 1)

prune2.1s

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 14.8b

localize33.0ms

Local error

Found 4 expressions with local error:

12.2b
(* (* (* (/ t l) (* (/ (* t t) l) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
7.2b
(/ (* t t) l)
6.8b
(* (/ (* t t) l) (sin k))
3.9b
(* (* (/ t l) (* (/ (* t t) l) (sin k))) (tan k))

rewrite135.0ms

Algorithm
rewrite-expression-head
Rules
44×associate-*l/
34×frac-times
29×add-exp-log
29×add-cbrt-cube
29×pow1
17×cbrt-unprod
17×prod-exp
17×pow-prod-down
16×tan-quot
14×associate-*r/
associate-*r*
flip-+
add-cube-cbrt
flip3-+
*-un-lft-identity
add-sqr-sqrt
associate-*l*
add-log-exp
*-commutative
div-inv
associate-/l*
distribute-lft-in
frac-2neg
clear-num
distribute-rgt-in
Counts
4 → 107
Calls
4 calls:
Slowest
79.0ms
(* (* (* (/ t l) (* (/ (* t t) l) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
41.0ms
(* (* (/ t l) (* (/ (* t t) l) (sin k))) (tan k))
8.0ms
(* (/ (* t t) l) (sin k))
4.0ms
(/ (* t t) l)

series600.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
333.0ms
(* (* (* (/ t l) (* (/ (* t t) l) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
175.0ms
(* (* (/ t l) (* (/ (* t t) l) (sin k))) (tan k))
76.0ms
(* (/ (* t t) l) (sin k))
16.0ms
(/ (* t t) l)

simplify20.6s

Counts
100 → 119
Calls
100 calls:
Slowest
967.0ms
(* (* l (cos k)) (+ (* (+ 1 (pow (/ k t) 2)) (+ 1 (pow (/ k t) 2))) (- (* 1 1) (* (+ 1 (pow (/ k t) 2)) 1))))
659.0ms
(- (+ 1 (pow (/ k t) 2)) 1)
649.0ms
(* (* l l) (- (+ 1 (pow (/ k t) 2)) 1))
622.0ms
(* (* l l) (+ (* (+ 1 (pow (/ k t) 2)) (+ 1 (pow (/ k t) 2))) (- (* 1 1) (* (+ 1 (pow (/ k t) 2)) 1))))
593.0ms
(* (* (* (/ t l) (* (* t t) (sin k))) (tan k)) (- (* (+ 1 (pow (/ k t) 2)) (+ 1 (pow (/ k t) 2))) (* 1 1)))

prune2.0s

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 8.5b

localize20.0ms

Local error

Found 4 expressions with local error:

12.2b
(* (* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
6.8b
(* (/ t (/ l t)) (sin k))
3.9b
(* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k))
0.2b
(/ 2 (* (* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1)))

rewrite153.0ms

Algorithm
rewrite-expression-head
Rules
78×associate-*l/
63×frac-times
29×add-exp-log
29×add-cbrt-cube
29×pow1
28×tan-quot
25×associate-*r/
24×associate-/r/
17×cbrt-unprod
17×prod-exp
17×pow-prod-down
16×flip-+
16×flip3-+
associate-*r*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
associate-*l*
add-log-exp
*-commutative
div-inv
distribute-lft-in
frac-2neg
associate-/r*
clear-num
distribute-rgt-in
Counts
4 → 131
Calls
4 calls:
Slowest
94.0ms
(* (* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
36.0ms
(* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k))
14.0ms
(/ 2 (* (* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1)))
7.0ms
(* (/ t (/ l t)) (sin k))

series842.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
378.0ms
(* (* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
205.0ms
(/ 2 (* (* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1)))
174.0ms
(* (* (/ t l) (* (/ t (/ l t)) (sin k))) (tan k))
85.0ms
(* (/ t (/ l t)) (sin k))

simplify27.2s

Counts
123 → 143
Calls
123 calls:
Slowest
792.0ms
(* (* (/ l t) (cos k)) (- (+ 1 (pow (/ k t) 2)) 1))
773.0ms
(/ (* (pow t 3) (pow (sin k) 2)) (* (pow l 2) (cos k)))
691.0ms
(* (/ l t) (+ (* (+ 1 (pow (/ k t) 2)) (+ 1 (pow (/ k t) 2))) (- (* 1 1) (* (+ 1 (pow (/ k t) 2)) 1))))
678.0ms
(* (/ l t) (- (+ 1 (pow (/ k t) 2)) 1))
670.0ms
(- (+ 1 (pow (/ k t) 2)) 1)

prune2.2s

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 5.7b

localize16.0ms

Local error

Found 4 expressions with local error:

11.0b
(* (* (* (/ t l) (* t (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
4.6b
(* (/ 2 (* (* (* (/ t l) (* t (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))) (/ l t))
2.3b
(* (* (/ t l) (* t (sin k))) (tan k))
2.3b
(* (/ t l) (* t (sin k)))

rewrite119.0ms

Algorithm
rewrite-expression-head
Rules
29×associate-*l/
22×add-exp-log
22×add-cbrt-cube
22×pow1
21×associate-*l*
20×frac-times
14×tan-quot
12×associate-*r/
11×cbrt-unprod
11×associate-/r/
11×prod-exp
11×pow-prod-down
11×associate-*r*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
flip-+
flip3-+
add-log-exp
*-commutative
div-inv
distribute-lft-in
distribute-rgt-in
Counts
4 → 105
Calls
4 calls:
Slowest
66.0ms
(* (* (* (/ t l) (* t (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
25.0ms
(* (/ 2 (* (* (* (/ t l) (* t (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))) (/ l t))
15.0ms
(* (* (/ t l) (* t (sin k))) (tan k))
10.0ms
(* (/ t l) (* t (sin k)))

series872.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
366.0ms
(* (* (* (/ t l) (* t (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))
237.0ms
(* (/ 2 (* (* (* (/ t l) (* t (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))) (/ l t))
175.0ms
(* (* (/ t l) (* t (sin k))) (tan k))
93.0ms
(* (/ t l) (* t (sin k)))

simplify15.5s

Counts
88 → 117
Calls
88 calls:
Slowest
662.0ms
(* (cos k) (+ (* (+ 1 (pow (/ k t) 2)) (+ 1 (pow (/ k t) 2))) (- (* 1 1) (* (+ 1 (pow (/ k t) 2)) 1))))
601.0ms
(- (+ 1 (pow (/ k t) 2)) 1)
594.0ms
(* (* (* t (* t (sin k))) (sin k)) (+ (+ 1 (pow (/ k t) 2)) 1))
593.0ms
(* (* l (cos k)) (+ (* (+ 1 (pow (/ k t) 2)) (+ 1 (pow (/ k t) 2))) (- (* 1 1) (* (+ 1 (pow (/ k t) 2)) 1))))
583.0ms
(* (* (* t (* t (sin k))) (tan k)) (+ (+ 1 (pow (/ k t) 2)) 1))

prune1.8s

Pruning

16 alts after pruning (16 fresh and 0 done)

Merged error: 4.1b

regimes468.0ms

Accuracy

68% (2.5b remaining)

Error of 8.7b against oracle of 6.2b and baseline of 14.0b

bsearch1.0s

end0.0ms

sample15.3s

Algorithm
intervals
Results
6.3s2022×body1280valid
3.6s1755×body640valid
3.0s5954×body80valid
1.8s852×body320valid
358.0ms394×body160valid