Average Error: 13.0 → 13.0
Time: 35.1s
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.0

    \[\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.0

    \[\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.0

    \[\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.0

    \[\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. Using strategy rm
  7. Applied *-commutative13.0

    \[\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))_*\]
  8. Final simplification13.0

    \[\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 2019002 +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: 32.0s)Debug log

sample533.0ms

Algorithm
intervals

simplify159.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune34.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 12.5b

localize42.0ms

Local error

Found 4 expressions with local error:

16.5b
(pow (fma 2 x (fma F F 2)) -1/2)
4.2b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
0.2b
(/ (- x) (tan B))
0.2b
(/ F (sin B))

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

6.0ms
(/ (- x) (tan B))
5.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
1.0ms
(/ F (sin B))

series680.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

233.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
220.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
140.0ms
(/ (- x) (tan B))
87.0ms
(/ F (sin B))

simplify2.0s

Counts
54 → 88
Calls

54 calls. Slowest were:

282.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
280.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)))
258.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))))))

prune1.6s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 12.1b

localize10.0ms

Local error

Found 4 expressions with local error:

16.5b
(pow (fma 2 x (fma F F 2)) -1/2)
4.2b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (- x) (tan B)))
0.2b
(* F (/ 1 (sin B)))
0.2b
(/ (- x) (tan B))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 77
Calls

4 calls. Slowest were:

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

series585.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

234.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (- x) (tan B)))
173.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
122.0ms
(/ (- x) (tan B))
56.0ms
(* F (/ 1 (sin B)))

simplify1.8s

Counts
57 → 89
Calls

57 calls. Slowest were:

264.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
251.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)))
249.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))))))

prune1.6s

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 12.1b

localize13.0ms

Local error

Found 4 expressions with local error:

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

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series536.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

206.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (* (cos B) (- x)) (sin B)))
185.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
84.0ms
(/ (* (cos B) (- x)) (sin B))
61.0ms
(* F (/ 1 (sin B)))

simplify2.0s

Counts
38 → 77
Calls

38 calls. Slowest were:

291.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)))
277.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
277.0ms
(- (/ (* (exp (* -1/2 (- (log -2) (log (/ -1 x))))) F) (sin B)) (+ (/ (* x (cos B)) (sin B)) (* 1/2 (/ (* (exp (* -1/2 (- (log -2) (log (/ -1 x))))) F) (* x (sin B))))))

prune1.4s

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 12.1b

localize31.0ms

Local error

Found 4 expressions with local error:

16.5b
(sqrt (fma 2 x (fma F F 2)))
16.5b
(sqrt (fma 2 x (fma F F 2)))
4.2b
(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.7b
(* (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)))

series281.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

140.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)))
55.0ms
(sqrt (fma 2 x (fma F F 2)))
54.0ms
(sqrt (fma 2 x (fma F F 2)))
32.0ms
(* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2))

simplify2.0s

Counts
50 → 91
Calls

50 calls. Slowest were:

342.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
273.0ms
(- (+ (sqrt 2) (* x (sqrt 1/2))) (* 1/2 (* (pow x 2) (sqrt 1/8))))
249.0ms
(- (+ (sqrt 2) (* x (sqrt 1/2))) (* 1/2 (* (pow x 2) (sqrt 1/8))))

prune1.4s

Pruning

17 alts after pruning (17 fresh and 0 done)

Merged error: 10.9b

regimes434.0ms

Accuracy

0% (2.0b remaining)

Error of 13.0b against oracle of 11.0b and baseline of 13.0b

bsearch2.0ms

end0.0ms

sample14.6s

Algorithm
intervals