Average Error: 13.2 → 0.2
Time: 45.2s
Precision: 64
Internal Precision: 128
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\frac{1}{\frac{\cos a \cdot \left(1 - \tan y \cdot \tan z\right)}{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}} + x\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 13.2

    \[x + \left(\tan \left(y + z\right) - \tan a\right)\]
  2. Using strategy rm
  3. Applied tan-quot13.2

    \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{\frac{\sin a}{\cos a}}\right)\]
  4. Applied tan-sum0.2

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}} - \frac{\sin a}{\cos a}\right)\]
  5. Applied frac-sub0.2

    \[\leadsto x + \color{blue}{\frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}}\]
  6. Using strategy rm
  7. Applied clear-num0.2

    \[\leadsto x + \color{blue}{\frac{1}{\frac{\left(1 - \tan y \cdot \tan z\right) \cdot \cos a}{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}}}\]
  8. Final simplification0.2

    \[\leadsto \frac{1}{\frac{\cos a \cdot \left(1 - \tan y \cdot \tan z\right)}{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}} + x\]

Reproduce

herbie shell --seed 2019008 
(FPCore (x y z a)
  :name "(+ x (- (tan (+ y z)) (tan a)))"
  :pre (and (or (== x 0) (<= 0.5884142 x 505.5909)) (or (<= -1.796658e+308 y -9.425585e-310) (<= 1.284938e-309 y 1.751224e+308)) (or (<= -1.776707e+308 z -8.599796e-310) (<= 3.293145e-311 z 1.725154e+308)) (or (<= -1.796658e+308 a -9.425585e-310) (<= 1.284938e-309 a 1.751224e+308)))
  (+ x (- (tan (+ y z)) (tan a))))

Details

Time bar (total: 44.0s)Debug log

sample475.0ms

Algorithm
intervals

simplify21.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

21.0ms
(+ x (- (tan (+ y z)) (tan a)))

prune34.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 13.8b

localize26.0ms

Local error

Found 3 expressions with local error:

4.7b
(tan (+ y z))
0.2b
(- (tan (+ y z)) (tan a))
0.1b
(+ x (- (tan (+ y z)) (tan a)))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
3 → 38
Calls

3 calls. Slowest were:

5.0ms
(- (tan (+ y z)) (tan a))
3.0ms
(+ x (- (tan (+ y z)) (tan a)))
1.0ms
(tan (+ y z))

series356.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

148.0ms
(+ x (- (tan (+ y z)) (tan a)))
147.0ms
(- (tan (+ y z)) (tan a))
60.0ms
(tan (+ y z))

simplify525.0ms

Counts
21 → 47
Calls

21 calls. Slowest were:

196.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
107.0ms
(* (- 1 (* (tan y) (tan z))) (cos a))
39.0ms
(+ (* 1/3 (pow y 3)) (+ z y))

prune623.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

localize52.0ms

Local error

Found 4 expressions with local error:

0.2b
(* (tan y) (tan z))
0.2b
(* (tan y) (tan z))
0.2b
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (* (tan y) (tan z))) (cos a)))
0.2b
(* (+ (tan y) (tan z)) (cos a))

rewrite80.0ms

Algorithm
rewrite-expression-head
Counts
4 → 93
Calls

4 calls. Slowest were:

41.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (* (tan y) (tan z))) (cos a)))
16.0ms
(* (+ (tan y) (tan z)) (cos a))
8.0ms
(* (tan y) (tan z))

series846.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

494.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (* (tan y) (tan z))) (cos a)))
153.0ms
(* (+ (tan y) (tan z)) (cos a))
106.0ms
(* (tan y) (tan z))
93.0ms
(* (tan y) (tan z))

simplify5.9s

Counts
71 → 105
Calls

71 calls. Slowest were:

436.0ms
(* (* (* (+ (tan y) (tan z)) (+ (tan y) (tan z))) (+ (tan y) (tan z))) (* (* (cos a) (cos a)) (cos a)))
322.0ms
(+ (* 1/3 (* (pow z 3) y)) (+ (* 1/3 (* z (pow y 3))) (* z y)))
310.0ms
(+ (* 1/3 (* (pow z 3) y)) (+ (* 1/3 (* z (pow y 3))) (* z y)))

prune2.0s

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.1b

localize37.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
0.3b
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- (* 1 1) (* (* (tan y) (tan z)) (* (tan y) (tan z)))) (cos a)))
0.2b
(* (tan y) (tan z))
0.2b
(* (tan y) (tan z))

rewrite60.0ms

Algorithm
rewrite-expression-head
Counts
4 → 116
Calls

4 calls. Slowest were:

22.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- (* 1 1) (* (* (tan y) (tan z)) (* (tan y) (tan z)))) (cos a)))
20.0ms
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
7.0ms
(* (tan y) (tan z))

series956.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

624.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- (* 1 1) (* (* (tan y) (tan z)) (* (tan y) (tan z)))) (cos a)))
134.0ms
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
108.0ms
(* (tan y) (tan z))
89.0ms
(* (tan y) (tan z))

simplify7.6s

Counts
108 → 128
Calls

108 calls. Slowest were:

849.0ms
(* (* (* (* (tan y) (tan y)) (tan y)) (* (* (tan z) (tan z)) (tan z))) (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))))
503.0ms
(* (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))) (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))))
499.0ms
(* (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))) (* (* (* (tan y) (tan y)) (tan y)) (* (* (tan z) (tan z)) (tan z))))

prune2.4s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

localize10.0ms

Local error

Found 4 expressions with local error:

0.3b
(/ (* (- 1 (* (tan y) (tan z))) (cos a)) (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))))
0.2b
(* (tan y) (tan z))
0.2b
(* (tan y) (tan z))
0.2b
(/ 1 (/ (* (- 1 (* (tan y) (tan z))) (cos a)) (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))))

rewrite68.0ms

Algorithm
rewrite-expression-head
Counts
4 → 102
Calls

4 calls. Slowest were:

31.0ms
(/ (* (- 1 (* (tan y) (tan z))) (cos a)) (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))))
20.0ms
(/ 1 (/ (* (- 1 (* (tan y) (tan z))) (cos a)) (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))))
8.0ms
(* (tan y) (tan z))

series1.1s

Counts
4 → 12
Calls

4 calls. Slowest were:

498.0ms
(/ (* (- 1 (* (tan y) (tan z))) (cos a)) (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))))
428.0ms
(/ 1 (/ (* (- 1 (* (tan y) (tan z))) (cos a)) (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))))
98.0ms
(* (tan y) (tan z))
89.0ms
(* (tan y) (tan z))

simplify7.4s

Counts
77 → 114
Calls

77 calls. Slowest were:

295.0ms
(* (* (cos y) (cos z)) (+ (* 1 1) (+ (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* 1 (* (tan y) (tan z))))))
291.0ms
(* (* (cos y) (cos z)) (+ (* 1 1) (+ (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* 1 (* (tan y) (tan z))))))
244.0ms
(* (* (cos y) (cos z)) (+ 1 (* (tan y) (tan z))))

prune1.5s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 0.1b

regimes1.0s

Accuracy

0% (0.1b remaining)

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

bsearch2.0ms

end0.0ms

sample10.9s

Algorithm
intervals