Average Error: 0.3 → 0.3
Time: 24.6s
Precision: 64
Internal Precision: 128
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \frac{\sin x \cdot \tan x}{\cos x}}\]

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 tan-quot0.4

    \[\leadsto \frac{1 - \tan x \cdot \color{blue}{\frac{\sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  4. Applied associate-*r/0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\tan x \cdot \sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  5. Using strategy rm
  6. Applied *-commutative0.4

    \[\leadsto \frac{1 - \frac{\color{blue}{\sin x \cdot \tan x}}{\cos x}}{1 + \tan x \cdot \tan x}\]
  7. Using strategy rm
  8. Applied tan-quot0.4

    \[\leadsto \frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \color{blue}{\frac{\sin x}{\cos x}} \cdot \tan x}\]
  9. Applied associate-*l/0.3

    \[\leadsto \frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \color{blue}{\frac{\sin x \cdot \tan x}{\cos x}}}\]
  10. Final simplification0.3

    \[\leadsto \frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \frac{\sin x \cdot \tan x}{\cos x}}\]

Reproduce

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

Details

Time bar (total: 23.4s)Debug log

sample246.0ms

Algorithm
intervals

simplify79.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune15.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

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

rewrite33.0ms

Algorithm
rewrite-expression-head
Counts
4 → 89
Calls

4 calls. Slowest were:

11.0ms
(* (tan x) (tan x))
8.0ms
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x))))
8.0ms
(* (tan x) (tan x))

series257.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

96.0ms
(/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x))))
73.0ms
(* (tan x) (tan x))
47.0ms
(* (tan x) (tan x))
41.0ms
(- 1 (* (tan x) (tan x)))

simplify1.9s

Counts
72 → 101
Calls

72 calls. Slowest were:

433.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)))))
238.0ms
(+ (* 1 1) (- (* (* (tan x) (tan x)) (* (tan x) (tan x))) (* 1 (* (tan x) (tan x)))))
192.0ms
(/ (- 1 (/ (pow (sin x) 2) (pow (cos x) 2))) (+ (/ (pow (sin x) 2) (pow (cos x) 2)) 1))

prune957.0ms

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 4 expressions with local error:

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

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
4 → 87
Calls

4 calls. Slowest were:

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

series206.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

83.0ms
(/ 1 (/ (+ 1 (* (tan x) (tan x))) (- 1 (* (tan x) (tan x)))))
44.0ms
(* (tan x) (tan x))
44.0ms
(* (tan x) (tan x))
35.0ms
(- 1 (* (tan x) (tan x)))

simplify961.0ms

Counts
59 → 99
Calls

59 calls. Slowest were:

242.0ms
(/ (- 1 (/ (pow (sin x) 2) (pow (cos x) 2))) (+ (/ (pow (sin x) 2) (pow (cos x) 2)) 1))
203.0ms
(/ (- 1 (/ (pow (sin x) 2) (pow (cos x) 2))) (+ (/ (pow (sin x) 2) (pow (cos x) 2)) 1))
69.0ms
(- (+ (* 2/3 (pow x 4)) 1) (* 2 (pow x 2)))

prune1.0s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 4 expressions with local error:

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 95
Calls

4 calls. Slowest were:

11.0ms
(/ (- 1 (/ (* (tan x) (sin x)) (cos x))) (+ 1 (* (tan x) (tan x))))
7.0ms
(/ (* (tan x) (sin x)) (cos x))
5.0ms
(* (tan x) (sin x))

series245.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

87.0ms
(/ (- 1 (/ (* (tan x) (sin x)) (cos x))) (+ 1 (* (tan x) (tan x))))
65.0ms
(* (tan x) (sin x))
64.0ms
(/ (* (tan x) (sin x)) (cos x))
28.0ms
(* (tan x) (tan x))

simplify4.1s

Counts
81 → 107
Calls

81 calls. Slowest were:

568.0ms
(/ (* (* (* (tan x) (tan x)) (tan x)) (* (* (sin x) (sin x)) (sin x))) (* (* (cos x) (cos x)) (cos x)))
501.0ms
(/ (* (* (* (tan x) (sin x)) (* (tan x) (sin x))) (* (tan x) (sin x))) (* (* (cos x) (cos x)) (cos x)))
387.0ms
(/ (* (* (- 1 (/ (* (tan x) (sin x)) (cos x))) (- 1 (/ (* (tan x) (sin x)) (cos x)))) (- 1 (/ (* (tan x) (sin x)) (cos x)))) (* (* (+ 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))) (+ 1 (* (tan x) (tan x)))))

prune1.3s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 0.0b

localize20.0ms

Local error

Found 4 expressions with local error:

0.2b
(* (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))))

rewrite28.0ms

Algorithm
rewrite-expression-head
Counts
4 → 95
Calls

4 calls. Slowest were:

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

series242.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

89.0ms
(/ (* (sin x) (tan x)) (cos x))
83.0ms
(/ (- 1 (/ (* (sin x) (tan x)) (cos x))) (+ 1 (* (tan x) (tan x))))
41.0ms
(* (sin x) (tan x))
29.0ms
(* (tan x) (tan x))

simplify4.0s

Counts
81 → 107
Calls

81 calls. Slowest were:

622.0ms
(/ (* (* (* (sin x) (sin x)) (sin x)) (* (* (tan x) (tan x)) (tan x))) (* (* (cos x) (cos x)) (cos x)))
483.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)))))
482.0ms
(/ (* (* (* (sin x) (tan x)) (* (sin x) (tan x))) (* (sin x) (tan x))) (* (* (cos x) (cos x)) (cos x)))

prune1.2s

Pruning

11 alts after pruning (9 fresh and 2 done)

Merged error: 0.0b

regimes307.0ms

Accuracy

0% (0.2b remaining)

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

bsearch3.0ms

end0.0ms

sample6.2s

Algorithm
intervals