Average Error: 0.0 → 0.0
Time: 18.2s
Precision: 64
Internal Precision: 128
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\left(1 - x\right) \cdot \frac{1 - x}{1 - x \cdot 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 flip-+0.0

    \[\leadsto 2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{\color{blue}{\frac{1 \cdot 1 - x \cdot x}{1 - x}}}}\right)\]
  4. Applied associate-/r/0.0

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

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

Reproduce

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

Details

Time bar (total: 17.9s)Debug log

sample226.0ms

Algorithm
intervals

simplify30.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune12.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))))

series75.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

39.0ms
(sqrt (/ (- 1 x) (+ 1 x)))
29.0ms
(/ (- 1 x) (+ 1 x))
7.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

simplify4.2s

Counts
57 → 80
Calls

57 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))))))
393.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))

prune787.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize40.0ms

Local error

Found 4 expressions with local error:

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

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 108
Calls

4 calls. Slowest were:

17.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
4.0ms
(/ (- 1 x) (- (* 1 1) (* x x)))
2.0ms
(sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x)))

series59.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

25.0ms
(sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x)))
18.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
12.0ms
(/ (- 1 x) (- (* 1 1) (* x x)))
3.0ms
(atan (sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))))

simplify8.6s

Counts
91 → 120
Calls

91 calls. Slowest were:

811.0ms
(sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- (* 1 1) (* x x))))
675.0ms
(* (* (* (/ (- 1 x) (- (* 1 1) (* x x))) (/ (- 1 x) (- (* 1 1) (* x x)))) (/ (- 1 x) (- (* 1 1) (* x x)))) (* (* (- 1 x) (- 1 x)) (- 1 x)))
620.0ms
(sqrt (* (- 1 x) (- (pow 1 3) (pow x 3))))

prune1.2s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes102.0ms

Accuracy

0% (0.0b remaining)

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

bsearch4.0ms

end0.0ms

sample2.5s

Algorithm
intervals