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

    \[\leadsto x + \color{blue}{\frac{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} \cdot \frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a \cdot \tan a}{\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} + \tan a}}\]
  6. Final simplification0.2

    \[\leadsto \frac{\frac{\tan y + \tan z}{1 - \tan z \cdot \tan y} \cdot \frac{\tan y + \tan z}{1 - \tan z \cdot \tan y} - \tan a \cdot \tan a}{\tan a + \frac{\tan y + \tan z}{1 - \tan z \cdot \tan y}} + x\]

Reproduce

herbie shell --seed 2019002 
(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: 36.8s)Debug log

sample425.0ms

Algorithm
intervals

simplify63.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune7.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 12.2b

localize18.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)))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
3 → 38
Calls

3 calls. Slowest were:

6.0ms
(- (tan (+ y z)) (tan a))
5.0ms
(+ x (- (tan (+ y z)) (tan a)))
2.0ms
(tan (+ y z))

series716.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

439.0ms
(tan (+ y z))
146.0ms
(+ x (- (tan (+ y z)) (tan a)))
132.0ms
(- (tan (+ y z)) (tan a))

simplify591.0ms

Counts
21 → 47
Calls

21 calls. Slowest were:

239.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
132.0ms
(* (- 1 (* (tan y) (tan z))) (cos a))
45.0ms
(- (+ (/ (sin (+ z y)) (cos (+ z y))) x) (/ (sin a) (cos a)))

prune605.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

localize49.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)))

rewrite128.0ms

Algorithm
rewrite-expression-head
Counts
4 → 85
Calls

4 calls. Slowest were:

52.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
41.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
26.0ms
(/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z))))

series1.2s

Counts
4 → 12
Calls

4 calls. Slowest were:

435.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
404.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
243.0ms
(/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z))))
143.0ms
(* (tan y) (tan z))

simplify3.3s

Counts
71 → 97
Calls

71 calls. Slowest were:

339.0ms
(/ (* (* (+ (tan y) (tan z)) (+ (tan y) (tan z))) (+ (tan y) (tan z))) (* (* (- 1 (* (tan y) (tan z))) (- 1 (* (tan y) (tan z)))) (- 1 (* (tan y) (tan z)))))
305.0ms
(+ (* 1/3 (* (pow z 3) y)) (+ (* 1/3 (* z (pow y 3))) (* z y)))
290.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))

prune1.3s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.0b

localize26.0ms

Local error

Found 4 expressions with local error:

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

rewrite79.0ms

Algorithm
rewrite-expression-head
Counts
4 → 92
Calls

4 calls. Slowest were:

38.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (/ (* (tan y) (sin z)) (cos z)))) (tan a))
26.0ms
(/ (+ (tan y) (tan z)) (- 1 (/ (* (tan y) (sin z)) (cos z))))
9.0ms
(/ (* (tan y) (sin z)) (cos z))

series847.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

435.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (/ (* (tan y) (sin z)) (cos z)))) (tan a))
224.0ms
(/ (+ (tan y) (tan z)) (- 1 (/ (* (tan y) (sin z)) (cos z))))
114.0ms
(/ (* (tan y) (sin z)) (cos z))
75.0ms
(* (tan y) (sin z))

simplify4.6s

Counts
80 → 104
Calls

80 calls. Slowest were:

492.0ms
(/ (* (* (* (tan y) (sin z)) (* (tan y) (sin z))) (* (tan y) (sin z))) (* (* (cos z) (cos z)) (cos z)))
442.0ms
(/ (* (* (* (tan y) (tan y)) (tan y)) (* (* (sin z) (sin z)) (sin z))) (* (* (cos z) (cos z)) (cos z)))
291.0ms
(/ (* (* (+ (tan y) (tan z)) (+ (tan y) (tan z))) (+ (tan y) (tan z))) (* (* (- 1 (/ (* (tan y) (sin z)) (cos z))) (- 1 (/ (* (tan y) (sin z)) (cos z)))) (- 1 (/ (* (tan y) (sin z)) (cos z)))))

prune1.6s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize33.0ms

Local error

Found 4 expressions with local error:

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

rewrite53.0ms

Algorithm
rewrite-expression-head
Counts
4 → 110
Calls

4 calls. Slowest were:

28.0ms
(/ (- (* (tan y) (tan y)) (* (tan z) (tan z))) (* (- 1 (/ (* (tan y) (sin z)) (cos z))) (- (tan y) (tan z))))
8.0ms
(* (tan y) (sin z))
8.0ms
(* (tan y) (tan y))

series480.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

354.0ms
(/ (- (* (tan y) (tan y)) (* (tan z) (tan z))) (* (- 1 (/ (* (tan y) (sin z)) (cos z))) (- (tan y) (tan z))))
72.0ms
(* (tan y) (sin z))
27.0ms
(* (tan y) (tan y))
27.0ms
(* (tan z) (tan z))

simplify5.3s

Counts
90 → 122
Calls

90 calls. Slowest were:

483.0ms
(- (log (- (* (tan y) (tan y)) (* (tan z) (tan z)))) (+ (log (- 1 (/ (* (tan y) (sin z)) (cos z)))) (log (- (tan y) (tan z)))))
355.0ms
(/ (- (* (tan y) (tan y)) (* (tan z) (tan z))) (- (tan y) (tan z)))
280.0ms
(* (+ 1 (/ (* (tan y) (sin z)) (cos z))) (* (cos y) (cos z)))

prune2.0s

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0.0b

regimes413.0ms

Accuracy

0% (0.1b remaining)

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

bsearch2.0ms

end0.0ms

sample13.0s

Algorithm
intervals