Average Error: 12.9 → 0.2
Time: 1.1m
Precision: 64
Internal Precision: 128
\[x + \left(\tan \left(y + z\right) - \tan a\right)\]
\[x + \frac{\cos a \cdot \left(\tan y + \tan z\right) - \left(1 - \tan z \cdot \tan y\right) \cdot \sin a}{\left(1 - \sqrt[3]{\left(\left(\tan z \cdot \tan y\right) \cdot \left(\tan z \cdot \tan y\right)\right) \cdot \left(\tan z \cdot \tan y\right)}\right) \cdot \cos a}\]

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 12.9

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

    \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{\frac{\sin a}{\cos a}}\right)\]
  4. Applied tan-sum0.2

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

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

    \[\leadsto x + \frac{\left(\tan y + \tan z\right) \cdot \cos a - \left(1 - \tan y \cdot \tan z\right) \cdot \sin a}{\left(1 - \color{blue}{\sqrt[3]{\left(\left(\tan y \cdot \tan z\right) \cdot \left(\tan y \cdot \tan z\right)\right) \cdot \left(\tan y \cdot \tan z\right)}}\right) \cdot \cos a}\]
  8. Using strategy rm
  9. Applied *-commutative0.2

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

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

Reproduce

herbie shell --seed 2019022 
(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

sample473.0ms

Algorithm
intervals
Results
264.0ms124×body1280valid
120.0ms66×body640valid
26.0ms256×pre80true
20.0ms23×body320valid
9.0ms35×body80valid
6.0msbody160valid

simplify40.0ms

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

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 12.1b

localize35.0ms

Local error

Found 3 expressions with local error:

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

rewrite31.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
*-un-lft-identity
add-sqr-sqrt
tan-quot
add-cube-cbrt
add-exp-log
add-cbrt-cube
pow1
frac-sub
sub-neg
associate-+r+
tan-sum
difference-of-squares
distribute-lft-out--
flip--
flip-+
diff-log
flip3--
flip3-+
associate-+r-
+-commutative
Counts
3 → 38
Calls
3 calls:
Slowest
9.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
140.0ms
(- (tan (+ y z)) (tan a))
129.0ms
(+ x (- (tan (+ y z)) (tan a)))
59.0ms
(tan (+ y z))

simplify542.0ms

Counts
21 → 47
Calls
21 calls:
Slowest
180.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
145.0ms
(* (- 1 (* (tan y) (tan z))) (cos a))
44.0ms
(- (+ (/ (sin (+ z y)) (cos (+ z y))) x) (/ (sin a) (cos a)))
43.0ms
(- (+ (/ (sin (+ z y)) (cos (+ z y))) x) (/ (sin a) (cos a)))
32.0ms
(+ (* 1/3 (pow y 3)) (+ z y))

prune580.0ms

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

localize57.0ms

Local error

Found 4 expressions with local error:

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

rewrite61.0ms

Algorithm
rewrite-expression-head
Rules
28×associate-*l/
16×tan-quot
13×add-exp-log
13×add-cbrt-cube
12×frac-sub
10×add-cube-cbrt
10×*-un-lft-identity
10×add-sqr-sqrt
flip--
flip3--
associate-/l/
pow1
add-log-exp
associate-*l*
associate-*r*
flip-+
frac-add
flip3-+
associate-/l*
cbrt-unprod
prod-exp
times-frac
*-commutative
associate-/r/
associate-*r/
pow-prod-down
div-exp
cbrt-undiv
frac-times
div-inv
div-sub
diff-log
frac-2neg
sub-neg
associate-/r*
clear-num
Counts
4 → 90
Calls
4 calls:
Slowest
38.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (* (tan y) (tan z))) (cos a)))
10.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
7.0ms
(* (tan y) (tan z))
5.0ms
(* (tan y) (tan z))

series1.1s

Counts
4 → 12
Calls
4 calls:
Slowest
561.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (* (tan y) (tan z))) (cos a)))
326.0ms
(- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a)))
109.0ms
(* (tan y) (tan z))
88.0ms
(* (tan y) (tan z))

simplify8.2s

Counts
73 → 102
Calls
73 calls:
Slowest
344.0ms
(* (* (cos y) (cos z)) (+ (* 1 1) (+ (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* 1 (* (tan y) (tan z))))))
333.0ms
(* (- (tan y) (tan z)) (+ (* 1 1) (+ (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* 1 (* (tan y) (tan z))))))
313.0ms
(+ (* 1/3 (* (pow z 3) y)) (+ (* 1/3 (* z (pow y 3))) (* z y)))
313.0ms
(- (+ (/ (* (cos a) (sin z)) (cos z)) (+ (/ (* (sin a) (* (sin z) (sin y))) (* (cos y) (cos z))) (/ (* (cos a) (sin y)) (cos y)))) (sin a))
301.0ms
(* (+ (* (tan y) (tan y)) (- (* (tan z) (tan z)) (* (tan y) (tan z)))) (+ 1 (* (tan y) (tan z))))

prune1.8s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

localize41.0ms

Local error

Found 4 expressions with local error:

26.5b
(cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))))
0.3b
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
0.2b
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))))) (cos a)))
0.2b
(* (tan y) (tan z))

rewrite88.0ms

Algorithm
rewrite-expression-head
Rules
232×tan-quot
147×frac-times
101×associate-*l/
75×associate-*r/
63×cbrt-div
33×pow1
23×add-exp-log
23×add-cbrt-cube
14×pow-prod-down
10×cbrt-unprod
10×prod-exp
associate-/l/
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
frac-sub
flip--
flip3--
add-log-exp
pow-prod-up
associate-*l*
associate-*r*
associate-/l*
times-frac
flip-+
*-commutative
associate-/r/
frac-add
div-exp
pow-plus
flip3-+
cbrt-undiv
div-inv
rem-cbrt-cube
pow3
div-sub
pow1/3
frac-2neg
associate-/r*
clear-num
pow2
cbrt-prod
Counts
4 → 169
Calls
4 calls:
Slowest
39.0ms
(cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))))
21.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))))) (cos a)))
20.0ms
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
4.0ms
(* (tan y) (tan z))

series843.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
534.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))))) (cos a)))
121.0ms
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
97.0ms
(* (tan y) (tan z))
91.0ms
(cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan y) (tan z))))

simplify21.5s

Counts
161 → 181
Calls
161 calls:
Slowest
837.0ms
(cbrt (* (* (* (tan y) (tan z)) (* (tan y) (sin z))) (* (sin y) (sin z))))
686.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))))
682.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))))
511.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))))
411.0ms
(cbrt (* (* (* (sin y) (tan z)) (* (tan y) (sin z))) (* (sin y) (sin z))))

prune2.6s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.1b

localize19.0ms

Local error

Found 4 expressions with local error:

26.5b
(cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan z) (tan y))))
0.3b
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
0.2b
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan z) (tan y))))) (cos a)))
0.2b
(* (tan y) (tan z))

rewrite78.0ms

Algorithm
rewrite-expression-head
Rules
232×tan-quot
147×frac-times
101×associate-*l/
75×associate-*r/
63×cbrt-div
33×pow1
23×add-exp-log
23×add-cbrt-cube
14×pow-prod-down
10×cbrt-unprod
10×prod-exp
associate-/l/
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
frac-sub
flip--
flip3--
add-log-exp
pow-prod-up
associate-*l*
associate-*r*
associate-/l*
times-frac
flip-+
*-commutative
associate-/r/
frac-add
div-exp
pow-plus
flip3-+
cbrt-undiv
div-inv
div-sub
pow1/3
frac-2neg
associate-/r*
clear-num
pow2
cbrt-prod
Counts
4 → 168
Calls
4 calls:
Slowest
33.0ms
(cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan z) (tan y))))
20.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan z) (tan y))))) (cos a)))
15.0ms
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
5.0ms
(* (tan y) (tan z))

series621.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
378.0ms
(/ (- (* (+ (tan y) (tan z)) (cos a)) (* (- 1 (* (tan y) (tan z))) (sin a))) (* (- 1 (cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan z) (tan y))))) (cos a)))
90.0ms
(* (* (tan y) (tan z)) (* (tan y) (tan z)))
77.0ms
(cbrt (* (* (* (tan y) (tan z)) (* (tan y) (tan z))) (* (tan z) (tan y))))
76.0ms
(* (tan y) (tan z))

simplify15.5s

Counts
160 → 180
Calls
160 calls:
Slowest
479.0ms
(cbrt (* (* (* (sin y) (tan z)) (* (tan y) (tan z))) (* (sin z) (tan y))))
369.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))))
344.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))))
333.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))))
263.0ms
(cbrt (* (* (* (sin y) (tan z)) (* (tan y) (sin z))) (* (sin z) (sin y))))

prune2.3s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0.1b

regimes815.0ms

Accuracy

0% (0.1b remaining)

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

bsearch3.0ms

end0.0ms

sample9.9s

Algorithm
intervals
Results
5.9s3863×body1280valid
2.3s1964×body640valid
526.0ms697×body320valid
513.0ms8000×pre80true
272.0ms1192×body80valid
146.0ms284×body160valid