Average Error: 13.5 → 0.2
Time: 53.4s
Precision: 64
Internal Precision: 128
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\left(\frac{1}{\frac{1 - \frac{\tan y \cdot \sin z}{\cos z}}{\tan z + \tan y}} - \tan a\right) + 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.5

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

    \[\leadsto x + \left(\color{blue}{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}} - \tan a\right)\]
  4. Using strategy rm
  5. Applied *-un-lft-identity0.2

    \[\leadsto x + \left(\frac{\tan y + \color{blue}{1 \cdot \tan z}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  6. Applied *-un-lft-identity0.2

    \[\leadsto x + \left(\frac{\color{blue}{1 \cdot \tan y} + 1 \cdot \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  7. Applied distribute-lft-out0.2

    \[\leadsto x + \left(\frac{\color{blue}{1 \cdot \left(\tan y + \tan z\right)}}{1 - \tan y \cdot \tan z} - \tan a\right)\]
  8. Applied associate-/l*0.2

    \[\leadsto x + \left(\color{blue}{\frac{1}{\frac{1 - \tan y \cdot \tan z}{\tan y + \tan z}}} - \tan a\right)\]
  9. Using strategy rm
  10. Applied tan-quot0.2

    \[\leadsto x + \left(\frac{1}{\frac{1 - \tan y \cdot \color{blue}{\frac{\sin z}{\cos z}}}{\tan y + \tan z}} - \tan a\right)\]
  11. Applied associate-*r/0.2

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

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

Reproduce

herbie shell --seed 2019002 +o rules:numerics
(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: 52.5s)Debug log

sample426.0ms

Algorithm
intervals

simplify47.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 12.2b

localize17.0ms

Local error

Found 3 expressions with local error:

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

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
3 → 65
Calls

3 calls. Slowest were:

17.0ms
(- (tan (+ y z)) (tan a))
4.0ms
(+ x (- (tan (+ y z)) (tan a)))
2.0ms
(tan (+ y z))

series325.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

156.0ms
(+ x (- (tan (+ y z)) (tan a)))
117.0ms
(- (tan (+ y z)) (tan a))
52.0ms
(tan (+ y z))

simplify1.2s

Counts
50 → 74
Calls

50 calls. Slowest were:

342.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
198.0ms
(* (- 1 (* (tan y) (tan z))) (cos a))
32.0ms
(- (+ (/ (sin (+ z y)) (cos (+ z y))) x) (/ (sin a) (cos a)))

prune962.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0.1b

localize21.0ms

Local error

Found 4 expressions with local error:

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

rewrite79.0ms

Algorithm
rewrite-expression-head
Counts
4 → 219
Calls

4 calls. Slowest were:

34.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
24.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
12.0ms
(/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z))))

series1.3s

Counts
4 → 12
Calls

4 calls. Slowest were:

485.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
406.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
275.0ms
(/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z))))
101.0ms
(* (tan y) (tan z))

simplify15.4s

Counts
250 → 231
Calls

250 calls. Slowest were:

587.0ms
(fma (/ 1 (* (cbrt (- 1 (* (tan y) (tan z)))) (cbrt (- 1 (* (tan y) (tan z)))))) (/ (+ (tan y) (tan z)) (cbrt (- 1 (* (tan y) (tan z))))) (- (* (cbrt (tan a)) (* (cbrt (tan a)) (cbrt (tan a))))))
576.0ms
(fma (/ 1 (* (cbrt (- 1 (* (tan y) (tan z)))) (cbrt (- 1 (* (tan y) (tan z)))))) (/ (+ (tan y) (tan z)) (cbrt (- 1 (* (tan y) (tan z))))) (- (* (tan a) 1)))
542.0ms
(fma (/ 1 (* (cbrt (- 1 (* (tan y) (tan z)))) (cbrt (- 1 (* (tan y) (tan z)))))) (/ (+ (tan y) (tan z)) (cbrt (- 1 (* (tan y) (tan z))))) (- (* (tan a) 1)))

prune3.0s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize15.0ms

Local error

Found 4 expressions with local error:

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

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 135
Calls

4 calls. Slowest were:

7.0ms
(/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z)))
5.0ms
(- (/ 1 (/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z)))) (tan a))
4.0ms
(* (tan y) (tan z))

series1.0s

Counts
4 → 12
Calls

4 calls. Slowest were:

428.0ms
(- (/ 1 (/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z)))) (tan a))
255.0ms
(/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z)))
246.0ms
(/ 1 (/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z))))
90.0ms
(* (tan y) (tan z))

simplify9.2s

Counts
123 → 147
Calls

123 calls. Slowest were:

576.0ms
(fma (* (cbrt (/ 1 (/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z))))) (cbrt (/ 1 (/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z)))))) (cbrt (/ 1 (/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z))))) (- (* (cbrt (tan a)) (* (cbrt (tan a)) (cbrt (tan a))))))
482.0ms
(- (/ 1 (/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z)))) (tan a))
480.0ms
(- (/ 1 (/ (- 1 (* (tan y) (tan z))) (+ (tan y) (tan z)))) (tan a))

prune1.5s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.0b

localize24.0ms

Local error

Found 4 expressions with local error:

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

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
4 → 119
Calls

4 calls. Slowest were:

12.0ms
(/ (- 1 (/ (* (tan y) (sin z)) (cos z))) (+ (tan y) (tan z)))
7.0ms
(/ (* (tan y) (sin z)) (cos z))
4.0ms
(/ 1 (/ (- 1 (/ (* (tan y) (sin z)) (cos z))) (+ (tan y) (tan z))))

series580.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

221.0ms
(/ (- 1 (/ (* (tan y) (sin z)) (cos z))) (+ (tan y) (tan z)))
206.0ms
(/ 1 (/ (- 1 (/ (* (tan y) (sin z)) (cos z))) (+ (tan y) (tan z))))
87.0ms
(/ (* (tan y) (sin z)) (cos z))
66.0ms
(* (tan y) (sin z))

simplify5.1s

Counts
95 → 131
Calls

95 calls. Slowest were:

599.0ms
(/ (* (* (* (tan y) (tan y)) (tan y)) (* (* (sin z) (sin z)) (sin z))) (* (* (cos z) (cos z)) (cos z)))
366.0ms
(/ (* (* (* (tan y) (sin z)) (* (tan y) (sin z))) (* (tan y) (sin z))) (* (* (cos z) (cos z)) (cos z)))
292.0ms
(/ (* (* (- 1 (/ (* (tan y) (sin z)) (cos z))) (- 1 (/ (* (tan y) (sin z)) (cos z)))) (- 1 (/ (* (tan y) (sin z)) (cos z)))) (* (* (+ (tan y) (tan z)) (+ (tan y) (tan z))) (+ (tan y) (tan z))))

prune1.5s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0.0b

regimes326.0ms

Accuracy

0% (0.1b remaining)

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

bsearch2.0ms

end0.0ms

sample10.5s

Algorithm
intervals