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

Details

Time bar (total: 33.1s)Debug log

sample166.0ms

Algorithm
intervals

simplify16.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
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

localize18.0ms

Local error

Found 3 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Rules
21×add-sqr-sqrt
19×times-frac
18×add-cube-cbrt
18×*-un-lft-identity
15×sqrt-prod
add-exp-log
add-cbrt-cube
associate-/r/
add-log-exp
associate-/l*
associate-/r*
pow1
associate-/l/
div-inv
flip-+
flip3-+
rem-sqrt-square
flip--
div-exp
div-sub
sqrt-div
pow1/2
flip3--
frac-2neg
clear-num
cbrt-undiv
Counts
3 → 65
Calls
3 calls:
Slowest
4.0ms
(/ (- 1 x) (+ 1 x))
1.0ms
(sqrt (/ (- 1 x) (+ 1 x)))
1.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

series61.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
36.0ms
(sqrt (/ (- 1 x) (+ 1 x)))
19.0ms
(/ (- 1 x) (+ 1 x))
6.0ms
(atan (sqrt (/ (- 1 x) (+ 1 x))))

simplify1.5s

Counts
57 → 74
Calls
57 calls:
Slowest
269.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))
228.0ms
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
224.0ms
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
123.0ms
(- (* 2 (/ 1 x)) (+ (* 2 (/ 1 (pow x 2))) 1))
87.0ms
(- (* 2 (/ 1 x)) (+ (* 2 (/ 1 (pow x 2))) 1))

prune590.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize34.0ms

Local error

Found 4 expressions with local error:

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

rewrite46.0ms

Algorithm
rewrite-expression-head
Rules
550×times-frac
434×sqrt-prod
306×add-sqr-sqrt
288×add-cube-cbrt
288×*-un-lft-identity
35×sqrt-div
32×associate-/r/
27×associate-/l*
17×flip-+
17×flip3-+
16×div-inv
12×associate-/r*
11×add-exp-log
11×add-cbrt-cube
rem-sqrt-square
add-log-exp
div-exp
cbrt-undiv
pow1
associate-/l/
div-sub
pow1/2
frac-2neg
clear-num
flip--
flip3--
Counts
4 → 416
Calls
4 calls:
Slowest
14.0ms
(/ (/ (- 1 x) (sqrt (+ 1 x))) (sqrt (+ 1 x)))
8.0ms
(sqrt (/ (/ (- 1 x) (sqrt (+ 1 x))) (sqrt (+ 1 x))))
5.0ms
(/ (- 1 x) (sqrt (+ 1 x)))
1.0ms
(sqrt (+ 1 x))

series121.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
48.0ms
(sqrt (/ (/ (- 1 x) (sqrt (+ 1 x))) (sqrt (+ 1 x))))
38.0ms
(/ (- 1 x) (sqrt (+ 1 x)))
18.0ms
(/ (/ (- 1 x) (sqrt (+ 1 x))) (sqrt (+ 1 x)))
17.0ms
(sqrt (+ 1 x))

simplify14.8s

Counts
552 → 428
Calls
552 calls:
Slowest
609.0ms
(/ (* (* (/ (- 1 x) (sqrt (+ 1 x))) (/ (- 1 x) (sqrt (+ 1 x)))) (/ (- 1 x) (sqrt (+ 1 x)))) (* (* (sqrt (+ 1 x)) (sqrt (+ 1 x))) (sqrt (+ 1 x))))
453.0ms
(/ (/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (sqrt (+ 1 x)) (sqrt (+ 1 x))) (sqrt (+ 1 x)))) (* (* (sqrt (+ 1 x)) (sqrt (+ 1 x))) (sqrt (+ 1 x))))
285.0ms
(/ (/ (* (cbrt (- 1 x)) (cbrt (- 1 x))) (sqrt 1)) (* (cbrt (sqrt (+ 1 x))) (cbrt (sqrt (+ 1 x)))))
278.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 (/ (/ (* (cbrt (- 1 x)) (cbrt (- 1 x))) (sqrt 1)) (* (cbrt (sqrt (+ 1 x))) (cbrt (sqrt (+ 1 x))))))

prune5.9s

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize41.0ms

Local error

Found 4 expressions with local error:

0.0b
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
0.0b
(sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 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
Rules
24×times-frac
22×add-cube-cbrt
22×*-un-lft-identity
22×add-sqr-sqrt
18×associate-*l*
11×add-exp-log
11×add-cbrt-cube
difference-of-squares
flip--
flip3--
pow1
sqrt-div
add-log-exp
associate-/r/
associate-*r/
associate-/r*
frac-times
associate-/l*
associate-*r*
associate-/l/
div-inv
cbrt-unprod
prod-exp
associate-*l/
div-exp
distribute-lft-in
sub-neg
cbrt-undiv
distribute-rgt-in
sqrt-prod
*-commutative
pow-prod-down
div-sub
pow1/2
frac-2neg
clear-num
Counts
4 → 100
Calls
4 calls:
Slowest
10.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
4.0ms
(/ (- 1 x) (- (* 1 1) (* x x)))
1.0ms
(sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x)))
1.0ms
(atan (sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))))

series69.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
27.0ms
(sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x)))
24.0ms
(/ (- 1 x) (- (* 1 1) (* x x)))
15.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))
3.0ms
(atan (sqrt (* (/ (- 1 x) (- (* 1 1) (* x x))) (- 1 x))))

simplify6.1s

Counts
91 → 112
Calls
91 calls:
Slowest
665.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)))
400.0ms
(* (- x) (/ (- 1 x) (- (* 1 1) (* x x))))
386.0ms
(* (- x) (/ (- 1 x) (- (* 1 1) (* x x))))
333.0ms
(* (- (* 1 1) (* x x)) (+ 1 x))
332.0ms
(* (/ (- 1 x) (- (* 1 1) (* x x))) (- x))

prune1.2s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes21.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample2.4s

Algorithm
intervals