Average Error: 0.3 → 0.5
Time: 1.2m
Precision: 64
Internal Precision: 128
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\left(1 - {\left(\tan x \cdot \tan x\right)}^{3}\right) \cdot \frac{1 - \tan x \cdot \tan x}{1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}}{{\left(\tan x\right)}^{4} + \left(\tan x \cdot \tan x + 1\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.3

    \[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  2. Using strategy rm
  3. Applied flip-+0.4

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{\color{blue}{\frac{1 \cdot 1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}{1 - \tan x \cdot \tan x}}}\]
  4. Applied associate-/r/0.4

    \[\leadsto \color{blue}{\frac{1 - \tan x \cdot \tan x}{1 \cdot 1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)} \cdot \left(1 - \tan x \cdot \tan x\right)}\]
  5. Using strategy rm
  6. Applied flip3--0.4

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{1 \cdot 1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)} \cdot \color{blue}{\frac{{1}^{3} - {\left(\tan x \cdot \tan x\right)}^{3}}{1 \cdot 1 + \left(\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) + 1 \cdot \left(\tan x \cdot \tan x\right)\right)}}\]
  7. Applied associate-*r/0.5

    \[\leadsto \color{blue}{\frac{\frac{1 - \tan x \cdot \tan x}{1 \cdot 1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)} \cdot \left({1}^{3} - {\left(\tan x \cdot \tan x\right)}^{3}\right)}{1 \cdot 1 + \left(\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) + 1 \cdot \left(\tan x \cdot \tan x\right)\right)}}\]
  8. Simplified0.5

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

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

Reproduce

herbie shell --seed 2019005 
(FPCore (x)
  :name "Trigonometry B"
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))

Details

Time bar (total: 1.2m)Debug log

sample216.0ms

Algorithm
intervals

simplify55.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

55.0ms
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x))))

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

localize18.0ms

Local error

Found 4 expressions with local error:

0.2b
(* (tan x) (tan x))
0.2b
(* (tan x) (tan x))
0.2b
(- 1 (* (tan x) (tan x)))
0.1b
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x))))

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 89
Calls

4 calls. Slowest were:

6.0ms
(* (tan x) (tan x))
5.0ms
(* (tan x) (tan x))
4.0ms
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x))))

series166.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

61.0ms
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x))))
53.0ms
(* (tan x) (tan x))
28.0ms
(* (tan x) (tan x))
24.0ms
(- 1 (* (tan x) (tan x)))

simplify1.7s

Counts
72 → 101
Calls

72 calls. Slowest were:

314.0ms
(/ (* (* (- 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x)))) (- 1 (* (tan x) (tan x)))) (* (* (+ 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))) (+ 1 (* (tan x) (tan x)))))
243.0ms
(/ (- 1 (/ (pow (sin x) 2) (pow (cos x) 2))) (+ (/ (pow (sin x) 2) (pow (cos x) 2)) 1))
232.0ms
(+ (* 1 1) (- (* (* (tan x) (tan x)) (* (tan x) (tan x))) (* 1 (* (tan x) (tan x)))))

prune891.0ms

Pruning

14 alts after pruning (14 fresh and 0 done)

Merged error: 0.0b

localize47.0ms

Local error

Found 4 expressions with local error:

0.2b
(pow (cos x) 2)
0.2b
(pow (cos x) 2)
0.2b
(pow (sin x) 2)
0.2b
(pow (sin x) 2)

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

3.0ms
(pow (cos x) 2)
2.0ms
(pow (cos x) 2)
2.0ms
(pow (sin x) 2)

series88.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

25.0ms
(pow (sin x) 2)
25.0ms
(pow (sin x) 2)
19.0ms
(pow (cos x) 2)
19.0ms
(pow (cos x) 2)

simplify245.0ms

Counts
32 → 68
Calls

32 calls. Slowest were:

58.0ms
(- (+ (pow x 2) (* 2/45 (pow x 6))) (* 1/3 (pow x 4)))
35.0ms
(- (+ (* 1/3 (pow x 4)) 1) (pow x 2))
27.0ms
(- (+ (pow x 2) (* 2/45 (pow x 6))) (* 1/3 (pow x 4)))

prune882.0ms

Pruning

12 alts after pruning (12 fresh and 0 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (* (tan x) (tan x)) (* (tan x) (tan x)))
0.2b
(* (/ (- 1 (* (tan x) (tan x))) (- (* 1 1) (* (* (tan x) (tan x)) (* (tan x) (tan x))))) (- 1 (* (tan x) (tan x))))
0.2b
(* (tan x) (tan x))
0.2b
(* (tan x) (tan x))

rewrite52.0ms

Algorithm
rewrite-expression-head
Counts
4 → 147
Calls

4 calls. Slowest were:

32.0ms
(* (* (tan x) (tan x)) (* (tan x) (tan x)))
9.0ms
(* (/ (- 1 (* (tan x) (tan x))) (- (* 1 1) (* (* (tan x) (tan x)) (* (tan x) (tan x))))) (- 1 (* (tan x) (tan x))))
6.0ms
(* (tan x) (tan x))

series209.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

112.0ms
(* (/ (- 1 (* (tan x) (tan x))) (- (* 1 1) (* (* (tan x) (tan x)) (* (tan x) (tan x))))) (- 1 (* (tan x) (tan x))))
44.0ms
(* (* (tan x) (tan x)) (* (tan x) (tan x)))
26.0ms
(* (tan x) (tan x))
26.0ms
(* (tan x) (tan x))

simplify5.5s

Counts
153 → 159
Calls

153 calls. Slowest were:

431.0ms
(* (- (* 1 1) (* (* (tan x) (tan x)) (* (tan x) (tan x)))) (+ (* 1 1) (+ (* (* (tan x) (tan x)) (* (tan x) (tan x))) (* 1 (* (tan x) (tan x))))))
408.0ms
(* (/ (- 1 (* (tan x) (tan x))) (- (* 1 1) (* (* (tan x) (tan x)) (* (tan x) (tan x))))) (- 1 (* (tan x) (tan x))))
365.0ms
(* (- 1 (* (tan x) (tan x))) (- (pow 1 3) (pow (* (tan x) (tan x)) 3)))

prune1.7s

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 0.0b

localize27.0ms

Local error

Found 4 expressions with local error:

0.2b
(* (/ 1 (+ 1 (* (tan x) (tan x)))) (* (/ (- 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x)))) (- 1 (* (tan x) (tan x)))))
0.2b
(* (tan x) (tan x))
0.2b
(* (tan x) (tan x))
0.2b
(* (tan x) (tan x))

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 114
Calls

4 calls. Slowest were:

16.0ms
(* (/ 1 (+ 1 (* (tan x) (tan x)))) (* (/ (- 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x)))) (- 1 (* (tan x) (tan x)))))
4.0ms
(* (tan x) (tan x))
4.0ms
(* (tan x) (tan x))

series198.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

77.0ms
(* (/ 1 (+ 1 (* (tan x) (tan x)))) (* (/ (- 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x)))) (- 1 (* (tan x) (tan x)))))
46.0ms
(* (tan x) (tan x))
45.0ms
(* (tan x) (tan x))
29.0ms
(* (tan x) (tan x))

simplify50.9s

Counts
97 → 126
Calls

97 calls. Slowest were:

39.9s
(* 1 (* (/ (- 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x)))) (- 1 (* (tan x) (tan x)))))
1.2s
(* (/ 1 (+ 1 (* (tan x) (tan x)))) (* (/ (- 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x)))) (- (* (tan x) (tan x)))))
1.0s
(* (* (- (* (tan x) (tan x))) (/ (- 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x))))) (/ 1 (+ 1 (* (tan x) (tan x)))))

prune907.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

regimes317.0ms

Accuracy

0% (0.4b remaining)

Error of 0.5b against oracle of 0.1b and baseline of 0.5b

bsearch3.0ms

end0.0ms

sample5.6s

Algorithm
intervals