Average Error: 15.1 → 0.4
Time: 7.1s
Precision: 64
Internal Precision: 128
\[\tan^{-1} \left(N + 1\right) - \tan^{-1} N\]
\[\tan^{-1}_* \frac{1}{\left(N + 1\right) \cdot N + 1}\]

Error

Bits error versus N

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.1
Target0.4
Herbie0.4
\[\tan^{-1} \left(\frac{1}{1 + N \cdot \left(N + 1\right)}\right)\]

Derivation

  1. Initial program 15.1

    \[\tan^{-1} \left(N + 1\right) - \tan^{-1} N\]
  2. Using strategy rm
  3. Applied diff-atan14.0

    \[\leadsto \color{blue}{\tan^{-1}_* \frac{\left(N + 1\right) - N}{1 + \left(N + 1\right) \cdot N}}\]
  4. Simplified0.4

    \[\leadsto \tan^{-1}_* \frac{\color{blue}{1}}{1 + \left(N + 1\right) \cdot N}\]
  5. Final simplification0.4

    \[\leadsto \tan^{-1}_* \frac{1}{\left(N + 1\right) \cdot N + 1}\]

Reproduce

herbie shell --seed 2019004 
(FPCore (N)
  :name "2atan (example 3.5)"

  :herbie-target
  (atan (/ 1 (+ 1 (* N (+ N 1)))))

  (- (atan (+ N 1)) (atan N)))

Details

Time bar (total: 6.5s)Debug log

sample76.0ms

Algorithm
intervals

simplify8.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

8.0ms
(- (atan (+ N 1)) (atan N))

prune24.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 15.5b

localize23.0ms

Local error

Found 2 expressions with local error:

1.6b
(- (atan (+ N 1)) (atan N))
0.0b
(atan (+ N 1))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
2 → 22
Calls

2 calls. Slowest were:

7.0ms
(- (atan (+ N 1)) (atan N))
1.0ms
(atan (+ N 1))

series14.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

11.0ms
(- (atan (+ N 1)) (atan N))
3.0ms
(atan (+ N 1))

simplify99.0ms

Counts
12 → 28
Calls

12 calls. Slowest were:

22.0ms
(+ 1 (* (+ N 1) N))
15.0ms
(- (+ N 1) N)
13.0ms
(/ (exp (atan (+ N 1))) (exp (atan N)))

prune240.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.5b

localize80.0ms

Local error

Found 1 expressions with local error:

0.5b
(atan2 1 (+ 1 (* (+ N 1) N)))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 7
Calls

1 calls. Slowest were:

0.0ms
(atan2 1 (+ 1 (* (+ N 1) N)))

series7.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

7.0ms
(atan2 1 (+ 1 (* (+ N 1) N)))

simplify70.0ms

Counts
3 → 10
Calls

3 calls. Slowest were:

24.0ms
(atan2 1 (+ N (+ (pow N 2) 1)))
23.0ms
(atan2 1 (+ N (+ (pow N 2) 1)))
22.0ms
(atan2 1 (+ N (+ (pow N 2) 1)))

prune109.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.4b

localize11.0ms

Local error

Found 4 expressions with local error:

17.6b
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))
17.6b
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))
0.5b
(* (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))) (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))))
0.5b
(atan2 1 (+ 1 (* (+ N 1) N)))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

5.0ms
(* (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))) (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))))
1.0ms
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))
1.0ms
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))

series32.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

13.0ms
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))
12.0ms
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))
4.0ms
(atan2 1 (+ 1 (* (+ N 1) N)))
3.0ms
(* (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))) (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))))

simplify1.0s

Counts
42 → 73
Calls

42 calls. Slowest were:

49.0ms
(* (* (* (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))) (sqrt (atan2 1 (+ 1 (* (+ N 1) N))))) (sqrt (atan2 1 (+ 1 (* (+ N 1) N))))) (* (* (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))) (sqrt (atan2 1 (+ 1 (* (+ N 1) N))))) (sqrt (atan2 1 (+ 1 (* (+ N 1) N))))))
45.0ms
(sqrt (* (cbrt (atan2 1 (+ 1 (* (+ N 1) N)))) (cbrt (atan2 1 (+ 1 (* (+ N 1) N))))))
45.0ms
(* (cbrt (sqrt (atan2 1 (+ 1 (* (+ N 1) N))))) (cbrt (sqrt (atan2 1 (+ 1 (* (+ N 1) N))))))

prune540.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.4b

localize34.0ms

Local error

Found 4 expressions with local error:

17.6b
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))
17.6b
(sqrt (atan2 1 (+ N (+ (pow N 2) 1))))
0.5b
(* (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))) (sqrt (atan2 1 (+ N (+ (pow N 2) 1)))))
0.5b
(atan2 1 (+ N (+ (pow N 2) 1)))

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

9.0ms
(* (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))) (sqrt (atan2 1 (+ N (+ (pow N 2) 1)))))
1.0ms
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))
1.0ms
(sqrt (atan2 1 (+ N (+ (pow N 2) 1))))

series52.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

21.0ms
(sqrt (atan2 1 (+ 1 (* (+ N 1) N))))
20.0ms
(sqrt (atan2 1 (+ N (+ (pow N 2) 1))))
5.0ms
(* (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))) (sqrt (atan2 1 (+ N (+ (pow N 2) 1)))))
5.0ms
(atan2 1 (+ N (+ (pow N 2) 1)))

simplify878.0ms

Counts
36 → 68
Calls

36 calls. Slowest were:

49.0ms
(sqrt (* (cbrt (atan2 1 (+ 1 (* (+ N 1) N)))) (cbrt (atan2 1 (+ 1 (* (+ N 1) N))))))
44.0ms
(* (cbrt (sqrt (atan2 1 (+ 1 (* (+ N 1) N))))) (cbrt (sqrt (atan2 1 (+ 1 (* (+ N 1) N))))))
42.0ms
(sqrt (sqrt (atan2 1 (+ 1 (* (+ N 1) N)))))

prune815.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.4b

regimes43.0ms

Accuracy

0% (0.0b remaining)

Error of 0.4b against oracle of 0.3b and baseline of 0.4b

bsearch1.0ms

end0.0ms

sample2.3s

Algorithm
intervals