?

Average Error: 25.4 → 14.0
Time: 18.2s
Precision: binary64
Cost: 7500

?

\[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
\[\begin{array}{l} t_0 := c \cdot c + d \cdot d\\ t_1 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{if}\;d \leq -2.9 \cdot 10^{+60}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1.46 \cdot 10^{-86}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{t_0}\\ \mathbf{elif}\;d \leq 6.1 \cdot 10^{-50}:\\ \;\;\;\;\frac{b}{c} + \frac{-d}{\frac{{c}^{2}}{a}}\\ \mathbf{elif}\;d \leq 2.1 \cdot 10^{+103}:\\ \;\;\;\;\frac{2}{t_0 \cdot \frac{2}{c \cdot b - d \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (/ (- (* b c) (* a d)) (+ (* c c) (* d d))))
(FPCore (a b c d)
 :precision binary64
 (let* ((t_0 (+ (* c c) (* d d))) (t_1 (/ (+ (- a) (* c (/ b d))) d)))
   (if (<= d -2.9e+60)
     t_1
     (if (<= d -1.46e-86)
       (/ (- (* b c) (* a d)) t_0)
       (if (<= d 6.1e-50)
         (+ (/ b c) (/ (- d) (/ (pow c 2.0) a)))
         (if (<= d 2.1e+103)
           (/ 2.0 (* t_0 (/ 2.0 (- (* c b) (* d a)))))
           t_1))))))
double code(double a, double b, double c, double d) {
	return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
double code(double a, double b, double c, double d) {
	double t_0 = (c * c) + (d * d);
	double t_1 = (-a + (c * (b / d))) / d;
	double tmp;
	if (d <= -2.9e+60) {
		tmp = t_1;
	} else if (d <= -1.46e-86) {
		tmp = ((b * c) - (a * d)) / t_0;
	} else if (d <= 6.1e-50) {
		tmp = (b / c) + (-d / (pow(c, 2.0) / a));
	} else if (d <= 2.1e+103) {
		tmp = 2.0 / (t_0 * (2.0 / ((c * b) - (d * a))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(a, b, c, d)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    code = ((b * c) - (a * d)) / ((c * c) + (d * d))
end function
real(8) function code(a, b, c, d)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (c * c) + (d * d)
    t_1 = (-a + (c * (b / d))) / d
    if (d <= (-2.9d+60)) then
        tmp = t_1
    else if (d <= (-1.46d-86)) then
        tmp = ((b * c) - (a * d)) / t_0
    else if (d <= 6.1d-50) then
        tmp = (b / c) + (-d / ((c ** 2.0d0) / a))
    else if (d <= 2.1d+103) then
        tmp = 2.0d0 / (t_0 * (2.0d0 / ((c * b) - (d * a))))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double a, double b, double c, double d) {
	return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
public static double code(double a, double b, double c, double d) {
	double t_0 = (c * c) + (d * d);
	double t_1 = (-a + (c * (b / d))) / d;
	double tmp;
	if (d <= -2.9e+60) {
		tmp = t_1;
	} else if (d <= -1.46e-86) {
		tmp = ((b * c) - (a * d)) / t_0;
	} else if (d <= 6.1e-50) {
		tmp = (b / c) + (-d / (Math.pow(c, 2.0) / a));
	} else if (d <= 2.1e+103) {
		tmp = 2.0 / (t_0 * (2.0 / ((c * b) - (d * a))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(a, b, c, d):
	return ((b * c) - (a * d)) / ((c * c) + (d * d))
def code(a, b, c, d):
	t_0 = (c * c) + (d * d)
	t_1 = (-a + (c * (b / d))) / d
	tmp = 0
	if d <= -2.9e+60:
		tmp = t_1
	elif d <= -1.46e-86:
		tmp = ((b * c) - (a * d)) / t_0
	elif d <= 6.1e-50:
		tmp = (b / c) + (-d / (math.pow(c, 2.0) / a))
	elif d <= 2.1e+103:
		tmp = 2.0 / (t_0 * (2.0 / ((c * b) - (d * a))))
	else:
		tmp = t_1
	return tmp
function code(a, b, c, d)
	return Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(Float64(c * c) + Float64(d * d)))
end
function code(a, b, c, d)
	t_0 = Float64(Float64(c * c) + Float64(d * d))
	t_1 = Float64(Float64(Float64(-a) + Float64(c * Float64(b / d))) / d)
	tmp = 0.0
	if (d <= -2.9e+60)
		tmp = t_1;
	elseif (d <= -1.46e-86)
		tmp = Float64(Float64(Float64(b * c) - Float64(a * d)) / t_0);
	elseif (d <= 6.1e-50)
		tmp = Float64(Float64(b / c) + Float64(Float64(-d) / Float64((c ^ 2.0) / a)));
	elseif (d <= 2.1e+103)
		tmp = Float64(2.0 / Float64(t_0 * Float64(2.0 / Float64(Float64(c * b) - Float64(d * a)))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp = code(a, b, c, d)
	tmp = ((b * c) - (a * d)) / ((c * c) + (d * d));
end
function tmp_2 = code(a, b, c, d)
	t_0 = (c * c) + (d * d);
	t_1 = (-a + (c * (b / d))) / d;
	tmp = 0.0;
	if (d <= -2.9e+60)
		tmp = t_1;
	elseif (d <= -1.46e-86)
		tmp = ((b * c) - (a * d)) / t_0;
	elseif (d <= 6.1e-50)
		tmp = (b / c) + (-d / ((c ^ 2.0) / a));
	elseif (d <= 2.1e+103)
		tmp = 2.0 / (t_0 * (2.0 / ((c * b) - (d * a))));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_, d_] := N[(N[(N[(b * c), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[((-a) + N[(c * N[(b / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[d, -2.9e+60], t$95$1, If[LessEqual[d, -1.46e-86], N[(N[(N[(b * c), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[d, 6.1e-50], N[(N[(b / c), $MachinePrecision] + N[((-d) / N[(N[Power[c, 2.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 2.1e+103], N[(2.0 / N[(t$95$0 * N[(2.0 / N[(N[(c * b), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}
\begin{array}{l}
t_0 := c \cdot c + d \cdot d\\
t_1 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\
\mathbf{if}\;d \leq -2.9 \cdot 10^{+60}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;d \leq -1.46 \cdot 10^{-86}:\\
\;\;\;\;\frac{b \cdot c - a \cdot d}{t_0}\\

\mathbf{elif}\;d \leq 6.1 \cdot 10^{-50}:\\
\;\;\;\;\frac{b}{c} + \frac{-d}{\frac{{c}^{2}}{a}}\\

\mathbf{elif}\;d \leq 2.1 \cdot 10^{+103}:\\
\;\;\;\;\frac{2}{t_0 \cdot \frac{2}{c \cdot b - d \cdot a}}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original25.4
Target0.5
Herbie14.0
\[\begin{array}{l} \mathbf{if}\;\left|d\right| < \left|c\right|:\\ \;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c + d \cdot \frac{d}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-a\right) + b \cdot \frac{c}{d}}{d + c \cdot \frac{c}{d}}\\ \end{array} \]

Derivation?

  1. Split input into 4 regimes
  2. if d < -2.9e60 or 2.1000000000000002e103 < d

    1. Initial program 36.7

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

      \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{\frac{\frac{1}{d \cdot d} + \frac{\frac{1}{c}}{c}}{\frac{1}{d \cdot d} \cdot \frac{\frac{1}{c}}{c}}}} \]
    3. Applied egg-rr50.6

      \[\leadsto \color{blue}{\frac{1}{c \cdot c} \cdot \frac{b \cdot c - a \cdot d}{\left(d \cdot d\right) \cdot \left(\frac{1}{d \cdot d} + \frac{1}{c \cdot c}\right)}} \]
    4. Simplified48.7

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

      [Start]50.6

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

      rational.json-simplify-2 [=>]50.6

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

      rational.json-simplify-2 [=>]50.6

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

      rational.json-simplify-43 [=>]48.7

      \[ \frac{1}{c \cdot c} \cdot \frac{c \cdot b - a \cdot d}{\color{blue}{d \cdot \left(d \cdot \left(\frac{1}{d \cdot d} + \frac{1}{c \cdot c}\right)\right)}} \]
    5. Applied egg-rr42.6

      \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{c \cdot b - a \cdot d}{d}}{c \cdot c}}{\frac{1}{c \cdot c} + \frac{\frac{1}{d}}{d}}}{d}} \]
    6. Taylor expanded in c around 0 13.9

      \[\leadsto \frac{\color{blue}{\frac{c \cdot b}{d} + -1 \cdot a}}{d} \]
    7. Simplified10.6

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

      [Start]13.9

      \[ \frac{\frac{c \cdot b}{d} + -1 \cdot a}{d} \]

      rational.json-simplify-1 [=>]13.9

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

      rational.json-simplify-2 [=>]13.9

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

      rational.json-simplify-9 [=>]13.9

      \[ \frac{\color{blue}{\left(-a\right)} + \frac{c \cdot b}{d}}{d} \]

      rational.json-simplify-2 [=>]13.9

      \[ \frac{\left(-a\right) + \frac{\color{blue}{b \cdot c}}{d}}{d} \]

      rational.json-simplify-49 [=>]10.6

      \[ \frac{\left(-a\right) + \color{blue}{c \cdot \frac{b}{d}}}{d} \]

    if -2.9e60 < d < -1.45999999999999993e-86

    1. Initial program 15.6

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

    if -1.45999999999999993e-86 < d < 6.0999999999999996e-50

    1. Initial program 19.7

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

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

      \[\leadsto \color{blue}{\frac{b}{c} + d \cdot \left(-\frac{a}{{c}^{2}}\right)} \]
      Proof

      [Start]12.5

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

      rational.json-simplify-1 [=>]12.5

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

      rational.json-simplify-49 [=>]16.2

      \[ \frac{b}{c} + -1 \cdot \color{blue}{\left(d \cdot \frac{a}{{c}^{2}}\right)} \]

      rational.json-simplify-43 [=>]16.2

      \[ \frac{b}{c} + \color{blue}{d \cdot \left(\frac{a}{{c}^{2}} \cdot -1\right)} \]

      rational.json-simplify-9 [=>]16.2

      \[ \frac{b}{c} + d \cdot \color{blue}{\left(-\frac{a}{{c}^{2}}\right)} \]
    4. Applied egg-rr15.8

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

    if 6.0999999999999996e-50 < d < 2.1000000000000002e103

    1. Initial program 17.4

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

      \[\leadsto \color{blue}{\frac{1}{c \cdot c + d \cdot d} \cdot \left(b \cdot c - a \cdot d\right)} \]
    3. Applied egg-rr17.7

      \[\leadsto \color{blue}{\frac{2}{\left(c \cdot c + d \cdot d\right) \cdot \frac{2}{c \cdot b - d \cdot a}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification14.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.9 \cdot 10^{+60}:\\ \;\;\;\;\frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{elif}\;d \leq -1.46 \cdot 10^{-86}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\ \mathbf{elif}\;d \leq 6.1 \cdot 10^{-50}:\\ \;\;\;\;\frac{b}{c} + \frac{-d}{\frac{{c}^{2}}{a}}\\ \mathbf{elif}\;d \leq 2.1 \cdot 10^{+103}:\\ \;\;\;\;\frac{2}{\left(c \cdot c + d \cdot d\right) \cdot \frac{2}{c \cdot b - d \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \end{array} \]

Alternatives

Alternative 1
Error13.2
Cost7500
\[\begin{array}{l} t_0 := c \cdot c + d \cdot d\\ t_1 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{if}\;d \leq -1.05 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -4.4 \cdot 10^{-82}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{t_0}\\ \mathbf{elif}\;d \leq 6.1 \cdot 10^{-50}:\\ \;\;\;\;\frac{b}{c} + a \cdot \left(-\frac{d}{{c}^{2}}\right)\\ \mathbf{elif}\;d \leq 6 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{t_0 \cdot \frac{2}{c \cdot b - d \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error14.2
Cost7500
\[\begin{array}{l} t_0 := c \cdot c + d \cdot d\\ t_1 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{if}\;d \leq -1.6 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -7.4 \cdot 10^{-84}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{t_0}\\ \mathbf{elif}\;d \leq 6.1 \cdot 10^{-50}:\\ \;\;\;\;\frac{b}{c} + d \cdot \left(-\frac{a}{{c}^{2}}\right)\\ \mathbf{elif}\;d \leq 7 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{t_0 \cdot \frac{2}{c \cdot b - d \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error20.8
Cost1556
\[\begin{array}{l} t_0 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ t_1 := a \cdot \left(-d\right)\\ \mathbf{if}\;d \leq -1.16 \cdot 10^{-82}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -3.6 \cdot 10^{-247}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{-167}:\\ \;\;\;\;\frac{1}{c \cdot c} \cdot \left(c \cdot b + t_1\right)\\ \mathbf{elif}\;d \leq 9.8 \cdot 10^{-50}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 12200:\\ \;\;\;\;\frac{1}{c \cdot c + d \cdot d} \cdot t_1\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{+24}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error13.8
Cost1488
\[\begin{array}{l} t_0 := \frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\ \mathbf{if}\;c \leq -1 \cdot 10^{+144}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -2.8 \cdot 10^{-22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;c \leq 5.2 \cdot 10^{-155}:\\ \;\;\;\;\frac{\frac{c \cdot b}{d} + -1 \cdot a}{d}\\ \mathbf{elif}\;c \leq 2.6 \cdot 10^{+128}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
Alternative 5
Error20.8
Cost1432
\[\begin{array}{l} t_0 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{if}\;d \leq -4.8 \cdot 10^{-84}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -5.8 \cdot 10^{-245}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 7 \cdot 10^{-183}:\\ \;\;\;\;\frac{1}{c \cdot c} \cdot \left(c \cdot b + a \cdot \left(-d\right)\right)\\ \mathbf{elif}\;d \leq 1.55 \cdot 10^{-49}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 13500:\\ \;\;\;\;\frac{a}{\frac{c \cdot c + d \cdot d}{-d}}\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{+25}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error19.3
Cost1168
\[\begin{array}{l} t_0 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{if}\;d \leq -4.15 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 2.8 \cdot 10^{-49}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 9500:\\ \;\;\;\;-\frac{d}{\frac{c \cdot c + d \cdot d}{a}}\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{+24}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error19.3
Cost1168
\[\begin{array}{l} t_0 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{if}\;d \leq -4.1 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{-50}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 3600:\\ \;\;\;\;\frac{-d}{c \cdot c + d \cdot d} \cdot a\\ \mathbf{elif}\;d \leq 4.9 \cdot 10^{+24}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error19.2
Cost1168
\[\begin{array}{l} t_0 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{if}\;d \leq -3.5 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 6.1 \cdot 10^{-50}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 4600:\\ \;\;\;\;\frac{a}{\frac{c \cdot c + d \cdot d}{-d}}\\ \mathbf{elif}\;d \leq 3.9 \cdot 10^{+24}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error19.2
Cost904
\[\begin{array}{l} t_0 := \frac{\left(-a\right) + c \cdot \frac{b}{d}}{d}\\ \mathbf{if}\;d \leq -3.9 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 1.7 \cdot 10^{-31}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error24.2
Cost520
\[\begin{array}{l} t_0 := -\frac{a}{d}\\ \mathbf{if}\;d \leq -4.15 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 6.8 \cdot 10^{+100}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error37.2
Cost192
\[\frac{b}{c} \]

Error

Reproduce?

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

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

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