Average Error: 43.4 → 0.7
Time: 12.6s
Precision: binary64
Cost: 33408
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\]
↓
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sin re \cdot im\]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)↓
\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sin re \cdot im(FPCore (re im)
:precision binary64
(* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
↓
(FPCore (re im)
:precision binary64
(-
(*
(* 0.5 (sin re))
(+
(* (pow im 7.0) -0.0003968253968253968)
(+
(* (pow im 5.0) -0.016666666666666666)
(* (pow im 3.0) -0.3333333333333333))))
(* (sin re) im)))double code(double re, double im) {
return (0.5 * sin(re)) * (exp(-im) - exp(im));
}
↓
double code(double re, double im) {
return ((0.5 * sin(re)) * ((pow(im, 7.0) * -0.0003968253968253968) + ((pow(im, 5.0) * -0.016666666666666666) + (pow(im, 3.0) * -0.3333333333333333)))) - (sin(re) * im);
}
Try it out
Enter valid numbers for all inputs
Target
| Original | 43.4 |
|---|
| Target | 0.3 |
|---|
| Herbie | 0.7 |
|---|
\[\begin{array}{l}
\mathbf{if}\;\left|im\right| < 1:\\
\;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\\
\end{array}\]
Alternatives
| Alternative 1 |
|---|
| Error | 42.9 |
|---|
| Cost | 101184 |
|---|
\[\frac{\left(0.5 \cdot \sin re\right) \cdot \left({\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right)}^{3} - {\left(0.0003968253968253968 \cdot {im}^{7}\right)}^{3}\right)}{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) \cdot \left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + \left(\left(0.0003968253968253968 \cdot {im}^{7}\right) \cdot \left(0.0003968253968253968 \cdot {im}^{7}\right) + \left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) \cdot \left(0.0003968253968253968 \cdot {im}^{7}\right)\right)}\]
| Alternative 2 |
|---|
| Error | 1.7 |
|---|
| Cost | 100352 |
|---|
\[\sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)} \cdot \left(\sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)} \cdot \sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)}\right)\]
| Alternative 3 |
|---|
| Error | 33.3 |
|---|
| Cost | 91392 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \left(\sqrt[3]{\sin re} \cdot \sqrt[3]{\sin re}\right) \cdot \left(im \cdot \left(\sqrt[3]{\sqrt{\sin re}} \cdot \sqrt[3]{\sqrt{\sin re}}\right)\right)\]
| Alternative 4 |
|---|
| Error | 1.7 |
|---|
| Cost | 87040 |
|---|
\[\sqrt[3]{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968} \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \left(\sqrt[3]{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968} \cdot \sqrt[3]{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968}\right)\right)\]
| Alternative 5 |
|---|
| Error | 43.4 |
|---|
| Cost | 78464 |
|---|
\[\sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)} \cdot \left(\sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)} \cdot \sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)}\right)\]
| Alternative 6 |
|---|
| Error | 43.5 |
|---|
| Cost | 71936 |
|---|
\[\frac{\left(0.5 \cdot \sin re\right) \cdot \left({\left(e^{im}\right)}^{-3} - {\left(e^{im}\right)}^{3}\right)}{e^{-im} \cdot e^{-im} + \left(e^{im} \cdot e^{im} + e^{-im} \cdot e^{im}\right)}\]
| Alternative 7 |
|---|
| Error | 25.5 |
|---|
| Cost | 66880 |
|---|
\[\sqrt{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)} \cdot \sqrt{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)}\]
| Alternative 8 |
|---|
| Error | 1.7 |
|---|
| Cost | 66112 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) + \sqrt[3]{\sin re \cdot \left(-im\right)} \cdot \left(\sqrt[3]{\sin re \cdot \left(-im\right)} \cdot \sqrt[3]{\sin re \cdot \left(-im\right)}\right)\]
| Alternative 9 |
|---|
| Error | 1.6 |
|---|
| Cost | 65664 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \left(\sqrt[3]{\sin re} \cdot \sqrt[3]{\sin re}\right) \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
| Alternative 10 |
|---|
| Error | 43.4 |
|---|
| Cost | 65152 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left(\sqrt[3]{e^{-im} - e^{im}} \cdot \left(\sqrt[3]{e^{-im} - e^{im}} \cdot \sqrt[3]{e^{-im} - e^{im}}\right)\right)\]
| Alternative 11 |
|---|
| Error | 22.6 |
|---|
| Cost | 61120 |
|---|
\[\frac{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) \cdot \left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{14} \cdot -1.5747039556563367 \cdot 10^{-07}\right)}{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + 0.0003968253968253968 \cdot {im}^{7}}\]
| Alternative 12 |
|---|
| Error | 33.2 |
|---|
| Cost | 60224 |
|---|
\[\sqrt{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968} \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \sqrt{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968}\right)\]
| Alternative 13 |
|---|
| Error | 33.5 |
|---|
| Cost | 59264 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - e^{0.6666666666666666 \cdot \log \sin re} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
| Alternative 14 |
|---|
| Error | 5.5 |
|---|
| Cost | 59264 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - {\left({\sin re}^{2}\right)}^{0.3333333333333333} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
| Alternative 15 |
|---|
| Error | 4.9 |
|---|
| Cost | 59200 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sqrt[3]{{\sin re}^{2}} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
| Alternative 16 |
|---|
| Error | 1.6 |
|---|
| Cost | 59200 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - {\left(\sqrt[3]{\sin re}\right)}^{2} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
| Alternative 17 |
|---|
| Error | 43.5 |
|---|
| Cost | 58688 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \frac{{\left(e^{im}\right)}^{-3} - {\left(e^{im}\right)}^{3}}{{\left(e^{im}\right)}^{-2} + \left({\left(e^{im}\right)}^{2} + 1\right)}\]
| Alternative 18 |
|---|
| Error | 43.4 |
|---|
| Cost | 58432 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left(\left(\sqrt{e^{-im}} + \sqrt{e^{im}}\right) \cdot \left(\sqrt{e^{-im}} - \sqrt{e^{im}}\right)\right)\]
| Alternative 19 |
|---|
| Error | 1.7 |
|---|
| Cost | 53056 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) + \sqrt[3]{-im} \cdot \left(\sin re \cdot \left(\sqrt[3]{-im} \cdot \sqrt[3]{-im}\right)\right)\]
| Alternative 20 |
|---|
| Error | 25.5 |
|---|
| Cost | 52992 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) + \sqrt{\sin re \cdot \left(-im\right)} \cdot \sqrt{\sin re \cdot \left(-im\right)}\]
| Alternative 21 |
|---|
| Error | 1.7 |
|---|
| Cost | 52864 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sqrt[3]{im} \cdot \left(\sin re \cdot \left(\sqrt[3]{im} \cdot \sqrt[3]{im}\right)\right)\]
| Alternative 22 |
|---|
| Error | 33.5 |
|---|
| Cost | 52800 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - {\sin re}^{0.6666666666666666} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
| Alternative 23 |
|---|
| Error | 33.0 |
|---|
| Cost | 52736 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sqrt{\sin re} \cdot \left(im \cdot \sqrt{\sin re}\right)\]
| Alternative 24 |
|---|
| Error | 33.2 |
|---|
| Cost | 46464 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) + \sqrt{-im} \cdot \left(\sin re \cdot \sqrt{-im}\right)\]
| Alternative 25 |
|---|
| Error | 31.8 |
|---|
| Cost | 46336 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sqrt{im} \cdot \left(\sin re \cdot \sqrt{im}\right)\]
| Alternative 26 |
|---|
| Error | 43.4 |
|---|
| Cost | 45696 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \frac{{\left(e^{im}\right)}^{-2} - {\left(e^{im}\right)}^{2}}{e^{-im} + e^{im}}\]
| Alternative 27 |
|---|
| Error | 33.9 |
|---|
| Cost | 39872 |
|---|
\[\sqrt[3]{{\left(\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)\right)}^{3}}\]
| Alternative 28 |
|---|
| Error | 0.7 |
|---|
| Cost | 39872 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - \sqrt[3]{{\left(0.0003968253968253968 \cdot {im}^{7}\right)}^{3}}\right)\]
| Alternative 29 |
|---|
| Error | 44.8 |
|---|
| Cost | 38784 |
|---|
\[\log \left(\sqrt{e^{\sin re \cdot \left(e^{-im} - e^{im}\right)}}\right)\]
| Alternative 30 |
|---|
| Error | 0.7 |
|---|
| Cost | 33280 |
|---|
\[\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right) - \sin re \cdot \left({im}^{7} \cdot 0.0001984126984126984 + {im}^{5} \cdot 0.008333333333333333\right)\]
| Alternative 31 |
|---|
| Error | 43.4 |
|---|
| Cost | 32576 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \sqrt[3]{{\left(e^{-im} - e^{im}\right)}^{3}}\]
| Alternative 32 |
|---|
| Error | 44.8 |
|---|
| Cost | 32512 |
|---|
\[e^{\log \left(\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\right)}\]
| Alternative 33 |
|---|
| Error | 43.8 |
|---|
| Cost | 32512 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \log \left(e^{e^{-im} - e^{im}}\right)\]
| Alternative 34 |
|---|
| Error | 0.7 |
|---|
| Cost | 27200 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + \left(im \cdot im\right) \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) - \sin re \cdot im\]
| Alternative 35 |
|---|
| Error | 31.5 |
|---|
| Cost | 27008 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - re \cdot im\]
| Alternative 36 |
|---|
| Error | 0.7 |
|---|
| Cost | 27008 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)\]
| Alternative 37 |
|---|
| Error | 7.7 |
|---|
| Cost | 26880 |
|---|
\[re \cdot \left({im}^{7} \cdot -0.0001984126984126984 + \left({im}^{3} \cdot -0.16666666666666666 - {im}^{5} \cdot 0.008333333333333333\right)\right) - \sin re \cdot im\]
| Alternative 38 |
|---|
| Error | 43.4 |
|---|
| Cost | 26304 |
|---|
\[\frac{0.5 \cdot \sin re}{e^{im}} + e^{im} \cdot \left(\sin re \cdot -0.5\right)\]
| Alternative 39 |
|---|
| Error | 0.7 |
|---|
| Cost | 20800 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + \left(im \cdot -2 - im \cdot \left(0.3333333333333333 \cdot \left(im \cdot im\right)\right)\right)\right)\right)\]
| Alternative 40 |
|---|
| Error | 31.5 |
|---|
| Cost | 20352 |
|---|
\[re \cdot \left({im}^{7} \cdot -0.0001984126984126984 - \left({im}^{5} \cdot 0.008333333333333333 + \left(im + {im}^{3} \cdot 0.16666666666666666\right)\right)\right)\]
| Alternative 41 |
|---|
| Error | 0.8 |
|---|
| Cost | 20288 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right)\]
| Alternative 42 |
|---|
| Error | 43.4 |
|---|
| Cost | 19712 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\]
| Alternative 43 |
|---|
| Error | 0.9 |
|---|
| Cost | 13568 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right)\]
| Alternative 44 |
|---|
| Error | 0.9 |
|---|
| Cost | 13312 |
|---|
\[\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\]
| Alternative 45 |
|---|
| Error | 1.3 |
|---|
| Cost | 6848 |
|---|
\[\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot -2\right)\]
| Alternative 46 |
|---|
| Error | 1.3 |
|---|
| Cost | 6656 |
|---|
\[\sin re \cdot \left(-im\right)\]
| Alternative 47 |
|---|
| Error | 61.7 |
|---|
| Cost | 64 |
|---|
\[1\]
| Alternative 48 |
|---|
| Error | 45.9 |
|---|
| Cost | 64 |
|---|
\[0\]
| Alternative 49 |
|---|
| Error | 61.7 |
|---|
| Cost | 64 |
|---|
\[-1\]
Error

Derivation
Initial program 43.4
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\]
Taylor expanded around 0 0.7
\[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(-\left(0.0003968253968253968 \cdot {im}^{7} + \left(0.016666666666666666 \cdot {im}^{5} + \left(0.3333333333333333 \cdot {im}^{3} + 2 \cdot im\right)\right)\right)\right)}\]
Simplified0.7
\[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right)}\]
- Using strategy
rm Applied sub-neg_binary64_33940.7
\[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\left(\color{blue}{\left(im \cdot -2 + \left(-0.3333333333333333 \cdot {im}^{3}\right)\right)} - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right)\]
Applied associate--l+_binary64_33380.7
\[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{\left(im \cdot -2 + \left(\left(-0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right)\right)} - 0.0003968253968253968 \cdot {im}^{7}\right)\]
Applied associate--l+_binary64_33380.7
\[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot -2 + \left(\left(\left(-0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right)\right)}\]
Applied distribute-rgt-in_binary64_33510.7
\[\leadsto \color{blue}{\left(im \cdot -2\right) \cdot \left(0.5 \cdot \sin re\right) + \left(\left(\left(-0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right) \cdot \left(0.5 \cdot \sin re\right)}\]
Simplified0.7
\[\leadsto \color{blue}{\sin re \cdot \left(-im\right)} + \left(\left(\left(-0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right) \cdot \left(0.5 \cdot \sin re\right)\]
Simplified0.7
\[\leadsto \sin re \cdot \left(-im\right) + \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right)}\]
Simplified0.7
\[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sin re \cdot im}\]
Final simplification0.7
\[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sin re \cdot im\]
Reproduce
herbie shell --seed 2021042
(FPCore (re im)
:name "math.cos on complex, imaginary part"
:precision binary64
:herbie-target
(if (< (fabs im) 1.0) (- (* (sin re) (+ (+ im (* (* (* 0.16666666666666666 im) im) im)) (* (* (* (* (* 0.008333333333333333 im) im) im) im) im)))) (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
(* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))