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

Details

Time bar (total: 13.2s)Debug log

sample180.0ms

Algorithm
intervals

simplify50.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune16.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize123.0ms

Local error

Found 2 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
2 → 39
Calls

2 calls. Slowest were:

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

series76.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

68.0ms
(/ (- 1 x) (+ 1 x))
7.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

simplify749.0ms

Counts
36 → 45
Calls

36 calls. Slowest were:

263.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))
81.0ms
(- (* 2 (/ 1 x)) (+ (* 2 (/ 1 (pow x 2))) 1))
67.0ms
(- (* 2 (/ 1 x)) (+ (* 2 (/ 1 (pow x 2))) 1))

prune399.0ms

Pruning

2 alts after pruning (2 fresh and 0 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
(- (* 1 1) (* x x))
0.0b
(/ (- 1 x) (- (* 1 1) (* x x)))
0.0b
(atan (sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))))

rewrite30.0ms

Algorithm
rewrite-expression-head
Counts
4 → 99
Calls

4 calls. Slowest were:

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

series70.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

31.0ms
(- (* 1 1) (* x x))
24.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))))

simplify5.0s

Counts
88 → 111
Calls

88 calls. Slowest were:

676.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)))
480.0ms
(* (- x) (/ (- 1 x) (- (* 1 1) (* x x))))
423.0ms
(* (- x) (/ (- 1 x) (- (* 1 1) (* x x))))

prune996.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

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

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 62
Calls

4 calls. Slowest were:

9.0ms
(* (- 1 x) (sqrt (/ 1 (- 1 (pow x 2)))))
2.0ms
(- 1 (pow x 2))
1.0ms
(atan (* (- 1 x) (sqrt (/ 1 (- 1 (pow x 2))))))

series108.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

37.0ms
(* (- 1 x) (sqrt (/ 1 (- 1 (pow x 2)))))
33.0ms
(- 1 (pow x 2))
32.0ms
(sqrt (/ 1 (- 1 (pow x 2))))
5.0ms
(atan (* (- 1 x) (sqrt (/ 1 (- 1 (pow x 2))))))

simplify2.3s

Counts
41 → 74
Calls

41 calls. Slowest were:

313.0ms
(* (+ (* 1 1) (+ (* x x) (* 1 x))) (sqrt (- 1 (pow x 2))))
296.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))
238.0ms
(- (sqrt -1) (+ (* 1/2 (/ 1 (* (pow x 2) (sqrt -1)))) (/ (sqrt -1) x)))

prune694.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes44.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.3s

Algorithm
intervals