Average Error: 0.3 → 0.4
Time: 21.0s
Precision: 64
Internal Precision: 128
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(1 - \tan x \cdot \tan x\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)}\]

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

    \[\leadsto \left(1 - \tan x \cdot \tan x\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)}\]

Reproduce

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

Details

Time bar (total: 20.1s)Debug log

sample296.0ms

Algorithm
intervals

simplify85.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune10.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

localize32.0ms

Local error

Found 4 expressions with local error:

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

rewrite31.0ms

Algorithm
rewrite-expression-head
Counts
4 → 89
Calls

4 calls. Slowest were:

10.0ms
(* (tan x) (tan x))
8.0ms
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x))))
7.0ms
(* (tan x) (tan x))

series263.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

105.0ms
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x))))
73.0ms
(* (tan x) (tan x))
46.0ms
(* (tan x) (tan x))
38.0ms
(- 1 (* (tan x) (tan x)))

simplify1.8s

Counts
72 → 101
Calls

72 calls. Slowest were:

485.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)))))
269.0ms
(+ (* 1 1) (- (* (* (tan x) (tan x)) (* (tan x) (tan x))) (* 1 (* (tan x) (tan x)))))
185.0ms
(/ (- 1 (/ (pow (sin x) 2) (pow (cos x) 2))) (+ (/ (pow (sin x) 2) (pow (cos x) 2)) 1))

prune875.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize16.0ms

Local error

Found 4 expressions with local error:

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

rewrite33.0ms

Algorithm
rewrite-expression-head
Counts
4 → 92
Calls

4 calls. Slowest were:

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

series140.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

46.0ms
(* (tan x) (tan x))
37.0ms
(* (tan x) (tan x))
30.0ms
(* (tan x) (tan x))
26.0ms
(* (tan x) (tan x))

simplify317.0ms

Counts
72 → 104
Calls

72 calls. Slowest were:

25.0ms
(* (* (* (tan x) (tan x)) (tan x)) (* (* (tan x) (tan x)) (tan x)))
25.0ms
(+ (pow x 2) (+ (* 2/3 (pow x 4)) (* 17/45 (pow x 6))))
24.0ms
(+ (pow x 2) (+ (* 2/3 (pow x 4)) (* 17/45 (pow x 6))))

prune1.0s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 4 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 95
Calls

4 calls. Slowest were:

7.0ms
(/ (* (sin x) (tan x)) (cos x))
6.0ms
(/ (- 1 (/ (* (sin x) (tan x)) (cos x))) (+ 1 (* (tan x) (tan x))))
4.0ms
(* (tan x) (tan x))

series229.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

87.0ms
(/ (- 1 (/ (* (sin x) (tan x)) (cos x))) (+ 1 (* (tan x) (tan x))))
66.0ms
(/ (* (sin x) (tan x)) (cos x))
39.0ms
(* (sin x) (tan x))
36.0ms
(* (tan x) (tan x))

simplify4.4s

Counts
81 → 107
Calls

81 calls. Slowest were:

589.0ms
(/ (* (* (* (sin x) (sin x)) (sin x)) (* (* (tan x) (tan x)) (tan x))) (* (* (cos x) (cos x)) (cos x)))
555.0ms
(/ (* (* (* (sin x) (tan x)) (* (sin x) (tan x))) (* (sin x) (tan x))) (* (* (cos x) (cos x)) (cos x)))
496.0ms
(/ (* (* (- 1 (/ (* (sin x) (tan x)) (cos x))) (- 1 (/ (* (sin x) (tan x)) (cos x)))) (- 1 (/ (* (sin x) (tan x)) (cos x)))) (* (* (+ 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))) (+ 1 (* (tan x) (tan x)))))

prune1.2s

Pruning

11 alts after pruning (9 fresh and 2 done)

Merged error: 0.0b

localize24.0ms

Local error

Found 4 expressions with local error:

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

rewrite34.0ms

Algorithm
rewrite-expression-head
Counts
4 → 87
Calls

4 calls. Slowest were:

10.0ms
(/ (cos x) (* (sin x) (tan x)))
8.0ms
(* (tan x) (tan x))
7.0ms
(* (sin x) (tan x))

series259.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

89.0ms
(/ 1 (/ (cos x) (* (sin x) (tan x))))
72.0ms
(/ (cos x) (* (sin x) (tan x)))
53.0ms
(* (sin x) (tan x))
46.0ms
(* (tan x) (tan x))

simplify1.5s

Counts
60 → 99
Calls

60 calls. Slowest were:

534.0ms
(/ (* (* (cos x) (cos x)) (cos x)) (* (* (* (sin x) (tan x)) (* (sin x) (tan x))) (* (sin x) (tan x))))
527.0ms
(/ (* (* (cos x) (cos x)) (cos x)) (* (* (* (sin x) (sin x)) (sin x)) (* (* (tan x) (tan x)) (tan x))))
88.0ms
(* (* (* (sin x) (sin x)) (sin x)) (* (* (tan x) (tan x)) (tan x)))

prune1.1s

Pruning

11 alts after pruning (8 fresh and 3 done)

Merged error: 0.0b

regimes317.0ms

Accuracy

0% (0.3b remaining)

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

bsearch3.0ms

end0.0ms

sample6.0s

Algorithm
intervals