Math FPCore C Java Python Julia MATLAB Wolfram TeX \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}
\]
↓
\[\begin{array}{l}
t_0 := \frac{b \cdot \frac{c}{\mathsf{hypot}\left(c, d\right)}}{\mathsf{hypot}\left(c, d\right)}\\
t_1 := \frac{1}{\mathsf{hypot}\left(c, d\right)}\\
t_2 := \frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{if}\;c \leq -3.0844161161393104 \cdot 10^{+87}:\\
\;\;\;\;t_1 \cdot \left(\frac{d}{\frac{c}{a}} - b\right)\\
\mathbf{elif}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 10^{-100}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;\frac{b - \frac{a}{\frac{c}{d}}}{c}\\
\mathbf{elif}\;c \leq 5.936106704635713 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.1193682608307834 \cdot 10^{+67}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(b - \frac{d}{\frac{\mathsf{hypot}\left(c, d\right)}{a}}\right)\\
\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 (/ (* b (/ c (hypot c d))) (hypot c d)))
(t_1 (/ 1.0 (hypot c d)))
(t_2 (/ (- (/ (* c b) d) a) d)))
(if (<= c -3.0844161161393104e+87)
(* t_1 (- (/ d (/ c a)) b))
(if (<= c -9.004640130169398e-22)
t_0
(if (<= c 1e-100)
t_2
(if (<= c 2.810993454941876e-65)
(/ (- b (/ a (/ c d))) c)
(if (<= c 5.936106704635713e-5)
t_2
(if (<= c 2.1193682608307834e+67)
t_0
(* t_1 (- b (/ d (/ (hypot c d) a)))))))))))) 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 = (b * (c / hypot(c, d))) / hypot(c, d);
double t_1 = 1.0 / hypot(c, d);
double t_2 = (((c * b) / d) - a) / d;
double tmp;
if (c <= -3.0844161161393104e+87) {
tmp = t_1 * ((d / (c / a)) - b);
} else if (c <= -9.004640130169398e-22) {
tmp = t_0;
} else if (c <= 1e-100) {
tmp = t_2;
} else if (c <= 2.810993454941876e-65) {
tmp = (b - (a / (c / d))) / c;
} else if (c <= 5.936106704635713e-5) {
tmp = t_2;
} else if (c <= 2.1193682608307834e+67) {
tmp = t_0;
} else {
tmp = t_1 * (b - (d / (hypot(c, d) / a)));
}
return tmp;
}
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 = (b * (c / Math.hypot(c, d))) / Math.hypot(c, d);
double t_1 = 1.0 / Math.hypot(c, d);
double t_2 = (((c * b) / d) - a) / d;
double tmp;
if (c <= -3.0844161161393104e+87) {
tmp = t_1 * ((d / (c / a)) - b);
} else if (c <= -9.004640130169398e-22) {
tmp = t_0;
} else if (c <= 1e-100) {
tmp = t_2;
} else if (c <= 2.810993454941876e-65) {
tmp = (b - (a / (c / d))) / c;
} else if (c <= 5.936106704635713e-5) {
tmp = t_2;
} else if (c <= 2.1193682608307834e+67) {
tmp = t_0;
} else {
tmp = t_1 * (b - (d / (Math.hypot(c, d) / a)));
}
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 = (b * (c / math.hypot(c, d))) / math.hypot(c, d)
t_1 = 1.0 / math.hypot(c, d)
t_2 = (((c * b) / d) - a) / d
tmp = 0
if c <= -3.0844161161393104e+87:
tmp = t_1 * ((d / (c / a)) - b)
elif c <= -9.004640130169398e-22:
tmp = t_0
elif c <= 1e-100:
tmp = t_2
elif c <= 2.810993454941876e-65:
tmp = (b - (a / (c / d))) / c
elif c <= 5.936106704635713e-5:
tmp = t_2
elif c <= 2.1193682608307834e+67:
tmp = t_0
else:
tmp = t_1 * (b - (d / (math.hypot(c, d) / a)))
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(b * Float64(c / hypot(c, d))) / hypot(c, d))
t_1 = Float64(1.0 / hypot(c, d))
t_2 = Float64(Float64(Float64(Float64(c * b) / d) - a) / d)
tmp = 0.0
if (c <= -3.0844161161393104e+87)
tmp = Float64(t_1 * Float64(Float64(d / Float64(c / a)) - b));
elseif (c <= -9.004640130169398e-22)
tmp = t_0;
elseif (c <= 1e-100)
tmp = t_2;
elseif (c <= 2.810993454941876e-65)
tmp = Float64(Float64(b - Float64(a / Float64(c / d))) / c);
elseif (c <= 5.936106704635713e-5)
tmp = t_2;
elseif (c <= 2.1193682608307834e+67)
tmp = t_0;
else
tmp = Float64(t_1 * Float64(b - Float64(d / Float64(hypot(c, d) / a))));
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 = (b * (c / hypot(c, d))) / hypot(c, d);
t_1 = 1.0 / hypot(c, d);
t_2 = (((c * b) / d) - a) / d;
tmp = 0.0;
if (c <= -3.0844161161393104e+87)
tmp = t_1 * ((d / (c / a)) - b);
elseif (c <= -9.004640130169398e-22)
tmp = t_0;
elseif (c <= 1e-100)
tmp = t_2;
elseif (c <= 2.810993454941876e-65)
tmp = (b - (a / (c / d))) / c;
elseif (c <= 5.936106704635713e-5)
tmp = t_2;
elseif (c <= 2.1193682608307834e+67)
tmp = t_0;
else
tmp = t_1 * (b - (d / (hypot(c, d) / a)));
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[(b * N[(c / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[c, -3.0844161161393104e+87], N[(t$95$1 * N[(N[(d / N[(c / a), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -9.004640130169398e-22], t$95$0, If[LessEqual[c, 1e-100], t$95$2, If[LessEqual[c, 2.810993454941876e-65], N[(N[(b - N[(a / N[(c / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, 5.936106704635713e-5], t$95$2, If[LessEqual[c, 2.1193682608307834e+67], t$95$0, N[(t$95$1 * N[(b - N[(d / N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}
↓
\begin{array}{l}
t_0 := \frac{b \cdot \frac{c}{\mathsf{hypot}\left(c, d\right)}}{\mathsf{hypot}\left(c, d\right)}\\
t_1 := \frac{1}{\mathsf{hypot}\left(c, d\right)}\\
t_2 := \frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{if}\;c \leq -3.0844161161393104 \cdot 10^{+87}:\\
\;\;\;\;t_1 \cdot \left(\frac{d}{\frac{c}{a}} - b\right)\\
\mathbf{elif}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 10^{-100}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;\frac{b - \frac{a}{\frac{c}{d}}}{c}\\
\mathbf{elif}\;c \leq 5.936106704635713 \cdot 10^{-5}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c \leq 2.1193682608307834 \cdot 10^{+67}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(b - \frac{d}{\frac{\mathsf{hypot}\left(c, d\right)}{a}}\right)\\
\end{array}
Alternatives Alternative 1 Error 15.1 Cost 14036
\[\begin{array}{l}
t_0 := \frac{b \cdot \frac{c}{\mathsf{hypot}\left(c, d\right)}}{\mathsf{hypot}\left(c, d\right)}\\
t_1 := \frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{if}\;c \leq -3.0844161161393104 \cdot 10^{+87}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{d}{\frac{c}{a}} - b\right)\\
\mathbf{elif}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;\frac{b - \frac{a}{\frac{c}{d}}}{c}\\
\mathbf{elif}\;c \leq 5.936106704635713 \cdot 10^{-5}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 15.9 Cost 7828
\[\begin{array}{l}
t_0 := \frac{b - \frac{a}{\frac{c}{d}}}{c}\\
t_1 := \frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{if}\;c \leq -3.0844161161393104 \cdot 10^{+87}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;b \cdot \frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}\\
\mathbf{elif}\;c \leq 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(b - d \cdot \frac{a}{c}\right)\\
\end{array}
\]
Alternative 3 Error 15.8 Cost 7696
\[\begin{array}{l}
t_0 := \frac{\frac{c \cdot b}{d} - a}{d}\\
t_1 := \frac{1}{\mathsf{hypot}\left(c, d\right)}\\
\mathbf{if}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;t_1 \cdot \left(\frac{d}{\frac{c}{a}} - b\right)\\
\mathbf{elif}\;c \leq 10^{-100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;\frac{b - \frac{a}{\frac{c}{d}}}{c}\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(b - d \cdot \frac{a}{c}\right)\\
\end{array}
\]
Alternative 4 Error 16.1 Cost 7240
\[\begin{array}{l}
t_0 := \frac{b - \frac{a}{\frac{c}{d}}}{c}\\
t_1 := \frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{if}\;c \leq -3.0844161161393104 \cdot 10^{+87}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;b \cdot \frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}\\
\mathbf{elif}\;c \leq 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 16.4 Cost 1236
\[\begin{array}{l}
t_0 := \frac{b - \frac{a}{\frac{c}{d}}}{c}\\
t_1 := \frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{if}\;c \leq -3.0844161161393104 \cdot 10^{+87}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;\frac{c \cdot b}{c \cdot c + d \cdot d}\\
\mathbf{elif}\;c \leq 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 6 Error 19.4 Cost 1104
\[\begin{array}{l}
t_0 := \frac{\frac{c \cdot b}{d} - a}{d}\\
\mathbf{if}\;c \leq -3.023733726081535 \cdot 10^{+48}:\\
\;\;\;\;\frac{b}{c}\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{-104}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;a \cdot \frac{-d}{c \cdot c}\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c}\\
\end{array}
\]
Alternative 7 Error 16.8 Cost 1104
\[\begin{array}{l}
t_0 := \frac{\frac{c \cdot b}{d} - a}{d}\\
t_1 := \frac{b - \frac{a}{\frac{c}{d}}}{c}\\
\mathbf{if}\;c \leq -2.900281961986854 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 10^{-100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 8 Error 24.0 Cost 908
\[\begin{array}{l}
t_0 := \frac{-a}{d}\\
\mathbf{if}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;\frac{b}{c}\\
\mathbf{elif}\;c \leq 4.4 \cdot 10^{-105}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;\frac{\left(-a\right) \cdot \frac{d}{c}}{c}\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c}\\
\end{array}
\]
Alternative 9 Error 24.0 Cost 908
\[\begin{array}{l}
t_0 := \frac{-a}{d}\\
\mathbf{if}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;\frac{b}{c}\\
\mathbf{elif}\;c \leq 4.4 \cdot 10^{-105}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 2.810993454941876 \cdot 10^{-65}:\\
\;\;\;\;a \cdot \frac{-d}{c \cdot c}\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c}\\
\end{array}
\]
Alternative 10 Error 23.2 Cost 520
\[\begin{array}{l}
\mathbf{if}\;c \leq -9.004640130169398 \cdot 10^{-22}:\\
\;\;\;\;\frac{b}{c}\\
\mathbf{elif}\;c \leq 1.413535944840097 \cdot 10^{+99}:\\
\;\;\;\;\frac{-a}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c}\\
\end{array}
\]
Alternative 11 Error 37.5 Cost 192
\[\frac{b}{c}
\]