Average Error: 31.3 → 10.8
Time: 4.8m
Precision: 64
Internal Precision: 128
\[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
\[\begin{array}{l} \mathbf{if}\;y.re \le -1.7748707103617984 \cdot 10^{-55}:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right) \cdot \left(\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right) \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)\right)}\\ \mathbf{elif}\;y.re \le -4.860137094138367 \cdot 10^{-280} \lor \neg \left(y.re \le 2.478594506845658 \cdot 10^{-159}\right):\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right) \cdot e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \log \left(\left(\sqrt[3]{\sqrt{x.im \cdot x.im + x.re \cdot x.re}} \cdot \sqrt[3]{\sqrt{x.im \cdot x.im + x.re \cdot x.re}}\right) \cdot \sqrt[3]{\sqrt{x.im \cdot x.im + x.re \cdot x.re}}\right) \cdot y.im\right)\\ \end{array}\]

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if y.re < -1.7748707103617984e-55

    1. Initial program 37.3

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    2. Taylor expanded around -inf 0.2

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified0.2

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    4. Using strategy rm
    5. Applied add-cbrt-cube0.2

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\sqrt[3]{\left(\sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}}\]

    if -1.7748707103617984e-55 < y.re < -4.860137094138367e-280 or 2.478594506845658e-159 < y.re

    1. Initial program 22.9

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    2. Taylor expanded around -inf 23.0

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified23.0

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    4. Taylor expanded around -inf 14.7

      \[\leadsto e^{\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    5. Simplified14.7

      \[\leadsto e^{\log \color{blue}{\left(-x.re\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

    if -4.860137094138367e-280 < y.re < 2.478594506845658e-159

    1. Initial program 31.4

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt31.4

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(\left(\sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right) \cdot \sqrt[3]{\sqrt{x.re \cdot x.re + x.im \cdot x.im}}\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification10.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \le -1.7748707103617984 \cdot 10^{-55}:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right) \cdot \left(\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right) \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)\right)}\\ \mathbf{elif}\;y.re \le -4.860137094138367 \cdot 10^{-280} \lor \neg \left(y.re \le 2.478594506845658 \cdot 10^{-159}\right):\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right) \cdot e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \log \left(\left(\sqrt[3]{\sqrt{x.im \cdot x.im + x.re \cdot x.re}} \cdot \sqrt[3]{\sqrt{x.im \cdot x.im + x.re \cdot x.re}}\right) \cdot \sqrt[3]{\sqrt{x.im \cdot x.im + x.re \cdot x.re}}\right) \cdot y.im\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019008 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))

Details

Time bar (total: 4.8m)Debug log

sample7.0s

Algorithm
intervals

simplify100.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

99.0ms
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re))))

prune12.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 31.1b

localize42.0ms

Local error

Found 4 expressions with local error:

35.2b
(sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))
29.1b
(sqrt (+ (* x.re x.re) (* x.im x.im)))
29.1b
(sqrt (+ (* x.re x.re) (* x.im x.im)))
0.3b
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im)

rewrite27.0ms

Algorithm
rewrite-expression-head
Counts
4 → 49
Calls

4 calls. Slowest were:

18.0ms
(sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))
3.0ms
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im)
2.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

series287.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

157.0ms
(sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))
88.0ms
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im)
22.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))
18.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

simplify695.0ms

Counts
27 → 61
Calls

27 calls. Slowest were:

143.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
108.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
79.0ms
(* -1 (* y.im (log (/ 1 x.re))))

prune1.2s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 11.6b

localize28.0ms

Local error

Found 4 expressions with local error:

35.0b
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
29.1b
(sqrt (+ (* x.re x.re) (* x.im x.im)))
0.3b
(* (log (- x.re)) y.im)
0.3b
(* (atan2 x.im x.re) y.im)

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
4 → 45
Calls

4 calls. Slowest were:

8.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
3.0ms
(* (log (- x.re)) y.im)
2.0ms
(* (atan2 x.im x.re) y.im)

series229.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

115.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
72.0ms
(* (log (- x.re)) y.im)
24.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))
18.0ms
(* (atan2 x.im x.re) y.im)

simplify671.0ms

Counts
23 → 57
Calls

23 calls. Slowest were:

176.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
111.0ms
(sin (- (+ (* (atan2 x.im x.re) y.re) (* y.im (log -1))) (* y.im (log (/ 1 x.re)))))
103.0ms
(sin (- (* (atan2 x.im x.re) y.re) (* y.im (log (/ -1 x.re)))))

prune1.1s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 6.1b

localize16.0ms

Local error

Found 4 expressions with local error:

35.0b
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
35.0b
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
35.0b
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
29.1b
(sqrt (+ (* x.re x.re) (* x.im x.im)))

rewrite31.0ms

Algorithm
rewrite-expression-head
Counts
4 → 38
Calls

4 calls. Slowest were:

12.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
9.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
8.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))

series420.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

140.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
137.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
124.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
19.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

simplify769.0ms

Counts
21 → 50
Calls

21 calls. Slowest were:

134.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
102.0ms
(sin (- (* (atan2 x.im x.re) y.re) (* y.im (log (/ -1 x.re)))))
88.0ms
(sin (- (+ (* (atan2 x.im x.re) y.re) (* y.im (log -1))) (* y.im (log (/ 1 x.re)))))

prune1.1s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 6.1b

localize18.0ms

Local error

Found 4 expressions with local error:

35.0b
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
0.3b
(* (log (- x.re)) y.im)
0.3b
(* (log (- x.re)) y.re)
0.3b
(* (atan2 x.im x.re) y.im)

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 43
Calls

4 calls. Slowest were:

8.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
3.0ms
(* (log (- x.re)) y.im)
3.0ms
(* (log (- x.re)) y.re)

series331.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

131.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
103.0ms
(* (log (- x.re)) y.re)
76.0ms
(* (log (- x.re)) y.im)
20.0ms
(* (atan2 x.im x.re) y.im)

simplify478.0ms

Counts
19 → 55
Calls

19 calls. Slowest were:

105.0ms
(* -1 (* y.im (log (/ -1 x.re))))
96.0ms
(* -1 (* y.re (log (/ -1 x.re))))
73.0ms
(sin (- (+ (* (atan2 x.im x.re) y.re) (* y.im (log -1))) (* y.im (log (/ 1 x.re)))))

prune811.0ms

Pruning

12 alts after pruning (10 fresh and 2 done)

Merged error: 6.0b

regimes762.0ms

Accuracy

58% (5.8b remaining)

Error of 10.8b against oracle of 4.9b and baseline of 18.8b

bsearch1.1m

end0.0ms

sample3.4m

Algorithm
intervals