
(FPCore (a b c d) :precision binary64 (/ (- (* b c) (* a d)) (+ (* c c) (* d d))))
double code(double a, double b, double c, double d) {
return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
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
public static double code(double a, double b, double c, double d) {
return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
def code(a, b, c, d): return ((b * c) - (a * d)) / ((c * c) + (d * d))
function code(a, b, c, d) return Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(Float64(c * c) + Float64(d * d))) end
function tmp = code(a, b, c, d) tmp = ((b * c) - (a * d)) / ((c * c) + (d * d)); 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]
\begin{array}{l}
\\
\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b c d) :precision binary64 (/ (- (* b c) (* a d)) (+ (* c c) (* d d))))
double code(double a, double b, double c, double d) {
return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
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
public static double code(double a, double b, double c, double d) {
return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
def code(a, b, c, d): return ((b * c) - (a * d)) / ((c * c) + (d * d))
function code(a, b, c, d) return Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(Float64(c * c) + Float64(d * d))) end
function tmp = code(a, b, c, d) tmp = ((b * c) - (a * d)) / ((c * c) + (d * d)); 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]
\begin{array}{l}
\\
\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}
\end{array}
(FPCore (a b c d) :precision binary64 (if (<= d -0.0001107) (/ (fma (/ b d) c (- a)) d) (if (<= d 2.5e-50) (/ (- b (/ (* a d) c)) c) (/ (- a) (fma c (/ c d) d)))))
double code(double a, double b, double c, double d) {
double tmp;
if (d <= -0.0001107) {
tmp = fma((b / d), c, -a) / d;
} else if (d <= 2.5e-50) {
tmp = (b - ((a * d) / c)) / c;
} else {
tmp = -a / fma(c, (c / d), d);
}
return tmp;
}
function code(a, b, c, d) tmp = 0.0 if (d <= -0.0001107) tmp = Float64(fma(Float64(b / d), c, Float64(-a)) / d); elseif (d <= 2.5e-50) tmp = Float64(Float64(b - Float64(Float64(a * d) / c)) / c); else tmp = Float64(Float64(-a) / fma(c, Float64(c / d), d)); end return tmp end
code[a_, b_, c_, d_] := If[LessEqual[d, -0.0001107], N[(N[(N[(b / d), $MachinePrecision] * c + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e-50], N[(N[(b - N[(N[(a * d), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[((-a) / N[(c * N[(c / d), $MachinePrecision] + d), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -0.0001107:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{-50}:\\
\;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{\mathsf{fma}\left(c, \frac{c}{d}, d\right)}\\
\end{array}
\end{array}
if d < -1.10699999999999994e-4Initial program 59.8%
lift--.f64N/A
flip3--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip3--N/A
lift--.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negN/A
distribute-neg-inN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
Applied rewrites59.8%
Taylor expanded in c around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
div-subN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6483.2
Applied rewrites83.2%
Applied rewrites83.4%
if -1.10699999999999994e-4 < d < 2.49999999999999984e-50Initial program 73.8%
Taylor expanded in c around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6492.7
Applied rewrites92.7%
if 2.49999999999999984e-50 < d Initial program 58.3%
Taylor expanded in b around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6461.0
Applied rewrites61.0%
Applied rewrites61.2%
Taylor expanded in c around 0
Applied rewrites87.3%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ (- a) d)))
(if (<= d -1.25e+18)
t_0
(if (<= d 5e-51)
(/ b c)
(if (<= d 7.4e+137) (* (/ d (fma c c (* d d))) (- a)) t_0)))))
double code(double a, double b, double c, double d) {
double t_0 = -a / d;
double tmp;
if (d <= -1.25e+18) {
tmp = t_0;
} else if (d <= 5e-51) {
tmp = b / c;
} else if (d <= 7.4e+137) {
tmp = (d / fma(c, c, (d * d))) * -a;
} else {
tmp = t_0;
}
return tmp;
}
function code(a, b, c, d) t_0 = Float64(Float64(-a) / d) tmp = 0.0 if (d <= -1.25e+18) tmp = t_0; elseif (d <= 5e-51) tmp = Float64(b / c); elseif (d <= 7.4e+137) tmp = Float64(Float64(d / fma(c, c, Float64(d * d))) * Float64(-a)); else tmp = t_0; end return tmp end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[((-a) / d), $MachinePrecision]}, If[LessEqual[d, -1.25e+18], t$95$0, If[LessEqual[d, 5e-51], N[(b / c), $MachinePrecision], If[LessEqual[d, 7.4e+137], N[(N[(d / N[(c * c + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-a)), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-a}{d}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 5 \cdot 10^{-51}:\\
\;\;\;\;\frac{b}{c}\\
\mathbf{elif}\;d \leq 7.4 \cdot 10^{+137}:\\
\;\;\;\;\frac{d}{\mathsf{fma}\left(c, c, d \cdot d\right)} \cdot \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d < -1.25e18 or 7.40000000000000041e137 < d Initial program 50.9%
Taylor expanded in c around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6482.4
Applied rewrites82.4%
if -1.25e18 < d < 5.00000000000000004e-51Initial program 75.2%
Taylor expanded in c around inf
lower-/.f6473.7
Applied rewrites73.7%
if 5.00000000000000004e-51 < d < 7.40000000000000041e137Initial program 77.2%
Taylor expanded in b around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6478.9
Applied rewrites78.9%
Final simplification77.7%
(FPCore (a b c d) :precision binary64 (if (<= d -0.0001107) (/ (- (/ (* c b) d) a) d) (if (<= d 2.5e-50) (/ (- b (/ (* a d) c)) c) (/ (- a) (fma c (/ c d) d)))))
double code(double a, double b, double c, double d) {
double tmp;
if (d <= -0.0001107) {
tmp = (((c * b) / d) - a) / d;
} else if (d <= 2.5e-50) {
tmp = (b - ((a * d) / c)) / c;
} else {
tmp = -a / fma(c, (c / d), d);
}
return tmp;
}
function code(a, b, c, d) tmp = 0.0 if (d <= -0.0001107) tmp = Float64(Float64(Float64(Float64(c * b) / d) - a) / d); elseif (d <= 2.5e-50) tmp = Float64(Float64(b - Float64(Float64(a * d) / c)) / c); else tmp = Float64(Float64(-a) / fma(c, Float64(c / d), d)); end return tmp end
code[a_, b_, c_, d_] := If[LessEqual[d, -0.0001107], N[(N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, 2.5e-50], N[(N[(b - N[(N[(a * d), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[((-a) / N[(c * N[(c / d), $MachinePrecision] + d), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -0.0001107:\\
\;\;\;\;\frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{-50}:\\
\;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{\mathsf{fma}\left(c, \frac{c}{d}, d\right)}\\
\end{array}
\end{array}
if d < -1.10699999999999994e-4Initial program 59.8%
Taylor expanded in c around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6483.2
Applied rewrites83.2%
if -1.10699999999999994e-4 < d < 2.49999999999999984e-50Initial program 73.8%
Taylor expanded in c around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6492.7
Applied rewrites92.7%
if 2.49999999999999984e-50 < d Initial program 58.3%
Taylor expanded in b around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6461.0
Applied rewrites61.0%
Applied rewrites61.2%
Taylor expanded in c around 0
Applied rewrites87.3%
Final simplification88.6%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ (- a) (fma c (/ c d) d))))
(if (<= d -0.0001107)
t_0
(if (<= d 2.5e-50) (/ (- b (/ (* a d) c)) c) t_0))))
double code(double a, double b, double c, double d) {
double t_0 = -a / fma(c, (c / d), d);
double tmp;
if (d <= -0.0001107) {
tmp = t_0;
} else if (d <= 2.5e-50) {
tmp = (b - ((a * d) / c)) / c;
} else {
tmp = t_0;
}
return tmp;
}
function code(a, b, c, d) t_0 = Float64(Float64(-a) / fma(c, Float64(c / d), d)) tmp = 0.0 if (d <= -0.0001107) tmp = t_0; elseif (d <= 2.5e-50) tmp = Float64(Float64(b - Float64(Float64(a * d) / c)) / c); else tmp = t_0; end return tmp end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[((-a) / N[(c * N[(c / d), $MachinePrecision] + d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -0.0001107], t$95$0, If[LessEqual[d, 2.5e-50], N[(N[(b - N[(N[(a * d), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-a}{\mathsf{fma}\left(c, \frac{c}{d}, d\right)}\\
\mathbf{if}\;d \leq -0.0001107:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 2.5 \cdot 10^{-50}:\\
\;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d < -1.10699999999999994e-4 or 2.49999999999999984e-50 < d Initial program 59.0%
Taylor expanded in b around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6457.4
Applied rewrites57.4%
Applied rewrites57.6%
Taylor expanded in c around 0
Applied rewrites81.9%
if -1.10699999999999994e-4 < d < 2.49999999999999984e-50Initial program 73.8%
Taylor expanded in c around inf
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6492.7
Applied rewrites92.7%
(FPCore (a b c d) :precision binary64 (let* ((t_0 (/ (- a) (fma c (/ c d) d)))) (if (<= d -7e-35) t_0 (if (<= d 4.7e-51) (/ b c) t_0))))
double code(double a, double b, double c, double d) {
double t_0 = -a / fma(c, (c / d), d);
double tmp;
if (d <= -7e-35) {
tmp = t_0;
} else if (d <= 4.7e-51) {
tmp = b / c;
} else {
tmp = t_0;
}
return tmp;
}
function code(a, b, c, d) t_0 = Float64(Float64(-a) / fma(c, Float64(c / d), d)) tmp = 0.0 if (d <= -7e-35) tmp = t_0; elseif (d <= 4.7e-51) tmp = Float64(b / c); else tmp = t_0; end return tmp end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[((-a) / N[(c * N[(c / d), $MachinePrecision] + d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -7e-35], t$95$0, If[LessEqual[d, 4.7e-51], N[(b / c), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-a}{\mathsf{fma}\left(c, \frac{c}{d}, d\right)}\\
\mathbf{if}\;d \leq -7 \cdot 10^{-35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 4.7 \cdot 10^{-51}:\\
\;\;\;\;\frac{b}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d < -6.99999999999999992e-35 or 4.6999999999999997e-51 < d Initial program 59.8%
Taylor expanded in b around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6457.6
Applied rewrites57.6%
Applied rewrites57.7%
Taylor expanded in c around 0
Applied rewrites81.2%
if -6.99999999999999992e-35 < d < 4.6999999999999997e-51Initial program 73.5%
Taylor expanded in c around inf
lower-/.f6475.9
Applied rewrites75.9%
(FPCore (a b c d) :precision binary64 (let* ((t_0 (/ (- a) d))) (if (<= d -1.25e+18) t_0 (if (<= d 1.15e-42) (/ b c) t_0))))
double code(double a, double b, double c, double d) {
double t_0 = -a / d;
double tmp;
if (d <= -1.25e+18) {
tmp = t_0;
} else if (d <= 1.15e-42) {
tmp = b / c;
} else {
tmp = t_0;
}
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
real(8) :: t_0
real(8) :: tmp
t_0 = -a / d
if (d <= (-1.25d+18)) then
tmp = t_0
else if (d <= 1.15d-42) then
tmp = b / c
else
tmp = t_0
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double t_0 = -a / d;
double tmp;
if (d <= -1.25e+18) {
tmp = t_0;
} else if (d <= 1.15e-42) {
tmp = b / c;
} else {
tmp = t_0;
}
return tmp;
}
def code(a, b, c, d): t_0 = -a / d tmp = 0 if d <= -1.25e+18: tmp = t_0 elif d <= 1.15e-42: tmp = b / c else: tmp = t_0 return tmp
function code(a, b, c, d) t_0 = Float64(Float64(-a) / d) tmp = 0.0 if (d <= -1.25e+18) tmp = t_0; elseif (d <= 1.15e-42) tmp = Float64(b / c); else tmp = t_0; end return tmp end
function tmp_2 = code(a, b, c, d) t_0 = -a / d; tmp = 0.0; if (d <= -1.25e+18) tmp = t_0; elseif (d <= 1.15e-42) tmp = b / c; else tmp = t_0; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[((-a) / d), $MachinePrecision]}, If[LessEqual[d, -1.25e+18], t$95$0, If[LessEqual[d, 1.15e-42], N[(b / c), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-a}{d}\\
\mathbf{if}\;d \leq -1.25 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;d \leq 1.15 \cdot 10^{-42}:\\
\;\;\;\;\frac{b}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if d < -1.25e18 or 1.15000000000000002e-42 < d Initial program 56.9%
Taylor expanded in c around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6477.4
Applied rewrites77.4%
if -1.25e18 < d < 1.15000000000000002e-42Initial program 75.2%
Taylor expanded in c around inf
lower-/.f6473.7
Applied rewrites73.7%
(FPCore (a b c d) :precision binary64 (/ b c))
double code(double a, double b, double c, double d) {
return b / c;
}
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
end function
public static double code(double a, double b, double c, double d) {
return b / c;
}
def code(a, b, c, d): return b / c
function code(a, b, c, d) return Float64(b / c) end
function tmp = code(a, b, c, d) tmp = b / c; end
code[a_, b_, c_, d_] := N[(b / c), $MachinePrecision]
\begin{array}{l}
\\
\frac{b}{c}
\end{array}
Initial program 65.8%
Taylor expanded in c around inf
lower-/.f6444.3
Applied rewrites44.3%
(FPCore (a b c d) :precision binary64 (if (< (fabs d) (fabs c)) (/ (- b (* a (/ d c))) (+ c (* d (/ d c)))) (/ (+ (- a) (* b (/ c d))) (+ d (* c (/ c d))))))
double code(double a, double b, double c, double d) {
double tmp;
if (fabs(d) < fabs(c)) {
tmp = (b - (a * (d / c))) / (c + (d * (d / c)));
} else {
tmp = (-a + (b * (c / d))) / (d + (c * (c / d)));
}
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
real(8) :: tmp
if (abs(d) < abs(c)) then
tmp = (b - (a * (d / c))) / (c + (d * (d / c)))
else
tmp = (-a + (b * (c / d))) / (d + (c * (c / d)))
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if (Math.abs(d) < Math.abs(c)) {
tmp = (b - (a * (d / c))) / (c + (d * (d / c)));
} else {
tmp = (-a + (b * (c / d))) / (d + (c * (c / d)));
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if math.fabs(d) < math.fabs(c): tmp = (b - (a * (d / c))) / (c + (d * (d / c))) else: tmp = (-a + (b * (c / d))) / (d + (c * (c / d))) return tmp
function code(a, b, c, d) tmp = 0.0 if (abs(d) < abs(c)) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / Float64(c + Float64(d * Float64(d / c)))); else tmp = Float64(Float64(Float64(-a) + Float64(b * Float64(c / d))) / Float64(d + Float64(c * Float64(c / d)))); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if (abs(d) < abs(c)) tmp = (b - (a * (d / c))) / (c + (d * (d / c))); else tmp = (-a + (b * (c / d))) / (d + (c * (c / d))); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Less[N[Abs[d], $MachinePrecision], N[Abs[c], $MachinePrecision]], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c + N[(d * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) + N[(b * N[(c / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d + N[(c * N[(c / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\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}
\end{array}
herbie shell --seed 2024235
(FPCore (a b c d)
:name "Complex division, imag part"
:precision binary64
:alt
(! :herbie-platform default (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))))