Average Error: 13.7 → 13.7
Time: 45.9s
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(\frac{\frac{1}{\sin B}}{\frac{1}{F}}\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.7

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

    \[\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 clear-num13.7

    \[\leadsto (\left({\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot \color{blue}{\left(\frac{1}{\frac{\sin B}{F}}\right)} + \left(\frac{-x}{\tan B}\right))_*\]
  5. Using strategy rm
  6. Applied div-inv13.7

    \[\leadsto (\left({\left((2 \cdot x + \left((F \cdot F + 2)_*\right))_*\right)}^{\frac{-1}{2}}\right) \cdot \left(\frac{1}{\color{blue}{\sin B \cdot \frac{1}{F}}}\right) + \left(\frac{-x}{\tan B}\right))_*\]
  7. Applied associate-/r*13.7

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

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

Reproduce

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

start866.0ms

Algorithm
intervals

setup202.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 15.3b

localize75.0ms

Local error

Found 4 expressions with local error:

18.7b
(pow (fma 2 x (fma F F 2)) -1/2)
7.3b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
0.1b
(/ (- x) (tan B))
0.1b
(/ F (sin B))

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

series733.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

267.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
260.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
122.0ms
(/ (- x) (tan B))
82.0ms
(/ F (sin B))

simplify1.9s

Counts
54 → 88
Calls

54 calls. Slowest were:

273.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))))))
272.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)))
257.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.8s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 14.8b

localize23.0ms

Local error

Found 4 expressions with local error:

18.7b
(pow (fma 2 x (fma F F 2)) -1/2)
7.3b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (- x) (tan B)))
0.3b
(* F (/ 1 (sin B)))
0.1b
(/ (- x) (tan B))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 77
Calls

4 calls. Slowest were:

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

series591.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

224.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (- x) (tan B)))
182.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
125.0ms
(/ (- x) (tan B))
61.0ms
(* F (/ 1 (sin B)))

simplify1.8s

Counts
57 → 89
Calls

57 calls. Slowest were:

311.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
271.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))))))
253.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

14 alts after pruning (14 fresh and 0 done)

Merged error: 14.8b

localize11.0ms

Local error

Found 4 expressions with local error:

18.7b
(pow (fma 2 x (fma F F 2)) -1/2)
7.3b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ 1 (/ (sin B) F)) (/ (- x) (tan B)))
0.2b
(/ 1 (/ (sin B) F))
0.2b
(/ (sin B) F)

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

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

series505.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

223.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
204.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ 1 (/ (sin B) F)) (/ (- x) (tan B)))
45.0ms
(/ 1 (/ (sin B) F))
32.0ms
(/ (sin B) F)

simplify1.7s

Counts
24 → 72
Calls

24 calls. Slowest were:

291.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
275.0ms
(- (+ (/ B F) (* 1/120 (/ (pow B 5) F))) (* 1/6 (/ (pow B 3) F)))
257.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: 14.8b

localize17.0ms

Local error

Found 4 expressions with local error:

18.7b
(pow (fma 2 x (fma F F 2)) -1/2)
7.3b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ (/ 1 (sin B)) (/ 1 F)) (/ (- x) (tan B)))
0.3b
(/ (/ 1 (sin B)) (/ 1 F))
0.1b
(/ (- x) (tan B))

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 102
Calls

4 calls. Slowest were:

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

series989.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

571.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ (/ 1 (sin B)) (/ 1 F)) (/ (- x) (tan B)))
206.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
144.0ms
(/ (- x) (tan B))
68.0ms
(/ (/ 1 (sin B)) (/ 1 F))

simplify3.5s

Counts
92 → 114
Calls

92 calls. Slowest were:

1.2s
(/ (* (* (/ 1 (sin B)) (/ 1 (sin B))) (/ 1 (sin B))) (* (* (/ 1 F) (/ 1 F)) (/ 1 F)))
300.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))))))
255.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.1s

Pruning

14 alts after pruning (13 fresh and 1 done)

Merged error: 14.8b

regimes523.0ms

Accuracy

0% (0.5b remaining)

Error of 13.7b against oracle of 13.1b and baseline of 13.7b

bsearch4.0ms