Average Error: 8.5 → 0.7
Time: 29.9s
Precision: 64
Internal Precision: 128
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\]
\[\pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}{F} \cdot \frac{1}{F}\]

Error

Bits error versus F

Bits error versus l

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 8.5

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

    \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity8.1

    \[\leadsto \pi \cdot \ell - \frac{\color{blue}{1 \cdot \tan \left(\pi \cdot \ell\right)}}{F \cdot F}\]
  5. Applied times-frac0.7

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

    \[\leadsto \pi \cdot \ell - \frac{1}{F} \cdot \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}}{F}\]
  7. Final simplification0.7

    \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}{F} \cdot \frac{1}{F}\]

Reproduce

herbie shell --seed 2019016 
(FPCore (F l)
  :name "VandenBroeck and Keller, Equation (6)"
  (- (* PI l) (* (/ 1 (* F F)) (tan (* PI l)))))

Details

Time bar (total: 28.6s)Debug log

sample658.0ms

Algorithm
intervals
Results
531×(pre true 80)
284×(body real 80)
241×(body exit 10240)
(body real 160)

simplify172.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
172.0ms
(- (* PI l) (* (/ 1 (* F F)) (tan (* PI l))))

prune23.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 5.8b

localize17.0ms

Local error

Found 4 expressions with local error:

5.7b
(/ (tan (* PI l)) (* F F))
3.5b
(tan (* PI l))
0.2b
(* PI l)
0.2b
(* PI l)

rewrite9.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
add-sqr-sqrt
add-log-exp
pow1
associate-/l*
times-frac
*-commutative
tan-quot
associate-/l/
div-inv
div-exp
frac-2neg
associate-/r*
clear-num
cbrt-undiv
Counts
4 → 44
Calls
4 calls:
Slowest
6.0ms
(/ (tan (* PI l)) (* F F))
1.0ms
(tan (* PI l))
0.0ms
(* PI l)
0.0ms
(* PI l)

series237.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
125.0ms
(/ (tan (* PI l)) (* F F))
44.0ms
(tan (* PI l))
35.0ms
(* PI l)
33.0ms
(* PI l)

simplify949.0ms

Counts
23 → 56
Calls
23 calls:
Slowest
432.0ms
(+ (/ (* PI l) (pow F 2)) (+ (* 2/15 (/ (* (pow PI 5) (pow l 5)) (pow F 2))) (* 1/3 (/ (* (pow PI 3) (pow l 3)) (pow F 2)))))
225.0ms
(+ (* 2/15 (* (pow PI 5) (pow l 5))) (+ (* 1/3 (* (pow PI 3) (pow l 3))) (* PI l)))
177.0ms
(/ (* (* (tan (* PI l)) (tan (* PI l))) (tan (* PI l))) (* (* (* F F) (* F F)) (* F F)))
35.0ms
(- (log (tan (* PI l))) (log (* F F)))
12.0ms
(/ (sin (* PI l)) (* (pow F 2) (cos (* PI l))))

prune515.0ms

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 0.2b

localize19.0ms

Local error

Found 4 expressions with local error:

3.5b
(tan (* PI l))
0.2b
(/ (tan (* PI l)) F)
0.2b
(* PI l)
0.2b
(* PI l)

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
add-exp-log
add-cbrt-cube
pow1
associate-/l*
*-commutative
tan-quot
associate-/l/
div-inv
frac-2neg
clear-num
Counts
4 → 38
Calls
4 calls:
Slowest
7.0ms
(/ (tan (* PI l)) F)
3.0ms
(tan (* PI l))
0.0ms
(* PI l)
0.0ms
(* PI l)

series242.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
88.0ms
(/ (tan (* PI l)) F)
63.0ms
(tan (* PI l))
46.0ms
(* PI l)
45.0ms
(* PI l)

simplify483.0ms

Counts
15 → 50
Calls
15 calls:
Slowest
266.0ms
(+ (* 2/15 (* (pow PI 5) (pow l 5))) (+ (* 1/3 (* (pow PI 3) (pow l 3))) (* PI l)))
177.0ms
(+ (* 1/3 (/ (* (pow PI 3) (pow l 3)) F)) (+ (/ (* PI l) F) (* 2/15 (/ (* (pow PI 5) (pow l 5)) F))))
5.0ms
(/ (sin (* PI l)) (cos (* PI l)))
5.0ms
(/ (sin (* PI l)) (cos (* PI l)))
4.0ms
(* (cbrt (tan (* PI l))) (cbrt (tan (* PI l))))

prune497.0ms

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0.2b

localize11.0ms

Local error

Found 4 expressions with local error:

3.5b
(tan (* PI l))
1.3b
(/ 1 (/ F (tan (* PI l))))
0.2b
(* PI l)
0.2b
(* PI l)

rewrite4.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
add-exp-log
*-un-lft-identity
associate-/r*
pow1
add-sqr-sqrt
add-log-exp
add-cbrt-cube
div-inv
*-commutative
associate-/r/
tan-quot
inv-pow
pow-flip
frac-2neg
clear-num
rec-exp
Counts
4 → 43
Calls
4 calls:
Slowest
2.0ms
(tan (* PI l))
1.0ms
(/ 1 (/ F (tan (* PI l))))
0.0ms
(* PI l)
0.0ms
(* PI l)

series220.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
110.0ms
(/ 1 (/ F (tan (* PI l))))
42.0ms
(tan (* PI l))
36.0ms
(* PI l)
32.0ms
(* PI l)

simplify424.0ms

Counts
19 → 55
Calls
19 calls:
Slowest
241.0ms
(+ (* 2/15 (* (pow PI 5) (pow l 5))) (+ (* 1/3 (* (pow PI 3) (pow l 3))) (* PI l)))
134.0ms
(+ (* 1/3 (/ (* (pow PI 3) (pow l 3)) F)) (/ (* PI l) F))
5.0ms
(sqrt (/ F (tan (* PI l))))
5.0ms
(cbrt (/ F (tan (* PI l))))
4.0ms
(/ 1 (tan (* PI l)))

prune629.0ms

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.2b

localize9.0ms

Local error

Found 4 expressions with local error:

3.5b
(tan (* PI l))
0.3b
(* (/ 1 F) (/ (tan (* PI l)) F))
0.2b
(/ (tan (* PI l)) F)
0.2b
(* PI l)

rewrite10.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-exp-log
add-cbrt-cube
pow1
add-log-exp
associate-*l*
associate-*r*
associate-/l*
div-inv
*-commutative
tan-quot
associate-/l/
cbrt-unprod
associate-*r/
prod-exp
associate-*l/
pow-prod-down
frac-2neg
clear-num
frac-times
Counts
4 → 52
Calls
4 calls:
Slowest
4.0ms
(* (/ 1 F) (/ (tan (* PI l)) F))
4.0ms
(/ (tan (* PI l)) F)
2.0ms
(tan (* PI l))
0.0ms
(* PI l)

series324.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
139.0ms
(* (/ 1 F) (/ (tan (* PI l)) F))
83.0ms
(/ (tan (* PI l)) F)
59.0ms
(tan (* PI l))
42.0ms
(* PI l)

simplify1.4s

Counts
27 → 64
Calls
27 calls:
Slowest
422.0ms
(* (* (* (/ 1 F) (/ 1 F)) (/ 1 F)) (* (* (/ (tan (* PI l)) F) (/ (tan (* PI l)) F)) (/ (tan (* PI l)) F)))
315.0ms
(+ (/ (* PI l) (pow F 2)) (* 1/3 (/ (* (pow PI 3) (pow l 3)) (pow F 2))))
261.0ms
(+ (* 2/15 (* (pow PI 5) (pow l 5))) (+ (* 1/3 (* (pow PI 3) (pow l 3))) (* PI l)))
149.0ms
(+ (* 1/3 (/ (* (pow PI 3) (pow l 3)) F)) (+ (/ (* PI l) F) (* 2/15 (/ (* (pow PI 5) (pow l 5)) F))))
92.0ms
(+ (log (/ 1 F)) (log (/ (tan (* PI l)) F)))

prune589.0ms

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.1b

regimes443.0ms

Accuracy

0% (0.2b remaining)

Error of 0.7b against oracle of 0.5b and baseline of 0.7b

bsearch2.0ms

end0.0ms

sample20.6s

Algorithm
intervals
Results
16926×(pre true 80)
8916×(body real 80)
7770×(body exit 10240)
240×(body real 160)