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

Error

Bits error versus F

Bits error versus B

Bits error versus x

Derivation

  1. Initial program 13.3

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

    \[\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 tan-quot13.2

    \[\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}{\color{blue}{\frac{\sin B}{\cos B}}}\right))_*\]
  5. Applied associate-/r/13.2

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

    \[\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(\color{blue}{\left(\left(-x\right) \cdot \frac{1}{\sin B}\right)} \cdot \cos B\right))_*\]
  8. Applied associate-*l*13.3

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

    \[\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(x \cdot \left(\frac{-1}{\sin B} \cdot \cos B\right)\right))_*\]

Reproduce

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

start1.3s

Algorithm
intervals

setup179.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 11.8b

localize85.0ms

Local error

Found 4 expressions with local error:

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

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

series689.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

256.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
214.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
166.0ms
(/ (- x) (tan B))
53.0ms
(/ F (sin B))

simplify2.0s

Counts
54 → 88
Calls

54 calls. Slowest were:

500.0ms
(/ (* (* (- x) (- x)) (- x)) (* (* (tan B) (tan B)) (tan B)))
241.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))))))
238.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.6s

Pruning

19 alts after pruning (19 fresh and 0 done)

Merged error: 11.3b

localize16.0ms

Local error

Found 4 expressions with local error:

14.7b
(pow (fma 2 x (fma F F 2)) -1/2)
5.2b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ 1 (/ (sin B) F)) (/ (- x) (tan B)))
0.3b
(/ 1 (/ (sin B) F))
0.2b
(/ (- x) (tan B))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 81
Calls

4 calls. Slowest were:

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

series596.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

212.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ 1 (/ (sin B) F)) (/ (- x) (tan B)))
205.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
129.0ms
(/ (- x) (tan B))
50.0ms
(/ 1 (/ (sin B) F))

simplify2.3s

Counts
56 → 93
Calls

56 calls. Slowest were:

573.0ms
(/ (* (* (- x) (- x)) (- x)) (* (* (tan B) (tan B)) (tan B)))
294.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))))))
247.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))

prune2.0s

Pruning

18 alts after pruning (18 fresh and 0 done)

Merged error: 11.3b

localize27.0ms

Local error

Found 4 expressions with local error:

14.7b
(pow (fma 2 x (fma F F 2)) -1/2)
5.2b
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (* (/ (- x) (sin B)) (cos B)))
0.2b
(* (/ (- x) (sin B)) (cos B))
0.1b
(/ F (sin B))

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

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

series636.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

245.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (* (/ (- x) (sin B)) (cos B)))
200.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
107.0ms
(* (/ (- x) (sin B)) (cos B))
85.0ms
(/ F (sin B))

simplify2.2s

Counts
45 → 88
Calls

45 calls. Slowest were:

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

21 alts after pruning (21 fresh and 0 done)

Merged error: 11.3b

localize19.0ms

Local error

Found 4 expressions with local error:

14.7b
(pow (fma 2 x (fma F F 2)) -1/2)
5.2b
(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.2b
(/ (- x) (tan B))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 102
Calls

4 calls. Slowest were:

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

series678.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

242.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ (/ 1 (sin B)) (/ 1 F)) (/ (- x) (tan B)))
223.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
141.0ms
(/ (- x) (tan B))
72.0ms
(/ (/ 1 (sin B)) (/ 1 F))

simplify2.9s

Counts
92 → 114
Calls

92 calls. Slowest were:

484.0ms
(/ (* (* (/ 1 (sin B)) (/ 1 (sin B))) (/ 1 (sin B))) (* (* (/ 1 F) (/ 1 F)) (/ 1 F)))
460.0ms
(/ (* (* (- x) (- x)) (- x)) (* (* (tan B) (tan B)) (tan B)))
243.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)))

prune2.5s

Pruning

20 alts after pruning (20 fresh and 0 done)

Merged error: 11.3b

regimes748.0ms

Accuracy

0% (0.6b remaining)

Error of 13.3b against oracle of 12.7b and baseline of 13.3b

bsearch12.0ms