Average Error: 13.6 → 13.6
Time: 32.3s
Precision: 64
Internal Precision: 128
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
\[(\left({\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{\frac{-1}{2}} \cdot {\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{\frac{-1}{2}}\right) \cdot \left(\frac{F}{\sin B}\right) + \left(\frac{-x}{\tan B}\right))_*\]

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.6

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

    \[\leadsto \color{blue}{(\left({\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot \left(\frac{F}{\sin B}\right) + \left(\frac{-x}{\tan B}\right))_*}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt13.5

    \[\leadsto (\left({\color{blue}{\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*} \cdot \sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}}^{\frac{-1}{2}}\right) \cdot \left(\frac{F}{\sin B}\right) + \left(\frac{-x}{\tan B}\right))_*\]
  5. Applied unpow-prod-down13.6

    \[\leadsto (\color{blue}{\left({\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{\frac{-1}{2}} \cdot {\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{\frac{-1}{2}}\right)} \cdot \left(\frac{F}{\sin B}\right) + \left(\frac{-x}{\tan B}\right))_*\]
  6. Final simplification13.6

    \[\leadsto (\left({\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{\frac{-1}{2}} \cdot {\left(\sqrt{(2 \cdot x + \left((F \cdot F + 2)_*\right))_*}\right)}^{\frac{-1}{2}}\right) \cdot \left(\frac{F}{\sin B}\right) + \left(\frac{-x}{\tan B}\right))_*\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))

Details

Time bar (total: 30.0s)Debug log

sample473.0ms

Algorithm
intervals

simplify113.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

112.0ms
(+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2)))))

prune41.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 14.7b

localize57.0ms

Local error

Found 4 expressions with local error:

19.1b
(pow (fma 2 x (fma F F 2)) -1/2)
6.3b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
0.2b
(/ F (sin B))
0.1b
(/ (- x) (tan B))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

3.0ms
(/ (- x) (tan B))
3.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
0.0ms
(/ F (sin B))

series625.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

236.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
192.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
134.0ms
(/ (- x) (tan B))
62.0ms
(/ F (sin B))

simplify1.7s

Counts
54 → 88
Calls

54 calls. Slowest were:

253.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
245.0ms
(- (/ (* F (exp (* -1/2 (- (log 2) (log (/ 1 x)))))) (sin B)) (+ (/ (* x (cos B)) (sin B)) (* 1/2 (/ (* F (exp (* -1/2 (- (log 2) (log (/ 1 x)))))) (* x (sin B))))))
222.0ms
(- (+ (exp (* -1/2 (- (log -2) (log (/ -1 x))))) (* 3/8 (/ (exp (* -1/2 (- (log -2) (log (/ -1 x))))) (pow x 2)))) (* 1/2 (/ (exp (* -1/2 (- (log -2) (log (/ -1 x))))) x)))

prune1.6s

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 14.3b

localize24.0ms

Local error

Found 4 expressions with local error:

19.1b
(pow (fma 2 x (fma F F 2)) -1/2)
6.3b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (* (cos B) (- x)) (sin B)))
0.2b
(/ (* (cos B) (- x)) (sin B))
0.2b
(/ F (sin B))

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

12.0ms
(/ (* (cos B) (- x)) (sin B))
2.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
1.0ms
(/ F (sin B))

series559.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

220.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
198.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (* (cos B) (- x)) (sin B)))
81.0ms
(/ (* (cos B) (- x)) (sin B))
60.0ms
(/ F (sin B))

simplify1.7s

Counts
35 → 76
Calls

35 calls. Slowest were:

259.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
219.0ms
(- (+ (* 3/8 (/ (exp (* -1/2 (- (log 2) (log (/ 1 x))))) (pow x 2))) (exp (* -1/2 (- (log 2) (log (/ 1 x)))))) (* 1/2 (/ (exp (* -1/2 (- (log 2) (log (/ 1 x))))) x)))
219.0ms
(- (+ (exp (* -1/2 (- (log -2) (log (/ -1 x))))) (* 3/8 (/ (exp (* -1/2 (- (log -2) (log (/ -1 x))))) (pow x 2)))) (* 1/2 (/ (exp (* -1/2 (- (log -2) (log (/ -1 x))))) x)))

prune1.2s

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 14.3b

localize31.0ms

Local error

Found 4 expressions with local error:

19.1b
(sqrt (fma 2 x (fma F F 2)))
19.1b
(sqrt (fma 2 x (fma F F 2)))
6.3b
(fma (* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2)) (/ F (sin B)) (/ (- x) (tan B)))
0.6b
(* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2))

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
4 → 79
Calls

4 calls. Slowest were:

15.0ms
(* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2))
2.0ms
(sqrt (fma 2 x (fma F F 2)))
2.0ms
(sqrt (fma 2 x (fma F F 2)))

series387.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

176.0ms
(fma (* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2)) (/ F (sin B)) (/ (- x) (tan B)))
84.0ms
(sqrt (fma 2 x (fma F F 2)))
79.0ms
(sqrt (fma 2 x (fma F F 2)))
48.0ms
(* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2))

simplify1.8s

Counts
50 → 91
Calls

50 calls. Slowest were:

252.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
230.0ms
(- (+ (sqrt 2) (* x (sqrt 1/2))) (* 1/2 (* (pow x 2) (sqrt 1/8))))
160.0ms
(- (+ (sqrt 2) (* x (sqrt 1/2))) (* 1/2 (* (pow x 2) (sqrt 1/8))))

prune1.7s

Pruning

13 alts after pruning (12 fresh and 1 done)

Merged error: 13.3b

localize22.0ms

Local error

Found 4 expressions with local error:

19.1b
(sqrt (fma 2 x (fma F F 2)))
19.1b
(sqrt (fma 2 x (fma F F 2)))
19.1b
(sqrt (fma 2 x (fma F F 2)))
6.3b
(fma (* (pow (sqrt (sqrt (fma 2 x (fma F F 2)))) -1/2) (* (pow (sqrt (sqrt (fma 2 x (fma F F 2)))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2))) (/ F (sin B)) (/ (- x) (tan B)))

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

1.0ms
(sqrt (fma 2 x (fma F F 2)))
1.0ms
(sqrt (fma 2 x (fma F F 2)))
1.0ms
(sqrt (fma 2 x (fma F F 2)))

series370.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

190.0ms
(fma (* (pow (sqrt (sqrt (fma 2 x (fma F F 2)))) -1/2) (* (pow (sqrt (sqrt (fma 2 x (fma F F 2)))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2))) (/ F (sin B)) (/ (- x) (tan B)))
65.0ms
(sqrt (fma 2 x (fma F F 2)))
64.0ms
(sqrt (fma 2 x (fma F F 2)))
51.0ms
(sqrt (fma 2 x (fma F F 2)))

simplify1.2s

Counts
24 → 64
Calls

24 calls. Slowest were:

276.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
221.0ms
(- (+ (sqrt 2) (* x (sqrt 1/2))) (* 1/2 (* (pow x 2) (sqrt 1/8))))
204.0ms
(- (+ (sqrt 2) (* x (sqrt 1/2))) (* 1/2 (* (pow x 2) (sqrt 1/8))))

prune1.2s

Pruning

13 alts after pruning (11 fresh and 2 done)

Merged error: 13.3b

regimes456.0ms

Accuracy

0% (2.1b remaining)

Error of 13.6b against oracle of 11.5b and baseline of 13.6b

bsearch2.0ms

end0.0ms

sample14.7s

Algorithm
intervals