?

Average Error: 26.4 → 4.4
Time: 16.3s
Precision: binary64
Cost: 20616

?

\[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d} \]
\[\begin{array}{l} t_0 := \frac{1}{\mathsf{hypot}\left(c, d\right)}\\ t_1 := \frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}}\\ \mathbf{if}\;c \leq -8 \cdot 10^{+126}:\\ \;\;\;\;\frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\ \mathbf{elif}\;c \leq 1.9 \cdot 10^{+45}:\\ \;\;\;\;t_0 \cdot \left(t_1 + \frac{c \cdot a}{\mathsf{hypot}\left(c, d\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(a + t_1\right)\\ \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (/ (+ (* a c) (* b d)) (+ (* c c) (* d d))))
(FPCore (a b c d)
 :precision binary64
 (let* ((t_0 (/ 1.0 (hypot c d))) (t_1 (/ b (/ (hypot c d) d))))
   (if (<= c -8e+126)
     (+ (/ a c) (/ (/ b c) (/ c d)))
     (if (<= c 1.9e+45)
       (* t_0 (+ t_1 (/ (* c a) (hypot c d))))
       (* t_0 (+ a t_1))))))
double code(double a, double b, double c, double d) {
	return ((a * c) + (b * d)) / ((c * c) + (d * d));
}
double code(double a, double b, double c, double d) {
	double t_0 = 1.0 / hypot(c, d);
	double t_1 = b / (hypot(c, d) / d);
	double tmp;
	if (c <= -8e+126) {
		tmp = (a / c) + ((b / c) / (c / d));
	} else if (c <= 1.9e+45) {
		tmp = t_0 * (t_1 + ((c * a) / hypot(c, d)));
	} else {
		tmp = t_0 * (a + t_1);
	}
	return tmp;
}
public static double code(double a, double b, double c, double d) {
	return ((a * c) + (b * d)) / ((c * c) + (d * d));
}
public static double code(double a, double b, double c, double d) {
	double t_0 = 1.0 / Math.hypot(c, d);
	double t_1 = b / (Math.hypot(c, d) / d);
	double tmp;
	if (c <= -8e+126) {
		tmp = (a / c) + ((b / c) / (c / d));
	} else if (c <= 1.9e+45) {
		tmp = t_0 * (t_1 + ((c * a) / Math.hypot(c, d)));
	} else {
		tmp = t_0 * (a + t_1);
	}
	return tmp;
}
def code(a, b, c, d):
	return ((a * c) + (b * d)) / ((c * c) + (d * d))
def code(a, b, c, d):
	t_0 = 1.0 / math.hypot(c, d)
	t_1 = b / (math.hypot(c, d) / d)
	tmp = 0
	if c <= -8e+126:
		tmp = (a / c) + ((b / c) / (c / d))
	elif c <= 1.9e+45:
		tmp = t_0 * (t_1 + ((c * a) / math.hypot(c, d)))
	else:
		tmp = t_0 * (a + t_1)
	return tmp
function code(a, b, c, d)
	return Float64(Float64(Float64(a * c) + Float64(b * d)) / Float64(Float64(c * c) + Float64(d * d)))
end
function code(a, b, c, d)
	t_0 = Float64(1.0 / hypot(c, d))
	t_1 = Float64(b / Float64(hypot(c, d) / d))
	tmp = 0.0
	if (c <= -8e+126)
		tmp = Float64(Float64(a / c) + Float64(Float64(b / c) / Float64(c / d)));
	elseif (c <= 1.9e+45)
		tmp = Float64(t_0 * Float64(t_1 + Float64(Float64(c * a) / hypot(c, d))));
	else
		tmp = Float64(t_0 * Float64(a + t_1));
	end
	return tmp
end
function tmp = code(a, b, c, d)
	tmp = ((a * c) + (b * d)) / ((c * c) + (d * d));
end
function tmp_2 = code(a, b, c, d)
	t_0 = 1.0 / hypot(c, d);
	t_1 = b / (hypot(c, d) / d);
	tmp = 0.0;
	if (c <= -8e+126)
		tmp = (a / c) + ((b / c) / (c / d));
	elseif (c <= 1.9e+45)
		tmp = t_0 * (t_1 + ((c * a) / hypot(c, d)));
	else
		tmp = t_0 * (a + t_1);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_, d_] := N[(N[(N[(a * c), $MachinePrecision] + N[(b * d), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b / N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8e+126], N[(N[(a / c), $MachinePrecision] + N[(N[(b / c), $MachinePrecision] / N[(c / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.9e+45], N[(t$95$0 * N[(t$95$1 + N[(N[(c * a), $MachinePrecision] / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d}
\begin{array}{l}
t_0 := \frac{1}{\mathsf{hypot}\left(c, d\right)}\\
t_1 := \frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}}\\
\mathbf{if}\;c \leq -8 \cdot 10^{+126}:\\
\;\;\;\;\frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\

\mathbf{elif}\;c \leq 1.9 \cdot 10^{+45}:\\
\;\;\;\;t_0 \cdot \left(t_1 + \frac{c \cdot a}{\mathsf{hypot}\left(c, d\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(a + t_1\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original26.4
Target0.5
Herbie4.4
\[\begin{array}{l} \mathbf{if}\;\left|d\right| < \left|c\right|:\\ \;\;\;\;\frac{a + b \cdot \frac{d}{c}}{c + d \cdot \frac{d}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + a \cdot \frac{c}{d}}{d + c \cdot \frac{c}{d}}\\ \end{array} \]

Derivation?

  1. Split input into 3 regimes
  2. if c < -7.9999999999999994e126

    1. Initial program 43.1

      \[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d} \]
    2. Taylor expanded in c around inf 16.9

      \[\leadsto \color{blue}{\frac{a}{c} + \frac{d \cdot b}{{c}^{2}}} \]
    3. Simplified9.2

      \[\leadsto \color{blue}{\frac{a}{c} + \frac{b}{c} \cdot \frac{d}{c}} \]
      Proof

      [Start]16.9

      \[ \frac{a}{c} + \frac{d \cdot b}{{c}^{2}} \]

      *-commutative [<=]16.9

      \[ \frac{a}{c} + \frac{\color{blue}{b \cdot d}}{{c}^{2}} \]

      unpow2 [=>]16.9

      \[ \frac{a}{c} + \frac{b \cdot d}{\color{blue}{c \cdot c}} \]

      times-frac [=>]9.2

      \[ \frac{a}{c} + \color{blue}{\frac{b}{c} \cdot \frac{d}{c}} \]
    4. Applied egg-rr9.3

      \[\leadsto \frac{a}{c} + \color{blue}{\frac{\frac{b}{c}}{\frac{c}{d}}} \]

    if -7.9999999999999994e126 < c < 1.9000000000000001e45

    1. Initial program 19.3

      \[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d} \]
    2. Applied egg-rr12.1

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \frac{\mathsf{fma}\left(a, c, b \cdot d\right)}{\mathsf{hypot}\left(c, d\right)}} \]
    3. Applied egg-rr12.1

      \[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\left(\frac{a \cdot c}{\mathsf{hypot}\left(c, d\right)} + \frac{b \cdot d}{\mathsf{hypot}\left(c, d\right)}\right)} \]
    4. Simplified2.5

      \[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\left(\frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}} + \frac{c \cdot a}{\mathsf{hypot}\left(c, d\right)}\right)} \]
      Proof

      [Start]12.1

      \[ \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{a \cdot c}{\mathsf{hypot}\left(c, d\right)} + \frac{b \cdot d}{\mathsf{hypot}\left(c, d\right)}\right) \]

      +-commutative [=>]12.1

      \[ \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\left(\frac{b \cdot d}{\mathsf{hypot}\left(c, d\right)} + \frac{a \cdot c}{\mathsf{hypot}\left(c, d\right)}\right)} \]

      associate-/l* [=>]2.5

      \[ \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\color{blue}{\frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}}} + \frac{a \cdot c}{\mathsf{hypot}\left(c, d\right)}\right) \]

      *-commutative [<=]2.5

      \[ \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}} + \frac{\color{blue}{c \cdot a}}{\mathsf{hypot}\left(c, d\right)}\right) \]

    if 1.9000000000000001e45 < c

    1. Initial program 34.9

      \[\frac{a \cdot c + b \cdot d}{c \cdot c + d \cdot d} \]
    2. Applied egg-rr24.4

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \frac{\mathsf{fma}\left(a, c, b \cdot d\right)}{\mathsf{hypot}\left(c, d\right)}} \]
    3. Applied egg-rr24.4

      \[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\left(\frac{a \cdot c}{\mathsf{hypot}\left(c, d\right)} + \frac{b \cdot d}{\mathsf{hypot}\left(c, d\right)}\right)} \]
    4. Simplified18.9

      \[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\left(\frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}} + \frac{c \cdot a}{\mathsf{hypot}\left(c, d\right)}\right)} \]
      Proof

      [Start]24.4

      \[ \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{a \cdot c}{\mathsf{hypot}\left(c, d\right)} + \frac{b \cdot d}{\mathsf{hypot}\left(c, d\right)}\right) \]

      +-commutative [=>]24.4

      \[ \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \color{blue}{\left(\frac{b \cdot d}{\mathsf{hypot}\left(c, d\right)} + \frac{a \cdot c}{\mathsf{hypot}\left(c, d\right)}\right)} \]

      associate-/l* [=>]18.9

      \[ \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\color{blue}{\frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}}} + \frac{a \cdot c}{\mathsf{hypot}\left(c, d\right)}\right) \]

      *-commutative [<=]18.9

      \[ \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}} + \frac{\color{blue}{c \cdot a}}{\mathsf{hypot}\left(c, d\right)}\right) \]
    5. Taylor expanded in c around inf 6.7

      \[\leadsto \frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}} + \color{blue}{a}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification4.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8 \cdot 10^{+126}:\\ \;\;\;\;\frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\ \mathbf{elif}\;c \leq 1.9 \cdot 10^{+45}:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}} + \frac{c \cdot a}{\mathsf{hypot}\left(c, d\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(a + \frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error9.9
Cost20696
\[\begin{array}{l} t_0 := \frac{\frac{\mathsf{fma}\left(a, c, b \cdot d\right)}{\mathsf{hypot}\left(c, d\right)}}{\mathsf{hypot}\left(c, d\right)}\\ \mathbf{if}\;c \leq -1.05 \cdot 10^{+154}:\\ \;\;\;\;\frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\ \mathbf{elif}\;c \leq -850000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq -4 \cdot 10^{-47}:\\ \;\;\;\;\frac{b}{d} + \frac{c}{d} \cdot \frac{a}{d}\\ \mathbf{elif}\;c \leq -1.55 \cdot 10^{-190}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq 4 \cdot 10^{-135}:\\ \;\;\;\;\frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ \mathbf{elif}\;c \leq 9.2 \cdot 10^{-35}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(a + \frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}}\right)\\ \end{array} \]
Alternative 2
Error12.0
Cost14424
\[\begin{array}{l} t_0 := d \cdot d + c \cdot c\\ \mathbf{if}\;c \leq -1.46 \cdot 10^{+125}:\\ \;\;\;\;\frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{+89}:\\ \;\;\;\;\frac{d}{\mathsf{hypot}\left(c, d\right)} \cdot \frac{b}{\mathsf{hypot}\left(c, d\right)}\\ \mathbf{elif}\;c \leq -2150000000000:\\ \;\;\;\;\frac{d}{\frac{t_0}{b}} + \frac{c}{\frac{t_0}{a}}\\ \mathbf{elif}\;c \leq -3.4 \cdot 10^{-47}:\\ \;\;\;\;\frac{b}{d} + \frac{c}{d} \cdot \frac{a}{d}\\ \mathbf{elif}\;c \leq -8.2 \cdot 10^{-100}:\\ \;\;\;\;\frac{b \cdot d + c \cdot a}{t_0}\\ \mathbf{elif}\;c \leq 6.8 \cdot 10^{-141}:\\ \;\;\;\;\frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(a + \frac{b}{\frac{\mathsf{hypot}\left(c, d\right)}{d}}\right)\\ \end{array} \]
Alternative 3
Error12.8
Cost13640
\[\begin{array}{l} t_0 := \frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\ t_1 := d \cdot d + c \cdot c\\ t_2 := \frac{d}{\frac{t_1}{b}} + \frac{c}{\frac{t_1}{a}}\\ \mathbf{if}\;c \leq -6.8 \cdot 10^{+123}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{+89}:\\ \;\;\;\;\frac{d}{\mathsf{hypot}\left(c, d\right)} \cdot \frac{b}{\mathsf{hypot}\left(c, d\right)}\\ \mathbf{elif}\;c \leq -1040000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -4 \cdot 10^{-47}:\\ \;\;\;\;\frac{b}{d} + \frac{c}{d} \cdot \frac{a}{d}\\ \mathbf{elif}\;c \leq -8.8 \cdot 10^{-95}:\\ \;\;\;\;\frac{b \cdot d + c \cdot a}{t_1}\\ \mathbf{elif}\;c \leq 1.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ \mathbf{elif}\;c \leq 1.75 \cdot 10^{+65}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error13.1
Cost2396
\[\begin{array}{l} t_0 := \frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ t_1 := \frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\ t_2 := d \cdot d + c \cdot c\\ t_3 := \frac{d}{\frac{t_2}{b}} + \frac{c}{\frac{t_2}{a}}\\ \mathbf{if}\;c \leq -7.5 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1.25 \cdot 10^{+57}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq -1040000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq -3.8 \cdot 10^{-47}:\\ \;\;\;\;\frac{b}{d} + \frac{c}{d} \cdot \frac{a}{d}\\ \mathbf{elif}\;c \leq -4.2 \cdot 10^{-98}:\\ \;\;\;\;\frac{b \cdot d + c \cdot a}{t_2}\\ \mathbf{elif}\;c \leq 1.9 \cdot 10^{-79}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq 1.8 \cdot 10^{+65}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error12.4
Cost1752
\[\begin{array}{l} t_0 := \frac{b \cdot d + c \cdot a}{d \cdot d + c \cdot c}\\ t_1 := \frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\ \mathbf{if}\;c \leq -4 \cdot 10^{+104}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -850000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq -4 \cdot 10^{-47}:\\ \;\;\;\;\frac{b}{d} + \frac{c}{d} \cdot \frac{a}{d}\\ \mathbf{elif}\;c \leq -1.85 \cdot 10^{-97}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq 7.2 \cdot 10^{-133}:\\ \;\;\;\;\frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ \mathbf{elif}\;c \leq 1.3 \cdot 10^{+65}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error15.7
Cost1234
\[\begin{array}{l} \mathbf{if}\;c \leq -2.2 \cdot 10^{+105} \lor \neg \left(c \leq -8.5 \cdot 10^{+56}\right) \land \left(c \leq -1.4 \cdot 10^{+15} \lor \neg \left(c \leq 1.85 \cdot 10^{+53}\right)\right):\\ \;\;\;\;\frac{1}{c} \cdot \left(a + \frac{d}{\frac{c}{b}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ \end{array} \]
Alternative 7
Error15.7
Cost1232
\[\begin{array}{l} t_0 := \frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ t_1 := \frac{a}{c} + \frac{b}{c} \cdot \frac{d}{c}\\ \mathbf{if}\;c \leq -1.35 \cdot 10^{+101}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -6.2 \cdot 10^{+56}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq -2.05 \cdot 10^{+15}:\\ \;\;\;\;\frac{1}{c} \cdot \left(a + \frac{d}{\frac{c}{b}}\right)\\ \mathbf{elif}\;c \leq 1.85 \cdot 10^{+53}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error15.7
Cost1232
\[\begin{array}{l} t_0 := \frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ t_1 := \frac{a}{c} + \frac{b}{c} \cdot \frac{d}{c}\\ \mathbf{if}\;c \leq -4.8 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1.2 \cdot 10^{+57}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq -1.75 \cdot 10^{+15}:\\ \;\;\;\;\frac{a}{c} + \frac{d}{\frac{c \cdot c}{b}}\\ \mathbf{elif}\;c \leq 2.1 \cdot 10^{+53}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error15.7
Cost1232
\[\begin{array}{l} t_0 := \frac{1}{d} \cdot \left(b + a \cdot \frac{c}{d}\right)\\ t_1 := \frac{a}{c} + \frac{\frac{b}{c}}{\frac{c}{d}}\\ \mathbf{if}\;c \leq -4.5 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1 \cdot 10^{+57}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq -1200000000000:\\ \;\;\;\;\frac{a}{c} + \frac{d}{\frac{c \cdot c}{b}}\\ \mathbf{elif}\;c \leq 2.1 \cdot 10^{+53}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error19.4
Cost968
\[\begin{array}{l} \mathbf{if}\;d \leq -1.76 \cdot 10^{+36}:\\ \;\;\;\;\frac{b}{d}\\ \mathbf{elif}\;d \leq 500:\\ \;\;\;\;\frac{1}{c} \cdot \left(a + \frac{d}{\frac{c}{b}}\right)\\ \mathbf{elif}\;d \leq 2.1 \cdot 10^{+44} \lor \neg \left(d \leq 3.3 \cdot 10^{+84}\right):\\ \;\;\;\;\frac{b}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{c}\\ \end{array} \]
Alternative 11
Error23.0
Cost456
\[\begin{array}{l} \mathbf{if}\;c \leq -2100000000:\\ \;\;\;\;\frac{a}{c}\\ \mathbf{elif}\;c \leq 1.58 \cdot 10^{-6}:\\ \;\;\;\;\frac{b}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{a}{c}\\ \end{array} \]
Alternative 12
Error38.1
Cost192
\[\frac{a}{c} \]

Error

Reproduce?

herbie shell --seed 2023060 
(FPCore (a b c d)
  :name "Complex division, real part"
  :precision binary64

  :herbie-target
  (if (< (fabs d) (fabs c)) (/ (+ a (* b (/ d c))) (+ c (* d (/ d c)))) (/ (+ b (* a (/ c d))) (+ d (* c (/ c d)))))

  (/ (+ (* a c) (* b d)) (+ (* c c) (* d d))))