Average Error: 0.0 → 0.0
Time: 4.6s
Precision: 64
Internal Precision: 128
\[2 \cdot \tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right)\]
\[\tan^{-1} \left(\sqrt{\frac{1 - x}{1 + x}}\right) \cdot 2\]

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. Final simplification0.0

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

Reproduce

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

Details

Time bar (total: 4.4s)Debug log

sample181.0ms

Algorithm
intervals
Results
67.0ms246×body80nan
36.0ms256×body80valid

simplify26.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
26.0ms
(* 2 (atan (sqrt (/ (- 1 x) (+ 1 x)))))

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0b

localize33.0ms

Local error

Found 2 expressions with local error:

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

rewrite33.0ms

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

series63.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
36.0ms
(sqrt (/ (- 1 x) (+ 1 x)))
27.0ms
(/ (- 1 x) (+ 1 x))

simplify1.5s

Counts
54 → 64
Calls
54 calls:
Slowest
289.0ms
(/ (* (* (- 1 x) (- 1 x)) (- 1 x)) (* (* (+ 1 x) (+ 1 x)) (+ 1 x)))
266.0ms
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
240.0ms
(- (+ (sqrt -1) (/ 1 (* x (sqrt -1)))) (+ (/ 1 (* (pow x 2) (sqrt -1))) (* 1/2 (/ 1 (* (pow x 2) (pow (sqrt -1) 3))))))
92.0ms
(- (* 2 (/ 1 x)) (+ (* 2 (/ 1 (pow x 2))) 1))
77.0ms
(- (* 2 (/ 1 x)) (+ (* 2 (/ 1 (pow x 2))) 1))

prune536.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0b

end0.0ms

sample2.0s

Algorithm
intervals
Results
990.0ms8000×body80valid
815.0ms7987×body80nan