Average Error: 31.8 → 9.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 -6.864987875366157 \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 \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) \cdot \sqrt[3]{\left(\log \left(-x.re\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right)\right) \cdot \sqrt[3]{\log \left(-x.re\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\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 2 regimes
  2. if y.re < -6.864987875366157e-55

    1. Initial program 37.5

      \[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-cube-cbrt0.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(\color{blue}{\left(\left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \sqrt[3]{\log \left(-x.re\right)}\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    6. Applied associate-*l*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(\color{blue}{\left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    7. Using strategy rm
    8. Applied cbrt-unprod0.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(\color{blue}{\sqrt[3]{\log \left(-x.re\right) \cdot \log \left(-x.re\right)}} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    9. Using strategy rm
    10. Applied add-cube-cbrt0.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(\sqrt[3]{\log \left(-x.re\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right) \cdot \sqrt[3]{\log \left(-x.re\right)}\right)}} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    11. Applied associate-*r*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(\sqrt[3]{\color{blue}{\left(\log \left(-x.re\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right)\right) \cdot \sqrt[3]{\log \left(-x.re\right)}}} \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

    if -6.864987875366157e-55 < y.re

    1. Initial program 26.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 31.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. Simplified31.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. Taylor expanded around -inf 19.3

      \[\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. Simplified19.3

      \[\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)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification9.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \le -6.864987875366157 \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 \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \left(\sqrt[3]{\log \left(-x.re\right)} \cdot y.im\right) \cdot \sqrt[3]{\left(\log \left(-x.re\right) \cdot \left(\sqrt[3]{\log \left(-x.re\right)} \cdot \sqrt[3]{\log \left(-x.re\right)}\right)\right) \cdot \sqrt[3]{\log \left(-x.re\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019005 
(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.9s

Algorithm
intervals

simplify492.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

491.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))))

prune13.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 31.5b

localize72.0ms

Local error

Found 4 expressions with local error:

37.9b
(sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))
29.7b
(sqrt (+ (* x.re x.re) (* x.im x.im)))
29.7b
(sqrt (+ (* x.re x.re) (* x.im x.im)))
0.3b
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
4 → 49
Calls

4 calls. Slowest were:

11.0ms
(sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))
4.0ms
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
2.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

series323.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

177.0ms
(sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))
80.0ms
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
34.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))
32.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

simplify578.0ms

Counts
27 → 61
Calls

27 calls. Slowest were:

122.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
107.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
71.0ms
(sin (- (* (atan2 x.im x.re) y.re) (* y.im (log (/ -1 x.re)))))

prune1.1s

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 10.9b

localize20.0ms

Local error

Found 4 expressions with local error:

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

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
4 → 47
Calls

4 calls. Slowest were:

12.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
6.0ms
(* (log (- x.re)) y.im)
4.0ms
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)

series330.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

141.0ms
(sin (+ (* (log (- x.re)) y.im) (* (atan2 x.im x.re) y.re)))
86.0ms
(* (log (- x.re)) y.im)
83.0ms
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
19.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

simplify667.0ms

Counts
23 → 59
Calls

23 calls. Slowest were:

115.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
97.0ms
(* -1 (* y.re (log (/ -1 x.re))))
93.0ms
(* -1 (* y.re (log (/ 1 x.re))))

prune1.3s

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 4.0b

localize32.0ms

Local error

Found 4 expressions with local error:

37.9b
(sin (+ (* (* (cbrt (log (- x.re))) (cbrt (log (- x.re)))) (* (cbrt (log (- x.re))) y.im)) (* (atan2 x.im x.re) y.re)))
29.7b
(sqrt (+ (* x.re x.re) (* x.im x.im)))
0.5b
(* (cbrt (log (- x.re))) (cbrt (log (- x.re))))
0.5b
(cbrt (log (- x.re)))

rewrite54.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

45.0ms
(sin (+ (* (* (cbrt (log (- x.re))) (cbrt (log (- x.re)))) (* (cbrt (log (- x.re))) y.im)) (* (atan2 x.im x.re) y.re)))
5.0ms
(* (cbrt (log (- x.re))) (cbrt (log (- x.re))))
2.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

series944.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

429.0ms
(* (cbrt (log (- x.re))) (cbrt (log (- x.re))))
376.0ms
(cbrt (log (- x.re)))
118.0ms
(sin (+ (* (* (cbrt (log (- x.re))) (cbrt (log (- x.re)))) (* (cbrt (log (- x.re))) y.im)) (* (atan2 x.im x.re) y.re)))
20.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

simplify651.0ms

Counts
45 → 76
Calls

45 calls. Slowest were:

158.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
123.0ms
(pow (pow (- (log -1) (log (/ 1 x.re))) 2) 1/3)
66.0ms
(sin (- (* (atan2 x.im x.re) y.re) (* y.im (log (/ -1 x.re)))))

prune1.9s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 4.0b

localize27.0ms

Local error

Found 4 expressions with local error:

37.9b
(sin (+ (* (cbrt (* (log (- x.re)) (log (- x.re)))) (* (cbrt (log (- x.re))) y.im)) (* (atan2 x.im x.re) y.re)))
29.7b
(sqrt (+ (* x.re x.re) (* x.im x.im)))
0.5b
(* (log (- x.re)) (log (- x.re)))
0.5b
(cbrt (* (log (- x.re)) (log (- x.re))))

rewrite54.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

35.0ms
(sin (+ (* (cbrt (* (log (- x.re)) (log (- x.re)))) (* (cbrt (log (- x.re))) y.im)) (* (atan2 x.im x.re) y.re)))
10.0ms
(* (log (- x.re)) (log (- x.re)))
4.0ms
(cbrt (* (log (- x.re)) (log (- x.re))))

series834.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

405.0ms
(cbrt (* (log (- x.re)) (log (- x.re))))
243.0ms
(* (log (- x.re)) (log (- x.re)))
167.0ms
(sin (+ (* (cbrt (* (log (- x.re)) (log (- x.re)))) (* (cbrt (log (- x.re))) y.im)) (* (atan2 x.im x.re) y.re)))
19.0ms
(sqrt (+ (* x.re x.re) (* x.im x.im)))

simplify773.0ms

Counts
40 → 73
Calls

40 calls. Slowest were:

169.0ms
(sqrt (- (* (* x.re x.re) (* x.re x.re)) (* (* x.im x.im) (* x.im x.im))))
118.0ms
(pow (- (log -1) (log (/ 1 x.re))) 2)
98.0ms
(sin (- (* (atan2 x.im x.re) y.re) (* y.im (log (/ -1 x.re)))))

prune1.9s

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 4.0b

regimes879.0ms

Accuracy

56.3% (4.7b remaining)

Error of 9.8b against oracle of 5.1b and baseline of 15.9b

bsearch48.9s

end0.0ms

sample3.6m

Algorithm
intervals