Average Error: 0.0 → 0.0
Time: 14.1s
Precision: 64
Internal Precision: 128
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right)\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
  2. Using strategy rm
  3. Applied sqrt-div0.0

    \[\leadsto 2 \cdot \tan^{-1} \color{blue}{\left(\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right)}\]
  4. Final simplification0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\frac{\sqrt{1 - x}}{\sqrt{1 + x}}\right)\]

Reproduce

herbie shell --seed 2019002 +o rules:numerics
(FPCore (x)
  :name "arccos"
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))

Details

Time bar (total: 13.8s)Debug log

sample137.0ms

Algorithm
intervals

simplify16.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

15.0ms
(* 2 (atan (sqrt (/ (- 1 x) (+ 1 x)))))

prune7.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 2 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
2 → 62
Calls

2 calls. Slowest were:

17.0ms
(/ (- 1 x) (+ 1 x))
2.0ms
(sqrt (/ (- 1 x) (+ 1 x)))

series44.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

26.0ms
(sqrt (/ (- 1 x) (+ 1 x)))
18.0ms
(/ (- 1 x) (+ 1 x))

simplify5.1s

Counts
54 → 68
Calls

54 calls. Slowest were:

1.8s
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
1.8s
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
439.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))

prune707.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize23.0ms

Local error

Found 1 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
1 → 67
Calls

1 calls. Slowest were:

8.0ms
(/ (sqrt (- 1 x)) (sqrt (+ 1 x)))

series44.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

44.0ms
(/ (sqrt (- 1 x)) (sqrt (+ 1 x)))

simplify4.4s

Counts
93 → 70
Calls

93 calls. Slowest were:

1.7s
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
1.7s
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
173.0ms
(/ (* (* (sqrt (- 1 x)) (sqrt (- 1 x))) (sqrt (- 1 x))) (* (* (sqrt (+ 1 x)) (sqrt (+ 1 x))) (sqrt (+ 1 x))))

prune799.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample2.4s

Algorithm
intervals