Average Error: 0.0 → 0.0
Time: 16.6s
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 2019005 +o rules:numerics
(FPCore (x)
  :name "arccos"
  (* 2 (atan (sqrt (/ (- 1 x) (+ 1 x))))))

Details

Time bar (total: 16.2s)Debug log

sample157.0ms

Algorithm
intervals

simplify24.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize33.0ms

Local error

Found 2 expressions with local error:

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

rewrite36.0ms

Algorithm
rewrite-expression-head
Counts
2 → 43
Calls

2 calls. Slowest were:

30.0ms
(/ (- 1 x) (+ 1 x))
2.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

series36.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

30.0ms
(/ (- 1 x) (+ 1 x))
6.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

simplify1.0s

Counts
36 → 49
Calls

36 calls. Slowest were:

315.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))
176.0ms
(- (* 2 (/ 1 x)) (+ (* 2 (/ 1 (pow x 2))) 1))
160.0ms
(- (* 2 (/ 1 x)) (+ (* 2 (/ 1 (pow x 2))) 1))

prune481.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize19.0ms

Local error

Found 4 expressions with local error:

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

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 109
Calls

4 calls. Slowest were:

8.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
4.0ms
(/ (- 1 x) (- (* 1 1) (* x x)))
2.0ms
(- (* 1 1) (* x x))

series70.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

31.0ms
(- (* 1 1) (* x x))
20.0ms
(/ (- 1 x) (- (* 1 1) (* x x)))
15.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
4.0ms
(atan (sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))))

simplify6.3s

Counts
90 → 121
Calls

90 calls. Slowest were:

867.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)))
524.0ms
(* (- 1 x) (- (pow 1 3) (pow x 3)))
489.0ms
(* (- x) (/ (- 1 x) (- (* 1 1) (* x x))))

prune1.3s

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 70
Calls

4 calls. Slowest were:

5.0ms
(* (- 1 x) (sqrt (/ 1 (- 1 (pow x 2)))))
1.0ms
(sqrt (/ 1 (- 1 (pow x 2))))
1.0ms
(- 1 (pow x 2))

series110.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

49.0ms
(sqrt (/ 1 (- 1 (pow x 2))))
29.0ms
(- 1 (pow x 2))
24.0ms
(* (- 1 x) (sqrt (/ 1 (- 1 (pow x 2)))))
8.0ms
(atan (* (- 1 x) (sqrt (/ 1 (- 1 (pow x 2))))))

simplify2.9s

Counts
41 → 82
Calls

41 calls. Slowest were:

464.0ms
(* (+ (* 1 1) (+ (* x x) (* 1 x))) (sqrt (- 1 (pow x 2))))
445.0ms
(- (+ (* 1/2 (/ 1 (* (pow x 3) (sqrt -1)))) (+ (* 1/2 (/ 1 (* (pow x 5) (sqrt -1)))) (* 1/8 (/ 1 (* (pow x 5) (pow (sqrt -1) 3)))))) (/ (sqrt -1) x))
312.0ms
(- (/ (sqrt -1) x) (+ (* 1/2 (/ 1 (* (pow x 3) (sqrt -1)))) (+ (* 1/2 (/ 1 (* (pow x 5) (sqrt -1)))) (* 1/8 (/ 1 (* (pow x 5) (pow (sqrt -1) 3)))))))

prune925.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes41.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