Average Error: 0.3 → 0.4
Time: 22.8s
Precision: 64
Internal Precision: 128
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(\tan x \cdot \tan x - 1\right) \cdot \frac{1 - \tan x \cdot \tan x}{\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) - 1}\]

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. Initial simplification0.3

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

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

    \[\leadsto \color{blue}{\frac{1 - \tan x \cdot \tan x}{\left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right) - 1 \cdot 1} \cdot \left(\tan x \cdot \tan x - 1\right)}\]
  6. Final simplification0.4

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

Reproduce

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

Details

Time bar (total: 12.6s)Debug log

start1.0s

Algorithm
intervals

setup40.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

localize51.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))) (+ (* (tan x) (tan x)) 1))

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
4 → 89
Calls

4 calls. Slowest were:

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

series254.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

103.0ms
(/ (- 1 (* (tan x) (tan x))) (+ (* (tan x) (tan x)) 1))
57.0ms
(* (tan x) (tan x))
54.0ms
(* (tan x) (tan x))
39.0ms
(- 1 (* (tan x) (tan x)))

simplify2.0s

Counts
72 → 101
Calls

72 calls. Slowest were:

405.0ms
(/ (* (* (- 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x)))) (- 1 (* (tan x) (tan x)))) (* (* (+ (* (tan x) (tan x)) 1) (+ (* (tan x) (tan x)) 1)) (+ (* (tan x) (tan x)) 1)))
259.0ms
(+ (* (* (tan x) (tan x)) (* (tan x) (tan x))) (- (* 1 1) (* (* (tan x) (tan x)) 1)))
210.0ms
(/ (- 1 (/ (pow (sin x) 2) (pow (cos x) 2))) (+ (/ (pow (sin x) 2) (pow (cos x) 2)) 1))

prune993.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.1b

localize24.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (* (tan x) (tan x)) (* (tan x) (tan x)))
0.2b
(* (tan x) (tan x))
0.2b
(* (tan x) (tan x))
0.2b
(* (tan x) (tan x))

rewrite47.0ms

Algorithm
rewrite-expression-head
Counts
4 → 127
Calls

4 calls. Slowest were:

21.0ms
(* (* (tan x) (tan x)) (* (tan x) (tan x)))
8.0ms
(* (tan x) (tan x))
8.0ms
(* (tan x) (tan x))

series130.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

41.0ms
(* (* (tan x) (tan x)) (* (tan x) (tan x)))
32.0ms
(* (tan x) (tan x))
31.0ms
(* (tan x) (tan x))
26.0ms
(* (tan x) (tan x))

simplify1.1s

Counts
132 → 139
Calls

132 calls. Slowest were:

120.0ms
(* (* (* (* (tan x) (tan x)) (tan x)) (* (* (tan x) (tan x)) (tan x))) (* (* (* (tan x) (tan x)) (* (tan x) (tan x))) (* (tan x) (tan x))))
117.0ms
(* (* (* (* (tan x) (tan x)) (tan x)) (* (* (tan x) (tan x)) (tan x))) (* (* (* (tan x) (tan x)) (tan x)) (* (* (tan x) (tan x)) (tan x))))
113.0ms
(* (* (* (* (tan x) (tan x)) (* (tan x) (tan x))) (* (tan x) (tan x))) (* (* (* (tan x) (tan x)) (tan x)) (* (* (tan x) (tan x)) (tan x))))

prune1.7s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.1b

localize27.0ms

Local error

Found 4 expressions with local error:

0.2b
(* (tan x) (tan x))
0.2b
(- 1 (/ (* (tan x) (sin x)) (cos x)))
0.2b
(* (tan x) (sin x))
0.2b
(/ (* (tan x) (sin x)) (cos x))

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
4 → 74
Calls

4 calls. Slowest were:

11.0ms
(/ (* (tan x) (sin x)) (cos x))
4.0ms
(* (tan x) (tan x))
4.0ms
(* (tan x) (sin x))

series205.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

77.0ms
(/ (* (tan x) (sin x)) (cos x))
52.0ms
(- 1 (/ (* (tan x) (sin x)) (cos x)))
43.0ms
(* (tan x) (sin x))
33.0ms
(* (tan x) (tan x))

simplify1.6s

Counts
51 → 86
Calls

51 calls. Slowest were:

566.0ms
(/ (* (* (* (tan x) (sin x)) (* (tan x) (sin x))) (* (tan x) (sin x))) (* (* (cos x) (cos x)) (cos x)))
522.0ms
(/ (* (* (* (tan x) (tan x)) (tan x)) (* (* (sin x) (sin x)) (sin x))) (* (* (cos x) (cos x)) (cos x)))
63.0ms
(- 1 (+ (pow x 2) (* 2/3 (pow x 4))))

prune1.2s

Pruning

12 alts after pruning (11 fresh and 1 done)

Merged error: 0.0b

localize14.0ms

Local error

Found 4 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 73
Calls

4 calls. Slowest were:

4.0ms
(* (tan x) (sin x))
4.0ms
(* (sin x) (sin x))
3.0ms
(* (cos x) (cos x))

series156.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

64.0ms
(- 1 (/ (* (tan x) (sin x)) (cos x)))
43.0ms
(* (tan x) (sin x))
25.0ms
(* (cos x) (cos x))
24.0ms
(* (sin x) (sin x))

simplify506.0ms

Counts
47 → 85
Calls

47 calls. Slowest were:

84.0ms
(* (* (* (tan x) (tan x)) (tan x)) (* (* (sin x) (sin x)) (sin x)))
73.0ms
(- 1 (+ (pow x 2) (* 2/3 (pow x 4))))
67.0ms
(- 1 (/ (pow (sin x) 2) (pow (cos x) 2)))

prune1.2s

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 0.0b

regimes254.0ms

Accuracy

0% (0.3b remaining)

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

bsearch3.0ms