Average Error: 0.0 → 0.0
Time: 22.9s
Precision: 64
Internal Precision: 128
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{\left(1 - x\right) \cdot \left(1 - x\right)}{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. Using strategy rm
  6. Applied associate-*l/0.0

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

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

Reproduce

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

Details

Time bar (total: 22.6s)Debug log

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

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
3 → 65
Calls

3 calls. Slowest were:

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

series48.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

25.0ms
(sqrt (/ (- 1 x) (+ 1 x)))
18.0ms
(/ (- 1 x) (+ 1 x))
5.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

simplify1.5s

Counts
57 → 74
Calls

57 calls. Slowest were:

273.0ms
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
251.0ms
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
233.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))

prune651.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

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

rewrite19.0ms

Algorithm
rewrite-expression-head
Counts
4 → 100
Calls

4 calls. Slowest were:

8.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
5.0ms
(/ (- 1 x) (- (* 1 1) (* x x)))
2.0ms
(sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x)))

series98.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

46.0ms
(sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x)))
25.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
21.0ms
(/ (- 1 x) (- (* 1 1) (* x x)))
6.0ms
(atan (sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))))

simplify6.4s

Counts
91 → 112
Calls

91 calls. Slowest were:

640.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)))
496.0ms
(* (- x) (/ (- 1 x) (- (* 1 1) (* x x))))
421.0ms
(* (- x) (/ (- 1 x) (- (* 1 1) (* x x))))

prune1.1s

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize12.0ms

Local error

Found 4 expressions with local error:

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

rewrite31.0ms

Algorithm
rewrite-expression-head
Counts
4 → 93
Calls

4 calls. Slowest were:

13.0ms
(/ (* (- 1 x) (- 1 x)) (- (* 1 1) (* x x)))
5.0ms
(sqrt (/ (* (- 1 x) (- 1 x)) (- (* 1 1) (* x x))))
5.0ms
(* (- 1 x) (- 1 x))

series68.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

38.0ms
(sqrt (/ (* (- 1 x) (- 1 x)) (- (* 1 1) (* x x))))
17.0ms
(/ (* (- 1 x) (- 1 x)) (- (* 1 1) (* x x)))
7.0ms
(* (- 1 x) (- 1 x))
6.0ms
(atan (sqrt (/ (* (- 1 x) (- 1 x)) (- (* 1 1) (* x x)))))

simplify9.0s

Counts
79 → 105
Calls

79 calls. Slowest were:

864.0ms
(sqrt (/ (* (- 1 x) (- 1 x)) (- (pow (* 1 1) 3) (pow (* x x) 3))))
660.0ms
(* (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (- 1 x) (- 1 x)) (- 1 x)))
603.0ms
(/ (* (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (- 1 x) (- 1 x)) (- 1 x))) (* (* (- (* 1 1) (* x x)) (- (* 1 1) (* x x))) (- (* 1 1) (* x x))))

prune1.1s

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample2.2s

Algorithm
intervals