Average Error: 0.2 → 0.2
Time: 27.0s
Precision: 64
Internal Precision: 128
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\]
\[\frac{1 - \cos B \cdot x}{\sin 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 \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}}\]
  4. Using strategy rm
  5. Applied sub-div0.2

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

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

Reproduce

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

Details

Time bar (total: 26.1s)Debug log

sample415.0ms

Algorithm
intervals

simplify92.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune30.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize18.0ms

Local error

Found 3 expressions with local error:

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

rewrite19.0ms

Algorithm
rewrite-expression-head
Counts
3 → 76
Calls

3 calls. Slowest were:

13.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
2.0ms
(/ x (tan B))
1.0ms
(/ 1 (sin B))

series288.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

145.0ms
(/ x (tan B))
119.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
24.0ms
(/ 1 (sin B))

simplify1.8s

Counts
66 → 85
Calls

66 calls. Slowest were:

100.0ms
(fma (* (cbrt (/ 1 (sin B))) (cbrt (/ 1 (sin B)))) (cbrt (/ 1 (sin B))) (- (* (/ 1 (tan B)) x)))
75.0ms
(fma 1 (/ 1 (sin B)) (- (* (/ 1 (tan B)) x)))
63.0ms
(fma 1 (/ 1 (sin B)) (- (* (/ x (tan B)) 1)))

prune952.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize30.0ms

Local error

Found 3 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
3 → 43
Calls

3 calls. Slowest were:

2.0ms
(/ 1 (sin B))
1.0ms
(/ x (sin B))
0.0ms
(fma (/ x (sin B)) (- (cos B)) (/ 1 (sin B)))

series180.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

88.0ms
(fma (/ x (sin B)) (- (cos B)) (/ 1 (sin B)))
61.0ms
(/ x (sin B))
31.0ms
(/ 1 (sin B))

simplify221.0ms

Counts
16 → 52
Calls

16 calls. Slowest were:

81.0ms
(+ (* 1/6 B) (+ (/ 1 B) (* 7/360 (pow B 3))))
41.0ms
(- (+ (* 1/6 B) (/ 1 B)) (/ x B))
35.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))

prune683.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 4 expressions with local error:

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

rewrite19.0ms

Algorithm
rewrite-expression-head
Counts
4 → 105
Calls

4 calls. Slowest were:

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

series292.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

122.0ms
(/ (* x (cos B)) (sin B))
109.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))
37.0ms
(* x (cos B))
24.0ms
(/ 1 (sin B))

simplify9.1s

Counts
101 → 117
Calls

101 calls. Slowest were:

815.0ms
(/ (* (* (* x (cos B)) (* x (cos B))) (* x (cos B))) (* (* (sin B) (sin B)) (sin B)))
477.0ms
(fma 1 (/ 1 (sin B)) (- (* (/ 1 (sin B)) (* x (cos B)))))
445.0ms
(fma 1 (/ 1 (sin B)) (- (* (/ 1 (sin B)) (* x (cos B)))))

prune1.2s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.0b

localize7.0ms

Local error

Found 2 expressions with local error:

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

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
2 → 45
Calls

2 calls. Slowest were:

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

series126.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

85.0ms
(/ (- 1 (* x (cos B))) (sin B))
41.0ms
(* x (cos B))

simplify1.2s

Counts
37 → 51
Calls

37 calls. Slowest were:

349.0ms
(- (pow 1 3) (pow (* x (cos B)) 3))
190.0ms
(/ (* (* (- 1 (* x (cos B))) (- 1 (* x (cos B)))) (- 1 (* x (cos B)))) (* (* (sin B) (sin B)) (sin B)))
58.0ms
(/ (- 1 (* x (cos B))) (sqrt (sin B)))

prune590.0ms

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0.0b

regimes113.0ms

Accuracy

0% (0.2b remaining)

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

bsearch1.0ms

end0.0ms

sample8.9s

Algorithm
intervals