Average Error: 0.2 → 0.2
Time: 23.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. Initial simplification0.1

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\tan B}\]
  3. Using strategy rm
  4. Applied tan-quot0.2

    \[\leadsto \frac{1}{\sin B} - \frac{x}{\color{blue}{\frac{\sin B}{\cos B}}}\]
  5. Applied associate-/r/0.2

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

    \[\leadsto \frac{1}{\sin B} - \color{blue}{\frac{x \cdot \cos B}{\sin B}}\]
  8. Applied sub-div0.2

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

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

Reproduce

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

Details

Time bar (total: 8.1s)Debug log

start1.4s

Algorithm
intervals

setup130.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize37.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 → 46
Calls

3 calls. Slowest were:

10.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
3.0ms
(/ x (tan B))
2.0ms
(/ 1 (sin B))

series326.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

165.0ms
(/ x (tan B))
137.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
22.0ms
(/ 1 (sin B))

simplify282.0ms

Counts
24 → 55
Calls

24 calls. Slowest were:

46.0ms
(+ (* 1/6 B) (+ (/ 1 B) (* 7/360 (pow B 3))))
42.0ms
(- (+ (* 1/6 B) (/ 1 B)) (/ x B))
36.0ms
(- (/ x B) (* 1/3 (* x B)))

prune569.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

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

series305.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

114.0ms
(* (/ x (sin B)) (cos B))
94.0ms
(- (/ 1 (sin B)) (* (/ x (sin B)) (cos B)))
73.0ms
(/ x (sin B))
24.0ms
(/ 1 (sin B))

simplify602.0ms

Counts
33 → 74
Calls

33 calls. Slowest were:

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

prune806.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 2 expressions with local error:

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

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
2 → 41
Calls

2 calls. Slowest were:

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

series146.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

97.0ms
(/ (- 1 (* x (cos B))) (sin B))
49.0ms
(* x (cos B))

simplify878.0ms

Counts
37 → 47
Calls

37 calls. Slowest were:

235.0ms
(- (pow 1 3) (pow (* x (cos B)) 3))
124.0ms
(/ (* (* (- 1 (* x (cos B))) (- 1 (* x (cos B)))) (- 1 (* x (cos B)))) (* (* (sin B) (sin B)) (sin B)))
62.0ms
(- (* 1 1) (* (* x (cos B)) (* x (cos B))))

prune611.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 66
Calls

4 calls. Slowest were:

9.0ms
(- (/ 1 (sin B)) (/ 1 (/ (tan B) x)))
5.0ms
(/ (tan B) x)
2.0ms
(/ 1 (/ (tan B) x))

series321.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

138.0ms
(- (/ 1 (sin B)) (/ 1 (/ (tan B) x)))
119.0ms
(/ 1 (/ (tan B) x))
42.0ms
(/ (tan B) x)
22.0ms
(/ 1 (sin B))

simplify577.0ms

Counts
33 → 78
Calls

33 calls. Slowest were:

71.0ms
(+ (/ B x) (+ (* 1/3 (/ (pow B 3) x)) (* 2/15 (/ (pow B 5) x))))
56.0ms
(/ (exp (/ 1 (sin B))) (exp (/ 1 (/ (tan B) x))))
52.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))

prune903.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.0b

regimes90.0ms

Accuracy

0% (0.2b remaining)

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

bsearch1.0ms