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

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 expm1-log1p-u0.0

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

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

Reproduce

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

Details

Time bar (total: 16.9s)Debug log

sample181.0ms

Algorithm
intervals

simplify17.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune10.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize60.0ms

Local error

Found 3 expressions with local error:

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

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
3 → 71
Calls

3 calls. Slowest were:

8.0ms
(/ (- 1 x) (+ 1 x))
3.0ms
(sqrt (/ (- 1 x) (+ 1 x)))
1.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

series74.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

40.0ms
(sqrt (/ (- 1 x) (+ 1 x)))
28.0ms
(/ (- 1 x) (+ 1 x))
6.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

simplify4.5s

Counts
57 → 80
Calls

57 calls. Slowest were:

1.5s
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
1.5s
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
434.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))

prune768.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 108
Calls

4 calls. Slowest were:

4.0ms
(/ (sqrt (- 1 x)) (sqrt (+ 1 x)))
3.0ms
(atan (/ (sqrt (- 1 x)) (sqrt (+ 1 x))))
1.0ms
(sqrt (- 1 x))

series54.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

24.0ms
(/ (sqrt (- 1 x)) (sqrt (+ 1 x)))
14.0ms
(sqrt (- 1 x))
13.0ms
(sqrt (+ 1 x))
2.0ms
(atan (/ (sqrt (- 1 x)) (sqrt (+ 1 x))))

simplify4.0s

Counts
114 → 120
Calls

114 calls. Slowest were:

1.4s
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
1.4s
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
155.0ms
(- 1 (+ (* 1/2 x) (* 1/8 (pow x 2))))

prune1.2s

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize30.0ms

Local error

Found 4 expressions with local error:

0.0b
(/ (- 1 x) (+ 1 x))
0.0b
(expm1 (log1p (/ (- 1 x) (+ 1 x))))
0.0b
(atan (sqrt (expm1 (log1p (/ (- 1 x) (+ 1 x))))))
0.0b
(sqrt (expm1 (log1p (/ (- 1 x) (+ 1 x)))))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

3.0ms
(/ (- 1 x) (+ 1 x))
1.0ms
(sqrt (expm1 (log1p (/ (- 1 x) (+ 1 x)))))
0.0ms
(atan (sqrt (expm1 (log1p (/ (- 1 x) (+ 1 x))))))

series202.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

113.0ms
(sqrt (expm1 (log1p (/ (- 1 x) (+ 1 x)))))
73.0ms
(expm1 (log1p (/ (- 1 x) (+ 1 x))))
11.0ms
(/ (- 1 x) (+ 1 x))
4.0ms
(atan (sqrt (expm1 (log1p (/ (- 1 x) (+ 1 x))))))

simplify2.2s

Counts
47 → 80
Calls

47 calls. Slowest were:

353.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))
309.0ms
(- (+ (exp (+ (log -2) (log (/ -1 x)))) (/ (exp (+ (log -2) (log (/ -1 x)))) (pow x 2))) (+ (/ (exp (+ (log -2) (log (/ -1 x)))) x) 1))
299.0ms
(- (+ (/ (exp (+ (log 2) (log (/ 1 x)))) (pow x 2)) (exp (+ (log 2) (log (/ 1 x))))) (+ (/ (exp (+ (log 2) (log (/ 1 x)))) x) 1))

prune906.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes75.0ms

Accuracy

0% (0.0b remaining)

Error of 0.0b against oracle of 0.0b and baseline of 0.0b

bsearch3.0ms

end0.0ms

sample2.6s

Algorithm
intervals