
(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 11 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
(let* ((t_0 (- (* c b) (* a d))))
(if (<= c -3e+52)
(/ (- b (* a (/ d c))) c)
(if (<= c -2.3e-131)
(/ t_0 (fma c c (* d d)))
(if (<= c 3.9e-91)
(/ (- (/ (* c b) d) a) d)
(if (<= c 1e+39)
(/ t_0 (+ (* d d) (* c c)))
(/ (+ b (/ -1.0 (/ (/ c a) d))) c)))))))
double code(double a, double b, double c, double d) {
double t_0 = (c * b) - (a * d);
double tmp;
if (c <= -3e+52) {
tmp = (b - (a * (d / c))) / c;
} else if (c <= -2.3e-131) {
tmp = t_0 / fma(c, c, (d * d));
} else if (c <= 3.9e-91) {
tmp = (((c * b) / d) - a) / d;
} else if (c <= 1e+39) {
tmp = t_0 / ((d * d) + (c * c));
} else {
tmp = (b + (-1.0 / ((c / a) / d))) / c;
}
return tmp;
}
function code(a, b, c, d) t_0 = Float64(Float64(c * b) - Float64(a * d)) tmp = 0.0 if (c <= -3e+52) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); elseif (c <= -2.3e-131) tmp = Float64(t_0 / fma(c, c, Float64(d * d))); elseif (c <= 3.9e-91) tmp = Float64(Float64(Float64(Float64(c * b) / d) - a) / d); elseif (c <= 1e+39) tmp = Float64(t_0 / Float64(Float64(d * d) + Float64(c * c))); else tmp = Float64(Float64(b + Float64(-1.0 / Float64(Float64(c / a) / d))) / c); end return tmp end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(c * b), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3e+52], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, -2.3e-131], N[(t$95$0 / N[(c * c + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.9e-91], N[(N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 1e+39], N[(t$95$0 / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + N[(-1.0 / N[(N[(c / a), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := c \cdot b - a \cdot d\\
\mathbf{if}\;c \leq -3 \cdot 10^{+52}:\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{elif}\;c \leq -2.3 \cdot 10^{-131}:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(c, c, d \cdot d\right)}\\
\mathbf{elif}\;c \leq 3.9 \cdot 10^{-91}:\\
\;\;\;\;\frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{elif}\;c \leq 10^{+39}:\\
\;\;\;\;\frac{t\_0}{d \cdot d + c \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \frac{-1}{\frac{\frac{c}{a}}{d}}}{c}\\
\end{array}
\end{array}
if c < -3e52Initial program 45.2%
Taylor expanded in c around inf 82.4%
mul-1-neg82.4%
unsub-neg82.4%
associate-/l*89.0%
Simplified89.0%
if -3e52 < c < -2.30000000000000022e-131Initial program 84.5%
fma-define84.5%
Simplified84.5%
if -2.30000000000000022e-131 < c < 3.89999999999999994e-91Initial program 68.1%
Taylor expanded in d around inf 93.0%
frac-2neg93.0%
distribute-frac-neg293.0%
distribute-neg-in93.0%
add-sqr-sqrt48.8%
sqrt-unprod54.2%
mul-1-neg54.2%
mul-1-neg54.2%
sqr-neg54.2%
sqrt-unprod14.4%
add-sqr-sqrt31.9%
mul-1-neg31.9%
sub-neg31.9%
add-sqr-sqrt17.5%
sqrt-unprod52.5%
mul-1-neg52.5%
mul-1-neg52.5%
sqr-neg52.5%
sqrt-unprod43.8%
add-sqr-sqrt93.0%
associate-/l*92.0%
Applied egg-rr92.0%
Taylor expanded in b around 0 93.0%
if 3.89999999999999994e-91 < c < 9.9999999999999994e38Initial program 89.1%
if 9.9999999999999994e38 < c Initial program 35.1%
Taylor expanded in c around inf 73.4%
mul-1-neg73.4%
unsub-neg73.4%
associate-/l*78.5%
Simplified78.5%
associate-*r/73.4%
clear-num73.4%
*-commutative73.4%
Applied egg-rr73.4%
*-un-lft-identity73.4%
*-commutative73.4%
*-commutative73.4%
associate-/r*78.6%
Applied egg-rr78.6%
Final simplification87.6%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ (- (* c b) (* a d)) (+ (* d d) (* c c)))))
(if (<= c -1.65e+50)
(/ (- b (* a (/ d c))) c)
(if (<= c -2.5e-131)
t_0
(if (<= c 3.4e-91)
(/ (- (/ (* c b) d) a) d)
(if (<= c 1e+39) t_0 (/ (+ b (/ -1.0 (/ (/ c a) d))) c)))))))
double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (a * d)) / ((d * d) + (c * c));
double tmp;
if (c <= -1.65e+50) {
tmp = (b - (a * (d / c))) / c;
} else if (c <= -2.5e-131) {
tmp = t_0;
} else if (c <= 3.4e-91) {
tmp = (((c * b) / d) - a) / d;
} else if (c <= 1e+39) {
tmp = t_0;
} else {
tmp = (b + (-1.0 / ((c / a) / d))) / c;
}
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 = ((c * b) - (a * d)) / ((d * d) + (c * c))
if (c <= (-1.65d+50)) then
tmp = (b - (a * (d / c))) / c
else if (c <= (-2.5d-131)) then
tmp = t_0
else if (c <= 3.4d-91) then
tmp = (((c * b) / d) - a) / d
else if (c <= 1d+39) then
tmp = t_0
else
tmp = (b + ((-1.0d0) / ((c / a) / d))) / c
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (a * d)) / ((d * d) + (c * c));
double tmp;
if (c <= -1.65e+50) {
tmp = (b - (a * (d / c))) / c;
} else if (c <= -2.5e-131) {
tmp = t_0;
} else if (c <= 3.4e-91) {
tmp = (((c * b) / d) - a) / d;
} else if (c <= 1e+39) {
tmp = t_0;
} else {
tmp = (b + (-1.0 / ((c / a) / d))) / c;
}
return tmp;
}
def code(a, b, c, d): t_0 = ((c * b) - (a * d)) / ((d * d) + (c * c)) tmp = 0 if c <= -1.65e+50: tmp = (b - (a * (d / c))) / c elif c <= -2.5e-131: tmp = t_0 elif c <= 3.4e-91: tmp = (((c * b) / d) - a) / d elif c <= 1e+39: tmp = t_0 else: tmp = (b + (-1.0 / ((c / a) / d))) / c return tmp
function code(a, b, c, d) t_0 = Float64(Float64(Float64(c * b) - Float64(a * d)) / Float64(Float64(d * d) + Float64(c * c))) tmp = 0.0 if (c <= -1.65e+50) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); elseif (c <= -2.5e-131) tmp = t_0; elseif (c <= 3.4e-91) tmp = Float64(Float64(Float64(Float64(c * b) / d) - a) / d); elseif (c <= 1e+39) tmp = t_0; else tmp = Float64(Float64(b + Float64(-1.0 / Float64(Float64(c / a) / d))) / c); end return tmp end
function tmp_2 = code(a, b, c, d) t_0 = ((c * b) - (a * d)) / ((d * d) + (c * c)); tmp = 0.0; if (c <= -1.65e+50) tmp = (b - (a * (d / c))) / c; elseif (c <= -2.5e-131) tmp = t_0; elseif (c <= 3.4e-91) tmp = (((c * b) / d) - a) / d; elseif (c <= 1e+39) tmp = t_0; else tmp = (b + (-1.0 / ((c / a) / d))) / c; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(c * b), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.65e+50], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, -2.5e-131], t$95$0, If[LessEqual[c, 3.4e-91], N[(N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 1e+39], t$95$0, N[(N[(b + N[(-1.0 / N[(N[(c / a), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c \cdot b - a \cdot d}{d \cdot d + c \cdot c}\\
\mathbf{if}\;c \leq -1.65 \cdot 10^{+50}:\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{elif}\;c \leq -2.5 \cdot 10^{-131}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;c \leq 3.4 \cdot 10^{-91}:\\
\;\;\;\;\frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{elif}\;c \leq 10^{+39}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \frac{-1}{\frac{\frac{c}{a}}{d}}}{c}\\
\end{array}
\end{array}
if c < -1.65e50Initial program 45.2%
Taylor expanded in c around inf 82.4%
mul-1-neg82.4%
unsub-neg82.4%
associate-/l*89.0%
Simplified89.0%
if -1.65e50 < c < -2.5000000000000002e-131 or 3.40000000000000027e-91 < c < 9.9999999999999994e38Initial program 86.6%
if -2.5000000000000002e-131 < c < 3.40000000000000027e-91Initial program 68.1%
Taylor expanded in d around inf 93.0%
frac-2neg93.0%
distribute-frac-neg293.0%
distribute-neg-in93.0%
add-sqr-sqrt48.8%
sqrt-unprod54.2%
mul-1-neg54.2%
mul-1-neg54.2%
sqr-neg54.2%
sqrt-unprod14.4%
add-sqr-sqrt31.9%
mul-1-neg31.9%
sub-neg31.9%
add-sqr-sqrt17.5%
sqrt-unprod52.5%
mul-1-neg52.5%
mul-1-neg52.5%
sqr-neg52.5%
sqrt-unprod43.8%
add-sqr-sqrt93.0%
associate-/l*92.0%
Applied egg-rr92.0%
Taylor expanded in b around 0 93.0%
if 9.9999999999999994e38 < c Initial program 35.1%
Taylor expanded in c around inf 73.4%
mul-1-neg73.4%
unsub-neg73.4%
associate-/l*78.5%
Simplified78.5%
associate-*r/73.4%
clear-num73.4%
*-commutative73.4%
Applied egg-rr73.4%
*-un-lft-identity73.4%
*-commutative73.4%
*-commutative73.4%
associate-/r*78.6%
Applied egg-rr78.6%
Final simplification87.6%
(FPCore (a b c d)
:precision binary64
(if (<= c -2e-14)
(/ (- b (* a (/ d c))) c)
(if (<= c 1.02e-57)
(/ (- (* (* c b) (/ 1.0 d)) a) d)
(/ (+ b (/ 1.0 (* (/ c d) (/ -1.0 a)))) c))))
double code(double a, double b, double c, double d) {
double tmp;
if (c <= -2e-14) {
tmp = (b - (a * (d / c))) / c;
} else if (c <= 1.02e-57) {
tmp = (((c * b) * (1.0 / d)) - a) / d;
} else {
tmp = (b + (1.0 / ((c / d) * (-1.0 / a)))) / c;
}
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 (c <= (-2d-14)) then
tmp = (b - (a * (d / c))) / c
else if (c <= 1.02d-57) then
tmp = (((c * b) * (1.0d0 / d)) - a) / d
else
tmp = (b + (1.0d0 / ((c / d) * ((-1.0d0) / a)))) / c
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if (c <= -2e-14) {
tmp = (b - (a * (d / c))) / c;
} else if (c <= 1.02e-57) {
tmp = (((c * b) * (1.0 / d)) - a) / d;
} else {
tmp = (b + (1.0 / ((c / d) * (-1.0 / a)))) / c;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if c <= -2e-14: tmp = (b - (a * (d / c))) / c elif c <= 1.02e-57: tmp = (((c * b) * (1.0 / d)) - a) / d else: tmp = (b + (1.0 / ((c / d) * (-1.0 / a)))) / c return tmp
function code(a, b, c, d) tmp = 0.0 if (c <= -2e-14) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); elseif (c <= 1.02e-57) tmp = Float64(Float64(Float64(Float64(c * b) * Float64(1.0 / d)) - a) / d); else tmp = Float64(Float64(b + Float64(1.0 / Float64(Float64(c / d) * Float64(-1.0 / a)))) / c); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if (c <= -2e-14) tmp = (b - (a * (d / c))) / c; elseif (c <= 1.02e-57) tmp = (((c * b) * (1.0 / d)) - a) / d; else tmp = (b + (1.0 / ((c / d) * (-1.0 / a)))) / c; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[LessEqual[c, -2e-14], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, 1.02e-57], N[(N[(N[(N[(c * b), $MachinePrecision] * N[(1.0 / d), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], N[(N[(b + N[(1.0 / N[(N[(c / d), $MachinePrecision] * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2 \cdot 10^{-14}:\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{elif}\;c \leq 1.02 \cdot 10^{-57}:\\
\;\;\;\;\frac{\left(c \cdot b\right) \cdot \frac{1}{d} - a}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \frac{1}{\frac{c}{d} \cdot \frac{-1}{a}}}{c}\\
\end{array}
\end{array}
if c < -2e-14Initial program 56.0%
Taylor expanded in c around inf 80.4%
mul-1-neg80.4%
unsub-neg80.4%
associate-/l*85.5%
Simplified85.5%
if -2e-14 < c < 1.02e-57Initial program 71.9%
Taylor expanded in d around inf 87.6%
div-inv87.6%
*-commutative87.6%
Applied egg-rr87.6%
if 1.02e-57 < c Initial program 47.9%
Taylor expanded in c around inf 69.6%
mul-1-neg69.6%
unsub-neg69.6%
associate-/l*73.3%
Simplified73.3%
associate-*r/69.6%
clear-num69.6%
*-commutative69.6%
Applied egg-rr69.6%
associate-/r*73.4%
div-inv73.4%
Applied egg-rr73.4%
Final simplification82.8%
(FPCore (a b c d) :precision binary64 (if (or (<= c -2.75e-14) (not (<= c 4.5e-58))) (/ (- b (* a (/ d c))) c) (/ (- (* (* c b) (/ 1.0 d)) a) d)))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -2.75e-14) || !(c <= 4.5e-58)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = (((c * b) * (1.0 / d)) - a) / 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 ((c <= (-2.75d-14)) .or. (.not. (c <= 4.5d-58))) then
tmp = (b - (a * (d / c))) / c
else
tmp = (((c * b) * (1.0d0 / d)) - a) / d
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -2.75e-14) || !(c <= 4.5e-58)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = (((c * b) * (1.0 / d)) - a) / d;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -2.75e-14) or not (c <= 4.5e-58): tmp = (b - (a * (d / c))) / c else: tmp = (((c * b) * (1.0 / d)) - a) / d return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -2.75e-14) || !(c <= 4.5e-58)) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); else tmp = Float64(Float64(Float64(Float64(c * b) * Float64(1.0 / d)) - a) / d); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -2.75e-14) || ~((c <= 4.5e-58))) tmp = (b - (a * (d / c))) / c; else tmp = (((c * b) * (1.0 / d)) - a) / d; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -2.75e-14], N[Not[LessEqual[c, 4.5e-58]], $MachinePrecision]], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(c * b), $MachinePrecision] * N[(1.0 / d), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.75 \cdot 10^{-14} \lor \neg \left(c \leq 4.5 \cdot 10^{-58}\right):\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(c \cdot b\right) \cdot \frac{1}{d} - a}{d}\\
\end{array}
\end{array}
if c < -2.74999999999999996e-14 or 4.5000000000000003e-58 < c Initial program 51.3%
Taylor expanded in c around inf 74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*78.5%
Simplified78.5%
if -2.74999999999999996e-14 < c < 4.5000000000000003e-58Initial program 71.9%
Taylor expanded in d around inf 87.6%
div-inv87.6%
*-commutative87.6%
Applied egg-rr87.6%
Final simplification82.8%
(FPCore (a b c d) :precision binary64 (if (or (<= c -4.1e-15) (not (<= c 1e-57))) (/ (- b (* a (/ d c))) c) (/ (- (/ 1.0 (/ d (* c b))) a) d)))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -4.1e-15) || !(c <= 1e-57)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = ((1.0 / (d / (c * b))) - a) / 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 ((c <= (-4.1d-15)) .or. (.not. (c <= 1d-57))) then
tmp = (b - (a * (d / c))) / c
else
tmp = ((1.0d0 / (d / (c * b))) - a) / d
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -4.1e-15) || !(c <= 1e-57)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = ((1.0 / (d / (c * b))) - a) / d;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -4.1e-15) or not (c <= 1e-57): tmp = (b - (a * (d / c))) / c else: tmp = ((1.0 / (d / (c * b))) - a) / d return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -4.1e-15) || !(c <= 1e-57)) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); else tmp = Float64(Float64(Float64(1.0 / Float64(d / Float64(c * b))) - a) / d); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -4.1e-15) || ~((c <= 1e-57))) tmp = (b - (a * (d / c))) / c; else tmp = ((1.0 / (d / (c * b))) - a) / d; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -4.1e-15], N[Not[LessEqual[c, 1e-57]], $MachinePrecision]], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(1.0 / N[(d / N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.1 \cdot 10^{-15} \lor \neg \left(c \leq 10^{-57}\right):\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{d}{c \cdot b}} - a}{d}\\
\end{array}
\end{array}
if c < -4.10000000000000036e-15 or 9.99999999999999955e-58 < c Initial program 51.3%
Taylor expanded in c around inf 74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*78.5%
Simplified78.5%
if -4.10000000000000036e-15 < c < 9.99999999999999955e-58Initial program 71.9%
Taylor expanded in d around inf 87.6%
frac-2neg87.6%
distribute-frac-neg287.6%
distribute-neg-in87.6%
add-sqr-sqrt42.2%
sqrt-unprod51.8%
mul-1-neg51.8%
mul-1-neg51.8%
sqr-neg51.8%
sqrt-unprod18.9%
add-sqr-sqrt34.3%
mul-1-neg34.3%
sub-neg34.3%
add-sqr-sqrt15.4%
sqrt-unprod52.8%
mul-1-neg52.8%
mul-1-neg52.8%
sqr-neg52.8%
sqrt-unprod45.1%
add-sqr-sqrt87.6%
associate-/l*86.8%
Applied egg-rr86.8%
associate-*r/87.6%
clear-num87.6%
Applied egg-rr87.6%
Final simplification82.8%
(FPCore (a b c d)
:precision binary64
(if (<= c -4.6e-15)
(/ (- b (* a (/ d c))) c)
(if (<= c 1.02e-57)
(/ (- (* (* c b) (/ 1.0 d)) a) d)
(/ (+ b (/ -1.0 (/ (/ c a) d))) c))))
double code(double a, double b, double c, double d) {
double tmp;
if (c <= -4.6e-15) {
tmp = (b - (a * (d / c))) / c;
} else if (c <= 1.02e-57) {
tmp = (((c * b) * (1.0 / d)) - a) / d;
} else {
tmp = (b + (-1.0 / ((c / a) / d))) / c;
}
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 (c <= (-4.6d-15)) then
tmp = (b - (a * (d / c))) / c
else if (c <= 1.02d-57) then
tmp = (((c * b) * (1.0d0 / d)) - a) / d
else
tmp = (b + ((-1.0d0) / ((c / a) / d))) / c
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if (c <= -4.6e-15) {
tmp = (b - (a * (d / c))) / c;
} else if (c <= 1.02e-57) {
tmp = (((c * b) * (1.0 / d)) - a) / d;
} else {
tmp = (b + (-1.0 / ((c / a) / d))) / c;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if c <= -4.6e-15: tmp = (b - (a * (d / c))) / c elif c <= 1.02e-57: tmp = (((c * b) * (1.0 / d)) - a) / d else: tmp = (b + (-1.0 / ((c / a) / d))) / c return tmp
function code(a, b, c, d) tmp = 0.0 if (c <= -4.6e-15) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); elseif (c <= 1.02e-57) tmp = Float64(Float64(Float64(Float64(c * b) * Float64(1.0 / d)) - a) / d); else tmp = Float64(Float64(b + Float64(-1.0 / Float64(Float64(c / a) / d))) / c); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if (c <= -4.6e-15) tmp = (b - (a * (d / c))) / c; elseif (c <= 1.02e-57) tmp = (((c * b) * (1.0 / d)) - a) / d; else tmp = (b + (-1.0 / ((c / a) / d))) / c; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[LessEqual[c, -4.6e-15], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, 1.02e-57], N[(N[(N[(N[(c * b), $MachinePrecision] * N[(1.0 / d), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], N[(N[(b + N[(-1.0 / N[(N[(c / a), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.6 \cdot 10^{-15}:\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{elif}\;c \leq 1.02 \cdot 10^{-57}:\\
\;\;\;\;\frac{\left(c \cdot b\right) \cdot \frac{1}{d} - a}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \frac{-1}{\frac{\frac{c}{a}}{d}}}{c}\\
\end{array}
\end{array}
if c < -4.59999999999999981e-15Initial program 56.0%
Taylor expanded in c around inf 80.4%
mul-1-neg80.4%
unsub-neg80.4%
associate-/l*85.5%
Simplified85.5%
if -4.59999999999999981e-15 < c < 1.02e-57Initial program 71.9%
Taylor expanded in d around inf 87.6%
div-inv87.6%
*-commutative87.6%
Applied egg-rr87.6%
if 1.02e-57 < c Initial program 47.9%
Taylor expanded in c around inf 69.6%
mul-1-neg69.6%
unsub-neg69.6%
associate-/l*73.3%
Simplified73.3%
associate-*r/69.6%
clear-num69.6%
*-commutative69.6%
Applied egg-rr69.6%
*-un-lft-identity69.6%
*-commutative69.6%
*-commutative69.6%
associate-/r*73.4%
Applied egg-rr73.4%
Final simplification82.8%
(FPCore (a b c d) :precision binary64 (if (or (<= c -2.1e-14) (not (<= c 8.5e-58))) (/ (- b (* a (/ d c))) c) (/ (- (/ (* c b) d) a) d)))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -2.1e-14) || !(c <= 8.5e-58)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = (((c * b) / d) - a) / 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 ((c <= (-2.1d-14)) .or. (.not. (c <= 8.5d-58))) then
tmp = (b - (a * (d / c))) / c
else
tmp = (((c * b) / d) - a) / d
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -2.1e-14) || !(c <= 8.5e-58)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = (((c * b) / d) - a) / d;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -2.1e-14) or not (c <= 8.5e-58): tmp = (b - (a * (d / c))) / c else: tmp = (((c * b) / d) - a) / d return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -2.1e-14) || !(c <= 8.5e-58)) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); else tmp = Float64(Float64(Float64(Float64(c * b) / d) - a) / d); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -2.1e-14) || ~((c <= 8.5e-58))) tmp = (b - (a * (d / c))) / c; else tmp = (((c * b) / d) - a) / d; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -2.1e-14], N[Not[LessEqual[c, 8.5e-58]], $MachinePrecision]], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.1 \cdot 10^{-14} \lor \neg \left(c \leq 8.5 \cdot 10^{-58}\right):\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c \cdot b}{d} - a}{d}\\
\end{array}
\end{array}
if c < -2.0999999999999999e-14 or 8.5000000000000004e-58 < c Initial program 51.3%
Taylor expanded in c around inf 74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*78.5%
Simplified78.5%
if -2.0999999999999999e-14 < c < 8.5000000000000004e-58Initial program 71.9%
Taylor expanded in d around inf 87.6%
frac-2neg87.6%
distribute-frac-neg287.6%
distribute-neg-in87.6%
add-sqr-sqrt42.2%
sqrt-unprod51.8%
mul-1-neg51.8%
mul-1-neg51.8%
sqr-neg51.8%
sqrt-unprod18.9%
add-sqr-sqrt34.3%
mul-1-neg34.3%
sub-neg34.3%
add-sqr-sqrt15.4%
sqrt-unprod52.8%
mul-1-neg52.8%
mul-1-neg52.8%
sqr-neg52.8%
sqrt-unprod45.1%
add-sqr-sqrt87.6%
associate-/l*86.8%
Applied egg-rr86.8%
Taylor expanded in b around 0 87.6%
Final simplification82.8%
(FPCore (a b c d) :precision binary64 (if (or (<= c -1.9e-14) (not (<= c 1.02e-57))) (/ (- b (* a (/ d c))) c) (/ (- (* b (/ c d)) a) d)))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -1.9e-14) || !(c <= 1.02e-57)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = ((b * (c / d)) - a) / 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 ((c <= (-1.9d-14)) .or. (.not. (c <= 1.02d-57))) then
tmp = (b - (a * (d / c))) / c
else
tmp = ((b * (c / d)) - a) / d
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -1.9e-14) || !(c <= 1.02e-57)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = ((b * (c / d)) - a) / d;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -1.9e-14) or not (c <= 1.02e-57): tmp = (b - (a * (d / c))) / c else: tmp = ((b * (c / d)) - a) / d return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -1.9e-14) || !(c <= 1.02e-57)) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); else tmp = Float64(Float64(Float64(b * Float64(c / d)) - a) / d); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -1.9e-14) || ~((c <= 1.02e-57))) tmp = (b - (a * (d / c))) / c; else tmp = ((b * (c / d)) - a) / d; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -1.9e-14], N[Not[LessEqual[c, 1.02e-57]], $MachinePrecision]], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(b * N[(c / d), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.9 \cdot 10^{-14} \lor \neg \left(c \leq 1.02 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b \cdot \frac{c}{d} - a}{d}\\
\end{array}
\end{array}
if c < -1.9000000000000001e-14 or 1.02e-57 < c Initial program 51.3%
Taylor expanded in c around inf 74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*78.5%
Simplified78.5%
if -1.9000000000000001e-14 < c < 1.02e-57Initial program 71.9%
Taylor expanded in d around inf 87.6%
frac-2neg87.6%
distribute-frac-neg287.6%
distribute-neg-in87.6%
add-sqr-sqrt42.2%
sqrt-unprod51.8%
mul-1-neg51.8%
mul-1-neg51.8%
sqr-neg51.8%
sqrt-unprod18.9%
add-sqr-sqrt34.3%
mul-1-neg34.3%
sub-neg34.3%
add-sqr-sqrt15.4%
sqrt-unprod52.8%
mul-1-neg52.8%
mul-1-neg52.8%
sqr-neg52.8%
sqrt-unprod45.1%
add-sqr-sqrt87.6%
associate-/l*86.8%
Applied egg-rr86.8%
Final simplification82.4%
(FPCore (a b c d) :precision binary64 (if (or (<= c -3.5e-15) (not (<= c 6.5e-107))) (/ (- b (* a (/ d c))) c) (/ a (- d))))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -3.5e-15) || !(c <= 6.5e-107)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = a / -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 ((c <= (-3.5d-15)) .or. (.not. (c <= 6.5d-107))) then
tmp = (b - (a * (d / c))) / c
else
tmp = a / -d
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -3.5e-15) || !(c <= 6.5e-107)) {
tmp = (b - (a * (d / c))) / c;
} else {
tmp = a / -d;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -3.5e-15) or not (c <= 6.5e-107): tmp = (b - (a * (d / c))) / c else: tmp = a / -d return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -3.5e-15) || !(c <= 6.5e-107)) tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / c); else tmp = Float64(a / Float64(-d)); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -3.5e-15) || ~((c <= 6.5e-107))) tmp = (b - (a * (d / c))) / c; else tmp = a / -d; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -3.5e-15], N[Not[LessEqual[c, 6.5e-107]], $MachinePrecision]], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(a / (-d)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.5 \cdot 10^{-15} \lor \neg \left(c \leq 6.5 \cdot 10^{-107}\right):\\
\;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{-d}\\
\end{array}
\end{array}
if c < -3.5000000000000001e-15 or 6.5000000000000002e-107 < c Initial program 54.3%
Taylor expanded in c around inf 71.8%
mul-1-neg71.8%
unsub-neg71.8%
associate-/l*75.8%
Simplified75.8%
if -3.5000000000000001e-15 < c < 6.5000000000000002e-107Initial program 70.3%
Taylor expanded in c around 0 72.3%
associate-*r/72.3%
mul-1-neg72.3%
Simplified72.3%
Final simplification74.3%
(FPCore (a b c d) :precision binary64 (if (or (<= c -2.75e-14) (not (<= c 2e-90))) (/ b c) (/ a (- d))))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -2.75e-14) || !(c <= 2e-90)) {
tmp = b / c;
} else {
tmp = a / -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 ((c <= (-2.75d-14)) .or. (.not. (c <= 2d-90))) then
tmp = b / c
else
tmp = a / -d
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -2.75e-14) || !(c <= 2e-90)) {
tmp = b / c;
} else {
tmp = a / -d;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -2.75e-14) or not (c <= 2e-90): tmp = b / c else: tmp = a / -d return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -2.75e-14) || !(c <= 2e-90)) tmp = Float64(b / c); else tmp = Float64(a / Float64(-d)); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -2.75e-14) || ~((c <= 2e-90))) tmp = b / c; else tmp = a / -d; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -2.75e-14], N[Not[LessEqual[c, 2e-90]], $MachinePrecision]], N[(b / c), $MachinePrecision], N[(a / (-d)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.75 \cdot 10^{-14} \lor \neg \left(c \leq 2 \cdot 10^{-90}\right):\\
\;\;\;\;\frac{b}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{-d}\\
\end{array}
\end{array}
if c < -2.74999999999999996e-14 or 1.99999999999999999e-90 < c Initial program 54.0%
Taylor expanded in c around inf 63.1%
if -2.74999999999999996e-14 < c < 1.99999999999999999e-90Initial program 70.0%
Taylor expanded in c around 0 71.0%
associate-*r/71.0%
mul-1-neg71.0%
Simplified71.0%
Final simplification66.6%
(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 61.0%
Taylor expanded in c around inf 40.5%
(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 2024118
(FPCore (a b c d)
:name "Complex division, imag part"
:precision binary64
:alt
(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))))