_divideComplex, real part

Percentage Accurate: 61.8% → 85.7%
Time: 9.0s
Alternatives: 11
Speedup: TODO×

Specification

?
\[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]

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?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
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?

\[\begin{array}{l} \mathbf{if}\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq \infty:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < +inf.0

    1. Initial program 78.8%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. *-un-lft-identity78.8%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(x.re \cdot y.re + x.im \cdot y.im\right)}}{y.re \cdot y.re + y.im \cdot y.im} \]
      2. add-sqr-sqrt78.8%

        \[\leadsto \frac{1 \cdot \left(x.re \cdot y.re + x.im \cdot y.im\right)}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      3. times-frac78.7%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      4. hypot-def78.7%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      5. fma-def78.7%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\color{blue}{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      6. hypot-def94.4%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    3. Applied egg-rr94.4%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}} \]

    if +inf.0 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im)))

    1. Initial program 0.0%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 42.8%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im \cdot x.im}{{y.re}^{2}}} \]
    3. Step-by-step derivation
      1. unpow242.8%

        \[\leadsto \frac{x.re}{y.re} + \frac{y.im \cdot x.im}{\color{blue}{y.re \cdot y.re}} \]
      2. times-frac54.9%

        \[\leadsto \frac{x.re}{y.re} + \color{blue}{\frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]
    4. Simplified54.9%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq \infty:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \end{array} \]

Alternative 2?

\[\begin{array}{l} \mathbf{if}\;y.re \leq -48000:\\ \;\;\;\;\left(x.re + \frac{y.im}{\frac{y.re}{x.im}}\right) \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq 5 \cdot 10^{-153}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\ \mathbf{elif}\;y.re \leq 1.65 \cdot 10^{+80}:\\ \;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \end{array} \]
Derivation
  1. Split input into 4 regimes
  2. if y.re < -48000

    1. Initial program 48.9%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. *-un-lft-identity48.9%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(x.re \cdot y.re + x.im \cdot y.im\right)}}{y.re \cdot y.re + y.im \cdot y.im} \]
      2. add-sqr-sqrt48.9%

        \[\leadsto \frac{1 \cdot \left(x.re \cdot y.re + x.im \cdot y.im\right)}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      3. times-frac48.9%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      4. hypot-def48.9%

        \[\leadsto \frac{1}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      5. fma-def48.9%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\color{blue}{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      6. hypot-def61.3%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    3. Applied egg-rr61.3%

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    4. Taylor expanded in y.re around -inf 76.3%

      \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y.im \cdot x.im}{y.re} + -1 \cdot x.re\right)} \]
    5. Step-by-step derivation
      1. neg-mul-176.3%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(-1 \cdot \frac{y.im \cdot x.im}{y.re} + \color{blue}{\left(-x.re\right)}\right) \]
      2. unsub-neg76.3%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\left(-1 \cdot \frac{y.im \cdot x.im}{y.re} - x.re\right)} \]
      3. mul-1-neg76.3%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\color{blue}{\left(-\frac{y.im \cdot x.im}{y.re}\right)} - x.re\right) \]
      4. associate-/l*81.5%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\left(-\color{blue}{\frac{y.im}{\frac{y.re}{x.im}}}\right) - x.re\right) \]
      5. distribute-neg-frac81.5%

        \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\color{blue}{\frac{-y.im}{\frac{y.re}{x.im}}} - x.re\right) \]
    6. Simplified81.5%

      \[\leadsto \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\left(\frac{-y.im}{\frac{y.re}{x.im}} - x.re\right)} \]

    if -48000 < y.re < 5.00000000000000033e-153

    1. Initial program 72.1%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 78.7%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.im}^{2}} + \frac{x.im}{y.im}} \]
    3. Step-by-step derivation
      1. +-commutative78.7%

        \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re \cdot y.re}{{y.im}^{2}}} \]
      2. unpow278.7%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re \cdot y.re}{\color{blue}{y.im \cdot y.im}} \]
      3. associate-/l*78.9%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    4. Simplified78.9%

      \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    5. Step-by-step derivation
      1. clear-num78.9%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{\frac{y.im \cdot y.im}{y.re}}{x.re}}} \]
      2. inv-pow78.9%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{{\left(\frac{\frac{y.im \cdot y.im}{y.re}}{x.re}\right)}^{-1}} \]
      3. associate-/l*84.5%

        \[\leadsto \frac{x.im}{y.im} + {\left(\frac{\color{blue}{\frac{y.im}{\frac{y.re}{y.im}}}}{x.re}\right)}^{-1} \]
    6. Applied egg-rr84.5%

      \[\leadsto \frac{x.im}{y.im} + \color{blue}{{\left(\frac{\frac{y.im}{\frac{y.re}{y.im}}}{x.re}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-184.5%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{\frac{y.im}{\frac{y.re}{y.im}}}{x.re}}} \]
      2. associate-/l/87.1%

        \[\leadsto \frac{x.im}{y.im} + \frac{1}{\color{blue}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}} \]
    8. Simplified87.1%

      \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}} \]

    if 5.00000000000000033e-153 < y.re < 1.64999999999999995e80

    1. Initial program 78.9%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]

    if 1.64999999999999995e80 < y.re

    1. Initial program 41.1%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 74.8%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im \cdot x.im}{{y.re}^{2}}} \]
    3. Step-by-step derivation
      1. unpow274.8%

        \[\leadsto \frac{x.re}{y.re} + \frac{y.im \cdot x.im}{\color{blue}{y.re \cdot y.re}} \]
      2. times-frac85.2%

        \[\leadsto \frac{x.re}{y.re} + \color{blue}{\frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]
    4. Simplified85.2%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification84.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -48000:\\ \;\;\;\;\left(x.re + \frac{y.im}{\frac{y.re}{x.im}}\right) \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq 5 \cdot 10^{-153}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\ \mathbf{elif}\;y.re \leq 1.65 \cdot 10^{+80}:\\ \;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \end{array} \]

Alternative 3?

\[\begin{array}{l} t_0 := \frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \mathbf{if}\;y.re \leq -260000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-153}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\ \mathbf{elif}\;y.re \leq 1.1 \cdot 10^{+82}:\\ \;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if y.re < -2.6e5 or 1.1000000000000001e82 < y.re

    1. Initial program 45.4%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 74.5%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im \cdot x.im}{{y.re}^{2}}} \]
    3. Step-by-step derivation
      1. unpow274.5%

        \[\leadsto \frac{x.re}{y.re} + \frac{y.im \cdot x.im}{\color{blue}{y.re \cdot y.re}} \]
      2. times-frac83.1%

        \[\leadsto \frac{x.re}{y.re} + \color{blue}{\frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]
    4. Simplified83.1%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]

    if -2.6e5 < y.re < 6.50000000000000032e-153

    1. Initial program 72.1%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 78.7%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.im}^{2}} + \frac{x.im}{y.im}} \]
    3. Step-by-step derivation
      1. +-commutative78.7%

        \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re \cdot y.re}{{y.im}^{2}}} \]
      2. unpow278.7%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re \cdot y.re}{\color{blue}{y.im \cdot y.im}} \]
      3. associate-/l*78.9%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    4. Simplified78.9%

      \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    5. Step-by-step derivation
      1. clear-num78.9%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{\frac{y.im \cdot y.im}{y.re}}{x.re}}} \]
      2. inv-pow78.9%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{{\left(\frac{\frac{y.im \cdot y.im}{y.re}}{x.re}\right)}^{-1}} \]
      3. associate-/l*84.5%

        \[\leadsto \frac{x.im}{y.im} + {\left(\frac{\color{blue}{\frac{y.im}{\frac{y.re}{y.im}}}}{x.re}\right)}^{-1} \]
    6. Applied egg-rr84.5%

      \[\leadsto \frac{x.im}{y.im} + \color{blue}{{\left(\frac{\frac{y.im}{\frac{y.re}{y.im}}}{x.re}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-184.5%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{\frac{y.im}{\frac{y.re}{y.im}}}{x.re}}} \]
      2. associate-/l/87.1%

        \[\leadsto \frac{x.im}{y.im} + \frac{1}{\color{blue}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}} \]
    8. Simplified87.1%

      \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}} \]

    if 6.50000000000000032e-153 < y.re < 1.1000000000000001e82

    1. Initial program 78.9%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -260000:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-153}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\ \mathbf{elif}\;y.re \leq 1.1 \cdot 10^{+82}:\\ \;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \end{array} \]

Alternative 4?

\[\begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq -4.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{elif}\;y.re \leq -1.65 \cdot 10^{-112}:\\ \;\;\;\;y.re \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.re \leq 1.1 \cdot 10^{+60}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if y.re < -9.5e19 or 1.09999999999999998e60 < y.re

    1. Initial program 43.0%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 70.9%

      \[\leadsto \color{blue}{\frac{x.re}{y.re}} \]

    if -9.5e19 < y.re < -4.5000000000000001e-40 or -1.65e-112 < y.re < 1.09999999999999998e60

    1. Initial program 74.6%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 67.1%

      \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]

    if -4.5000000000000001e-40 < y.re < -1.65e-112

    1. Initial program 81.2%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in x.re around inf 71.1%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.re}^{2} + {y.im}^{2}}} \]
    3. Step-by-step derivation
      1. associate-/l*66.4%

        \[\leadsto \color{blue}{\frac{x.re}{\frac{{y.re}^{2} + {y.im}^{2}}{y.re}}} \]
      2. associate-/r/57.3%

        \[\leadsto \color{blue}{\frac{x.re}{{y.re}^{2} + {y.im}^{2}} \cdot y.re} \]
      3. unpow257.3%

        \[\leadsto \frac{x.re}{\color{blue}{y.re \cdot y.re} + {y.im}^{2}} \cdot y.re \]
      4. unpow257.3%

        \[\leadsto \frac{x.re}{y.re \cdot y.re + \color{blue}{y.im \cdot y.im}} \cdot y.re \]
      5. +-commutative57.3%

        \[\leadsto \frac{x.re}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}} \cdot y.re \]
      6. fma-udef57.3%

        \[\leadsto \frac{x.re}{\color{blue}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \cdot y.re \]
    4. Simplified57.3%

      \[\leadsto \color{blue}{\frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot y.re} \]
    5. Step-by-step derivation
      1. fma-udef57.3%

        \[\leadsto \frac{x.re}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}} \cdot y.re \]
      2. +-commutative57.3%

        \[\leadsto \frac{x.re}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}} \cdot y.re \]
    6. Applied egg-rr57.3%

      \[\leadsto \frac{x.re}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}} \cdot y.re \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{+19}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq -4.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{elif}\;y.re \leq -1.65 \cdot 10^{-112}:\\ \;\;\;\;y.re \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.re \leq 1.1 \cdot 10^{+60}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]

Alternative 5?

\[\begin{array}{l} \mathbf{if}\;y.re \leq -125 \lor \neg \left(y.re \leq 8.4 \cdot 10^{+80}\right):\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if y.re < -125 or 8.40000000000000005e80 < y.re

    1. Initial program 45.4%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 74.5%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im \cdot x.im}{{y.re}^{2}}} \]
    3. Step-by-step derivation
      1. unpow274.5%

        \[\leadsto \frac{x.re}{y.re} + \frac{y.im \cdot x.im}{\color{blue}{y.re \cdot y.re}} \]
      2. times-frac83.1%

        \[\leadsto \frac{x.re}{y.re} + \color{blue}{\frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]
    4. Simplified83.1%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]

    if -125 < y.re < 8.40000000000000005e80

    1. Initial program 74.0%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 73.4%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.im}^{2}} + \frac{x.im}{y.im}} \]
    3. Step-by-step derivation
      1. +-commutative73.4%

        \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re \cdot y.re}{{y.im}^{2}}} \]
      2. unpow273.4%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re \cdot y.re}{\color{blue}{y.im \cdot y.im}} \]
      3. associate-/l*73.5%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    4. Simplified73.5%

      \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    5. Step-by-step derivation
      1. clear-num73.5%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{\frac{y.im \cdot y.im}{y.re}}{x.re}}} \]
      2. inv-pow73.5%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{{\left(\frac{\frac{y.im \cdot y.im}{y.re}}{x.re}\right)}^{-1}} \]
      3. associate-/l*78.8%

        \[\leadsto \frac{x.im}{y.im} + {\left(\frac{\color{blue}{\frac{y.im}{\frac{y.re}{y.im}}}}{x.re}\right)}^{-1} \]
    6. Applied egg-rr78.8%

      \[\leadsto \frac{x.im}{y.im} + \color{blue}{{\left(\frac{\frac{y.im}{\frac{y.re}{y.im}}}{x.re}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-178.8%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{\frac{y.im}{\frac{y.re}{y.im}}}{x.re}}} \]
      2. associate-/l/81.4%

        \[\leadsto \frac{x.im}{y.im} + \frac{1}{\color{blue}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}} \]
    8. Simplified81.4%

      \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -125 \lor \neg \left(y.re \leq 8.4 \cdot 10^{+80}\right):\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\ \end{array} \]

Alternative 6?

\[\begin{array}{l} \mathbf{if}\;y.re \leq -8.8 \cdot 10^{+23} \lor \neg \left(y.re \leq 8.2 \cdot 10^{+80}\right):\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if y.re < -8.80000000000000034e23 or 8.20000000000000003e80 < y.re

    1. Initial program 42.7%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 72.6%

      \[\leadsto \color{blue}{\frac{x.re}{y.re}} \]

    if -8.80000000000000034e23 < y.re < 8.20000000000000003e80

    1. Initial program 74.8%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 71.8%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.im}^{2}} + \frac{x.im}{y.im}} \]
    3. Step-by-step derivation
      1. +-commutative71.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re \cdot y.re}{{y.im}^{2}}} \]
      2. *-commutative71.8%

        \[\leadsto \frac{x.im}{y.im} + \frac{\color{blue}{y.re \cdot x.re}}{{y.im}^{2}} \]
      3. unpow271.8%

        \[\leadsto \frac{x.im}{y.im} + \frac{y.re \cdot x.re}{\color{blue}{y.im \cdot y.im}} \]
      4. times-frac76.5%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{y.re}{y.im} \cdot \frac{x.re}{y.im}} \]
    4. Simplified76.5%

      \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -8.8 \cdot 10^{+23} \lor \neg \left(y.re \leq 8.2 \cdot 10^{+80}\right):\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \end{array} \]

Alternative 7?

\[\begin{array}{l} \mathbf{if}\;y.re \leq -450 \lor \neg \left(y.re \leq 9.2 \cdot 10^{+78}\right):\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im}{\frac{y.re}{y.im}}}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if y.re < -450 or 9.2000000000000008e78 < y.re

    1. Initial program 45.4%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 74.5%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im \cdot x.im}{{y.re}^{2}}} \]
    3. Step-by-step derivation
      1. unpow274.5%

        \[\leadsto \frac{x.re}{y.re} + \frac{y.im \cdot x.im}{\color{blue}{y.re \cdot y.re}} \]
      2. times-frac83.1%

        \[\leadsto \frac{x.re}{y.re} + \color{blue}{\frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]
    4. Simplified83.1%

      \[\leadsto \color{blue}{\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}} \]

    if -450 < y.re < 9.2000000000000008e78

    1. Initial program 74.0%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 73.4%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.im}^{2}} + \frac{x.im}{y.im}} \]
    3. Step-by-step derivation
      1. +-commutative73.4%

        \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re \cdot y.re}{{y.im}^{2}}} \]
      2. unpow273.4%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re \cdot y.re}{\color{blue}{y.im \cdot y.im}} \]
      3. associate-/l*73.5%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    4. Simplified73.5%

      \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    5. Taylor expanded in y.im around 0 73.5%

      \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{\frac{{y.im}^{2}}{y.re}}} \]
    6. Step-by-step derivation
      1. unpow273.5%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\frac{\color{blue}{y.im \cdot y.im}}{y.re}} \]
      2. associate-*r/78.8%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{y.im \cdot \frac{y.im}{y.re}}} \]
      3. *-commutative78.8%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{\frac{y.im}{y.re} \cdot y.im}} \]
      4. associate-/r/78.9%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{\frac{y.im}{\frac{y.re}{y.im}}}} \]
    7. Simplified78.9%

      \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{\frac{y.im}{\frac{y.re}{y.im}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification80.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -450 \lor \neg \left(y.re \leq 9.2 \cdot 10^{+78}\right):\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im}{\frac{y.re}{y.im}}}\\ \end{array} \]

Alternative 8?

\[\begin{array}{l} \mathbf{if}\;y.re \leq -4.8 \cdot 10^{+24}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq 1.16 \cdot 10^{+79}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im}{\frac{y.re}{y.im}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if y.re < -4.8000000000000001e24 or 1.16000000000000007e79 < y.re

    1. Initial program 42.7%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 72.6%

      \[\leadsto \color{blue}{\frac{x.re}{y.re}} \]

    if -4.8000000000000001e24 < y.re < 1.16000000000000007e79

    1. Initial program 74.8%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 71.8%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.im}^{2}} + \frac{x.im}{y.im}} \]
    3. Step-by-step derivation
      1. +-commutative71.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re \cdot y.re}{{y.im}^{2}}} \]
      2. unpow271.8%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re \cdot y.re}{\color{blue}{y.im \cdot y.im}} \]
      3. associate-/l*72.0%

        \[\leadsto \frac{x.im}{y.im} + \color{blue}{\frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    4. Simplified72.0%

      \[\leadsto \color{blue}{\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im \cdot y.im}{y.re}}} \]
    5. Taylor expanded in y.im around 0 72.0%

      \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{\frac{{y.im}^{2}}{y.re}}} \]
    6. Step-by-step derivation
      1. unpow272.0%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\frac{\color{blue}{y.im \cdot y.im}}{y.re}} \]
      2. associate-*r/77.0%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{y.im \cdot \frac{y.im}{y.re}}} \]
      3. *-commutative77.0%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{\frac{y.im}{y.re} \cdot y.im}} \]
      4. associate-/r/77.1%

        \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{\frac{y.im}{\frac{y.re}{y.im}}}} \]
    7. Simplified77.1%

      \[\leadsto \frac{x.im}{y.im} + \frac{x.re}{\color{blue}{\frac{y.im}{\frac{y.re}{y.im}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -4.8 \cdot 10^{+24}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq 1.16 \cdot 10^{+79}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{\frac{y.im}{\frac{y.re}{y.im}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]

Alternative 9?

\[\begin{array}{l} \mathbf{if}\;y.re \leq -3.8 \cdot 10^{+22}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq -5 \cdot 10^{-41}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{elif}\;y.re \leq -5 \cdot 10^{-113}:\\ \;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{+56}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]
Derivation
  1. Split input into 3 regimes
  2. if y.re < -3.8000000000000004e22 or 2.10000000000000017e56 < y.re

    1. Initial program 43.0%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 70.9%

      \[\leadsto \color{blue}{\frac{x.re}{y.re}} \]

    if -3.8000000000000004e22 < y.re < -4.9999999999999996e-41 or -4.9999999999999997e-113 < y.re < 2.10000000000000017e56

    1. Initial program 74.6%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 67.1%

      \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]

    if -4.9999999999999996e-41 < y.re < -4.9999999999999997e-113

    1. Initial program 81.2%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in x.re around inf 71.1%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.re}^{2} + {y.im}^{2}}} \]
    3. Step-by-step derivation
      1. associate-/l*66.4%

        \[\leadsto \color{blue}{\frac{x.re}{\frac{{y.re}^{2} + {y.im}^{2}}{y.re}}} \]
      2. associate-/r/57.3%

        \[\leadsto \color{blue}{\frac{x.re}{{y.re}^{2} + {y.im}^{2}} \cdot y.re} \]
      3. unpow257.3%

        \[\leadsto \frac{x.re}{\color{blue}{y.re \cdot y.re} + {y.im}^{2}} \cdot y.re \]
      4. unpow257.3%

        \[\leadsto \frac{x.re}{y.re \cdot y.re + \color{blue}{y.im \cdot y.im}} \cdot y.re \]
      5. +-commutative57.3%

        \[\leadsto \frac{x.re}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}} \cdot y.re \]
      6. fma-udef57.3%

        \[\leadsto \frac{x.re}{\color{blue}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \cdot y.re \]
    4. Simplified57.3%

      \[\leadsto \color{blue}{\frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot y.re} \]
    5. Step-by-step derivation
      1. fma-udef57.3%

        \[\leadsto \frac{x.re}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}} \cdot y.re \]
      2. +-commutative57.3%

        \[\leadsto \frac{x.re}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}} \cdot y.re \]
    6. Applied egg-rr57.3%

      \[\leadsto \frac{x.re}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}} \cdot y.re \]
    7. Taylor expanded in y.re around 0 52.4%

      \[\leadsto \color{blue}{\frac{x.re \cdot y.re}{{y.im}^{2}}} \]
    8. Step-by-step derivation
      1. *-commutative52.4%

        \[\leadsto \frac{\color{blue}{y.re \cdot x.re}}{{y.im}^{2}} \]
      2. unpow252.4%

        \[\leadsto \frac{y.re \cdot x.re}{\color{blue}{y.im \cdot y.im}} \]
      3. times-frac57.0%

        \[\leadsto \color{blue}{\frac{y.re}{y.im} \cdot \frac{x.re}{y.im}} \]
    9. Simplified57.0%

      \[\leadsto \color{blue}{\frac{y.re}{y.im} \cdot \frac{x.re}{y.im}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.8 \cdot 10^{+22}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq -5 \cdot 10^{-41}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{elif}\;y.re \leq -5 \cdot 10^{-113}:\\ \;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{+56}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]

Alternative 10?

\[\begin{array}{l} \mathbf{if}\;y.re \leq -4.5 \cdot 10^{+23}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+57}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]
Derivation
  1. Split input into 2 regimes
  2. if y.re < -4.49999999999999979e23 or 2.9000000000000002e57 < y.re

    1. Initial program 43.0%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 70.9%

      \[\leadsto \color{blue}{\frac{x.re}{y.re}} \]

    if -4.49999999999999979e23 < y.re < 2.9000000000000002e57

    1. Initial program 75.5%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 63.1%

      \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -4.5 \cdot 10^{+23}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+57}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]

Alternative 11?

\[\frac{x.im}{y.im} \]
Derivation
  1. Initial program 62.2%

    \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
  2. Taylor expanded in y.re around 0 44.1%

    \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]
  3. Final simplification44.1%

    \[\leadsto \frac{x.im}{y.im} \]

Reproduce

?
herbie shell --seed 2023166 
(FPCore (x.re x.im y.re y.im)
  :name "_divideComplex, real part"
  :precision binary64
  (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))