Average Error: 0.1 → 0.1
Time: 11.0s
Precision: 64
Internal Precision: 128
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left((\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}\right) \cdot \left(\sqrt[3]{\frac{1}{x}}\right) + \left(\frac{\sqrt{1 - x \cdot x}}{x}\right))_*\right)\]

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.1

    \[\leadsto \log \left(\color{blue}{\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}\right) \cdot \sqrt[3]{\frac{1}{x}}} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  4. Applied fma-def0.1

    \[\leadsto \log \color{blue}{\left((\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}\right) \cdot \left(\sqrt[3]{\frac{1}{x}}\right) + \left(\frac{\sqrt{1 - x \cdot x}}{x}\right))_*\right)}\]
  5. Final simplification0.1

    \[\leadsto \log \left((\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}\right) \cdot \left(\sqrt[3]{\frac{1}{x}}\right) + \left(\frac{\sqrt{1 - x \cdot x}}{x}\right))_*\right)\]

Reproduce

herbie shell --seed 2019022 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))

Details

Time bar (total: 10.6s)Debug log

sample123.0ms

Algorithm
intervals
Results
76.0ms805×body80nan
28.0ms256×body80valid

simplify42.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
42.0ms
(log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x)))

prune5.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 2 expressions with local error:

0.0b
(+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))
0.0b
(log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x)))

rewrite8.0ms

Algorithm
rewrite-expression-head
Rules
12×*-un-lft-identity
11×div-inv
log-prod
add-log-exp
distribute-lft-out
add-cube-cbrt
distribute-rgt-out
fma-def
add-sqr-sqrt
add-exp-log
log-div
pow1
log1p-expm1-u
flip-+
distribute-rgt1-in
frac-add
add-cbrt-cube
flip3-+
expm1-log1p-u
log-pow
rem-log-exp
sum-log
+-commutative
Counts
2 → 45
Calls
2 calls:
Slowest
5.0ms
(+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))
3.0ms
(log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x)))

series144.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
112.0ms
(log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x)))
31.0ms
(+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))

simplify2.2s

Counts
30 → 51
Calls
30 calls:
Slowest
462.0ms
(- (log 2) (+ (* 1/4 (pow x 2)) (+ (* 3/32 (pow x 4)) (log x))))
312.0ms
(log (- (* (/ 1 x) (/ 1 x)) (* (/ (sqrt (- 1 (* x x))) x) (/ (sqrt (- 1 (* x x))) x))))
285.0ms
(- (/ 1 x) (+ (* 1/2 (/ 1 (* (pow x 2) (sqrt -1)))) (sqrt -1)))
232.0ms
(- (* 2 (/ 1 x)) (+ (* 1/2 x) (* 1/8 (pow x 3))))
230.0ms
(log (+ (pow (/ 1 x) 3) (pow (/ (sqrt (- 1 (* x x))) x) 3)))

prune406.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize23.0ms

Local error

Found 4 expressions with local error:

0.6b
(* (cbrt (/ 1 x)) (cbrt (/ 1 x)))
0.5b
(cbrt (/ 1 x))
0.5b
(cbrt (/ 1 x))
0.5b
(cbrt (/ 1 x))

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
20×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
pow1
associate-*l*
associate-*r*
pow1/3
cbrt-div
add-exp-log
div-inv
add-log-exp
log1p-expm1-u
add-cbrt-cube
expm1-log1p-u
pow-prod-up
pow-prod-down
cbrt-unprod
*-commutative
associate-*r/
prod-exp
associate-*l/
pow-plus
frac-times
pow2
Counts
4 → 80
Calls
4 calls:
Slowest
9.0ms
(* (cbrt (/ 1 x)) (cbrt (/ 1 x)))
1.0ms
(cbrt (/ 1 x))
1.0ms
(cbrt (/ 1 x))
1.0ms
(cbrt (/ 1 x))

series1.1s

Counts
4 → 12
Calls
4 calls:
Slowest
305.0ms
(cbrt (/ 1 x))
300.0ms
(* (cbrt (/ 1 x)) (cbrt (/ 1 x)))
269.0ms
(cbrt (/ 1 x))
260.0ms
(cbrt (/ 1 x))

simplify167.0ms

Counts
53 → 92
Calls
53 calls:
Slowest
23.0ms
(* (pow (/ 1 (pow x 2)) 1/3) (pow (cbrt -1) 2))
12.0ms
(* (/ 1 x) (/ 1 x))
6.0ms
(* (pow (/ -1 x) 1/3) (cbrt -1))
6.0ms
(* (pow (/ -1 x) 1/3) (cbrt -1))
6.0ms
(* (pow (/ -1 x) 1/3) (cbrt -1))

prune1.1s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes85.0ms

Accuracy

0% (0.0b remaining)

Error of 0.1b against oracle of 0.1b and baseline of 0.1b

bsearch2.0ms

end0.0ms

sample5.1s

Algorithm
intervals
Results
3.5s24239×body80nan
1.2s8000×body80valid