Average Error: 0.2 → 0.2
Time: 18.1s
Precision: 64
Internal Precision: 128
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\]

Error

Bits error versus B

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
  2. Simplified0.2

    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x}{\tan B}}\]
  3. Taylor expanded around -inf 0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x \cdot \cos B}{\sin B}}\]
  4. Using strategy rm
  5. Applied associate-/l*0.2

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x}{\frac{\sin B}{\cos B}}}\]
  6. Final simplification0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\frac{\sin B}{\cos B}}\]

Reproduce

herbie shell --seed 2019004 
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))

Details

Time bar (total: 17.1s)Debug log

sample472.0ms

Algorithm
intervals

simplify120.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

119.0ms
(+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B)))

prune20.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize38.0ms

Local error

Found 3 expressions with local error:

0.2b
(/ x (tan B))
0.1b
(/ 1 (sin B))
0.0b
(- (/ 1 (sin B)) (/ x (tan B)))

rewrite19.0ms

Algorithm
rewrite-expression-head
Counts
3 → 46
Calls

3 calls. Slowest were:

11.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
4.0ms
(/ x (tan B))
2.0ms
(/ 1 (sin B))

series358.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

206.0ms
(/ x (tan B))
125.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
28.0ms
(/ 1 (sin B))

simplify208.0ms

Counts
24 → 55
Calls

24 calls. Slowest were:

27.0ms
(+ (* 1/6 B) (+ (/ 1 B) (* 7/360 (pow B 3))))
25.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))
25.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))

prune544.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 4 expressions with local error:

0.2b
(/ (* x (cos B)) (sin B))
0.1b
(* x (cos B))
0.1b
(/ 1 (sin B))
0.0b
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

8.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))
4.0ms
(/ (* x (cos B)) (sin B))
1.0ms
(* x (cos B))

series271.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

125.0ms
(/ (* x (cos B)) (sin B))
101.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))
31.0ms
(* x (cos B))
14.0ms
(/ 1 (sin B))

simplify1.2s

Counts
43 → 77
Calls

43 calls. Slowest were:

558.0ms
(/ (* (* (* x (cos B)) (* x (cos B))) (* x (cos B))) (* (* (sin B) (sin B)) (sin B)))
123.0ms
(- (* 1 (sin B)) (* (sin B) (* x (cos B))))
51.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))

prune799.0ms

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 4 expressions with local error:

0.2b
(/ (sin B) (cos B))
0.2b
(/ x (/ (sin B) (cos B)))
0.1b
(/ 1 (sin B))
0.0b
(- (/ 1 (sin B)) (/ x (/ (sin B) (cos B))))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 84
Calls

4 calls. Slowest were:

9.0ms
(- (/ 1 (sin B)) (/ x (/ (sin B) (cos B))))
3.0ms
(/ (sin B) (cos B))
1.0ms
(/ 1 (sin B))

series284.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

124.0ms
(/ x (/ (sin B) (cos B)))
107.0ms
(- (/ 1 (sin B)) (/ x (/ (sin B) (cos B))))
30.0ms
(/ (sin B) (cos B))
24.0ms
(/ 1 (sin B))

simplify644.0ms

Counts
62 → 96
Calls

62 calls. Slowest were:

108.0ms
(/ (* (* (sin B) (sin B)) (sin B)) (* (* (cos B) (cos B)) (cos B)))
53.0ms
(- (* 1 (/ (sin B) (cos B))) (* (sin B) x))
49.0ms
(+ (* 1/6 B) (+ (/ 1 B) (* 7/360 (pow B 3))))

prune1.0s

Pruning

8 alts after pruning (6 fresh and 2 done)

Merged error: 0.0b

localize23.0ms

Local error

Found 4 expressions with local error:

0.2b
(* (/ x (sin B)) (cos B))
0.2b
(/ x (sin B))
0.1b
(/ 1 (sin B))
0.0b
(- (/ 1 (sin B)) (* (/ x (sin B)) (cos B)))

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 62
Calls

4 calls. Slowest were:

13.0ms
(- (/ 1 (sin B)) (* (/ x (sin B)) (cos B)))
8.0ms
(* (/ x (sin B)) (cos B))
2.0ms
(/ 1 (sin B))

series345.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

157.0ms
(* (/ x (sin B)) (cos B))
99.0ms
(- (/ 1 (sin B)) (* (/ x (sin B)) (cos B)))
75.0ms
(/ x (sin B))
14.0ms
(/ 1 (sin B))

simplify640.0ms

Counts
33 → 74
Calls

33 calls. Slowest were:

162.0ms
(- (* 1 (sin B)) (* (sin B) (* x (cos B))))
162.0ms
(* (* (* (/ x (sin B)) (/ x (sin B))) (/ x (sin B))) (* (* (cos B) (cos B)) (cos B)))
43.0ms
(+ (log (/ x (sin B))) (log (cos B)))

prune726.0ms

Pruning

8 alts after pruning (5 fresh and 3 done)

Merged error: 0.0b

regimes93.0ms

Accuracy

0% (0.1b remaining)

Error of 0.2b against oracle of 0.0b and baseline of 0.2b

bsearch2.0ms

end0.0ms

sample9.3s

Algorithm
intervals