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

    \[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 tan-quot0.2

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

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

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

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

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

Reproduce

herbie shell --seed 2019010 +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: 1.1m)Debug log

sample450.0ms

Algorithm
intervals

simplify46.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
46.0ms
(+ x (- (tan (+ y z)) (tan a)))

prune39.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 10.7b

localize39.0ms

Local error

Found 3 expressions with local error:

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

rewrite27.0ms

Algorithm
rewrite-expression-head
Rules
18×prod-diff
18×*-un-lft-identity
18×add-sqr-sqrt
16×add-cube-cbrt
11×associate-+r+
add-log-exp
tan-quot
log1p-expm1-u
add-exp-log
fma-neg
add-cbrt-cube
pow1
expm1-log1p-u
frac-sub
sub-neg
tan-sum
difference-of-squares
distribute-lft-out--
flip--
flip-+
diff-log
flip3--
flip3-+
associate-+r-
+-commutative
Counts
3 → 65
Calls
3 calls:
Slowest
12.0ms
(- (tan (+ y z)) (tan a))
10.0ms
(+ x (- (tan (+ y z)) (tan a)))
3.0ms
(tan (+ y z))

series275.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
103.0ms
(+ x (- (tan (+ y z)) (tan a)))
103.0ms
(- (tan (+ y z)) (tan a))
69.0ms
(tan (+ y z))

simplify1.2s

Counts
50 → 74
Calls
50 calls:
Slowest
231.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
156.0ms
(* (- 1 (* (tan y) (tan z))) (cos a))
51.0ms
(- (+ (/ (sin (+ z y)) (cos (+ z y))) x) (/ (sin a) (cos a)))
44.0ms
(fma (sqrt (tan (+ y z))) (sqrt (tan (+ y z))) (- (* (sqrt (tan a)) (sqrt (tan a)))))
39.0ms
(fma 1 (tan (+ y z)) (- (* (tan a) 1)))

prune935.0ms

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.1b

localize25.0ms

Local error

Found 4 expressions with local error:

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

rewrite92.0ms

Algorithm
rewrite-expression-head
Rules
145×*-un-lft-identity
108×prod-diff
104×add-sqr-sqrt
99×add-cube-cbrt
85×times-frac
56×associate-+r+
22×distribute-lft-out
18×fma-neg
14×associate-/r/
add-log-exp
flip--
flip3--
div-inv
tan-quot
add-exp-log
add-cbrt-cube
pow1
log1p-expm1-u
expm1-log1p-u
associate-*l*
associate-*r*
fma-def
difference-of-squares
flip-+
flip3-+
sub-neg
+-commutative
distribute-lft-out--
cbrt-unprod
frac-sub
*-commutative
associate-*r/
prod-exp
frac-add
associate-*l/
pow-prod-down
diff-log
sum-log
associate-+r-
frac-times
Counts
4 → 199
Calls
4 calls:
Slowest
42.0ms
(+ 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))
4.0ms
(* (tan y) (tan z))
4.0ms
(+ (tan y) (tan z))

series1.1s

Counts
4 → 12
Calls
4 calls:
Slowest
463.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a))
433.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (* (tan y) (tan z)))) (tan a)))
121.0ms
(* (tan y) (tan z))
115.0ms
(+ (tan y) (tan z))

simplify14.3s

Counts
220 → 211
Calls
220 calls:
Slowest
516.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))))))
488.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)))
472.0ms
(fma (/ (* (cbrt (+ (tan y) (tan z))) (cbrt (+ (tan y) (tan z)))) 1) (/ (cbrt (+ (tan y) (tan z))) (- 1 (* (tan y) (tan z)))) (- (* (tan a) 1)))
466.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)))
460.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))))))

prune3.1s

Pruning

13 alts after pruning (13 fresh and 0 done)

Merged error: 0.1b

localize46.0ms

Local error

Found 4 expressions with local error:

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

rewrite131.0ms

Algorithm
rewrite-expression-head
Rules
144×*-un-lft-identity
108×prod-diff
105×add-sqr-sqrt
100×add-cube-cbrt
88×times-frac
56×associate-+r+
21×distribute-lft-out
18×fma-neg
14×associate-/r/
11×add-exp-log
11×add-cbrt-cube
flip--
div-inv
flip3--
add-log-exp
pow1
log1p-expm1-u
expm1-log1p-u
tan-quot
associate-*l*
associate-*r*
associate-/r*
difference-of-squares
cbrt-unprod
associate-*r/
prod-exp
div-exp
sub-neg
cbrt-undiv
associate-/l/
distribute-lft-out--
associate-/l*
flip-+
frac-sub
*-commutative
pow-prod-down
diff-log
flip3-+
frac-2neg
associate-+r-
clear-num
+-commutative
Counts
4 → 203
Calls
4 calls:
Slowest
56.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (/ (* (sin y) (tan z)) (cos y)))) (tan a)))
47.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (/ (* (sin y) (tan z)) (cos y)))) (tan a))
12.0ms
(* (sin y) (tan z))
7.0ms
(/ (* (sin y) (tan z)) (cos y))

series933.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
426.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (/ (* (sin y) (tan z)) (cos y)))) (tan a))
326.0ms
(+ x (- (/ (+ (tan y) (tan z)) (- 1 (/ (* (sin y) (tan z)) (cos y)))) (tan a)))
106.0ms
(/ (* (sin y) (tan z)) (cos y))
75.0ms
(* (sin y) (tan z))

simplify12.4s

Counts
226 → 215
Calls
226 calls:
Slowest
494.0ms
(/ (* (* (* (sin y) (tan z)) (* (sin y) (tan z))) (* (sin y) (tan z))) (* (* (cos y) (cos y)) (cos y)))
407.0ms
(/ (* (* (* (sin y) (sin y)) (sin y)) (* (* (tan z) (tan z)) (tan z))) (* (* (cos y) (cos y)) (cos y)))
381.0ms
(fma (/ 1 (* (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y)))) (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y)))))) (/ (+ (tan y) (tan z)) (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y))))) (- (* (sqrt (tan a)) (sqrt (tan a)))))
332.0ms
(fma (/ 1 (* (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y)))) (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y)))))) (/ (+ (tan y) (tan z)) (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y))))) (- (* (sqrt (tan a)) (sqrt (tan a)))))
328.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (/ (* (sin y) (tan z)) (cos y))) (sin a)))

prune3.7s

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.1b

localize8.0ms

Local error

Found 4 expressions with local error:

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

rewrite142.0ms

Algorithm
rewrite-expression-head
Rules
85×*-un-lft-identity
64×add-sqr-sqrt
59×add-cube-cbrt
54×prod-diff
52×times-frac
18×fma-neg
12×distribute-lft-out
11×add-exp-log
11×add-cbrt-cube
associate-/r/
add-log-exp
pow1
flip--
div-inv
flip3--
log1p-expm1-u
expm1-log1p-u
tan-quot
associate-*l*
associate-*r*
associate-/r*
exp-prod
difference-of-squares
cbrt-unprod
associate-*r/
prod-exp
div-exp
cbrt-undiv
associate-/l/
rem-exp-log
distribute-lft-out--
associate-/l*
frac-sub
*-commutative
pow-prod-down
exp-sum
diff-log
exp-diff
frac-2neg
sub-neg
associate-+r-
clear-num
Counts
4 → 149
Calls
4 calls:
Slowest
80.0ms
(exp (+ x (- (/ (+ (tan y) (tan z)) (- 1 (/ (* (sin y) (tan z)) (cos y)))) (tan a))))
48.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (/ (* (sin y) (tan z)) (cos y)))) (tan a))
8.0ms
(/ (* (sin y) (tan z)) (cos y))
4.0ms
(* (sin y) (tan z))

series1.0s

Counts
4 → 12
Calls
4 calls:
Slowest
439.0ms
(exp (+ x (- (/ (+ (tan y) (tan z)) (- 1 (/ (* (sin y) (tan z)) (cos y)))) (tan a))))
400.0ms
(- (/ (+ (tan y) (tan z)) (- 1 (/ (* (sin y) (tan z)) (cos y)))) (tan a))
128.0ms
(/ (* (sin y) (tan z)) (cos y))
81.0ms
(* (sin y) (tan z))

simplify10.8s

Counts
175 → 161
Calls
175 calls:
Slowest
347.0ms
(/ (* (* (* (sin y) (tan z)) (* (sin y) (tan z))) (* (sin y) (tan z))) (* (* (cos y) (cos y)) (cos y)))
336.0ms
(fma (/ 1 (* (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y)))) (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y)))))) (/ (+ (tan y) (tan z)) (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y))))) (- (* (sqrt (tan a)) (sqrt (tan a)))))
334.0ms
(/ (* (* (* (sin y) (sin y)) (sin y)) (* (* (tan z) (tan z)) (tan z))) (* (* (cos y) (cos y)) (cos y)))
334.0ms
(fma (/ 1 (* (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y)))) (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y)))))) (/ (+ (tan y) (tan z)) (cbrt (- 1 (/ (* (sin y) (tan z)) (cos y))))) (- (* (sqrt (tan a)) (sqrt (tan a)))))
238.0ms
(fma (/ 1 (sqrt (- 1 (/ (* (sin y) (tan z)) (cos y))))) (/ (+ (tan y) (tan z)) (sqrt (- 1 (/ (* (sin y) (tan z)) (cos y))))) (- (* (cbrt (tan a)) (* (cbrt (tan a)) (cbrt (tan a))))))

prune2.2s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.0b

regimes388.0ms

Accuracy

0% (0.2b remaining)

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

bsearch2.0ms

end0.0ms

sample11.1s

Algorithm
intervals