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

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. Using strategy rm
  4. Applied div-inv0.2

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

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

Reproduce

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

Details

Time bar (total: 15.6s)Debug log

sample532.0ms

Algorithm
intervals
Results
187.0ms41×body640valid
124.0ms63×body1280valid
79.0ms155×body80valid
23.0ms24×body320valid
10.0ms14×body160valid

simplify88.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
87.0ms
(+ (- (* x (/ 1 (tan B)))) (/ 1 (sin B)))

prune14.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.2b

localize17.0ms

Local error

Found 3 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
*-un-lft-identity
add-sqr-sqrt
associate-/r*
add-log-exp
add-cube-cbrt
add-exp-log
pow1
div-inv
add-cbrt-cube
distribute-lft-out--
frac-2neg
clear-num
difference-of-squares
inv-pow
flip--
pow-flip
frac-sub
associate-/r/
tan-quot
diff-log
flip3--
sub-neg
rec-exp
Counts
3 → 46
Calls
3 calls:
Slowest
7.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
2.0ms
(/ x (tan B))
1.0ms
(/ 1 (sin B))

series287.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
165.0ms
(/ x (tan B))
102.0ms
(- (/ 1 (sin B)) (/ x (tan B)))
20.0ms
(/ 1 (sin B))

simplify299.0ms

Counts
24 → 55
Calls
24 calls:
Slowest
47.0ms
(+ (* 1/6 B) (+ (/ 1 B) (* 7/360 (pow B 3))))
44.0ms
(- (+ (* 1/6 B) (/ 1 B)) (/ x B))
42.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))
40.0ms
(- (/ x B) (* 1/3 (* x B)))
27.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))

prune548.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize9.0ms

Local error

Found 4 expressions with local error:

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
add-exp-log
associate-/r*
pow1
associate-*r*
add-cbrt-cube
div-inv
inv-pow
pow-flip
frac-sub
un-div-inv
associate-/r/
associate-*r/
tan-quot
frac-2neg
clear-num
rec-exp
flip--
*-commutative
diff-log
flip3--
sub-neg
Counts
4 → 62
Calls
4 calls:
Slowest
4.0ms
(- (/ 1 (sin B)) (* x (/ 1 (tan B))))
1.0ms
(* x (/ 1 (tan B)))
1.0ms
(/ 1 (tan B))
1.0ms
(/ 1 (sin B))

series350.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
146.0ms
(- (/ 1 (sin B)) (* x (/ 1 (tan B))))
144.0ms
(* x (/ 1 (tan B)))
44.0ms
(/ 1 (tan B))
15.0ms
(/ 1 (sin B))

simplify490.0ms

Counts
33 → 74
Calls
33 calls:
Slowest
161.0ms
(- (/ 1 B) (+ (* 1/3 B) (* 1/45 (pow B 3))))
49.0ms
(+ (* 1/6 B) (+ (/ 1 B) (* 7/360 (pow B 3))))
48.0ms
(/ (exp (/ 1 (sin B))) (exp (* x (/ 1 (tan B)))))
42.0ms
(- (/ x B) (* 1/3 (* x B)))
36.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))

prune749.0ms

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 4 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Rules
11×*-un-lft-identity
add-sqr-sqrt
div-inv
add-cube-cbrt
associate-/r*
add-log-exp
add-exp-log
pow1
distribute-lft-out--
add-cbrt-cube
associate-/l*
frac-2neg
clear-num
inv-pow
pow-flip
rec-exp
associate-/l/
difference-of-squares
flip--
frac-sub
associate-/r/
tan-quot
diff-log
flip3--
sub-neg
Counts
4 → 66
Calls
4 calls:
Slowest
4.0ms
(- (/ 1 (sin B)) (/ 1 (/ (tan B) x)))
3.0ms
(/ 1 (sin B))
2.0ms
(/ (tan B) x)
1.0ms
(/ 1 (/ (tan B) x))

series258.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
110.0ms
(- (/ 1 (sin B)) (/ 1 (/ (tan B) x)))
79.0ms
(/ 1 (/ (tan B) x))
50.0ms
(/ (tan B) x)
19.0ms
(/ 1 (sin B))

simplify605.0ms

Counts
33 → 78
Calls
33 calls:
Slowest
99.0ms
(+ (/ B x) (+ (* 1/3 (/ (pow B 3) x)) (* 2/15 (/ (pow B 5) x))))
51.0ms
(/ (exp (/ 1 (sin B))) (exp (/ 1 (/ (tan B) x))))
50.0ms
(- (/ 1 (sin B)) (/ (* x (cos B)) (sin B)))
49.0ms
(- (* 1 (/ (tan B) x)) (* (sin B) 1))
41.0ms
(- (/ 1 (sin B)) (/ 1 (/ (tan B) x)))

prune735.0ms

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 0.0b

localize21.0ms

Local error

Found 4 expressions with local error:

0.3b
(* x (/ 1 (sin B)))
0.2b
(* (* x (/ 1 (sin B))) (cos B))
0.2b
(/ 1 (sin B))
0.2b
(/ 1 (sin B))

rewrite15.0ms

Algorithm
rewrite-expression-head
Rules
add-cube-cbrt
add-exp-log
*-un-lft-identity
pow1
add-sqr-sqrt
associate-*r*
add-cbrt-cube
associate-/r*
add-log-exp
div-inv
inv-pow
pow-flip
*-commutative
un-div-inv
associate-*r/
associate-*l/
frac-2neg
clear-num
rec-exp
cbrt-unprod
prod-exp
pow-prod-down
associate-*l*
Counts
4 → 63
Calls
4 calls:
Slowest
9.0ms
(* (* x (/ 1 (sin B))) (cos B))
2.0ms
(* x (/ 1 (sin B)))
1.0ms
(/ 1 (sin B))
1.0ms
(/ 1 (sin B))

series202.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
99.0ms
(* (* x (/ 1 (sin B))) (cos B))
76.0ms
(* x (/ 1 (sin B)))
13.0ms
(/ 1 (sin B))
13.0ms
(/ 1 (sin B))

simplify637.0ms

Counts
34 → 75
Calls
34 calls:
Slowest
292.0ms
(* (* (* (* x (/ 1 (sin B))) (* x (/ 1 (sin B)))) (* x (/ 1 (sin B)))) (* (* (cos B) (cos B)) (cos B)))
79.0ms
(+ (log (* x (/ 1 (sin B)))) (log (cos B)))
76.0ms
(* (* x (/ 1 (sin B))) (cos B))
49.0ms
(+ (* 1/6 B) (+ (/ 1 B) (* 7/360 (pow B 3))))
40.0ms
(- (/ x B) (* 1/3 (* x B)))

prune715.0ms

Pruning

10 alts after pruning (7 fresh and 3 done)

Merged error: 0.0b

regimes130.0ms

Accuracy

0% (0.2b remaining)

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

bsearch2.0ms

end0.0ms

sample8.8s

Algorithm
intervals
Results
4.0s1768×body1280valid
1.9s4926×body80valid
1.8s1401×body640valid
659.0ms708×body320valid
248.0ms351×body160valid