
(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 14 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 (* (/ 1.0 (hypot c d)) (- (* (/ c (hypot c d)) b) (* d (/ a (hypot c d))))))
double code(double a, double b, double c, double d) {
return (1.0 / hypot(c, d)) * (((c / hypot(c, d)) * b) - (d * (a / hypot(c, d))));
}
public static double code(double a, double b, double c, double d) {
return (1.0 / Math.hypot(c, d)) * (((c / Math.hypot(c, d)) * b) - (d * (a / Math.hypot(c, d))));
}
def code(a, b, c, d): return (1.0 / math.hypot(c, d)) * (((c / math.hypot(c, d)) * b) - (d * (a / math.hypot(c, d))))
function code(a, b, c, d) return Float64(Float64(1.0 / hypot(c, d)) * Float64(Float64(Float64(c / hypot(c, d)) * b) - Float64(d * Float64(a / hypot(c, d))))) end
function tmp = code(a, b, c, d) tmp = (1.0 / hypot(c, d)) * (((c / hypot(c, d)) * b) - (d * (a / hypot(c, d)))); end
code[a_, b_, c_, d_] := N[(N[(1.0 / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] - N[(d * N[(a / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(\frac{c}{\mathsf{hypot}\left(c, d\right)} \cdot b - d \cdot \frac{a}{\mathsf{hypot}\left(c, d\right)}\right)
\end{array}
Initial program 65.5%
*-un-lft-identity65.5%
add-sqr-sqrt65.5%
times-frac65.4%
hypot-def65.4%
hypot-def79.7%
Applied egg-rr79.7%
div-sub79.7%
sub-neg79.7%
*-commutative79.7%
associate-/l*89.7%
associate-/l*98.0%
Applied egg-rr98.0%
sub-neg98.0%
associate-/r/99.6%
associate-/r/98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ 1.0 (hypot c d))) (t_1 (- (* c b) (* d a))))
(if (<= (/ t_1 (+ (* c c) (* d d))) 2e+298)
(* t_0 (/ t_1 (hypot c d)))
(* t_0 (- (* (/ c (hypot c d)) b) a)))))
double code(double a, double b, double c, double d) {
double t_0 = 1.0 / hypot(c, d);
double t_1 = (c * b) - (d * a);
double tmp;
if ((t_1 / ((c * c) + (d * d))) <= 2e+298) {
tmp = t_0 * (t_1 / hypot(c, d));
} else {
tmp = t_0 * (((c / hypot(c, d)) * b) - a);
}
return tmp;
}
public static double code(double a, double b, double c, double d) {
double t_0 = 1.0 / Math.hypot(c, d);
double t_1 = (c * b) - (d * a);
double tmp;
if ((t_1 / ((c * c) + (d * d))) <= 2e+298) {
tmp = t_0 * (t_1 / Math.hypot(c, d));
} else {
tmp = t_0 * (((c / Math.hypot(c, d)) * b) - a);
}
return tmp;
}
def code(a, b, c, d): t_0 = 1.0 / math.hypot(c, d) t_1 = (c * b) - (d * a) tmp = 0 if (t_1 / ((c * c) + (d * d))) <= 2e+298: tmp = t_0 * (t_1 / math.hypot(c, d)) else: tmp = t_0 * (((c / math.hypot(c, d)) * b) - a) return tmp
function code(a, b, c, d) t_0 = Float64(1.0 / hypot(c, d)) t_1 = Float64(Float64(c * b) - Float64(d * a)) tmp = 0.0 if (Float64(t_1 / Float64(Float64(c * c) + Float64(d * d))) <= 2e+298) tmp = Float64(t_0 * Float64(t_1 / hypot(c, d))); else tmp = Float64(t_0 * Float64(Float64(Float64(c / hypot(c, d)) * b) - a)); end return tmp end
function tmp_2 = code(a, b, c, d) t_0 = 1.0 / hypot(c, d); t_1 = (c * b) - (d * a); tmp = 0.0; if ((t_1 / ((c * c) + (d * d))) <= 2e+298) tmp = t_0 * (t_1 / hypot(c, d)); else tmp = t_0 * (((c / hypot(c, d)) * b) - a); end tmp_2 = tmp; end
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[(N[(c * b), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+298], N[(t$95$0 * N[(t$95$1 / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[(c / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\mathsf{hypot}\left(c, d\right)}\\
t_1 := c \cdot b - d \cdot a\\
\mathbf{if}\;\frac{t_1}{c \cdot c + d \cdot d} \leq 2 \cdot 10^{+298}:\\
\;\;\;\;t_0 \cdot \frac{t_1}{\mathsf{hypot}\left(c, d\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\frac{c}{\mathsf{hypot}\left(c, d\right)} \cdot b - a\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 b c) (*.f64 a d)) (+.f64 (*.f64 c c) (*.f64 d d))) < 1.9999999999999999e298Initial program 78.9%
*-un-lft-identity78.9%
add-sqr-sqrt78.9%
times-frac78.8%
hypot-def78.8%
hypot-def95.0%
Applied egg-rr95.0%
if 1.9999999999999999e298 < (/.f64 (-.f64 (*.f64 b c) (*.f64 a d)) (+.f64 (*.f64 c c) (*.f64 d d))) Initial program 14.0%
*-un-lft-identity14.0%
add-sqr-sqrt14.0%
times-frac14.0%
hypot-def14.0%
hypot-def21.2%
Applied egg-rr21.2%
div-sub21.2%
sub-neg21.2%
*-commutative21.2%
associate-/l*61.3%
associate-/l*95.9%
Applied egg-rr95.9%
sub-neg95.9%
associate-/r/99.4%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in c around 0 69.7%
Final simplification89.8%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ (- (* c b) (* d a)) (+ (* c c) (* d d)))))
(if (<= c -8.5e+80)
(/ b (* (hypot c d) (/ (hypot c d) c)))
(if (<= c -2.05e-160)
t_0
(if (<= c 1.2e-116)
(* (/ 1.0 d) (- (/ b (/ d c)) a))
(if (<= c 1.75e-62)
t_0
(if (<= c 1.15e+18)
(* (/ 1.0 d) (- (/ (* c b) d) a))
(* (/ 1.0 (hypot c d)) (- b (* d (/ a (hypot c d))))))))))))
double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -8.5e+80) {
tmp = b / (hypot(c, d) * (hypot(c, d) / c));
} else if (c <= -2.05e-160) {
tmp = t_0;
} else if (c <= 1.2e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 1.75e-62) {
tmp = t_0;
} else if (c <= 1.15e+18) {
tmp = (1.0 / d) * (((c * b) / d) - a);
} else {
tmp = (1.0 / hypot(c, d)) * (b - (d * (a / hypot(c, d))));
}
return tmp;
}
public static double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -8.5e+80) {
tmp = b / (Math.hypot(c, d) * (Math.hypot(c, d) / c));
} else if (c <= -2.05e-160) {
tmp = t_0;
} else if (c <= 1.2e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 1.75e-62) {
tmp = t_0;
} else if (c <= 1.15e+18) {
tmp = (1.0 / d) * (((c * b) / d) - a);
} else {
tmp = (1.0 / Math.hypot(c, d)) * (b - (d * (a / Math.hypot(c, d))));
}
return tmp;
}
def code(a, b, c, d): t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)) tmp = 0 if c <= -8.5e+80: tmp = b / (math.hypot(c, d) * (math.hypot(c, d) / c)) elif c <= -2.05e-160: tmp = t_0 elif c <= 1.2e-116: tmp = (1.0 / d) * ((b / (d / c)) - a) elif c <= 1.75e-62: tmp = t_0 elif c <= 1.15e+18: tmp = (1.0 / d) * (((c * b) / d) - a) else: tmp = (1.0 / math.hypot(c, d)) * (b - (d * (a / math.hypot(c, d)))) return tmp
function code(a, b, c, d) t_0 = Float64(Float64(Float64(c * b) - Float64(d * a)) / Float64(Float64(c * c) + Float64(d * d))) tmp = 0.0 if (c <= -8.5e+80) tmp = Float64(b / Float64(hypot(c, d) * Float64(hypot(c, d) / c))); elseif (c <= -2.05e-160) tmp = t_0; elseif (c <= 1.2e-116) tmp = Float64(Float64(1.0 / d) * Float64(Float64(b / Float64(d / c)) - a)); elseif (c <= 1.75e-62) tmp = t_0; elseif (c <= 1.15e+18) tmp = Float64(Float64(1.0 / d) * Float64(Float64(Float64(c * b) / d) - a)); else tmp = Float64(Float64(1.0 / hypot(c, d)) * Float64(b - Float64(d * Float64(a / hypot(c, d))))); end return tmp end
function tmp_2 = code(a, b, c, d) t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)); tmp = 0.0; if (c <= -8.5e+80) tmp = b / (hypot(c, d) * (hypot(c, d) / c)); elseif (c <= -2.05e-160) tmp = t_0; elseif (c <= 1.2e-116) tmp = (1.0 / d) * ((b / (d / c)) - a); elseif (c <= 1.75e-62) tmp = t_0; elseif (c <= 1.15e+18) tmp = (1.0 / d) * (((c * b) / d) - a); else tmp = (1.0 / hypot(c, d)) * (b - (d * (a / hypot(c, d)))); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(c * b), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8.5e+80], N[(b / N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] * N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.05e-160], t$95$0, If[LessEqual[c, 1.2e-116], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(b / N[(d / c), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.75e-62], t$95$0, If[LessEqual[c, 1.15e+18], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision] * N[(b - N[(d * N[(a / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c \cdot b - d \cdot a}{c \cdot c + d \cdot d}\\
\mathbf{if}\;c \leq -8.5 \cdot 10^{+80}:\\
\;\;\;\;\frac{b}{\mathsf{hypot}\left(c, d\right) \cdot \frac{\mathsf{hypot}\left(c, d\right)}{c}}\\
\mathbf{elif}\;c \leq -2.05 \cdot 10^{-160}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 1.2 \cdot 10^{-116}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{b}{\frac{d}{c}} - a\right)\\
\mathbf{elif}\;c \leq 1.75 \cdot 10^{-62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 1.15 \cdot 10^{+18}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{c \cdot b}{d} - a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(b - d \cdot \frac{a}{\mathsf{hypot}\left(c, d\right)}\right)\\
\end{array}
\end{array}
if c < -8.50000000000000007e80Initial program 45.6%
Taylor expanded in b around inf 41.9%
associate-/l*48.8%
+-commutative48.8%
unpow248.8%
fma-udef48.8%
Simplified48.8%
fma-udef48.8%
+-commutative48.8%
add-sqr-sqrt48.8%
pow248.8%
hypot-udef48.8%
pow248.8%
hypot-udef48.8%
*-un-lft-identity48.8%
times-frac92.1%
/-rgt-identity92.1%
Applied egg-rr92.1%
if -8.50000000000000007e80 < c < -2.05000000000000001e-160 or 1.19999999999999996e-116 < c < 1.7500000000000001e-62Initial program 85.2%
if -2.05000000000000001e-160 < c < 1.19999999999999996e-116Initial program 74.2%
*-un-lft-identity74.2%
add-sqr-sqrt74.2%
times-frac74.2%
hypot-def74.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 45.0%
Taylor expanded in c around 0 95.0%
neg-mul-195.0%
+-commutative95.0%
unsub-neg95.0%
associate-/l*95.0%
Simplified95.0%
if 1.7500000000000001e-62 < c < 1.15e18Initial program 70.3%
*-un-lft-identity70.3%
add-sqr-sqrt70.3%
times-frac70.3%
hypot-def70.4%
hypot-def87.0%
Applied egg-rr87.0%
Taylor expanded in c around 0 42.5%
Taylor expanded in c around 0 80.4%
if 1.15e18 < c Initial program 49.4%
*-un-lft-identity49.4%
add-sqr-sqrt49.4%
times-frac49.4%
hypot-def49.4%
hypot-def63.6%
Applied egg-rr63.6%
div-sub63.6%
sub-neg63.6%
*-commutative63.6%
associate-/l*87.9%
associate-/l*99.3%
Applied egg-rr99.3%
sub-neg99.3%
associate-/r/99.7%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in c around inf 93.4%
Final simplification90.3%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ (- (* c b) (* d a)) (+ (* c c) (* d d)))))
(if (<= c -2.15e+80)
(/ b (* (hypot c d) (/ (hypot c d) c)))
(if (<= c -2.05e-160)
t_0
(if (<= c 3e-116)
(* (/ 1.0 d) (- (/ b (/ d c)) a))
(if (<= c 1.6e-61)
t_0
(if (<= c 1.15e+18)
(* (/ 1.0 d) (- (/ (* c b) d) a))
(* (/ 1.0 (hypot c d)) (- b (/ a (/ (hypot c d) d)))))))))))
double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -2.15e+80) {
tmp = b / (hypot(c, d) * (hypot(c, d) / c));
} else if (c <= -2.05e-160) {
tmp = t_0;
} else if (c <= 3e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 1.6e-61) {
tmp = t_0;
} else if (c <= 1.15e+18) {
tmp = (1.0 / d) * (((c * b) / d) - a);
} else {
tmp = (1.0 / hypot(c, d)) * (b - (a / (hypot(c, d) / d)));
}
return tmp;
}
public static double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -2.15e+80) {
tmp = b / (Math.hypot(c, d) * (Math.hypot(c, d) / c));
} else if (c <= -2.05e-160) {
tmp = t_0;
} else if (c <= 3e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 1.6e-61) {
tmp = t_0;
} else if (c <= 1.15e+18) {
tmp = (1.0 / d) * (((c * b) / d) - a);
} else {
tmp = (1.0 / Math.hypot(c, d)) * (b - (a / (Math.hypot(c, d) / d)));
}
return tmp;
}
def code(a, b, c, d): t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)) tmp = 0 if c <= -2.15e+80: tmp = b / (math.hypot(c, d) * (math.hypot(c, d) / c)) elif c <= -2.05e-160: tmp = t_0 elif c <= 3e-116: tmp = (1.0 / d) * ((b / (d / c)) - a) elif c <= 1.6e-61: tmp = t_0 elif c <= 1.15e+18: tmp = (1.0 / d) * (((c * b) / d) - a) else: tmp = (1.0 / math.hypot(c, d)) * (b - (a / (math.hypot(c, d) / d))) return tmp
function code(a, b, c, d) t_0 = Float64(Float64(Float64(c * b) - Float64(d * a)) / Float64(Float64(c * c) + Float64(d * d))) tmp = 0.0 if (c <= -2.15e+80) tmp = Float64(b / Float64(hypot(c, d) * Float64(hypot(c, d) / c))); elseif (c <= -2.05e-160) tmp = t_0; elseif (c <= 3e-116) tmp = Float64(Float64(1.0 / d) * Float64(Float64(b / Float64(d / c)) - a)); elseif (c <= 1.6e-61) tmp = t_0; elseif (c <= 1.15e+18) tmp = Float64(Float64(1.0 / d) * Float64(Float64(Float64(c * b) / d) - a)); else tmp = Float64(Float64(1.0 / hypot(c, d)) * Float64(b - Float64(a / Float64(hypot(c, d) / d)))); end return tmp end
function tmp_2 = code(a, b, c, d) t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)); tmp = 0.0; if (c <= -2.15e+80) tmp = b / (hypot(c, d) * (hypot(c, d) / c)); elseif (c <= -2.05e-160) tmp = t_0; elseif (c <= 3e-116) tmp = (1.0 / d) * ((b / (d / c)) - a); elseif (c <= 1.6e-61) tmp = t_0; elseif (c <= 1.15e+18) tmp = (1.0 / d) * (((c * b) / d) - a); else tmp = (1.0 / hypot(c, d)) * (b - (a / (hypot(c, d) / d))); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(c * b), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.15e+80], N[(b / N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] * N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.05e-160], t$95$0, If[LessEqual[c, 3e-116], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(b / N[(d / c), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.6e-61], t$95$0, If[LessEqual[c, 1.15e+18], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision] * N[(b - N[(a / N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c \cdot b - d \cdot a}{c \cdot c + d \cdot d}\\
\mathbf{if}\;c \leq -2.15 \cdot 10^{+80}:\\
\;\;\;\;\frac{b}{\mathsf{hypot}\left(c, d\right) \cdot \frac{\mathsf{hypot}\left(c, d\right)}{c}}\\
\mathbf{elif}\;c \leq -2.05 \cdot 10^{-160}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 3 \cdot 10^{-116}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{b}{\frac{d}{c}} - a\right)\\
\mathbf{elif}\;c \leq 1.6 \cdot 10^{-61}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 1.15 \cdot 10^{+18}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{c \cdot b}{d} - a\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(b - \frac{a}{\frac{\mathsf{hypot}\left(c, d\right)}{d}}\right)\\
\end{array}
\end{array}
if c < -2.15000000000000002e80Initial program 45.6%
Taylor expanded in b around inf 41.9%
associate-/l*48.8%
+-commutative48.8%
unpow248.8%
fma-udef48.8%
Simplified48.8%
fma-udef48.8%
+-commutative48.8%
add-sqr-sqrt48.8%
pow248.8%
hypot-udef48.8%
pow248.8%
hypot-udef48.8%
*-un-lft-identity48.8%
times-frac92.1%
/-rgt-identity92.1%
Applied egg-rr92.1%
if -2.15000000000000002e80 < c < -2.05000000000000001e-160 or 3.00000000000000026e-116 < c < 1.6000000000000001e-61Initial program 85.2%
if -2.05000000000000001e-160 < c < 3.00000000000000026e-116Initial program 74.2%
*-un-lft-identity74.2%
add-sqr-sqrt74.2%
times-frac74.2%
hypot-def74.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 45.0%
Taylor expanded in c around 0 95.0%
neg-mul-195.0%
+-commutative95.0%
unsub-neg95.0%
associate-/l*95.0%
Simplified95.0%
if 1.6000000000000001e-61 < c < 1.15e18Initial program 70.3%
*-un-lft-identity70.3%
add-sqr-sqrt70.3%
times-frac70.3%
hypot-def70.4%
hypot-def87.0%
Applied egg-rr87.0%
Taylor expanded in c around 0 42.5%
Taylor expanded in c around 0 80.4%
if 1.15e18 < c Initial program 49.4%
*-un-lft-identity49.4%
add-sqr-sqrt49.4%
times-frac49.4%
hypot-def49.4%
hypot-def63.6%
Applied egg-rr63.6%
div-sub63.6%
*-commutative63.6%
associate-/l*87.9%
associate-/l*99.3%
Applied egg-rr99.3%
Taylor expanded in c around inf 93.4%
Final simplification90.3%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ (- (* c b) (* d a)) (+ (* c c) (* d d)))))
(if (<= c -1e+81)
(/ b (* (hypot c d) (/ (hypot c d) c)))
(if (<= c -1.95e-160)
t_0
(if (<= c 3e-116)
(* (/ 1.0 d) (- (/ b (/ d c)) a))
(if (<= c 4.3e+117)
t_0
(* (/ 1.0 (hypot c d)) (- b (/ a (/ c d))))))))))
double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -1e+81) {
tmp = b / (hypot(c, d) * (hypot(c, d) / c));
} else if (c <= -1.95e-160) {
tmp = t_0;
} else if (c <= 3e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 4.3e+117) {
tmp = t_0;
} else {
tmp = (1.0 / hypot(c, d)) * (b - (a / (c / d)));
}
return tmp;
}
public static double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -1e+81) {
tmp = b / (Math.hypot(c, d) * (Math.hypot(c, d) / c));
} else if (c <= -1.95e-160) {
tmp = t_0;
} else if (c <= 3e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 4.3e+117) {
tmp = t_0;
} else {
tmp = (1.0 / Math.hypot(c, d)) * (b - (a / (c / d)));
}
return tmp;
}
def code(a, b, c, d): t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)) tmp = 0 if c <= -1e+81: tmp = b / (math.hypot(c, d) * (math.hypot(c, d) / c)) elif c <= -1.95e-160: tmp = t_0 elif c <= 3e-116: tmp = (1.0 / d) * ((b / (d / c)) - a) elif c <= 4.3e+117: tmp = t_0 else: tmp = (1.0 / math.hypot(c, d)) * (b - (a / (c / d))) return tmp
function code(a, b, c, d) t_0 = Float64(Float64(Float64(c * b) - Float64(d * a)) / Float64(Float64(c * c) + Float64(d * d))) tmp = 0.0 if (c <= -1e+81) tmp = Float64(b / Float64(hypot(c, d) * Float64(hypot(c, d) / c))); elseif (c <= -1.95e-160) tmp = t_0; elseif (c <= 3e-116) tmp = Float64(Float64(1.0 / d) * Float64(Float64(b / Float64(d / c)) - a)); elseif (c <= 4.3e+117) tmp = t_0; else tmp = Float64(Float64(1.0 / hypot(c, d)) * Float64(b - Float64(a / Float64(c / d)))); end return tmp end
function tmp_2 = code(a, b, c, d) t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)); tmp = 0.0; if (c <= -1e+81) tmp = b / (hypot(c, d) * (hypot(c, d) / c)); elseif (c <= -1.95e-160) tmp = t_0; elseif (c <= 3e-116) tmp = (1.0 / d) * ((b / (d / c)) - a); elseif (c <= 4.3e+117) tmp = t_0; else tmp = (1.0 / hypot(c, d)) * (b - (a / (c / d))); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(c * b), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1e+81], N[(b / N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] * N[(N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.95e-160], t$95$0, If[LessEqual[c, 3e-116], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(b / N[(d / c), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.3e+117], t$95$0, N[(N[(1.0 / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision] * N[(b - N[(a / N[(c / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c \cdot b - d \cdot a}{c \cdot c + d \cdot d}\\
\mathbf{if}\;c \leq -1 \cdot 10^{+81}:\\
\;\;\;\;\frac{b}{\mathsf{hypot}\left(c, d\right) \cdot \frac{\mathsf{hypot}\left(c, d\right)}{c}}\\
\mathbf{elif}\;c \leq -1.95 \cdot 10^{-160}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 3 \cdot 10^{-116}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{b}{\frac{d}{c}} - a\right)\\
\mathbf{elif}\;c \leq 4.3 \cdot 10^{+117}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(b - \frac{a}{\frac{c}{d}}\right)\\
\end{array}
\end{array}
if c < -9.99999999999999921e80Initial program 45.6%
Taylor expanded in b around inf 41.9%
associate-/l*48.8%
+-commutative48.8%
unpow248.8%
fma-udef48.8%
Simplified48.8%
fma-udef48.8%
+-commutative48.8%
add-sqr-sqrt48.8%
pow248.8%
hypot-udef48.8%
pow248.8%
hypot-udef48.8%
*-un-lft-identity48.8%
times-frac92.1%
/-rgt-identity92.1%
Applied egg-rr92.1%
if -9.99999999999999921e80 < c < -1.94999999999999995e-160 or 3.00000000000000026e-116 < c < 4.29999999999999998e117Initial program 80.8%
if -1.94999999999999995e-160 < c < 3.00000000000000026e-116Initial program 74.2%
*-un-lft-identity74.2%
add-sqr-sqrt74.2%
times-frac74.2%
hypot-def74.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 45.0%
Taylor expanded in c around 0 95.0%
neg-mul-195.0%
+-commutative95.0%
unsub-neg95.0%
associate-/l*95.0%
Simplified95.0%
if 4.29999999999999998e117 < c Initial program 29.1%
*-un-lft-identity29.1%
add-sqr-sqrt29.1%
times-frac29.1%
hypot-def29.1%
hypot-def50.1%
Applied egg-rr50.1%
Taylor expanded in c around inf 88.5%
mul-1-neg88.5%
unsub-neg88.5%
associate-/l*90.8%
Simplified90.8%
Final simplification87.6%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ (- (* c b) (* d a)) (+ (* c c) (* d d)))))
(if (<= c -7e+133)
(- (/ b c) (* d (/ (/ a c) c)))
(if (<= c -2.75e-160)
t_0
(if (<= c 1.18e-116)
(* (/ 1.0 d) (- (/ b (/ d c)) a))
(if (<= c 2.6e+120)
t_0
(* (/ 1.0 (hypot c d)) (- b (/ a (/ c d))))))))))
double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -7e+133) {
tmp = (b / c) - (d * ((a / c) / c));
} else if (c <= -2.75e-160) {
tmp = t_0;
} else if (c <= 1.18e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 2.6e+120) {
tmp = t_0;
} else {
tmp = (1.0 / hypot(c, d)) * (b - (a / (c / d)));
}
return tmp;
}
public static double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -7e+133) {
tmp = (b / c) - (d * ((a / c) / c));
} else if (c <= -2.75e-160) {
tmp = t_0;
} else if (c <= 1.18e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 2.6e+120) {
tmp = t_0;
} else {
tmp = (1.0 / Math.hypot(c, d)) * (b - (a / (c / d)));
}
return tmp;
}
def code(a, b, c, d): t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)) tmp = 0 if c <= -7e+133: tmp = (b / c) - (d * ((a / c) / c)) elif c <= -2.75e-160: tmp = t_0 elif c <= 1.18e-116: tmp = (1.0 / d) * ((b / (d / c)) - a) elif c <= 2.6e+120: tmp = t_0 else: tmp = (1.0 / math.hypot(c, d)) * (b - (a / (c / d))) return tmp
function code(a, b, c, d) t_0 = Float64(Float64(Float64(c * b) - Float64(d * a)) / Float64(Float64(c * c) + Float64(d * d))) tmp = 0.0 if (c <= -7e+133) tmp = Float64(Float64(b / c) - Float64(d * Float64(Float64(a / c) / c))); elseif (c <= -2.75e-160) tmp = t_0; elseif (c <= 1.18e-116) tmp = Float64(Float64(1.0 / d) * Float64(Float64(b / Float64(d / c)) - a)); elseif (c <= 2.6e+120) tmp = t_0; else tmp = Float64(Float64(1.0 / hypot(c, d)) * Float64(b - Float64(a / Float64(c / d)))); end return tmp end
function tmp_2 = code(a, b, c, d) t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)); tmp = 0.0; if (c <= -7e+133) tmp = (b / c) - (d * ((a / c) / c)); elseif (c <= -2.75e-160) tmp = t_0; elseif (c <= 1.18e-116) tmp = (1.0 / d) * ((b / (d / c)) - a); elseif (c <= 2.6e+120) tmp = t_0; else tmp = (1.0 / hypot(c, d)) * (b - (a / (c / d))); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(c * b), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -7e+133], N[(N[(b / c), $MachinePrecision] - N[(d * N[(N[(a / c), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.75e-160], t$95$0, If[LessEqual[c, 1.18e-116], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(b / N[(d / c), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.6e+120], t$95$0, N[(N[(1.0 / N[Sqrt[c ^ 2 + d ^ 2], $MachinePrecision]), $MachinePrecision] * N[(b - N[(a / N[(c / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c \cdot b - d \cdot a}{c \cdot c + d \cdot d}\\
\mathbf{if}\;c \leq -7 \cdot 10^{+133}:\\
\;\;\;\;\frac{b}{c} - d \cdot \frac{\frac{a}{c}}{c}\\
\mathbf{elif}\;c \leq -2.75 \cdot 10^{-160}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 1.18 \cdot 10^{-116}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{b}{\frac{d}{c}} - a\right)\\
\mathbf{elif}\;c \leq 2.6 \cdot 10^{+120}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(c, d\right)} \cdot \left(b - \frac{a}{\frac{c}{d}}\right)\\
\end{array}
\end{array}
if c < -6.9999999999999997e133Initial program 35.9%
Taylor expanded in c around inf 93.5%
+-commutative93.5%
mul-1-neg93.5%
unsub-neg93.5%
associate-/l*96.1%
associate-/r/96.1%
Simplified96.1%
*-un-lft-identity96.1%
pow296.1%
times-frac96.3%
Applied egg-rr96.3%
associate-*l/96.3%
*-lft-identity96.3%
Simplified96.3%
if -6.9999999999999997e133 < c < -2.75e-160 or 1.1800000000000001e-116 < c < 2.5999999999999999e120Initial program 80.3%
if -2.75e-160 < c < 1.1800000000000001e-116Initial program 74.2%
*-un-lft-identity74.2%
add-sqr-sqrt74.2%
times-frac74.2%
hypot-def74.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 45.0%
Taylor expanded in c around 0 95.0%
neg-mul-195.0%
+-commutative95.0%
unsub-neg95.0%
associate-/l*95.0%
Simplified95.0%
if 2.5999999999999999e120 < c Initial program 29.1%
*-un-lft-identity29.1%
add-sqr-sqrt29.1%
times-frac29.1%
hypot-def29.1%
hypot-def50.1%
Applied egg-rr50.1%
Taylor expanded in c around inf 88.5%
mul-1-neg88.5%
unsub-neg88.5%
associate-/l*90.8%
Simplified90.8%
Final simplification87.5%
(FPCore (a b c d)
:precision binary64
(let* ((t_0 (/ (- (* c b) (* d a)) (+ (* c c) (* d d)))))
(if (<= c -6.5e+133)
(- (/ b c) (* d (/ (/ a c) c)))
(if (<= c -6.2e-161)
t_0
(if (<= c 3.2e-116)
(* (/ 1.0 d) (- (/ b (/ d c)) a))
(if (<= c 4.8e+117) t_0 (- (/ b c) (/ (/ (* d a) c) c))))))))
double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -6.5e+133) {
tmp = (b / c) - (d * ((a / c) / c));
} else if (c <= -6.2e-161) {
tmp = t_0;
} else if (c <= 3.2e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 4.8e+117) {
tmp = t_0;
} else {
tmp = (b / c) - (((d * a) / c) / 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) - (d * a)) / ((c * c) + (d * d))
if (c <= (-6.5d+133)) then
tmp = (b / c) - (d * ((a / c) / c))
else if (c <= (-6.2d-161)) then
tmp = t_0
else if (c <= 3.2d-116) then
tmp = (1.0d0 / d) * ((b / (d / c)) - a)
else if (c <= 4.8d+117) then
tmp = t_0
else
tmp = (b / c) - (((d * a) / c) / c)
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d));
double tmp;
if (c <= -6.5e+133) {
tmp = (b / c) - (d * ((a / c) / c));
} else if (c <= -6.2e-161) {
tmp = t_0;
} else if (c <= 3.2e-116) {
tmp = (1.0 / d) * ((b / (d / c)) - a);
} else if (c <= 4.8e+117) {
tmp = t_0;
} else {
tmp = (b / c) - (((d * a) / c) / c);
}
return tmp;
}
def code(a, b, c, d): t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)) tmp = 0 if c <= -6.5e+133: tmp = (b / c) - (d * ((a / c) / c)) elif c <= -6.2e-161: tmp = t_0 elif c <= 3.2e-116: tmp = (1.0 / d) * ((b / (d / c)) - a) elif c <= 4.8e+117: tmp = t_0 else: tmp = (b / c) - (((d * a) / c) / c) return tmp
function code(a, b, c, d) t_0 = Float64(Float64(Float64(c * b) - Float64(d * a)) / Float64(Float64(c * c) + Float64(d * d))) tmp = 0.0 if (c <= -6.5e+133) tmp = Float64(Float64(b / c) - Float64(d * Float64(Float64(a / c) / c))); elseif (c <= -6.2e-161) tmp = t_0; elseif (c <= 3.2e-116) tmp = Float64(Float64(1.0 / d) * Float64(Float64(b / Float64(d / c)) - a)); elseif (c <= 4.8e+117) tmp = t_0; else tmp = Float64(Float64(b / c) - Float64(Float64(Float64(d * a) / c) / c)); end return tmp end
function tmp_2 = code(a, b, c, d) t_0 = ((c * b) - (d * a)) / ((c * c) + (d * d)); tmp = 0.0; if (c <= -6.5e+133) tmp = (b / c) - (d * ((a / c) / c)); elseif (c <= -6.2e-161) tmp = t_0; elseif (c <= 3.2e-116) tmp = (1.0 / d) * ((b / (d / c)) - a); elseif (c <= 4.8e+117) tmp = t_0; else tmp = (b / c) - (((d * a) / c) / c); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(c * b), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.5e+133], N[(N[(b / c), $MachinePrecision] - N[(d * N[(N[(a / c), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -6.2e-161], t$95$0, If[LessEqual[c, 3.2e-116], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(b / N[(d / c), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.8e+117], t$95$0, N[(N[(b / c), $MachinePrecision] - N[(N[(N[(d * a), $MachinePrecision] / c), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c \cdot b - d \cdot a}{c \cdot c + d \cdot d}\\
\mathbf{if}\;c \leq -6.5 \cdot 10^{+133}:\\
\;\;\;\;\frac{b}{c} - d \cdot \frac{\frac{a}{c}}{c}\\
\mathbf{elif}\;c \leq -6.2 \cdot 10^{-161}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c \leq 3.2 \cdot 10^{-116}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{b}{\frac{d}{c}} - a\right)\\
\mathbf{elif}\;c \leq 4.8 \cdot 10^{+117}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c} - \frac{\frac{d \cdot a}{c}}{c}\\
\end{array}
\end{array}
if c < -6.5000000000000004e133Initial program 35.9%
Taylor expanded in c around inf 93.5%
+-commutative93.5%
mul-1-neg93.5%
unsub-neg93.5%
associate-/l*96.1%
associate-/r/96.1%
Simplified96.1%
*-un-lft-identity96.1%
pow296.1%
times-frac96.3%
Applied egg-rr96.3%
associate-*l/96.3%
*-lft-identity96.3%
Simplified96.3%
if -6.5000000000000004e133 < c < -6.1999999999999997e-161 or 3.20000000000000009e-116 < c < 4.7999999999999998e117Initial program 80.3%
if -6.1999999999999997e-161 < c < 3.20000000000000009e-116Initial program 74.2%
*-un-lft-identity74.2%
add-sqr-sqrt74.2%
times-frac74.2%
hypot-def74.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 45.0%
Taylor expanded in c around 0 95.0%
neg-mul-195.0%
+-commutative95.0%
unsub-neg95.0%
associate-/l*95.0%
Simplified95.0%
if 4.7999999999999998e117 < c Initial program 29.1%
Taylor expanded in c around inf 81.6%
+-commutative81.6%
mul-1-neg81.6%
unsub-neg81.6%
associate-/l*83.5%
associate-/r/83.5%
Simplified83.5%
associate-*l/81.6%
pow281.6%
associate-/r*88.8%
Applied egg-rr88.8%
Final simplification87.2%
(FPCore (a b c d) :precision binary64 (if (or (<= c -3.9e-14) (not (<= c 2.7e+18))) (/ b c) (* (/ 1.0 d) (- (* c (/ b d)) a))))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -3.9e-14) || !(c <= 2.7e+18)) {
tmp = b / c;
} else {
tmp = (1.0 / d) * ((c * (b / d)) - a);
}
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.9d-14)) .or. (.not. (c <= 2.7d+18))) then
tmp = b / c
else
tmp = (1.0d0 / d) * ((c * (b / d)) - a)
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -3.9e-14) || !(c <= 2.7e+18)) {
tmp = b / c;
} else {
tmp = (1.0 / d) * ((c * (b / d)) - a);
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -3.9e-14) or not (c <= 2.7e+18): tmp = b / c else: tmp = (1.0 / d) * ((c * (b / d)) - a) return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -3.9e-14) || !(c <= 2.7e+18)) tmp = Float64(b / c); else tmp = Float64(Float64(1.0 / d) * Float64(Float64(c * Float64(b / d)) - a)); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -3.9e-14) || ~((c <= 2.7e+18))) tmp = b / c; else tmp = (1.0 / d) * ((c * (b / d)) - a); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -3.9e-14], N[Not[LessEqual[c, 2.7e+18]], $MachinePrecision]], N[(b / c), $MachinePrecision], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(c * N[(b / d), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.9 \cdot 10^{-14} \lor \neg \left(c \leq 2.7 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{b}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{d} \cdot \left(c \cdot \frac{b}{d} - a\right)\\
\end{array}
\end{array}
if c < -3.8999999999999998e-14 or 2.7e18 < c Initial program 52.8%
Taylor expanded in c around inf 76.8%
if -3.8999999999999998e-14 < c < 2.7e18Initial program 77.3%
*-un-lft-identity77.3%
add-sqr-sqrt77.3%
times-frac77.2%
hypot-def77.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 40.8%
Taylor expanded in c around 0 79.2%
+-commutative79.2%
mul-1-neg79.2%
unsub-neg79.2%
div-inv79.1%
*-commutative79.1%
associate-*l*77.1%
div-inv77.2%
Applied egg-rr77.2%
Final simplification77.0%
(FPCore (a b c d) :precision binary64 (if (or (<= c -3.9e-14) (not (<= c 5.5e+18))) (/ b c) (* (/ 1.0 d) (- (/ b (/ d c)) a))))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -3.9e-14) || !(c <= 5.5e+18)) {
tmp = b / c;
} else {
tmp = (1.0 / d) * ((b / (d / c)) - a);
}
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.9d-14)) .or. (.not. (c <= 5.5d+18))) then
tmp = b / c
else
tmp = (1.0d0 / d) * ((b / (d / c)) - a)
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -3.9e-14) || !(c <= 5.5e+18)) {
tmp = b / c;
} else {
tmp = (1.0 / d) * ((b / (d / c)) - a);
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -3.9e-14) or not (c <= 5.5e+18): tmp = b / c else: tmp = (1.0 / d) * ((b / (d / c)) - a) return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -3.9e-14) || !(c <= 5.5e+18)) tmp = Float64(b / c); else tmp = Float64(Float64(1.0 / d) * Float64(Float64(b / Float64(d / c)) - a)); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -3.9e-14) || ~((c <= 5.5e+18))) tmp = b / c; else tmp = (1.0 / d) * ((b / (d / c)) - a); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -3.9e-14], N[Not[LessEqual[c, 5.5e+18]], $MachinePrecision]], N[(b / c), $MachinePrecision], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(b / N[(d / c), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.9 \cdot 10^{-14} \lor \neg \left(c \leq 5.5 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{b}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{b}{\frac{d}{c}} - a\right)\\
\end{array}
\end{array}
if c < -3.8999999999999998e-14 or 5.5e18 < c Initial program 52.8%
Taylor expanded in c around inf 76.8%
if -3.8999999999999998e-14 < c < 5.5e18Initial program 77.3%
*-un-lft-identity77.3%
add-sqr-sqrt77.3%
times-frac77.2%
hypot-def77.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 40.8%
Taylor expanded in c around 0 79.2%
neg-mul-179.2%
+-commutative79.2%
unsub-neg79.2%
associate-/l*79.2%
Simplified79.2%
Final simplification78.0%
(FPCore (a b c d) :precision binary64 (if (or (<= c -1.62e-15) (not (<= c 1.2e+18))) (- (/ b c) (* d (/ (/ a c) c))) (* (/ 1.0 d) (- (/ b (/ d c)) a))))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -1.62e-15) || !(c <= 1.2e+18)) {
tmp = (b / c) - (d * ((a / c) / c));
} else {
tmp = (1.0 / d) * ((b / (d / c)) - a);
}
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.62d-15)) .or. (.not. (c <= 1.2d+18))) then
tmp = (b / c) - (d * ((a / c) / c))
else
tmp = (1.0d0 / d) * ((b / (d / c)) - a)
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -1.62e-15) || !(c <= 1.2e+18)) {
tmp = (b / c) - (d * ((a / c) / c));
} else {
tmp = (1.0 / d) * ((b / (d / c)) - a);
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -1.62e-15) or not (c <= 1.2e+18): tmp = (b / c) - (d * ((a / c) / c)) else: tmp = (1.0 / d) * ((b / (d / c)) - a) return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -1.62e-15) || !(c <= 1.2e+18)) tmp = Float64(Float64(b / c) - Float64(d * Float64(Float64(a / c) / c))); else tmp = Float64(Float64(1.0 / d) * Float64(Float64(b / Float64(d / c)) - a)); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -1.62e-15) || ~((c <= 1.2e+18))) tmp = (b / c) - (d * ((a / c) / c)); else tmp = (1.0 / d) * ((b / (d / c)) - a); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -1.62e-15], N[Not[LessEqual[c, 1.2e+18]], $MachinePrecision]], N[(N[(b / c), $MachinePrecision] - N[(d * N[(N[(a / c), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(b / N[(d / c), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.62 \cdot 10^{-15} \lor \neg \left(c \leq 1.2 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{b}{c} - d \cdot \frac{\frac{a}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{b}{\frac{d}{c}} - a\right)\\
\end{array}
\end{array}
if c < -1.62000000000000009e-15 or 1.2e18 < c Initial program 52.8%
Taylor expanded in c around inf 78.2%
+-commutative78.2%
mul-1-neg78.2%
unsub-neg78.2%
associate-/l*79.6%
associate-/r/80.4%
Simplified80.4%
*-un-lft-identity80.4%
pow280.4%
times-frac81.9%
Applied egg-rr81.9%
associate-*l/81.9%
*-lft-identity81.9%
Simplified81.9%
if -1.62000000000000009e-15 < c < 1.2e18Initial program 77.3%
*-un-lft-identity77.3%
add-sqr-sqrt77.3%
times-frac77.2%
hypot-def77.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 40.8%
Taylor expanded in c around 0 79.2%
neg-mul-179.2%
+-commutative79.2%
unsub-neg79.2%
associate-/l*79.2%
Simplified79.2%
Final simplification80.5%
(FPCore (a b c d) :precision binary64 (if (or (<= c -1.36e-14) (not (<= c 2.7e+18))) (- (/ b c) (* d (/ (/ a c) c))) (* (/ 1.0 d) (- (/ (* c b) d) a))))
double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -1.36e-14) || !(c <= 2.7e+18)) {
tmp = (b / c) - (d * ((a / c) / c));
} else {
tmp = (1.0 / d) * (((c * b) / d) - a);
}
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.36d-14)) .or. (.not. (c <= 2.7d+18))) then
tmp = (b / c) - (d * ((a / c) / c))
else
tmp = (1.0d0 / d) * (((c * b) / d) - a)
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((c <= -1.36e-14) || !(c <= 2.7e+18)) {
tmp = (b / c) - (d * ((a / c) / c));
} else {
tmp = (1.0 / d) * (((c * b) / d) - a);
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (c <= -1.36e-14) or not (c <= 2.7e+18): tmp = (b / c) - (d * ((a / c) / c)) else: tmp = (1.0 / d) * (((c * b) / d) - a) return tmp
function code(a, b, c, d) tmp = 0.0 if ((c <= -1.36e-14) || !(c <= 2.7e+18)) tmp = Float64(Float64(b / c) - Float64(d * Float64(Float64(a / c) / c))); else tmp = Float64(Float64(1.0 / d) * Float64(Float64(Float64(c * b) / d) - a)); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((c <= -1.36e-14) || ~((c <= 2.7e+18))) tmp = (b / c) - (d * ((a / c) / c)); else tmp = (1.0 / d) * (((c * b) / d) - a); end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[c, -1.36e-14], N[Not[LessEqual[c, 2.7e+18]], $MachinePrecision]], N[(N[(b / c), $MachinePrecision] - N[(d * N[(N[(a / c), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / d), $MachinePrecision] * N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.36 \cdot 10^{-14} \lor \neg \left(c \leq 2.7 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{b}{c} - d \cdot \frac{\frac{a}{c}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{d} \cdot \left(\frac{c \cdot b}{d} - a\right)\\
\end{array}
\end{array}
if c < -1.36e-14 or 2.7e18 < c Initial program 52.8%
Taylor expanded in c around inf 78.2%
+-commutative78.2%
mul-1-neg78.2%
unsub-neg78.2%
associate-/l*79.6%
associate-/r/80.4%
Simplified80.4%
*-un-lft-identity80.4%
pow280.4%
times-frac81.9%
Applied egg-rr81.9%
associate-*l/81.9%
*-lft-identity81.9%
Simplified81.9%
if -1.36e-14 < c < 2.7e18Initial program 77.3%
*-un-lft-identity77.3%
add-sqr-sqrt77.3%
times-frac77.2%
hypot-def77.2%
hypot-def91.1%
Applied egg-rr91.1%
Taylor expanded in c around 0 40.8%
Taylor expanded in c around 0 79.2%
Final simplification80.5%
(FPCore (a b c d) :precision binary64 (if (or (<= d -3.2e+66) (not (<= d 3.6e+138))) (/ (- a) d) (/ b c)))
double code(double a, double b, double c, double d) {
double tmp;
if ((d <= -3.2e+66) || !(d <= 3.6e+138)) {
tmp = -a / d;
} else {
tmp = b / 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 ((d <= (-3.2d+66)) .or. (.not. (d <= 3.6d+138))) then
tmp = -a / d
else
tmp = b / c
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((d <= -3.2e+66) || !(d <= 3.6e+138)) {
tmp = -a / d;
} else {
tmp = b / c;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (d <= -3.2e+66) or not (d <= 3.6e+138): tmp = -a / d else: tmp = b / c return tmp
function code(a, b, c, d) tmp = 0.0 if ((d <= -3.2e+66) || !(d <= 3.6e+138)) tmp = Float64(Float64(-a) / d); else tmp = Float64(b / c); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((d <= -3.2e+66) || ~((d <= 3.6e+138))) tmp = -a / d; else tmp = b / c; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[d, -3.2e+66], N[Not[LessEqual[d, 3.6e+138]], $MachinePrecision]], N[((-a) / d), $MachinePrecision], N[(b / c), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -3.2 \cdot 10^{+66} \lor \neg \left(d \leq 3.6 \cdot 10^{+138}\right):\\
\;\;\;\;\frac{-a}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c}\\
\end{array}
\end{array}
if d < -3.2e66 or 3.6000000000000001e138 < d Initial program 47.5%
Taylor expanded in c around 0 77.8%
associate-*r/77.8%
neg-mul-177.8%
Simplified77.8%
if -3.2e66 < d < 3.6000000000000001e138Initial program 73.5%
Taylor expanded in c around inf 61.8%
Final simplification66.7%
(FPCore (a b c d) :precision binary64 (if (or (<= d -2e+199) (not (<= d 8e+154))) (/ a d) (/ b c)))
double code(double a, double b, double c, double d) {
double tmp;
if ((d <= -2e+199) || !(d <= 8e+154)) {
tmp = a / d;
} else {
tmp = b / 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 ((d <= (-2d+199)) .or. (.not. (d <= 8d+154))) then
tmp = a / d
else
tmp = b / c
end if
code = tmp
end function
public static double code(double a, double b, double c, double d) {
double tmp;
if ((d <= -2e+199) || !(d <= 8e+154)) {
tmp = a / d;
} else {
tmp = b / c;
}
return tmp;
}
def code(a, b, c, d): tmp = 0 if (d <= -2e+199) or not (d <= 8e+154): tmp = a / d else: tmp = b / c return tmp
function code(a, b, c, d) tmp = 0.0 if ((d <= -2e+199) || !(d <= 8e+154)) tmp = Float64(a / d); else tmp = Float64(b / c); end return tmp end
function tmp_2 = code(a, b, c, d) tmp = 0.0; if ((d <= -2e+199) || ~((d <= 8e+154))) tmp = a / d; else tmp = b / c; end tmp_2 = tmp; end
code[a_, b_, c_, d_] := If[Or[LessEqual[d, -2e+199], N[Not[LessEqual[d, 8e+154]], $MachinePrecision]], N[(a / d), $MachinePrecision], N[(b / c), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;d \leq -2 \cdot 10^{+199} \lor \neg \left(d \leq 8 \cdot 10^{+154}\right):\\
\;\;\;\;\frac{a}{d}\\
\mathbf{else}:\\
\;\;\;\;\frac{b}{c}\\
\end{array}
\end{array}
if d < -2.00000000000000019e199 or 8.0000000000000003e154 < d Initial program 47.3%
*-un-lft-identity47.3%
add-sqr-sqrt47.3%
times-frac47.3%
hypot-def47.3%
hypot-def67.5%
Applied egg-rr67.5%
Taylor expanded in c around 0 58.9%
Taylor expanded in d around -inf 47.9%
if -2.00000000000000019e199 < d < 8.0000000000000003e154Initial program 69.0%
Taylor expanded in c around inf 54.7%
Final simplification53.6%
(FPCore (a b c d) :precision binary64 (/ a d))
double code(double a, double b, double c, double d) {
return a / 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 = a / d
end function
public static double code(double a, double b, double c, double d) {
return a / d;
}
def code(a, b, c, d): return a / d
function code(a, b, c, d) return Float64(a / d) end
function tmp = code(a, b, c, d) tmp = a / d; end
code[a_, b_, c_, d_] := N[(a / d), $MachinePrecision]
\begin{array}{l}
\\
\frac{a}{d}
\end{array}
Initial program 65.5%
*-un-lft-identity65.5%
add-sqr-sqrt65.5%
times-frac65.4%
hypot-def65.4%
hypot-def79.7%
Applied egg-rr79.7%
Taylor expanded in c around 0 25.6%
Taylor expanded in d around -inf 11.2%
Final simplification11.2%
(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 2023307
(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))))