math.cos on complex, real part Percentage Accurate: 100.0% → 100.0%
Time: 9.2s
Alternatives: 16
Speedup: TODO×
Unsound rule application detected in e-graph. Results may not be sound. (more) 49.7% of points produce a very large (infinite) output. You may want to add a precondition. (more) Specification ? \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Local Percentage Accuracy vs ?
The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples. Accuracy vs Speed? The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs. Alternative 1? \[\cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{0.5}{e^{im}}\right)
\]
Derivation Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \color{blue}{\left(\cos re \cdot 0.5\right)} \cdot \left(e^{-im} + e^{im}\right)
\]
associate-*l*100.0%
\[\leadsto \color{blue}{\cos re \cdot \left(0.5 \cdot \left(e^{-im} + e^{im}\right)\right)}
\]
+-commutative100.0%
\[\leadsto \cos re \cdot \left(0.5 \cdot \color{blue}{\left(e^{im} + e^{-im}\right)}\right)
\]
distribute-lft-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(0.5 \cdot e^{im} + 0.5 \cdot e^{-im}\right)}
\]
distribute-lft-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(0.5 \cdot \left(e^{im} + e^{-im}\right)\right)}
\]
distribute-rgt-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(e^{im} \cdot 0.5 + e^{-im} \cdot 0.5\right)}
\]
*-commutative100.0%
\[\leadsto \cos re \cdot \left(\color{blue}{0.5 \cdot e^{im}} + e^{-im} \cdot 0.5\right)
\]
fma-def100.0%
\[\leadsto \cos re \cdot \color{blue}{\mathsf{fma}\left(0.5, e^{im}, e^{-im} \cdot 0.5\right)}
\]
exp-neg100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{\frac{1}{e^{im}}} \cdot 0.5\right)
\]
associate-*l/100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{\frac{1 \cdot 0.5}{e^{im}}}\right)
\]
metadata-eval100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{\color{blue}{0.5}}{e^{im}}\right)
\]
Simplified100.0%
\[\leadsto \color{blue}{\cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{0.5}{e^{im}}\right)}
\]
Final simplification100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{0.5}{e^{im}}\right)
\]
Alternative 2? \[\begin{array}{l}
\mathbf{if}\;im \leq -2.35 \cdot 10^{+79}:\\
\;\;\;\;{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -12.5:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \mathsf{fma}\left(0.5, e^{im}, 0.5\right)\\
\end{array}
\]
Derivation Split input into 3 regimes if im < -2.35000000000000011e79 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow2100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Taylor expanded in im around inf 100.0%
\[\leadsto \color{blue}{0.041666666666666664 \cdot \left(\cos re \cdot {im}^{4}\right)}
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \color{blue}{\left(\cos re \cdot {im}^{4}\right) \cdot 0.041666666666666664}
\]
*-commutative100.0%
\[\leadsto \color{blue}{\left({im}^{4} \cdot \cos re\right)} \cdot 0.041666666666666664
\]
associate-*l*100.0%
\[\leadsto \color{blue}{{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)}
\]
Simplified100.0%
\[\leadsto \color{blue}{{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)}
\]
if -2.35000000000000011e79 < im < -12.5 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in re around 0 73.3%
\[\leadsto \color{blue}{0.5 \cdot \left(e^{im} + e^{-im}\right)}
\]
if -12.5 < im Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \color{blue}{\left(\cos re \cdot 0.5\right)} \cdot \left(e^{-im} + e^{im}\right)
\]
associate-*l*100.0%
\[\leadsto \color{blue}{\cos re \cdot \left(0.5 \cdot \left(e^{-im} + e^{im}\right)\right)}
\]
+-commutative100.0%
\[\leadsto \cos re \cdot \left(0.5 \cdot \color{blue}{\left(e^{im} + e^{-im}\right)}\right)
\]
distribute-lft-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(0.5 \cdot e^{im} + 0.5 \cdot e^{-im}\right)}
\]
distribute-lft-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(0.5 \cdot \left(e^{im} + e^{-im}\right)\right)}
\]
distribute-rgt-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(e^{im} \cdot 0.5 + e^{-im} \cdot 0.5\right)}
\]
*-commutative100.0%
\[\leadsto \cos re \cdot \left(\color{blue}{0.5 \cdot e^{im}} + e^{-im} \cdot 0.5\right)
\]
fma-def100.0%
\[\leadsto \cos re \cdot \color{blue}{\mathsf{fma}\left(0.5, e^{im}, e^{-im} \cdot 0.5\right)}
\]
exp-neg100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{\frac{1}{e^{im}}} \cdot 0.5\right)
\]
associate-*l/100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{\frac{1 \cdot 0.5}{e^{im}}}\right)
\]
metadata-eval100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{\color{blue}{0.5}}{e^{im}}\right)
\]
Simplified100.0%
\[\leadsto \color{blue}{\cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{0.5}{e^{im}}\right)}
\]
Taylor expanded in im around 0 97.6%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{0.5}\right)
\]
Recombined 3 regimes into one program. Final simplification96.6%
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \leq -2.35 \cdot 10^{+79}:\\
\;\;\;\;{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -12.5:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos re \cdot \mathsf{fma}\left(0.5, e^{im}, 0.5\right)\\
\end{array}
\]
Alternative 3? \[\left(\cos re \cdot 0.5\right) \cdot \left(e^{im} + e^{-im}\right)
\]
Derivation Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Final simplification100.0%
\[\leadsto \left(\cos re \cdot 0.5\right) \cdot \left(e^{im} + e^{-im}\right)
\]
Alternative 4? \[\begin{array}{l}
\mathbf{if}\;im \leq -2.35 \cdot 10^{+79}:\\
\;\;\;\;{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -12.5 \lor \neg \left(im \leq 0.165\right) \land im \leq 4 \cdot 10^{+76}:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos re \cdot 0.5\right) \cdot \left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)\\
\end{array}
\]
Derivation Split input into 3 regimes if im < -2.35000000000000011e79 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow2100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Taylor expanded in im around inf 100.0%
\[\leadsto \color{blue}{0.041666666666666664 \cdot \left(\cos re \cdot {im}^{4}\right)}
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \color{blue}{\left(\cos re \cdot {im}^{4}\right) \cdot 0.041666666666666664}
\]
*-commutative100.0%
\[\leadsto \color{blue}{\left({im}^{4} \cdot \cos re\right)} \cdot 0.041666666666666664
\]
associate-*l*100.0%
\[\leadsto \color{blue}{{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)}
\]
Simplified100.0%
\[\leadsto \color{blue}{{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)}
\]
if -2.35000000000000011e79 < im < -12.5 or 0.165000000000000008 < im < 4.0000000000000002e76 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in re around 0 78.3%
\[\leadsto \color{blue}{0.5 \cdot \left(e^{im} + e^{-im}\right)}
\]
if -12.5 < im < 0.165000000000000008 or 4.0000000000000002e76 < im Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 99.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow299.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative99.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified99.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Recombined 3 regimes into one program. Final simplification96.2%
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \leq -2.35 \cdot 10^{+79}:\\
\;\;\;\;{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -12.5 \lor \neg \left(im \leq 0.165\right) \land im \leq 4 \cdot 10^{+76}:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos re \cdot 0.5\right) \cdot \left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)\\
\end{array}
\]
Alternative 5? \[\begin{array}{l}
t_0 := \left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
t_1 := 0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{if}\;im \leq -2.5 \cdot 10^{+154}:\\
\;\;\;\;im \cdot \left(\cos re \cdot \left(0.5 \cdot im\right)\right)\\
\mathbf{elif}\;im \leq -12.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 1.26 \cdot 10^{-9}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 7.9 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Derivation Split input into 4 regimes if im < -2.50000000000000002e154 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow2100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in im around inf 100.0%
\[\leadsto \color{blue}{0.5 \cdot \left(\cos re \cdot {im}^{2}\right)}
\]
Step-by-step derivation associate-*r*100.0%
\[\leadsto \color{blue}{\left(0.5 \cdot \cos re\right) \cdot {im}^{2}}
\]
unpow2100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(im \cdot im\right)}
\]
associate-*r*100.0%
\[\leadsto \color{blue}{\left(\left(0.5 \cdot \cos re\right) \cdot im\right) \cdot im}
\]
*-commutative100.0%
\[\leadsto \color{blue}{im \cdot \left(\left(0.5 \cdot \cos re\right) \cdot im\right)}
\]
*-commutative100.0%
\[\leadsto im \cdot \left(\color{blue}{\left(\cos re \cdot 0.5\right)} \cdot im\right)
\]
associate-*l*100.0%
\[\leadsto im \cdot \color{blue}{\left(\cos re \cdot \left(0.5 \cdot im\right)\right)}
\]
*-commutative100.0%
\[\leadsto im \cdot \left(\cos re \cdot \color{blue}{\left(im \cdot 0.5\right)}\right)
\]
Simplified100.0%
\[\leadsto \color{blue}{im \cdot \left(\cos re \cdot \left(im \cdot 0.5\right)\right)}
\]
if -2.50000000000000002e154 < im < -12.5 or 1.25999999999999999e-9 < im < 7.8999999999999997e62 or 1.39999999999999991e101 < im < 1.1e136 Initial program 99.9%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in re around 0 83.1%
\[\leadsto \color{blue}{0.5 \cdot \left(e^{im} + e^{-im}\right)}
\]
if -12.5 < im < 1.25999999999999999e-9 or 1.1e136 < im Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 98.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow298.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified98.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
if 7.8999999999999997e62 < im < 1.39999999999999991e101 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 4.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow24.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified4.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 75.7%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right) + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)}
\]
Step-by-step derivation *-commutative75.7%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot 0.5} + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)
\]
*-commutative75.7%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right) \cdot -0.25}
\]
associate-*l*75.7%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(2 + {im}^{2}\right) \cdot \left({re}^{2} \cdot -0.25\right)}
\]
distribute-lft-out75.7%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)}
\]
+-commutative75.7%
\[\leadsto \color{blue}{\left({im}^{2} + 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
unpow275.7%
\[\leadsto \left(\color{blue}{im \cdot im} + 2\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
fma-def75.7%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
*-commutative75.7%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + \color{blue}{-0.25 \cdot {re}^{2}}\right)
\]
unpow275.7%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \color{blue}{\left(re \cdot re\right)}\right)
\]
Simplified75.7%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)}
\]
Recombined 4 regimes into one program. Final simplification94.6%
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \leq -2.5 \cdot 10^{+154}:\\
\;\;\;\;im \cdot \left(\cos re \cdot \left(0.5 \cdot im\right)\right)\\
\mathbf{elif}\;im \leq -12.5:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{elif}\;im \leq 1.26 \cdot 10^{-9}:\\
\;\;\;\;\left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 7.9 \cdot 10^{+62}:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+136}:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\end{array}
\]
Alternative 6? \[\begin{array}{l}
t_0 := 0.5 \cdot \left(e^{im} + e^{-im}\right)\\
t_1 := {im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)\\
\mathbf{if}\;im \leq -2.35 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq -12.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.26 \cdot 10^{-9}:\\
\;\;\;\;\left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 4 \cdot 10^{+76}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Derivation Split input into 3 regimes if im < -2.35000000000000011e79 or 4.0000000000000002e76 < im Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 99.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow299.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative99.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified99.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Taylor expanded in im around inf 99.0%
\[\leadsto \color{blue}{0.041666666666666664 \cdot \left(\cos re \cdot {im}^{4}\right)}
\]
Step-by-step derivation *-commutative99.0%
\[\leadsto \color{blue}{\left(\cos re \cdot {im}^{4}\right) \cdot 0.041666666666666664}
\]
*-commutative99.0%
\[\leadsto \color{blue}{\left({im}^{4} \cdot \cos re\right)} \cdot 0.041666666666666664
\]
associate-*l*99.0%
\[\leadsto \color{blue}{{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)}
\]
Simplified99.0%
\[\leadsto \color{blue}{{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)}
\]
if -2.35000000000000011e79 < im < -12.5 or 1.25999999999999999e-9 < im < 4.0000000000000002e76 Initial program 99.9%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in re around 0 79.7%
\[\leadsto \color{blue}{0.5 \cdot \left(e^{im} + e^{-im}\right)}
\]
if -12.5 < im < 1.25999999999999999e-9 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 99.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow299.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified99.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Recombined 3 regimes into one program. Final simplification96.1%
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \leq -2.35 \cdot 10^{+79}:\\
\;\;\;\;{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)\\
\mathbf{elif}\;im \leq -12.5:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{elif}\;im \leq 1.26 \cdot 10^{-9}:\\
\;\;\;\;\left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 4 \cdot 10^{+76}:\\
\;\;\;\;0.5 \cdot \left(e^{im} + e^{-im}\right)\\
\mathbf{else}:\\
\;\;\;\;{im}^{4} \cdot \left(\cos re \cdot 0.041666666666666664\right)\\
\end{array}
\]
Alternative 7? \[\begin{array}{l}
t_0 := \left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
t_1 := 0.5 \cdot \frac{9.506944444444445 - {im}^{4}}{3.0833333333333335 - im \cdot im}\\
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;im \cdot \left(\cos re \cdot \left(0.5 \cdot im\right)\right)\\
\mathbf{elif}\;im \leq -1.35 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;im \leq 18000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Derivation Split input into 4 regimes if im < -1.35000000000000003e154 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow2100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in im around inf 100.0%
\[\leadsto \color{blue}{0.5 \cdot \left(\cos re \cdot {im}^{2}\right)}
\]
Step-by-step derivation associate-*r*100.0%
\[\leadsto \color{blue}{\left(0.5 \cdot \cos re\right) \cdot {im}^{2}}
\]
unpow2100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(im \cdot im\right)}
\]
associate-*r*100.0%
\[\leadsto \color{blue}{\left(\left(0.5 \cdot \cos re\right) \cdot im\right) \cdot im}
\]
*-commutative100.0%
\[\leadsto \color{blue}{im \cdot \left(\left(0.5 \cdot \cos re\right) \cdot im\right)}
\]
*-commutative100.0%
\[\leadsto im \cdot \left(\color{blue}{\left(\cos re \cdot 0.5\right)} \cdot im\right)
\]
associate-*l*100.0%
\[\leadsto im \cdot \color{blue}{\left(\cos re \cdot \left(0.5 \cdot im\right)\right)}
\]
*-commutative100.0%
\[\leadsto im \cdot \left(\cos re \cdot \color{blue}{\left(im \cdot 0.5\right)}\right)
\]
Simplified100.0%
\[\leadsto \color{blue}{im \cdot \left(\cos re \cdot \left(im \cdot 0.5\right)\right)}
\]
if -1.35000000000000003e154 < im < -1.3499999999999999e69 or 1.39999999999999991e101 < im < 1.1e136 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 96.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow296.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative96.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified96.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Applied egg-rr 6.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{1.0833333333333333}\right)\right)
\]
Taylor expanded in re around 0 5.6%
\[\leadsto \color{blue}{0.5 \cdot \left(3.0833333333333335 + {im}^{2}\right)}
\]
Step-by-step derivation flip-+80.2%
\[\leadsto 0.5 \cdot \color{blue}{\frac{3.0833333333333335 \cdot 3.0833333333333335 - {im}^{2} \cdot {im}^{2}}{3.0833333333333335 - {im}^{2}}}
\]
div-sub80.2%
\[\leadsto 0.5 \cdot \color{blue}{\left(\frac{3.0833333333333335 \cdot 3.0833333333333335}{3.0833333333333335 - {im}^{2}} - \frac{{im}^{2} \cdot {im}^{2}}{3.0833333333333335 - {im}^{2}}\right)}
\]
metadata-eval80.2%
\[\leadsto 0.5 \cdot \left(\frac{\color{blue}{9.506944444444445}}{3.0833333333333335 - {im}^{2}} - \frac{{im}^{2} \cdot {im}^{2}}{3.0833333333333335 - {im}^{2}}\right)
\]
unpow280.2%
\[\leadsto 0.5 \cdot \left(\frac{9.506944444444445}{3.0833333333333335 - \color{blue}{im \cdot im}} - \frac{{im}^{2} \cdot {im}^{2}}{3.0833333333333335 - {im}^{2}}\right)
\]
pow-prod-up80.2%
\[\leadsto 0.5 \cdot \left(\frac{9.506944444444445}{3.0833333333333335 - im \cdot im} - \frac{\color{blue}{{im}^{\left(2 + 2\right)}}}{3.0833333333333335 - {im}^{2}}\right)
\]
metadata-eval80.2%
\[\leadsto 0.5 \cdot \left(\frac{9.506944444444445}{3.0833333333333335 - im \cdot im} - \frac{{im}^{\color{blue}{4}}}{3.0833333333333335 - {im}^{2}}\right)
\]
unpow280.2%
\[\leadsto 0.5 \cdot \left(\frac{9.506944444444445}{3.0833333333333335 - im \cdot im} - \frac{{im}^{4}}{3.0833333333333335 - \color{blue}{im \cdot im}}\right)
\]
Applied egg-rr 80.2%
\[\leadsto 0.5 \cdot \color{blue}{\left(\frac{9.506944444444445}{3.0833333333333335 - im \cdot im} - \frac{{im}^{4}}{3.0833333333333335 - im \cdot im}\right)}
\]
Step-by-step derivation div-sub80.2%
\[\leadsto 0.5 \cdot \color{blue}{\frac{9.506944444444445 - {im}^{4}}{3.0833333333333335 - im \cdot im}}
\]
Simplified80.2%
\[\leadsto 0.5 \cdot \color{blue}{\frac{9.506944444444445 - {im}^{4}}{3.0833333333333335 - im \cdot im}}
\]
if -1.3499999999999999e69 < im < 1.8e10 or 1.1e136 < im Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 89.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow289.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified89.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
if 1.8e10 < im < 1.39999999999999991e101 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 4.2%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow24.2%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified4.2%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 36.5%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right) + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)}
\]
Step-by-step derivation *-commutative36.5%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot 0.5} + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)
\]
*-commutative36.5%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right) \cdot -0.25}
\]
associate-*l*36.5%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(2 + {im}^{2}\right) \cdot \left({re}^{2} \cdot -0.25\right)}
\]
distribute-lft-out36.5%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)}
\]
+-commutative36.5%
\[\leadsto \color{blue}{\left({im}^{2} + 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
unpow236.5%
\[\leadsto \left(\color{blue}{im \cdot im} + 2\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
fma-def36.5%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
*-commutative36.5%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + \color{blue}{-0.25 \cdot {re}^{2}}\right)
\]
unpow236.5%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \color{blue}{\left(re \cdot re\right)}\right)
\]
Simplified36.5%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)}
\]
Recombined 4 regimes into one program. Final simplification85.3%
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;im \cdot \left(\cos re \cdot \left(0.5 \cdot im\right)\right)\\
\mathbf{elif}\;im \leq -1.35 \cdot 10^{+69}:\\
\;\;\;\;0.5 \cdot \frac{9.506944444444445 - {im}^{4}}{3.0833333333333335 - im \cdot im}\\
\mathbf{elif}\;im \leq 18000000000:\\
\;\;\;\;\left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\mathbf{elif}\;im \leq 1.4 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)\\
\mathbf{elif}\;im \leq 1.1 \cdot 10^{+136}:\\
\;\;\;\;0.5 \cdot \frac{9.506944444444445 - {im}^{4}}{3.0833333333333335 - im \cdot im}\\
\mathbf{else}:\\
\;\;\;\;\left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
\end{array}
\]
Alternative 8? \[\begin{array}{l}
t_0 := im \cdot \left(\cos re \cdot \left(0.5 \cdot im\right)\right)\\
\mathbf{if}\;im \leq -1.45:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 175000000000:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 4.1 \cdot 10^{+153}:\\
\;\;\;\;re \cdot \left(re \cdot -0.5\right) + 1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Derivation Split input into 3 regimes if im < -1.44999999999999996 or 4.10000000000000017e153 < im Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 68.7%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow268.7%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified68.7%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in im around inf 68.7%
\[\leadsto \color{blue}{0.5 \cdot \left(\cos re \cdot {im}^{2}\right)}
\]
Step-by-step derivation associate-*r*68.7%
\[\leadsto \color{blue}{\left(0.5 \cdot \cos re\right) \cdot {im}^{2}}
\]
unpow268.7%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(im \cdot im\right)}
\]
associate-*r*68.7%
\[\leadsto \color{blue}{\left(\left(0.5 \cdot \cos re\right) \cdot im\right) \cdot im}
\]
*-commutative68.7%
\[\leadsto \color{blue}{im \cdot \left(\left(0.5 \cdot \cos re\right) \cdot im\right)}
\]
*-commutative68.7%
\[\leadsto im \cdot \left(\color{blue}{\left(\cos re \cdot 0.5\right)} \cdot im\right)
\]
associate-*l*68.7%
\[\leadsto im \cdot \color{blue}{\left(\cos re \cdot \left(0.5 \cdot im\right)\right)}
\]
*-commutative68.7%
\[\leadsto im \cdot \left(\cos re \cdot \color{blue}{\left(im \cdot 0.5\right)}\right)
\]
Simplified68.7%
\[\leadsto \color{blue}{im \cdot \left(\cos re \cdot \left(im \cdot 0.5\right)\right)}
\]
if -1.44999999999999996 < im < 1.75e11 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \color{blue}{\left(\cos re \cdot 0.5\right)} \cdot \left(e^{-im} + e^{im}\right)
\]
associate-*l*100.0%
\[\leadsto \color{blue}{\cos re \cdot \left(0.5 \cdot \left(e^{-im} + e^{im}\right)\right)}
\]
+-commutative100.0%
\[\leadsto \cos re \cdot \left(0.5 \cdot \color{blue}{\left(e^{im} + e^{-im}\right)}\right)
\]
distribute-lft-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(0.5 \cdot e^{im} + 0.5 \cdot e^{-im}\right)}
\]
distribute-lft-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(0.5 \cdot \left(e^{im} + e^{-im}\right)\right)}
\]
distribute-rgt-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(e^{im} \cdot 0.5 + e^{-im} \cdot 0.5\right)}
\]
*-commutative100.0%
\[\leadsto \cos re \cdot \left(\color{blue}{0.5 \cdot e^{im}} + e^{-im} \cdot 0.5\right)
\]
fma-def100.0%
\[\leadsto \cos re \cdot \color{blue}{\mathsf{fma}\left(0.5, e^{im}, e^{-im} \cdot 0.5\right)}
\]
exp-neg100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{\frac{1}{e^{im}}} \cdot 0.5\right)
\]
associate-*l/100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{\frac{1 \cdot 0.5}{e^{im}}}\right)
\]
metadata-eval100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{\color{blue}{0.5}}{e^{im}}\right)
\]
Simplified100.0%
\[\leadsto \color{blue}{\cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{0.5}{e^{im}}\right)}
\]
Taylor expanded in im around 0 96.5%
\[\leadsto \color{blue}{\cos re}
\]
if 1.75e11 < im < 4.10000000000000017e153 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 4.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow24.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified4.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 33.5%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right) + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)}
\]
Step-by-step derivation *-commutative33.5%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot 0.5} + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)
\]
*-commutative33.5%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right) \cdot -0.25}
\]
associate-*l*33.5%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(2 + {im}^{2}\right) \cdot \left({re}^{2} \cdot -0.25\right)}
\]
distribute-lft-out33.5%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)}
\]
+-commutative33.5%
\[\leadsto \color{blue}{\left({im}^{2} + 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
unpow233.5%
\[\leadsto \left(\color{blue}{im \cdot im} + 2\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
fma-def33.5%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
*-commutative33.5%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + \color{blue}{-0.25 \cdot {re}^{2}}\right)
\]
unpow233.5%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \color{blue}{\left(re \cdot re\right)}\right)
\]
Simplified33.5%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)}
\]
Taylor expanded in im around 0 29.8%
\[\leadsto \color{blue}{2 \cdot \left(0.5 + -0.25 \cdot {re}^{2}\right)}
\]
Step-by-step derivation distribute-lft-in29.8%
\[\leadsto \color{blue}{2 \cdot 0.5 + 2 \cdot \left(-0.25 \cdot {re}^{2}\right)}
\]
metadata-eval29.8%
\[\leadsto \color{blue}{1} + 2 \cdot \left(-0.25 \cdot {re}^{2}\right)
\]
associate-*r*29.8%
\[\leadsto 1 + \color{blue}{\left(2 \cdot -0.25\right) \cdot {re}^{2}}
\]
metadata-eval29.8%
\[\leadsto 1 + \color{blue}{-0.5} \cdot {re}^{2}
\]
+-commutative29.8%
\[\leadsto \color{blue}{-0.5 \cdot {re}^{2} + 1}
\]
*-commutative29.8%
\[\leadsto \color{blue}{{re}^{2} \cdot -0.5} + 1
\]
unpow229.8%
\[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot -0.5 + 1
\]
associate-*l*29.8%
\[\leadsto \color{blue}{re \cdot \left(re \cdot -0.5\right)} + 1
\]
Simplified29.8%
\[\leadsto \color{blue}{re \cdot \left(re \cdot -0.5\right) + 1}
\]
Recombined 3 regimes into one program. Final simplification78.0%
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \leq -1.45:\\
\;\;\;\;im \cdot \left(\cos re \cdot \left(0.5 \cdot im\right)\right)\\
\mathbf{elif}\;im \leq 175000000000:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 4.1 \cdot 10^{+153}:\\
\;\;\;\;re \cdot \left(re \cdot -0.5\right) + 1\\
\mathbf{else}:\\
\;\;\;\;im \cdot \left(\cos re \cdot \left(0.5 \cdot im\right)\right)\\
\end{array}
\]
Alternative 9? \[\left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)
\]
Derivation Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 75.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow275.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified75.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Final simplification75.3%
\[\leadsto \left(\cos re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)
\]
Alternative 10? \[\begin{array}{l}
t_0 := 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq -2.7 \cdot 10^{+50}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;im \leq 960000000000:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 1.12 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(re \cdot -0.5\right) + 1\\
\mathbf{else}:\\
\;\;\;\;1 + t_0\\
\end{array}
\]
Derivation Split input into 4 regimes if im < -2.7e50 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 89.5%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow289.5%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative89.5%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified89.5%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Applied egg-rr 61.2%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{1.0833333333333333}\right)\right)
\]
Taylor expanded in re around 0 47.4%
\[\leadsto \color{blue}{0.5 \cdot \left(3.0833333333333335 + {im}^{2}\right)}
\]
Taylor expanded in im around inf 47.4%
\[\leadsto 0.5 \cdot \color{blue}{{im}^{2}}
\]
Step-by-step derivation unpow247.4%
\[\leadsto 0.5 \cdot \color{blue}{\left(im \cdot im\right)}
\]
Simplified47.4%
\[\leadsto 0.5 \cdot \color{blue}{\left(im \cdot im\right)}
\]
if -2.7e50 < im < 9.6e11 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Step-by-step derivation *-commutative100.0%
\[\leadsto \color{blue}{\left(\cos re \cdot 0.5\right)} \cdot \left(e^{-im} + e^{im}\right)
\]
associate-*l*100.0%
\[\leadsto \color{blue}{\cos re \cdot \left(0.5 \cdot \left(e^{-im} + e^{im}\right)\right)}
\]
+-commutative100.0%
\[\leadsto \cos re \cdot \left(0.5 \cdot \color{blue}{\left(e^{im} + e^{-im}\right)}\right)
\]
distribute-lft-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(0.5 \cdot e^{im} + 0.5 \cdot e^{-im}\right)}
\]
distribute-lft-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(0.5 \cdot \left(e^{im} + e^{-im}\right)\right)}
\]
distribute-rgt-in100.0%
\[\leadsto \cos re \cdot \color{blue}{\left(e^{im} \cdot 0.5 + e^{-im} \cdot 0.5\right)}
\]
*-commutative100.0%
\[\leadsto \cos re \cdot \left(\color{blue}{0.5 \cdot e^{im}} + e^{-im} \cdot 0.5\right)
\]
fma-def100.0%
\[\leadsto \cos re \cdot \color{blue}{\mathsf{fma}\left(0.5, e^{im}, e^{-im} \cdot 0.5\right)}
\]
exp-neg100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{\frac{1}{e^{im}}} \cdot 0.5\right)
\]
associate-*l/100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \color{blue}{\frac{1 \cdot 0.5}{e^{im}}}\right)
\]
metadata-eval100.0%
\[\leadsto \cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{\color{blue}{0.5}}{e^{im}}\right)
\]
Simplified100.0%
\[\leadsto \color{blue}{\cos re \cdot \mathsf{fma}\left(0.5, e^{im}, \frac{0.5}{e^{im}}\right)}
\]
Taylor expanded in im around 0 90.6%
\[\leadsto \color{blue}{\cos re}
\]
if 9.6e11 < im < 1.11999999999999994e154 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 4.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow24.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified4.8%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 33.5%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right) + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)}
\]
Step-by-step derivation *-commutative33.5%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot 0.5} + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)
\]
*-commutative33.5%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right) \cdot -0.25}
\]
associate-*l*33.5%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(2 + {im}^{2}\right) \cdot \left({re}^{2} \cdot -0.25\right)}
\]
distribute-lft-out33.5%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)}
\]
+-commutative33.5%
\[\leadsto \color{blue}{\left({im}^{2} + 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
unpow233.5%
\[\leadsto \left(\color{blue}{im \cdot im} + 2\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
fma-def33.5%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
*-commutative33.5%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + \color{blue}{-0.25 \cdot {re}^{2}}\right)
\]
unpow233.5%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \color{blue}{\left(re \cdot re\right)}\right)
\]
Simplified33.5%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)}
\]
Taylor expanded in im around 0 29.8%
\[\leadsto \color{blue}{2 \cdot \left(0.5 + -0.25 \cdot {re}^{2}\right)}
\]
Step-by-step derivation distribute-lft-in29.8%
\[\leadsto \color{blue}{2 \cdot 0.5 + 2 \cdot \left(-0.25 \cdot {re}^{2}\right)}
\]
metadata-eval29.8%
\[\leadsto \color{blue}{1} + 2 \cdot \left(-0.25 \cdot {re}^{2}\right)
\]
associate-*r*29.8%
\[\leadsto 1 + \color{blue}{\left(2 \cdot -0.25\right) \cdot {re}^{2}}
\]
metadata-eval29.8%
\[\leadsto 1 + \color{blue}{-0.5} \cdot {re}^{2}
\]
+-commutative29.8%
\[\leadsto \color{blue}{-0.5 \cdot {re}^{2} + 1}
\]
*-commutative29.8%
\[\leadsto \color{blue}{{re}^{2} \cdot -0.5} + 1
\]
unpow229.8%
\[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot -0.5 + 1
\]
associate-*l*29.8%
\[\leadsto \color{blue}{re \cdot \left(re \cdot -0.5\right)} + 1
\]
Simplified29.8%
\[\leadsto \color{blue}{re \cdot \left(re \cdot -0.5\right) + 1}
\]
if 1.11999999999999994e154 < im Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow2100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified100.0%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 77.4%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right)}
\]
Step-by-step derivation distribute-lft-in77.4%
\[\leadsto \color{blue}{0.5 \cdot 2 + 0.5 \cdot {im}^{2}}
\]
metadata-eval77.4%
\[\leadsto \color{blue}{1} + 0.5 \cdot {im}^{2}
\]
unpow277.4%
\[\leadsto 1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}
\]
Simplified77.4%
\[\leadsto \color{blue}{1 + 0.5 \cdot \left(im \cdot im\right)}
\]
Recombined 4 regimes into one program. Final simplification72.4%
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \leq -2.7 \cdot 10^{+50}:\\
\;\;\;\;0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;im \leq 960000000000:\\
\;\;\;\;\cos re\\
\mathbf{elif}\;im \leq 1.12 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \left(re \cdot -0.5\right) + 1\\
\mathbf{else}:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\end{array}
\]
Alternative 11? \[\begin{array}{l}
t_0 := re \cdot \left(re \cdot -0.5\right) + 1\\
\mathbf{if}\;re \leq -5 \cdot 10^{+166}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;re \leq 1.1 \cdot 10^{+164}:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 7.2 \cdot 10^{+220}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;26623333280885244000 + \left(re \cdot re\right) \cdot 26623333280885244000\\
\end{array}
\]
Derivation Split input into 3 regimes if re < -5.0000000000000002e166 or 1.10000000000000003e164 < re < 7.20000000000000038e220 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 66.1%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow266.1%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified66.1%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 26.5%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right) + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)}
\]
Step-by-step derivation *-commutative26.5%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot 0.5} + -0.25 \cdot \left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right)
\]
*-commutative26.5%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(\left(2 + {im}^{2}\right) \cdot {re}^{2}\right) \cdot -0.25}
\]
associate-*l*26.5%
\[\leadsto \left(2 + {im}^{2}\right) \cdot 0.5 + \color{blue}{\left(2 + {im}^{2}\right) \cdot \left({re}^{2} \cdot -0.25\right)}
\]
distribute-lft-out39.3%
\[\leadsto \color{blue}{\left(2 + {im}^{2}\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)}
\]
+-commutative39.3%
\[\leadsto \color{blue}{\left({im}^{2} + 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
unpow239.3%
\[\leadsto \left(\color{blue}{im \cdot im} + 2\right) \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
fma-def39.3%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \cdot \left(0.5 + {re}^{2} \cdot -0.25\right)
\]
*-commutative39.3%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + \color{blue}{-0.25 \cdot {re}^{2}}\right)
\]
unpow239.3%
\[\leadsto \mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \color{blue}{\left(re \cdot re\right)}\right)
\]
Simplified39.3%
\[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 + -0.25 \cdot \left(re \cdot re\right)\right)}
\]
Taylor expanded in im around 0 39.3%
\[\leadsto \color{blue}{2 \cdot \left(0.5 + -0.25 \cdot {re}^{2}\right)}
\]
Step-by-step derivation distribute-lft-in39.3%
\[\leadsto \color{blue}{2 \cdot 0.5 + 2 \cdot \left(-0.25 \cdot {re}^{2}\right)}
\]
metadata-eval39.3%
\[\leadsto \color{blue}{1} + 2 \cdot \left(-0.25 \cdot {re}^{2}\right)
\]
associate-*r*39.3%
\[\leadsto 1 + \color{blue}{\left(2 \cdot -0.25\right) \cdot {re}^{2}}
\]
metadata-eval39.3%
\[\leadsto 1 + \color{blue}{-0.5} \cdot {re}^{2}
\]
+-commutative39.3%
\[\leadsto \color{blue}{-0.5 \cdot {re}^{2} + 1}
\]
*-commutative39.3%
\[\leadsto \color{blue}{{re}^{2} \cdot -0.5} + 1
\]
unpow239.3%
\[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot -0.5 + 1
\]
associate-*l*39.3%
\[\leadsto \color{blue}{re \cdot \left(re \cdot -0.5\right)} + 1
\]
Simplified39.3%
\[\leadsto \color{blue}{re \cdot \left(re \cdot -0.5\right) + 1}
\]
if -5.0000000000000002e166 < re < 1.10000000000000003e164 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 77.6%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow277.6%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified77.6%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 58.4%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right)}
\]
Step-by-step derivation distribute-lft-in58.4%
\[\leadsto \color{blue}{0.5 \cdot 2 + 0.5 \cdot {im}^{2}}
\]
metadata-eval58.4%
\[\leadsto \color{blue}{1} + 0.5 \cdot {im}^{2}
\]
unpow258.4%
\[\leadsto 1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}
\]
Simplified58.4%
\[\leadsto \color{blue}{1 + 0.5 \cdot \left(im \cdot im\right)}
\]
if 7.20000000000000038e220 < re Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 79.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow279.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative79.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified79.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Applied egg-rr 4.3%
\[\leadsto \color{blue}{{\left(1.9380669946781485 \cdot 10^{-10} \cdot \cos re\right)}^{-2}}
\]
Step-by-step derivation *-commutative4.3%
\[\leadsto {\color{blue}{\left(\cos re \cdot 1.9380669946781485 \cdot 10^{-10}\right)}}^{-2}
\]
Simplified4.3%
\[\leadsto \color{blue}{{\left(\cos re \cdot 1.9380669946781485 \cdot 10^{-10}\right)}^{-2}}
\]
Taylor expanded in re around 0 35.8%
\[\leadsto \color{blue}{26623333280885244000 + 26623333280885244000 \cdot {re}^{2}}
\]
Step-by-step derivation unpow235.8%
\[\leadsto 26623333280885244000 + 26623333280885244000 \cdot \color{blue}{\left(re \cdot re\right)}
\]
Simplified35.8%
\[\leadsto \color{blue}{26623333280885244000 + 26623333280885244000 \cdot \left(re \cdot re\right)}
\]
Recombined 3 regimes into one program. Final simplification53.5%
\[\leadsto \begin{array}{l}
\mathbf{if}\;re \leq -5 \cdot 10^{+166}:\\
\;\;\;\;re \cdot \left(re \cdot -0.5\right) + 1\\
\mathbf{elif}\;re \leq 1.1 \cdot 10^{+164}:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{elif}\;re \leq 7.2 \cdot 10^{+220}:\\
\;\;\;\;re \cdot \left(re \cdot -0.5\right) + 1\\
\mathbf{else}:\\
\;\;\;\;26623333280885244000 + \left(re \cdot re\right) \cdot 26623333280885244000\\
\end{array}
\]
Alternative 12? \[\begin{array}{l}
\mathbf{if}\;im \leq -12.5 \lor \neg \left(im \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Derivation Split input into 2 regimes if im < -12.5 or 1.3999999999999999 < im Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 73.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow273.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative73.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified73.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Applied egg-rr 51.5%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{1.0833333333333333}\right)\right)
\]
Taylor expanded in re around 0 39.8%
\[\leadsto \color{blue}{0.5 \cdot \left(3.0833333333333335 + {im}^{2}\right)}
\]
Taylor expanded in im around inf 39.8%
\[\leadsto 0.5 \cdot \color{blue}{{im}^{2}}
\]
Step-by-step derivation unpow239.8%
\[\leadsto 0.5 \cdot \color{blue}{\left(im \cdot im\right)}
\]
Simplified39.8%
\[\leadsto 0.5 \cdot \color{blue}{\left(im \cdot im\right)}
\]
if -12.5 < im < 1.3999999999999999 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 98.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow298.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative98.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified98.9%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Applied egg-rr 55.2%
\[\leadsto \color{blue}{\frac{\cos re - 1.9380669946781485 \cdot 10^{-10} \cdot \cos re}{\cos re - 1.9380669946781485 \cdot 10^{-10} \cdot \cos re}}
\]
Step-by-step derivation *-inverses55.2%
\[\leadsto \color{blue}{1}
\]
Simplified55.2%
\[\leadsto \color{blue}{1}
\]
Recombined 2 regimes into one program. Final simplification47.5%
\[\leadsto \begin{array}{l}
\mathbf{if}\;im \leq -12.5 \lor \neg \left(im \leq 1.4\right):\\
\;\;\;\;0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 13? \[\begin{array}{l}
\mathbf{if}\;re \leq 1.7 \cdot 10^{+178}:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;26623333280885244000 + \left(re \cdot re\right) \cdot 26623333280885244000\\
\end{array}
\]
Derivation Split input into 2 regimes if re < 1.7000000000000001e178 Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 76.4%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow276.4%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified76.4%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 52.4%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right)}
\]
Step-by-step derivation distribute-lft-in52.4%
\[\leadsto \color{blue}{0.5 \cdot 2 + 0.5 \cdot {im}^{2}}
\]
metadata-eval52.4%
\[\leadsto \color{blue}{1} + 0.5 \cdot {im}^{2}
\]
unpow252.4%
\[\leadsto 1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}
\]
Simplified52.4%
\[\leadsto \color{blue}{1 + 0.5 \cdot \left(im \cdot im\right)}
\]
if 1.7000000000000001e178 < re Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 79.4%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow279.4%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative79.4%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified79.4%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Applied egg-rr 3.7%
\[\leadsto \color{blue}{{\left(1.9380669946781485 \cdot 10^{-10} \cdot \cos re\right)}^{-2}}
\]
Step-by-step derivation *-commutative3.7%
\[\leadsto {\color{blue}{\left(\cos re \cdot 1.9380669946781485 \cdot 10^{-10}\right)}}^{-2}
\]
Simplified3.7%
\[\leadsto \color{blue}{{\left(\cos re \cdot 1.9380669946781485 \cdot 10^{-10}\right)}^{-2}}
\]
Taylor expanded in re around 0 29.0%
\[\leadsto \color{blue}{26623333280885244000 + 26623333280885244000 \cdot {re}^{2}}
\]
Step-by-step derivation unpow229.0%
\[\leadsto 26623333280885244000 + 26623333280885244000 \cdot \color{blue}{\left(re \cdot re\right)}
\]
Simplified29.0%
\[\leadsto \color{blue}{26623333280885244000 + 26623333280885244000 \cdot \left(re \cdot re\right)}
\]
Recombined 2 regimes into one program. Final simplification49.5%
\[\leadsto \begin{array}{l}
\mathbf{if}\;re \leq 1.7 \cdot 10^{+178}:\\
\;\;\;\;1 + 0.5 \cdot \left(im \cdot im\right)\\
\mathbf{else}:\\
\;\;\;\;26623333280885244000 + \left(re \cdot re\right) \cdot 26623333280885244000\\
\end{array}
\]
Alternative 14? \[1 + 0.5 \cdot \left(im \cdot im\right)
\]
Derivation Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 75.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow275.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified75.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Taylor expanded in re around 0 47.9%
\[\leadsto \color{blue}{0.5 \cdot \left(2 + {im}^{2}\right)}
\]
Step-by-step derivation distribute-lft-in47.9%
\[\leadsto \color{blue}{0.5 \cdot 2 + 0.5 \cdot {im}^{2}}
\]
metadata-eval47.9%
\[\leadsto \color{blue}{1} + 0.5 \cdot {im}^{2}
\]
unpow247.9%
\[\leadsto 1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}
\]
Simplified47.9%
\[\leadsto \color{blue}{1 + 0.5 \cdot \left(im \cdot im\right)}
\]
Final simplification47.9%
\[\leadsto 1 + 0.5 \cdot \left(im \cdot im\right)
\]
Alternative 15? \[-1
\]
Derivation Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 75.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)}
\]
Step-by-step derivation unpow275.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \color{blue}{im \cdot im}\right)
\]
Simplified75.3%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)}
\]
Applied egg-rr 3.3%
\[\leadsto \color{blue}{-2 + \cos re}
\]
Step-by-step derivation +-commutative3.3%
\[\leadsto \color{blue}{\cos re + -2}
\]
Simplified3.3%
\[\leadsto \color{blue}{\cos re + -2}
\]
Taylor expanded in re around 0 3.7%
\[\leadsto \color{blue}{-1}
\]
Final simplification3.7%
\[\leadsto -1
\]
Alternative 16? \[1
\]
Derivation Initial program 100.0%
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)
\]
Taylor expanded in im around 0 86.2%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left({im}^{2} + 0.08333333333333333 \cdot {im}^{4}\right)\right)}
\]
Step-by-step derivation unpow286.2%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(\color{blue}{im \cdot im} + 0.08333333333333333 \cdot {im}^{4}\right)\right)
\]
*-commutative86.2%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \left(2 + \left(im \cdot im + \color{blue}{{im}^{4} \cdot 0.08333333333333333}\right)\right)
\]
Simplified86.2%
\[\leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{\left(2 + \left(im \cdot im + {im}^{4} \cdot 0.08333333333333333\right)\right)}
\]
Applied egg-rr 29.1%
\[\leadsto \color{blue}{\frac{\cos re - 1.9380669946781485 \cdot 10^{-10} \cdot \cos re}{\cos re - 1.9380669946781485 \cdot 10^{-10} \cdot \cos re}}
\]
Step-by-step derivation *-inverses29.1%
\[\leadsto \color{blue}{1}
\]
Simplified29.1%
\[\leadsto \color{blue}{1}
\]
Final simplification29.1%
\[\leadsto 1
\]
Reproduce ? herbie shell --seed 2023166
(FPCore (re im)
:name "math.cos on complex, real part"
:precision binary64
(* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))