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

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

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

    \[\leadsto x + \left(\frac{\tan y + \tan z}{\frac{1 \cdot 1 - \color{blue}{\frac{\tan y \cdot \sin z}{\cos z}} \cdot \left(\tan y \cdot \tan z\right)}{1 + \tan y \cdot \tan z}} - \tan a\right)\]
  9. Using strategy rm
  10. Applied add-log-exp0.3

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

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

Reproduce

herbie shell --seed 2019005 +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: 42.9s)Debug log

sample462.0ms

Algorithm
intervals

simplify43.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune13.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 14.6b

localize19.0ms

Local error

Found 3 expressions with local error:

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

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
3 → 65
Calls

3 calls. Slowest were:

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

series649.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

396.0ms
(tan (+ y z))
149.0ms
(- (tan (+ y z)) (tan a))
104.0ms
(+ x (- (tan (+ y z)) (tan a)))

simplify1.1s

Counts
50 → 74
Calls

50 calls. Slowest were:

234.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
137.0ms
(* (- 1 (* (tan y) (tan z))) (cos a))
41.0ms
(fma (sqrt (tan (+ y z))) (sqrt (tan (+ y z))) (- (* (sqrt (tan a)) (sqrt (tan a)))))

prune945.0ms

Pruning

7 alts after pruning (7 fresh and 0 done)

Merged error: 0.1b

localize45.0ms

Local error

Found 4 expressions with local error:

0.2b
(* (tan y) (tan z))
0.1b
(+ 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
(- 1 (* (tan y) (tan z)))

rewrite97.0ms

Algorithm
rewrite-expression-head
Counts
4 → 194
Calls

4 calls. Slowest were:

47.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
37.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
8.0ms
(* (tan y) (tan z))

series1.1s

Counts
4 → 12
Calls

4 calls. Slowest were:

438.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
430.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
135.0ms
(- 1 (* (tan y) (tan z)))
133.0ms
(* (tan y) (tan z))

simplify12.7s

Counts
214 → 206
Calls

214 calls. Slowest were:

426.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)))
413.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))))))
400.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)))

prune2.8s

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.1b

localize44.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
0.2b
(* (tan y) (tan z))
0.2b
(* (tan y) (tan z))
0.2b
(* (tan y) (tan z))

rewrite39.0ms

Algorithm
rewrite-expression-head
Counts
4 → 112
Calls

4 calls. Slowest were:

23.0ms
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
7.0ms
(* (tan y) (tan z))
4.0ms
(* (tan y) (tan z))

series406.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

114.0ms
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
113.0ms
(* (tan y) (tan z))
90.0ms
(* (tan y) (tan z))
89.0ms
(* (tan y) (tan z))

simplify3.4s

Counts
96 → 124
Calls

96 calls. Slowest were:

457.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))))
449.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))))
382.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))))

prune1.6s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.1b

localize28.0ms

Local error

Found 4 expressions with local error:

0.3b
(* (/ (* (tan y) (sin z)) (cos z)) (* (tan y) (tan z)))
0.2b
(* (tan y) (tan z))
0.2b
(* (tan y) (tan z))
0.2b
(* (tan y) (sin z))

rewrite33.0ms

Algorithm
rewrite-expression-head
Counts
4 → 103
Calls

4 calls. Slowest were:

16.0ms
(* (/ (* (tan y) (sin z)) (cos z)) (* (tan y) (tan z)))
7.0ms
(* (tan y) (tan z))
4.0ms
(* (tan y) (sin z))

series358.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

142.0ms
(* (/ (* (tan y) (sin z)) (cos z)) (* (tan y) (tan z)))
79.0ms
(* (tan y) (tan z))
78.0ms
(* (tan y) (tan z))
59.0ms
(* (tan y) (sin z))

simplify3.9s

Counts
76 → 115
Calls

76 calls. Slowest were:

305.0ms
(/ (* (sin z) (sin y)) (cos y))
274.0ms
(/ (* (pow (sin z) 2) (pow (sin y) 2)) (* (pow (cos y) 2) (pow (cos z) 2)))
268.0ms
(/ (* (pow (sin z) 2) (pow (sin y) 2)) (* (pow (cos y) 2) (pow (cos z) 2)))

prune1.8s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

regimes418.0ms

Accuracy

0% (0.2b remaining)

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

bsearch4.0ms

end0.0ms

sample10.8s

Algorithm
intervals