Average Error: 8.7 → 6.8
Time: 40.4s
Precision: 64
Internal Precision: 128
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
\[\begin{array}{l} \mathbf{if}\;F \le 8.515036906183745 \cdot 10^{-276}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{1}{\left(\sqrt[3]{\cos \left(\pi \cdot \ell\right) \cdot {F}^{2}} \cdot \sqrt[3]{\frac{1}{\sin \left(\pi \cdot \ell\right)}}\right) \cdot \sqrt[3]{\frac{\cos \left(\pi \cdot \ell\right) \cdot {F}^{2}}{\sin \left(\pi \cdot \ell\right)}}}}{\sqrt[3]{\frac{\cos \left(\pi \cdot \ell\right) \cdot {F}^{2}}{\sin \left(\pi \cdot \ell\right)}}}\\ \mathbf{elif}\;F \le 7.409720906535869 \cdot 10^{-155}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{e^{(\left(\log F\right) \cdot 2 + \left(\log \left(\cos \left(\pi \cdot \ell\right)\right)\right))_* - \log \left(\sin \left(\pi \cdot \ell\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{1}{\cos \left(\pi \cdot \ell\right) \cdot {F}^{2}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)}}\\ \end{array}\]

Error

Bits error versus F

Bits error versus l

Derivation

  1. Split input into 3 regimes
  2. if F < 8.515036906183745e-276

    1. Initial program 9.2

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Simplified9.2

      \[\leadsto \color{blue}{(\left(\tan \left(\pi \cdot \ell\right)\right) \cdot \left(\frac{-1}{F \cdot F}\right) + \left(\pi \cdot \ell\right))_*}\]
    3. Taylor expanded around -inf 8.8

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\sin \left(\pi \cdot \ell\right)}{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}}\]
    4. Using strategy rm
    5. Applied clear-num8.8

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}}\]
    6. Using strategy rm
    7. Applied add-cube-cbrt9.0

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\left(\sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}} \cdot \sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}\right) \cdot \sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}}}\]
    8. Applied associate-/r*9.0

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{1}{\sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}} \cdot \sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}}}{\sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}}}\]
    9. Using strategy rm
    10. Applied div-inv9.0

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}} \cdot \sqrt[3]{\color{blue}{\left({F}^{2} \cdot \cos \left(\pi \cdot \ell\right)\right) \cdot \frac{1}{\sin \left(\pi \cdot \ell\right)}}}}}{\sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}}\]
    11. Applied cbrt-prod9.0

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}} \cdot \color{blue}{\left(\sqrt[3]{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)} \cdot \sqrt[3]{\frac{1}{\sin \left(\pi \cdot \ell\right)}}\right)}}}{\sqrt[3]{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}}\]

    if 8.515036906183745e-276 < F < 7.409720906535869e-155

    1. Initial program 60.0

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Simplified60.0

      \[\leadsto \color{blue}{(\left(\tan \left(\pi \cdot \ell\right)\right) \cdot \left(\frac{-1}{F \cdot F}\right) + \left(\pi \cdot \ell\right))_*}\]
    3. Taylor expanded around -inf 55.9

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\sin \left(\pi \cdot \ell\right)}{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}}\]
    4. Using strategy rm
    5. Applied clear-num55.9

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}}\]
    6. Using strategy rm
    7. Applied add-exp-log57.6

      \[\leadsto \pi \cdot \ell - \frac{1}{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\color{blue}{e^{\log \left(\sin \left(\pi \cdot \ell\right)\right)}}}}\]
    8. Applied add-exp-log57.6

      \[\leadsto \pi \cdot \ell - \frac{1}{\frac{{F}^{2} \cdot \color{blue}{e^{\log \left(\cos \left(\pi \cdot \ell\right)\right)}}}{e^{\log \left(\sin \left(\pi \cdot \ell\right)\right)}}}\]
    9. Applied pow-to-exp57.6

      \[\leadsto \pi \cdot \ell - \frac{1}{\frac{\color{blue}{e^{\log F \cdot 2}} \cdot e^{\log \left(\cos \left(\pi \cdot \ell\right)\right)}}{e^{\log \left(\sin \left(\pi \cdot \ell\right)\right)}}}\]
    10. Applied prod-exp57.6

      \[\leadsto \pi \cdot \ell - \frac{1}{\frac{\color{blue}{e^{\log F \cdot 2 + \log \left(\cos \left(\pi \cdot \ell\right)\right)}}}{e^{\log \left(\sin \left(\pi \cdot \ell\right)\right)}}}\]
    11. Applied div-exp31.6

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{e^{\left(\log F \cdot 2 + \log \left(\cos \left(\pi \cdot \ell\right)\right)\right) - \log \left(\sin \left(\pi \cdot \ell\right)\right)}}}\]
    12. Simplified31.6

      \[\leadsto \pi \cdot \ell - \frac{1}{e^{\color{blue}{(\left(\log F\right) \cdot 2 + \left(\log \left(\cos \left(\pi \cdot \ell\right)\right)\right))_* - \log \left(\sin \left(\pi \cdot \ell\right)\right)}}}\]

    if 7.409720906535869e-155 < F

    1. Initial program 0.7

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
    2. Simplified0.7

      \[\leadsto \color{blue}{(\left(\tan \left(\pi \cdot \ell\right)\right) \cdot \left(\frac{-1}{F \cdot F}\right) + \left(\pi \cdot \ell\right))_*}\]
    3. Taylor expanded around -inf 0.7

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\sin \left(\pi \cdot \ell\right)}{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}}\]
    4. Using strategy rm
    5. Applied clear-num0.7

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}{\sin \left(\pi \cdot \ell\right)}}}\]
    6. Using strategy rm
    7. Applied div-inv0.7

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\left({F}^{2} \cdot \cos \left(\pi \cdot \ell\right)\right) \cdot \frac{1}{\sin \left(\pi \cdot \ell\right)}}}\]
    8. Applied associate-/r*0.7

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{1}{{F}^{2} \cdot \cos \left(\pi \cdot \ell\right)}}{\frac{1}{\sin \left(\pi \cdot \ell\right)}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le 8.515036906183745 \cdot 10^{-276}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{1}{\left(\sqrt[3]{\cos \left(\pi \cdot \ell\right) \cdot {F}^{2}} \cdot \sqrt[3]{\frac{1}{\sin \left(\pi \cdot \ell\right)}}\right) \cdot \sqrt[3]{\frac{\cos \left(\pi \cdot \ell\right) \cdot {F}^{2}}{\sin \left(\pi \cdot \ell\right)}}}}{\sqrt[3]{\frac{\cos \left(\pi \cdot \ell\right) \cdot {F}^{2}}{\sin \left(\pi \cdot \ell\right)}}}\\ \mathbf{elif}\;F \le 7.409720906535869 \cdot 10^{-155}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{e^{(\left(\log F\right) \cdot 2 + \left(\log \left(\cos \left(\pi \cdot \ell\right)\right)\right))_* - \log \left(\sin \left(\pi \cdot \ell\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{1}{\cos \left(\pi \cdot \ell\right) \cdot {F}^{2}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (F l)
  :name "VandenBroeck and Keller, Equation (6)"
  (- (* PI l) (* (/ 1 (* F F)) (tan (* PI l)))))

Details

Time bar (total: 39.0s)Debug log

sample551.0ms

Algorithm
intervals

simplify266.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

265.0ms
(- (* PI l) (* (/ 1 (* F F)) (tan (* PI l))))

prune17.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 8.4b

localize17.0ms

Local error

Found 4 expressions with local error:

8.0b
(fma (tan (* PI l)) (/ -1 (* F F)) (* PI l))
2.7b
(tan (* PI l))
0.6b
(/ -1 (* F F))
0.3b
(* PI l)

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
4 → 43
Calls

4 calls. Slowest were:

2.0ms
(tan (* PI l))
1.0ms
(fma (tan (* PI l)) (/ -1 (* F F)) (* PI l))
0.0ms
(/ -1 (* F F))

series212.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

115.0ms
(fma (tan (* PI l)) (/ -1 (* F F)) (* PI l))
46.0ms
(tan (* PI l))
30.0ms
(* PI l)
20.0ms
(/ -1 (* F F))

simplify849.0ms

Counts
12 → 55
Calls

12 calls. Slowest were:

408.0ms
(- (* PI l) (+ (/ (* PI l) (pow F 2)) (* 1/3 (/ (* (pow PI 3) (pow l 3)) (pow F 2)))))
344.0ms
(+ (* 2/15 (* (pow PI 5) (pow l 5))) (+ (* 1/3 (* (pow PI 3) (pow l 3))) (* PI l)))
50.0ms
(- (* PI l) (/ (sin (* PI l)) (* (pow F 2) (cos (* PI l)))))

prune638.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 7.7b

localize34.0ms

Local error

Found 4 expressions with local error:

7.5b
(/ (sin (* PI l)) (* (pow F 2) (cos (* PI l))))
2.7b
(sin (* PI l))
2.6b
(cos (* PI l))
0.3b
(* PI l)

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

17.0ms
(/ (sin (* PI l)) (* (pow F 2) (cos (* PI l))))
3.0ms
(sin (* PI l))
3.0ms
(cos (* PI l))

series193.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

129.0ms
(/ (sin (* PI l)) (* (pow F 2) (cos (* PI l))))
32.0ms
(* PI l)
18.0ms
(sin (* PI l))
14.0ms
(cos (* PI l))

simplify1.2s

Counts
26 → 64
Calls

26 calls. Slowest were:

278.0ms
(- (+ (* 1/24 (* (pow PI 4) (pow l 4))) 1) (* 1/2 (* (pow PI 2) (pow l 2))))
204.0ms
(- (+ (* 1/120 (* (pow PI 5) (pow l 5))) (* PI l)) (* 1/6 (* (pow PI 3) (pow l 3))))
147.0ms
(- (log (sin (* PI l))) (+ (log (pow F 2)) (log (cos (* PI l)))))

prune819.0ms

Pruning

14 alts after pruning (13 fresh and 1 done)

Merged error: 6.4b

localize19.0ms

Local error

Found 4 expressions with local error:

7.6b
(/ (* (pow F 2) (cos (* PI l))) (sin (* PI l)))
2.7b
(sin (* PI l))
2.6b
(cos (* PI l))
0.4b
(/ 1 (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

17.0ms
(/ (* (pow F 2) (cos (* PI l))) (sin (* PI l)))
5.0ms
(/ 1 (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
3.0ms
(sin (* PI l))

series305.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

154.0ms
(/ (* (pow F 2) (cos (* PI l))) (sin (* PI l)))
108.0ms
(/ 1 (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
26.0ms
(sin (* PI l))
17.0ms
(cos (* PI l))

simplify2.7s

Counts
36 → 80
Calls

36 calls. Slowest were:

946.0ms
(/ (* (* (* (pow F 2) (cos (* PI l))) (* (pow F 2) (cos (* PI l)))) (* (pow F 2) (cos (* PI l)))) (* (* (sin (* PI l)) (sin (* PI l))) (sin (* PI l))))
403.0ms
(- (/ (pow F 2) (* PI l)) (* 1/3 (* (pow F 2) (* PI l))))
361.0ms
(+ (/ (* PI l) (pow F 2)) (* 1/3 (/ (* (pow PI 3) (pow l 3)) (pow F 2))))

prune939.0ms

Pruning

13 alts after pruning (12 fresh and 1 done)

Merged error: 6.4b

localize34.0ms

Local error

Found 4 expressions with local error:

28.1b
(cbrt (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
28.1b
(cbrt (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
28.1b
(cbrt (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
7.6b
(/ (* (pow F 2) (cos (* PI l))) (sin (* PI l)))

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
4 → 78
Calls

4 calls. Slowest were:

9.0ms
(/ (* (pow F 2) (cos (* PI l))) (sin (* PI l)))
2.0ms
(cbrt (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
2.0ms
(cbrt (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))

series844.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

244.0ms
(cbrt (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
240.0ms
(cbrt (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
237.0ms
(cbrt (/ (* (pow F 2) (cos (* PI l))) (sin (* PI l))))
123.0ms
(/ (* (pow F 2) (cos (* PI l))) (sin (* PI l)))

simplify4.4s

Counts
51 → 90
Calls

51 calls. Slowest were:

936.0ms
(/ (* (* (* (pow F 2) (cos (* PI l))) (* (pow F 2) (cos (* PI l)))) (* (pow F 2) (cos (* PI l)))) (* (* (sin (* PI l)) (sin (* PI l))) (sin (* PI l))))
370.0ms
(- (/ (pow F 2) (* PI l)) (* 1/3 (* (pow F 2) (* PI l))))
338.0ms
(exp (* 1/3 (- (log (/ (cos (* PI l)) (sin (* PI l)))) (* 2 (log (/ 1 F))))))

prune1.3s

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 6.3b

regimes508.0ms

Accuracy

77.1% (0.5b remaining)

Error of 6.8b against oracle of 6.3b and baseline of 8.5b

bsearch2.9s

end0.0ms

sample20.3s

Algorithm
intervals