Average Error: 13.6 → 13.6
Time: 33.4s
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(x \cdot \frac{-1}{\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 div-inv13.6

    \[\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. Using strategy rm
  6. Applied div-inv13.6

    \[\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(\left(-x\right) \cdot \frac{1}{\tan B}\right)})_*\]
  7. Final simplification13.6

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

Reproduce

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

sample485.0ms

Algorithm
intervals
Results
152.0ms54×body1280valid
107.0ms149×body80valid
75.0ms44×body640valid
31.0ms24×body320valid
17.0ms48×body80nan
13.0ms14×body160valid

simplify204.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
203.0ms
(+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2)))))

prune39.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 15.1b

localize53.0ms

Local error

Found 4 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
15×add-cube-cbrt
15×*-un-lft-identity
15×add-sqr-sqrt
12×times-frac
add-exp-log
add-cbrt-cube
associate-/r*
pow1
add-log-exp
associate-/l*
log1p-expm1-u
neg-mul-1
expm1-log1p-u
unpow-prod-down
div-inv
frac-2neg
clear-num
fma-udef
associate-/r/
distribute-frac-neg
tan-quot
pow-exp
div-exp
div-sub
pow-pow
cbrt-undiv
pow-to-exp
neg-sub0
Counts
4 → 76
Calls
4 calls:
Slowest
6.0ms
(/ (- x) (tan B))
2.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
1.0ms
(/ F (sin B))
0.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))

series600.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
213.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (- x) (tan B)))
210.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
101.0ms
(/ (- x) (tan B))
75.0ms
(/ F (sin B))

simplify1.7s

Counts
54 → 88
Calls
54 calls:
Slowest
262.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))))))
240.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
227.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)))
204.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))))))
179.0ms
(/ (* (* (- x) (- x)) (- x)) (* (* (tan B) (tan B)) (tan B)))

prune1.5s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 14.5b

localize14.0ms

Local error

Found 4 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Rules
15×add-cube-cbrt
15×*-un-lft-identity
15×add-sqr-sqrt
12×times-frac
add-exp-log
add-cbrt-cube
pow1
add-log-exp
associate-/l*
log1p-expm1-u
associate-*r*
neg-mul-1
expm1-log1p-u
unpow-prod-down
associate-/r*
div-inv
fma-udef
*-commutative
un-div-inv
associate-/r/
distribute-frac-neg
associate-*r/
tan-quot
pow-exp
div-exp
div-sub
frac-2neg
pow-pow
clear-num
cbrt-undiv
pow-to-exp
neg-sub0
Counts
4 → 77
Calls
4 calls:
Slowest
3.0ms
(/ (- x) (tan B))
1.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
1.0ms
(* F (/ 1 (sin B)))
0.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (- x) (tan B)))

series581.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
215.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (* F (/ 1 (sin B))) (/ (- x) (tan B)))
185.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
123.0ms
(/ (- x) (tan B))
58.0ms
(* F (/ 1 (sin B)))

simplify1.8s

Counts
57 → 89
Calls
57 calls:
Slowest
257.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))))))
240.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
238.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)))
203.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))))))
180.0ms
(/ (* (* (- x) (- x)) (- x)) (* (* (tan B) (tan B)) (tan B)))

prune1.6s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 14.5b

localize31.0ms

Local error

Found 4 expressions with local error:

17.3b
(sqrt (fma 2 x (fma F F 2)))
17.3b
(sqrt (fma 2 x (fma F F 2)))
6.9b
(fma (* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2)) (* F (/ 1 (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))

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
16×add-exp-log
14×add-sqr-sqrt
12×sqrt-prod
12×add-cube-cbrt
12×*-un-lft-identity
12×unpow-prod-down
prod-exp
associate-*l*
associate-*r*
pow-exp
add-cbrt-cube
pow-to-exp
add-log-exp
log1p-expm1-u
pow1
expm1-log1p-u
pow1/2
rem-sqrt-square
fma-udef
cbrt-unprod
pow-prod-up
*-commutative
pow-prod-down
pow2
Counts
4 → 79
Calls
4 calls:
Slowest
9.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)))
0.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 (/ 1 (sin B))) (/ (- x) (tan B)))

series355.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
177.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 (/ 1 (sin B))) (/ (- x) (tan B)))
77.0ms
(sqrt (fma 2 x (fma F F 2)))
58.0ms
(sqrt (fma 2 x (fma F F 2)))
43.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
254.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
201.0ms
(- (+ (sqrt 2) (* x (sqrt 1/2))) (* 1/2 (* (pow x 2) (sqrt 1/8))))
156.0ms
(- (+ (sqrt 2) (* x (sqrt 1/2))) (* 1/2 (* (pow x 2) (sqrt 1/8))))
110.0ms
(- (+ (* 3/2 (* (sqrt 1/32) (pow x 2))) (sqrt 1/2)) (* x (sqrt 1/8)))
68.0ms
(* (* (* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2)) (pow (sqrt (fma 2 x (fma F F 2))) -1/2)) (* (* (pow (sqrt (fma 2 x (fma F F 2))) -1/2) (pow (sqrt (fma 2 x (fma F F 2))) -1/2)) (pow (sqrt (fma 2 x (fma F F 2))) -1/2)))

prune1.7s

Pruning

16 alts after pruning (16 fresh and 0 done)

Merged error: 13.0b

localize15.0ms

Local error

Found 4 expressions with local error:

17.3b
(pow (fma 2 x (fma F F 2)) -1/2)
6.9b
(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
(* (cos B) (- x))

rewrite12.0ms

Algorithm
rewrite-expression-head
Rules
12×add-exp-log
11×add-cbrt-cube
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
pow1
add-log-exp
log1p-expm1-u
associate-*r*
expm1-log1p-u
associate-*l*
times-frac
unpow-prod-down
associate-/r*
cbrt-unprod
distribute-rgt-neg-out
prod-exp
div-exp
cbrt-undiv
associate-/l*
div-inv
fma-udef
*-commutative
distribute-frac-neg
pow-exp
pow-prod-down
frac-2neg
pow-pow
neg-mul-1
clear-num
pow-to-exp
Counts
4 → 70
Calls
4 calls:
Slowest
7.0ms
(/ (* (cos B) (- x)) (sin B))
4.0ms
(* (cos B) (- x))
1.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
0.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (* (cos B) (- x)) (sin B)))

series531.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
207.0ms
(fma (pow (fma 2 x (fma F F 2)) -1/2) (/ F (sin B)) (/ (* (cos B) (- x)) (sin B)))
192.0ms
(pow (fma 2 x (fma F F 2)) -1/2)
89.0ms
(/ (* (cos B) (- x)) (sin B))
43.0ms
(* (cos B) (- x))

simplify1.9s

Counts
40 → 82
Calls
40 calls:
Slowest
279.0ms
(* (* (* (cos B) (cos B)) (cos B)) (* (* (- x) (- x)) (- x)))
218.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (/ x B) (/ (* x (* F (sqrt 1/8))) B)))
213.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)))
204.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)))
197.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.2s

Pruning

15 alts after pruning (15 fresh and 0 done)

Merged error: 13.0b

regimes446.0ms

Accuracy

0% (2.1b remaining)

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

bsearch8.0ms

end0.0ms

sample14.4s

Algorithm
intervals
Results
5.1s1695×body1280valid
3.7s1373×body640valid
2.6s4804×body80valid
1.5s677×body320valid
851.0ms1629×body80nan
367.0ms349×body160valid