Average Error: 0.2 → 0.2
Time: 21.1s
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. Initial simplification0.2

    \[\leadsto \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 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 2018362 
(FPCore (B x)
  :name "VandenBroeck and Keller, Equation (24)"
  (+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B))))

Details

Time bar (total: 7.2s)Debug log

start286.0ms

Algorithm
intervals

setup88.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize27.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)))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
3 → 46
Calls

3 calls. Slowest were:

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

series251.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

142.0ms
(/ x (tan B))
85.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
23.0ms
(/ 1 (sin B))

simplify187.0ms

Counts
24 → 55
Calls

24 calls. Slowest were:

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

prune394.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 4 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series235.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

99.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))
92.0ms
(/ (* x (cos B)) (sin B))
30.0ms
(* x (cos B))
14.0ms
(/ 1 (sin B))

simplify890.0ms

Counts
43 → 77
Calls

43 calls. Slowest were:

433.0ms
(/ (* (* (* x (cos B)) (* x (cos B))) (* x (cos B))) (* (* (sin B) (sin B)) (sin B)))
134.0ms
(- (* 1 (sin B)) (* (sin B) (* x (cos B))))
33.0ms
(/ (exp (/ 1 (sin B))) (exp (/ (* x (cos B)) (sin B))))

prune552.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0.0b

localize9.0ms

Local error

Found 2 expressions with local error:

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
2 → 41
Calls

2 calls. Slowest were:

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

series127.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

82.0ms
(/ (- 1 (* x (cos B))) (sin B))
44.0ms
(* x (cos B))

simplify995.0ms

Counts
37 → 47
Calls

37 calls. Slowest were:

298.0ms
(- (pow 1 3) (pow (* x (cos B)) 3))
195.0ms
(/ (* (* (- 1 (* x (cos B))) (- 1 (* x (cos B)))) (- 1 (* x (cos B)))) (* (* (sin B) (sin B)) (sin B)))
51.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))

prune473.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize13.0ms

Local error

Found 4 expressions with local error:

0.6b
(cbrt (* x (cos B)))
0.6b
(cbrt (* x (cos B)))
0.6b
(cbrt (* x (cos B)))
0.5b
(* (cbrt (* x (cos B))) (cbrt (* x (cos B))))

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
4 → 51
Calls

4 calls. Slowest were:

5.0ms
(* (cbrt (* x (cos B))) (cbrt (* x (cos B))))
1.0ms
(cbrt (* x (cos B)))
1.0ms
(cbrt (* x (cos B)))

series635.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

186.0ms
(cbrt (* x (cos B)))
178.0ms
(cbrt (* x (cos B)))
139.0ms
(cbrt (* x (cos B)))
132.0ms
(* (cbrt (* x (cos B))) (cbrt (* x (cos B))))

simplify1.1s

Counts
31 → 63
Calls

31 calls. Slowest were:

157.0ms
(exp (* 1/3 (- (log (pow (cos B) 2)) (* 2 (log (/ 1 x))))))
154.0ms
(* (exp (* 1/3 (- (log (pow (cos B) 2)) (* 2 (log (/ -1 x)))))) (pow (cbrt -1) 2))
126.0ms
(* (cbrt -1) (exp (* 1/3 (- (log (cos B)) (log (/ -1 x))))))

prune739.0ms

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0.0b

regimes80.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms