Average Error: 13.1 → 0.3
Time: 37.7s
Precision: 64
Internal Precision: 128
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[\log \left({e}^{\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right) + x\right)}\right)\]

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.1

    \[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 add-log-exp0.3

    \[\leadsto \color{blue}{\log \left(e^{x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)}\right)}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity0.3

    \[\leadsto \log \left(e^{\color{blue}{1 \cdot \left(x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\right)}}\right)\]
  8. Applied exp-prod0.3

    \[\leadsto \log \color{blue}{\left({\left(e^{1}\right)}^{\left(x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\right)}\right)}\]
  9. Simplified0.3

    \[\leadsto \log \left({\color{blue}{e}}^{\left(x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\right)}\right)\]
  10. Final simplification0.3

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

Reproduce

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

start491.0ms

Algorithm
intervals

setup112.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 12.0b

localize35.0ms

Local error

Found 3 expressions with local error:

2.8b
(tan (+ y z))
0.1b
(- (tan (+ y z)) (tan a))
0.1b
(+ x (- (tan (+ y z)) (tan a)))

rewrite19.0ms

Algorithm
rewrite-expression-head
Counts
3 → 38
Calls

3 calls. Slowest were:

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

series329.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

125.0ms
(+ x (- (tan (+ y z)) (tan a)))
117.0ms
(- (tan (+ y z)) (tan a))
87.0ms
(tan (+ y z))

simplify561.0ms

Counts
21 → 47
Calls

21 calls. Slowest were:

250.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
78.0ms
(* (- 1 (* (tan y) (tan z))) (cos a))
46.0ms
(- (+ (/ (sin (+ z y)) (cos (+ z y))) x) (/ (sin a) (cos a)))

prune597.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
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
0.1b
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
0.1b
(/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z))))

rewrite97.0ms

Algorithm
rewrite-expression-head
Counts
4 → 85
Calls

4 calls. Slowest were:

50.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
22.0ms
(/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z))))
20.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))

series1.2s

Counts
4 → 12
Calls

4 calls. Slowest were:

456.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
426.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
224.0ms
(/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z))))
119.0ms
(* (tan y) (tan z))

simplify2.8s

Counts
71 → 97
Calls

71 calls. Slowest were:

269.0ms
(+ (* 1/3 (* (pow z 3) y)) (+ (* 1/3 (* z (pow y 3))) (* z y)))
252.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
216.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)))))

prune1.6s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

localize9.0ms

Local error

Found 4 expressions with local error:

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

rewrite142.0ms

Algorithm
rewrite-expression-head
Counts
4 → 62
Calls

4 calls. Slowest were:

68.0ms
(exp (+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))))
38.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
25.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))

series1.3s

Counts
4 → 12
Calls

4 calls. Slowest were:

462.0ms
(exp (+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))))
374.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
364.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
133.0ms
(* (tan y) (tan z))

simplify2.3s

Counts
41 → 74
Calls

41 calls. Slowest were:

342.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
303.0ms
(+ (* 1/3 (* (pow z 3) y)) (+ (* 1/3 (* z (pow y 3))) (* z y)))
257.0ms
(exp (- (+ x (+ (/ (sin z) (* (cos z) (- 1 (/ (* (sin z) (sin y)) (* (cos y) (cos z)))))) (/ (sin y) (* (cos y) (- 1 (/ (* (sin z) (sin y)) (* (cos y) (cos z)))))))) (/ (sin a) (cos a))))

prune1.4s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

localize26.0ms

Local error

Found 4 expressions with local error:

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

rewrite141.0ms

Algorithm
rewrite-expression-head
Counts
4 → 62
Calls

4 calls. Slowest were:

51.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
44.0ms
(pow E (+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))))
38.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))

series1.4s

Counts
4 → 12
Calls

4 calls. Slowest were:

552.0ms
(pow E (+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))))
399.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
318.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
96.0ms
(* (tan y) (tan z))

simplify2.0s

Counts
40 → 74
Calls

40 calls. Slowest were:

281.0ms
(+ (* 1/3 (* (pow z 3) y)) (+ (* 1/3 (* z (pow y 3))) (* z y)))
231.0ms
(- (+ (/ (sin z) (* (cos z) (- 1 (/ (* (sin z) (sin y)) (* (cos y) (cos z)))))) (+ (/ (sin y) (* (cos y) (- 1 (/ (* (sin z) (sin y)) (* (cos y) (cos z)))))) x)) (/ (sin a) (cos a)))
214.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))

prune1.8s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0.1b

regimes590.0ms

Accuracy

0% (0.2b remaining)

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

bsearch2.0ms