Average Error: 13.5 → 13.4
Time: 45.6s
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((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot \left(F \cdot \frac{1}{\sin B}\right) + \left(\frac{\left(-x\right) \cdot \cos B}{\sin B}\right))_*\]

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.5

    \[\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. Initial simplification13.4

    \[\leadsto (\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 div-inv13.4

    \[\leadsto (\left({\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} + \left(\frac{-x}{\tan B}\right))_*\]
  5. Taylor expanded around -inf 13.4

    \[\leadsto (\left({\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot \left(F \cdot \frac{1}{\sin B}\right) + \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{\sin B}\right)})_*\]
  6. Simplified13.4

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

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

Reproduce

herbie shell --seed 2018365 +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: 20.1s)Debug log

start1.3s

Algorithm
intervals

setup223.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 15.3b

localize40.0ms

Local error

Found 4 expressions with local error:

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

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

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

series658.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

235.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
232.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
128.0ms
(/ (- x) (tan B))
63.0ms
(/ F (sin B))

simplify1.8s

Counts
54 → 88
Calls

54 calls. Slowest were:

311.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))))))
306.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
240.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.7s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 14.7b

localize20.0ms

Local error

Found 4 expressions with local error:

19.3b
(pow (fma 2 x (fma F F 2)) -1/2)
6.6b
(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))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 77
Calls

4 calls. Slowest were:

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

series697.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

260.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (- x) (tan B)))
216.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
152.0ms
(/ (- x) (tan B))
69.0ms
(* F (/ 1 (sin B)))

simplify2.0s

Counts
57 → 89
Calls

57 calls. Slowest were:

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

prune2.0s

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 14.7b

localize16.0ms

Local error

Found 4 expressions with local error:

19.3b
(pow (fma 2 x (fma F F 2)) -1/2)
6.6b
(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))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

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

series612.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

214.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (* (cos B) (- x)) (sin B)))
195.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
115.0ms
(/ (* (cos B) (- x)) (sin B))
87.0ms
(* F (/ 1 (sin B)))

simplify1.7s

Counts
38 → 77
Calls

38 calls. Slowest were:

223.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))))))
216.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
200.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.7s

Pruning

14 alts after pruning (13 fresh and 1 done)

Merged error: 14.7b

localize10.0ms

Local error

Found 4 expressions with local error:

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

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 77
Calls

4 calls. Slowest were:

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

series610.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

237.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (* (/ (- x) (sin B)) (cos B)))
200.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
111.0ms
(* (/ (- x) (sin B)) (cos B))
63.0ms
(* F (/ 1 (sin B)))

simplify2.4s

Counts
48 → 89
Calls

48 calls. Slowest were:

413.0ms
(* (* (* (/ (- x) (sin B)) (/ (- x) (sin B))) (/ (- x) (sin B))) (* (* (cos B) (cos B)) (cos B)))
343.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
275.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.9s

Pruning

13 alts after pruning (11 fresh and 2 done)

Merged error: 14.7b

regimes713.0ms

Accuracy

0% (0.5b remaining)

Error of 13.4b against oracle of 12.9b and baseline of 13.4b

bsearch8.0ms