
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -2e+152)
(* (* y x) (/ z (- (* 0.5 (* t (/ a z))) z)))
(if (<= z 2e+53)
(* y (* x (/ z (sqrt (- (* z z) (* t a))))))
(/ (* y x) (sqrt (- 1.0 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+152) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= 2e+53) {
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))));
} else {
tmp = (y * x) / sqrt((1.0 - (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2d+152)) then
tmp = (y * x) * (z / ((0.5d0 * (t * (a / z))) - z))
else if (z <= 2d+53) then
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))))
else
tmp = (y * x) / sqrt((1.0d0 - (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+152) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= 2e+53) {
tmp = y * (x * (z / Math.sqrt(((z * z) - (t * a)))));
} else {
tmp = (y * x) / Math.sqrt((1.0 - (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2e+152: tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z)) elif z <= 2e+53: tmp = y * (x * (z / math.sqrt(((z * z) - (t * a))))) else: tmp = (y * x) / math.sqrt((1.0 - (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+152) tmp = Float64(Float64(y * x) * Float64(z / Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z))); elseif (z <= 2e+53) tmp = Float64(y * Float64(x * Float64(z / sqrt(Float64(Float64(z * z) - Float64(t * a)))))); else tmp = Float64(Float64(y * x) / sqrt(Float64(1.0 - Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2e+152)
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
elseif (z <= 2e+53)
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))));
else
tmp = (y * x) / sqrt((1.0 - (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+152], N[(N[(y * x), $MachinePrecision] * N[(z / N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+53], N[(y * N[(x * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[Sqrt[N[(1.0 - N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+152}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+53}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{\sqrt{1 - \frac{a}{\frac{z \cdot z}{t}}}}\\
\end{array}
\end{array}
if z < -2.0000000000000001e152Initial program 19.6%
associate-/l*20.0%
Simplified20.0%
associate-*l/20.2%
associate-/l*19.4%
div-inv19.4%
associate-*l*20.2%
div-inv20.2%
Applied egg-rr20.2%
Taylor expanded in z around -inf 78.4%
add-sqr-sqrt58.2%
sqrt-unprod78.4%
pow278.4%
associate-/l*85.6%
Applied egg-rr85.6%
unpow285.6%
rem-sqrt-square88.5%
associate-/r/88.5%
Simplified88.5%
Taylor expanded in x around 0 51.7%
fma-def51.7%
*-commutative51.7%
associate-*r/54.7%
neg-mul-154.7%
*-commutative54.7%
associate-*r*71.7%
associate-*r/88.5%
fma-udef88.5%
associate-*r/78.4%
*-commutative78.4%
unsub-neg78.4%
Simplified88.5%
if -2.0000000000000001e152 < z < 2e53Initial program 85.3%
associate-/l*90.8%
Simplified90.8%
associate-*l/91.3%
associate-/l*88.0%
div-inv87.8%
associate-*l*91.3%
div-inv91.3%
Applied egg-rr91.3%
if 2e53 < z Initial program 49.7%
associate-/l*54.4%
Simplified54.4%
add-sqr-sqrt54.4%
sqrt-unprod54.4%
frac-times43.7%
add-sqr-sqrt43.7%
Applied egg-rr43.7%
div-sub43.7%
*-inverses87.2%
*-commutative87.2%
associate-/l*97.0%
Simplified97.0%
Final simplification92.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (* z x) (sqrt (- (* z z) (* t a)))))))
(if (<= z -8.5e+112)
(* (* y x) (/ z (- (* 0.5 (* t (/ a z))) z)))
(if (<= z -7.2e-252)
t_1
(if (<= z 4.1e-165)
(/ (* y x) (/ (sqrt (* t (- a))) z))
(if (<= z 3.3e+56) t_1 (* y x)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z * x) / sqrt(((z * z) - (t * a))));
double tmp;
if (z <= -8.5e+112) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= -7.2e-252) {
tmp = t_1;
} else if (z <= 4.1e-165) {
tmp = (y * x) / (sqrt((t * -a)) / z);
} else if (z <= 3.3e+56) {
tmp = t_1;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * ((z * x) / sqrt(((z * z) - (t * a))))
if (z <= (-8.5d+112)) then
tmp = (y * x) * (z / ((0.5d0 * (t * (a / z))) - z))
else if (z <= (-7.2d-252)) then
tmp = t_1
else if (z <= 4.1d-165) then
tmp = (y * x) / (sqrt((t * -a)) / z)
else if (z <= 3.3d+56) then
tmp = t_1
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z * x) / Math.sqrt(((z * z) - (t * a))));
double tmp;
if (z <= -8.5e+112) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= -7.2e-252) {
tmp = t_1;
} else if (z <= 4.1e-165) {
tmp = (y * x) / (Math.sqrt((t * -a)) / z);
} else if (z <= 3.3e+56) {
tmp = t_1;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = y * ((z * x) / math.sqrt(((z * z) - (t * a)))) tmp = 0 if z <= -8.5e+112: tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z)) elif z <= -7.2e-252: tmp = t_1 elif z <= 4.1e-165: tmp = (y * x) / (math.sqrt((t * -a)) / z) elif z <= 3.3e+56: tmp = t_1 else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(t * a))))) tmp = 0.0 if (z <= -8.5e+112) tmp = Float64(Float64(y * x) * Float64(z / Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z))); elseif (z <= -7.2e-252) tmp = t_1; elseif (z <= 4.1e-165) tmp = Float64(Float64(y * x) / Float64(sqrt(Float64(t * Float64(-a))) / z)); elseif (z <= 3.3e+56) tmp = t_1; else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * ((z * x) / sqrt(((z * z) - (t * a))));
tmp = 0.0;
if (z <= -8.5e+112)
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
elseif (z <= -7.2e-252)
tmp = t_1;
elseif (z <= 4.1e-165)
tmp = (y * x) / (sqrt((t * -a)) / z);
elseif (z <= 3.3e+56)
tmp = t_1;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+112], N[(N[(y * x), $MachinePrecision] * N[(z / N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.2e-252], t$95$1, If[LessEqual[z, 4.1e-165], N[(N[(y * x), $MachinePrecision] / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+56], t$95$1, N[(y * x), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+112}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-252}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-165}:\\
\;\;\;\;\frac{y \cdot x}{\frac{\sqrt{t \cdot \left(-a\right)}}{z}}\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+56}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -8.50000000000000047e112Initial program 32.4%
associate-/l*34.7%
Simplified34.7%
associate-*l/34.8%
associate-/l*32.2%
div-inv32.2%
associate-*l*34.8%
div-inv34.8%
Applied egg-rr34.8%
Taylor expanded in z around -inf 80.6%
add-sqr-sqrt58.0%
sqrt-unprod80.6%
pow280.6%
associate-/l*86.5%
Applied egg-rr86.5%
unpow286.5%
rem-sqrt-square88.8%
associate-/r/88.8%
Simplified88.8%
Taylor expanded in x around 0 56.7%
fma-def56.7%
*-commutative56.7%
associate-*r/59.2%
neg-mul-159.2%
*-commutative59.2%
associate-*r*73.2%
associate-*r/88.8%
fma-udef88.8%
associate-*r/80.6%
*-commutative80.6%
unsub-neg80.6%
Simplified88.8%
if -8.50000000000000047e112 < z < -7.20000000000000046e-252 or 4.1000000000000002e-165 < z < 3.30000000000000002e56Initial program 87.0%
*-commutative87.0%
associate-*l*88.1%
associate-*r/93.4%
Simplified93.4%
if -7.20000000000000046e-252 < z < 4.1000000000000002e-165Initial program 75.5%
associate-/l*79.5%
Simplified79.5%
Taylor expanded in z around 0 79.5%
associate-*r*59.9%
neg-mul-159.9%
Simplified79.5%
if 3.30000000000000002e56 < z Initial program 49.7%
*-commutative49.7%
associate-*l*47.9%
associate-*r/50.9%
Simplified50.9%
Taylor expanded in z around inf 95.5%
Final simplification91.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* t a)))))
(if (<= z -1e+113)
(* (* y x) (/ z (- (* 0.5 (* t (/ a z))) z)))
(if (<= z -5.6e-254)
(* y (/ (* z x) t_1))
(if (<= z 5e-165)
(/ (* y x) (/ (sqrt (* t (- a))) z))
(if (<= z 4e+55) (* z (/ (* y x) t_1)) (* y x)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -1e+113) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= -5.6e-254) {
tmp = y * ((z * x) / t_1);
} else if (z <= 5e-165) {
tmp = (y * x) / (sqrt((t * -a)) / z);
} else if (z <= 4e+55) {
tmp = z * ((y * x) / t_1);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((z * z) - (t * a)))
if (z <= (-1d+113)) then
tmp = (y * x) * (z / ((0.5d0 * (t * (a / z))) - z))
else if (z <= (-5.6d-254)) then
tmp = y * ((z * x) / t_1)
else if (z <= 5d-165) then
tmp = (y * x) / (sqrt((t * -a)) / z)
else if (z <= 4d+55) then
tmp = z * ((y * x) / t_1)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -1e+113) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= -5.6e-254) {
tmp = y * ((z * x) / t_1);
} else if (z <= 5e-165) {
tmp = (y * x) / (Math.sqrt((t * -a)) / z);
} else if (z <= 4e+55) {
tmp = z * ((y * x) / t_1);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (t * a))) tmp = 0 if z <= -1e+113: tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z)) elif z <= -5.6e-254: tmp = y * ((z * x) / t_1) elif z <= 5e-165: tmp = (y * x) / (math.sqrt((t * -a)) / z) elif z <= 4e+55: tmp = z * ((y * x) / t_1) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(t * a))) tmp = 0.0 if (z <= -1e+113) tmp = Float64(Float64(y * x) * Float64(z / Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z))); elseif (z <= -5.6e-254) tmp = Float64(y * Float64(Float64(z * x) / t_1)); elseif (z <= 5e-165) tmp = Float64(Float64(y * x) / Float64(sqrt(Float64(t * Float64(-a))) / z)); elseif (z <= 4e+55) tmp = Float64(z * Float64(Float64(y * x) / t_1)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (t * a)));
tmp = 0.0;
if (z <= -1e+113)
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
elseif (z <= -5.6e-254)
tmp = y * ((z * x) / t_1);
elseif (z <= 5e-165)
tmp = (y * x) / (sqrt((t * -a)) / z);
elseif (z <= 4e+55)
tmp = z * ((y * x) / t_1);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1e+113], N[(N[(y * x), $MachinePrecision] * N[(z / N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.6e-254], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-165], N[(N[(y * x), $MachinePrecision] / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+55], N[(z * N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+113}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-254}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-165}:\\
\;\;\;\;\frac{y \cdot x}{\frac{\sqrt{t \cdot \left(-a\right)}}{z}}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+55}:\\
\;\;\;\;z \cdot \frac{y \cdot x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1e113Initial program 32.4%
associate-/l*34.7%
Simplified34.7%
associate-*l/34.8%
associate-/l*32.2%
div-inv32.2%
associate-*l*34.8%
div-inv34.8%
Applied egg-rr34.8%
Taylor expanded in z around -inf 80.6%
add-sqr-sqrt58.0%
sqrt-unprod80.6%
pow280.6%
associate-/l*86.5%
Applied egg-rr86.5%
unpow286.5%
rem-sqrt-square88.8%
associate-/r/88.8%
Simplified88.8%
Taylor expanded in x around 0 56.7%
fma-def56.7%
*-commutative56.7%
associate-*r/59.2%
neg-mul-159.2%
*-commutative59.2%
associate-*r*73.2%
associate-*r/88.8%
fma-udef88.8%
associate-*r/80.6%
*-commutative80.6%
unsub-neg80.6%
Simplified88.8%
if -1e113 < z < -5.59999999999999966e-254Initial program 82.0%
*-commutative82.0%
associate-*l*86.0%
associate-*r/95.4%
Simplified95.4%
if -5.59999999999999966e-254 < z < 4.99999999999999981e-165Initial program 75.5%
associate-/l*79.5%
Simplified79.5%
Taylor expanded in z around 0 79.5%
associate-*r*59.9%
neg-mul-159.9%
Simplified79.5%
if 4.99999999999999981e-165 < z < 4.00000000000000004e55Initial program 93.4%
associate-/l*93.4%
Simplified93.4%
associate-/l*93.4%
div-inv93.3%
associate-*l*87.9%
associate-*l*88.0%
*-commutative88.0%
pow1/288.0%
pow-flip87.9%
metadata-eval87.9%
Applied egg-rr87.9%
expm1-log1p-u70.1%
expm1-udef38.1%
*-commutative38.1%
associate-*l*37.4%
metadata-eval37.4%
pow-flip37.4%
pow1/237.4%
div-inv37.4%
Applied egg-rr37.4%
expm1-def69.5%
expm1-log1p89.2%
associate-*l*85.6%
associate-*l/91.7%
*-commutative91.7%
Simplified91.7%
if 4.00000000000000004e55 < z Initial program 49.7%
*-commutative49.7%
associate-*l*47.9%
associate-*r/50.9%
Simplified50.9%
Taylor expanded in z around inf 95.5%
Final simplification91.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4e+152) (* (* y x) (/ z (- (* 0.5 (* t (/ a z))) z))) (if (<= z 2e+56) (* y (* x (/ z (sqrt (- (* z z) (* t a)))))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+152) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= 2e+56) {
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4d+152)) then
tmp = (y * x) * (z / ((0.5d0 * (t * (a / z))) - z))
else if (z <= 2d+56) then
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+152) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= 2e+56) {
tmp = y * (x * (z / Math.sqrt(((z * z) - (t * a)))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4e+152: tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z)) elif z <= 2e+56: tmp = y * (x * (z / math.sqrt(((z * z) - (t * a))))) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+152) tmp = Float64(Float64(y * x) * Float64(z / Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z))); elseif (z <= 2e+56) tmp = Float64(y * Float64(x * Float64(z / sqrt(Float64(Float64(z * z) - Float64(t * a)))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4e+152)
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
elseif (z <= 2e+56)
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+152], N[(N[(y * x), $MachinePrecision] * N[(z / N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+56], N[(y * N[(x * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+152}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+56}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.0000000000000002e152Initial program 19.6%
associate-/l*20.0%
Simplified20.0%
associate-*l/20.2%
associate-/l*19.4%
div-inv19.4%
associate-*l*20.2%
div-inv20.2%
Applied egg-rr20.2%
Taylor expanded in z around -inf 78.4%
add-sqr-sqrt58.2%
sqrt-unprod78.4%
pow278.4%
associate-/l*85.6%
Applied egg-rr85.6%
unpow285.6%
rem-sqrt-square88.5%
associate-/r/88.5%
Simplified88.5%
Taylor expanded in x around 0 51.7%
fma-def51.7%
*-commutative51.7%
associate-*r/54.7%
neg-mul-154.7%
*-commutative54.7%
associate-*r*71.7%
associate-*r/88.5%
fma-udef88.5%
associate-*r/78.4%
*-commutative78.4%
unsub-neg78.4%
Simplified88.5%
if -4.0000000000000002e152 < z < 2.00000000000000018e56Initial program 85.3%
associate-/l*90.8%
Simplified90.8%
associate-*l/91.3%
associate-/l*88.0%
div-inv87.8%
associate-*l*91.3%
div-inv91.3%
Applied egg-rr91.3%
if 2.00000000000000018e56 < z Initial program 49.7%
*-commutative49.7%
associate-*l*47.9%
associate-*r/50.9%
Simplified50.9%
Taylor expanded in z around inf 95.5%
Final simplification91.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.7e-71)
(* (* y x) (/ z (- (* 0.5 (* t (/ a z))) z)))
(if (<= z 1.1e-70)
(* y (/ (* z x) (sqrt (* t (- a)))))
(/ (* y x) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-71) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= 1.1e-70) {
tmp = y * ((z * x) / sqrt((t * -a)));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.7d-71)) then
tmp = (y * x) * (z / ((0.5d0 * (t * (a / z))) - z))
else if (z <= 1.1d-70) then
tmp = y * ((z * x) / sqrt((t * -a)))
else
tmp = (y * x) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-71) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= 1.1e-70) {
tmp = y * ((z * x) / Math.sqrt((t * -a)));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.7e-71: tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z)) elif z <= 1.1e-70: tmp = y * ((z * x) / math.sqrt((t * -a))) else: tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e-71) tmp = Float64(Float64(y * x) * Float64(z / Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z))); elseif (z <= 1.1e-70) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(t * Float64(-a))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.7e-71)
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
elseif (z <= 1.1e-70)
tmp = y * ((z * x) / sqrt((t * -a)));
else
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e-71], N[(N[(y * x), $MachinePrecision] * N[(z / N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-70], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-71}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-70}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -2.7000000000000001e-71Initial program 55.9%
associate-/l*62.5%
Simplified62.5%
associate-*l/62.5%
associate-/l*61.0%
div-inv60.9%
associate-*l*62.4%
div-inv62.5%
Applied egg-rr62.5%
Taylor expanded in z around -inf 80.7%
add-sqr-sqrt53.4%
sqrt-unprod80.6%
pow280.6%
associate-/l*83.9%
Applied egg-rr83.9%
unpow283.9%
rem-sqrt-square85.3%
associate-/r/85.3%
Simplified85.3%
Taylor expanded in x around 0 63.1%
fma-def63.1%
*-commutative63.1%
associate-*r/64.5%
neg-mul-164.5%
*-commutative64.5%
associate-*r*72.4%
associate-*r/86.3%
fma-udef86.3%
associate-*r/81.7%
*-commutative81.7%
unsub-neg81.7%
Simplified86.3%
if -2.7000000000000001e-71 < z < 1.0999999999999999e-70Initial program 80.3%
*-commutative80.3%
associate-*l*77.2%
associate-*r/79.7%
Simplified79.7%
Taylor expanded in z around 0 73.2%
associate-*r*73.2%
neg-mul-173.2%
Simplified73.2%
if 1.0999999999999999e-70 < z Initial program 65.0%
associate-/l*68.2%
Simplified68.2%
Taylor expanded in z around inf 86.3%
unpow286.3%
associate-/l*91.9%
Simplified91.9%
Final simplification84.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -5e-106)
(* (* y x) (/ z (- (* 0.5 (* t (/ a z))) z)))
(if (<= z 6.4e-71)
(/ (* y x) (/ (sqrt (* t (- a))) z))
(/ (* y x) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-106) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= 6.4e-71) {
tmp = (y * x) / (sqrt((t * -a)) / z);
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5d-106)) then
tmp = (y * x) * (z / ((0.5d0 * (t * (a / z))) - z))
else if (z <= 6.4d-71) then
tmp = (y * x) / (sqrt((t * -a)) / z)
else
tmp = (y * x) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-106) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else if (z <= 6.4e-71) {
tmp = (y * x) / (Math.sqrt((t * -a)) / z);
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5e-106: tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z)) elif z <= 6.4e-71: tmp = (y * x) / (math.sqrt((t * -a)) / z) else: tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e-106) tmp = Float64(Float64(y * x) * Float64(z / Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z))); elseif (z <= 6.4e-71) tmp = Float64(Float64(y * x) / Float64(sqrt(Float64(t * Float64(-a))) / z)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5e-106)
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
elseif (z <= 6.4e-71)
tmp = (y * x) / (sqrt((t * -a)) / z);
else
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-106], N[(N[(y * x), $MachinePrecision] * N[(z / N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.4e-71], N[(N[(y * x), $MachinePrecision] / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-106}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-71}:\\
\;\;\;\;\frac{y \cdot x}{\frac{\sqrt{t \cdot \left(-a\right)}}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -4.99999999999999983e-106Initial program 56.4%
associate-/l*62.7%
Simplified62.7%
associate-*l/62.6%
associate-/l*61.2%
div-inv61.2%
associate-*l*62.6%
div-inv62.6%
Applied egg-rr62.6%
Taylor expanded in z around -inf 79.3%
add-sqr-sqrt52.8%
sqrt-unprod79.1%
pow279.1%
associate-/l*82.3%
Applied egg-rr82.3%
unpow282.3%
rem-sqrt-square83.7%
associate-/r/83.7%
Simplified83.7%
Taylor expanded in x around 0 62.2%
fma-def62.2%
*-commutative62.2%
associate-*r/63.6%
neg-mul-163.6%
*-commutative63.6%
associate-*r*71.2%
associate-*r/84.7%
fma-udef84.7%
associate-*r/80.3%
*-commutative80.3%
unsub-neg80.3%
Simplified84.7%
if -4.99999999999999983e-106 < z < 6.3999999999999998e-71Initial program 80.8%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in z around 0 76.2%
associate-*r*74.8%
neg-mul-174.8%
Simplified76.2%
if 6.3999999999999998e-71 < z Initial program 65.0%
associate-/l*68.2%
Simplified68.2%
Taylor expanded in z around inf 86.3%
unpow286.3%
associate-/l*91.9%
Simplified91.9%
Final simplification84.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.05e-193) (* y (- x)) (if (<= z 2.4e-29) (* y (/ (* z x) (+ z (* -0.5 (/ (* t a) z))))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-193) {
tmp = y * -x;
} else if (z <= 2.4e-29) {
tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.05d-193)) then
tmp = y * -x
else if (z <= 2.4d-29) then
tmp = y * ((z * x) / (z + ((-0.5d0) * ((t * a) / z))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-193) {
tmp = y * -x;
} else if (z <= 2.4e-29) {
tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.05e-193: tmp = y * -x elif z <= 2.4e-29: tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z)))) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e-193) tmp = Float64(y * Float64(-x)); elseif (z <= 2.4e-29) tmp = Float64(y * Float64(Float64(z * x) / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.05e-193)
tmp = y * -x;
elseif (z <= 2.4e-29)
tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e-193], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.4e-29], N[(y * N[(N[(z * x), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-193}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-29}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.05e-193Initial program 60.3%
*-commutative60.3%
associate-*l*61.7%
associate-*r/66.1%
Simplified66.1%
Taylor expanded in z around -inf 78.5%
neg-mul-178.5%
Simplified78.5%
if -1.05e-193 < z < 2.39999999999999992e-29Initial program 81.5%
*-commutative81.5%
associate-*l*75.2%
associate-*r/78.1%
Simplified78.1%
Taylor expanded in z around inf 47.0%
if 2.39999999999999992e-29 < z Initial program 62.4%
*-commutative62.4%
associate-*l*60.9%
associate-*r/63.2%
Simplified63.2%
Taylor expanded in z around inf 93.3%
Final simplification75.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.1e-195) (* y (- x)) (if (<= z 12.6) (* y (* x (/ z (+ z (* -0.5 (/ (* t a) z)))))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e-195) {
tmp = y * -x;
} else if (z <= 12.6) {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.1d-195)) then
tmp = y * -x
else if (z <= 12.6d0) then
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e-195) {
tmp = y * -x;
} else if (z <= 12.6) {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.1e-195: tmp = y * -x elif z <= 12.6: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e-195) tmp = Float64(y * Float64(-x)); elseif (z <= 12.6) tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.1e-195)
tmp = y * -x;
elseif (z <= 12.6)
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e-195], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 12.6], N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-195}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 12.6:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -3.10000000000000002e-195Initial program 60.3%
*-commutative60.3%
associate-*l*61.7%
associate-*r/66.1%
Simplified66.1%
Taylor expanded in z around -inf 78.5%
neg-mul-178.5%
Simplified78.5%
if -3.10000000000000002e-195 < z < 12.5999999999999996Initial program 83.0%
associate-/l*85.7%
Simplified85.7%
associate-*l/84.5%
associate-/l*79.9%
div-inv79.7%
associate-*l*84.4%
div-inv84.4%
Applied egg-rr84.4%
Taylor expanded in z around inf 54.1%
if 12.5999999999999996 < z Initial program 59.5%
*-commutative59.5%
associate-*l*57.9%
associate-*r/60.4%
Simplified60.4%
Taylor expanded in z around inf 94.0%
Final simplification76.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.05e-161) (* y (- x)) (if (<= z 2.6e-177) (* -2.0 (* (/ y a) (/ (* z (* z x)) t))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-161) {
tmp = y * -x;
} else if (z <= 2.6e-177) {
tmp = -2.0 * ((y / a) * ((z * (z * x)) / t));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.05d-161)) then
tmp = y * -x
else if (z <= 2.6d-177) then
tmp = (-2.0d0) * ((y / a) * ((z * (z * x)) / t))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.05e-161) {
tmp = y * -x;
} else if (z <= 2.6e-177) {
tmp = -2.0 * ((y / a) * ((z * (z * x)) / t));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.05e-161: tmp = y * -x elif z <= 2.6e-177: tmp = -2.0 * ((y / a) * ((z * (z * x)) / t)) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.05e-161) tmp = Float64(y * Float64(-x)); elseif (z <= 2.6e-177) tmp = Float64(-2.0 * Float64(Float64(y / a) * Float64(Float64(z * Float64(z * x)) / t))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.05e-161)
tmp = y * -x;
elseif (z <= 2.6e-177)
tmp = -2.0 * ((y / a) * ((z * (z * x)) / t));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.05e-161], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.6e-177], N[(-2.0 * N[(N[(y / a), $MachinePrecision] * N[(N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-161}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-177}:\\
\;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{z \cdot \left(z \cdot x\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.05e-161Initial program 58.9%
*-commutative58.9%
associate-*l*59.4%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 81.9%
neg-mul-181.9%
Simplified81.9%
if -1.05e-161 < z < 2.6000000000000001e-177Initial program 77.0%
associate-/l*82.0%
Simplified82.0%
*-commutative82.0%
div-inv81.9%
times-frac74.5%
Applied egg-rr74.5%
Taylor expanded in z around inf 36.8%
Taylor expanded in z around 0 36.4%
times-frac36.3%
unpow236.3%
associate-*r*39.0%
Simplified39.0%
if 2.6000000000000001e-177 < z Initial program 69.5%
*-commutative69.5%
associate-*l*66.5%
associate-*r/68.2%
Simplified68.2%
Taylor expanded in z around inf 81.5%
Final simplification75.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.3e-160) (* y (- x)) (if (<= z 3.3e-198) (* -2.0 (/ (* (* z x) (* z (/ y a))) t)) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e-160) {
tmp = y * -x;
} else if (z <= 3.3e-198) {
tmp = -2.0 * (((z * x) * (z * (y / a))) / t);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.3d-160)) then
tmp = y * -x
else if (z <= 3.3d-198) then
tmp = (-2.0d0) * (((z * x) * (z * (y / a))) / t)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.3e-160) {
tmp = y * -x;
} else if (z <= 3.3e-198) {
tmp = -2.0 * (((z * x) * (z * (y / a))) / t);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.3e-160: tmp = y * -x elif z <= 3.3e-198: tmp = -2.0 * (((z * x) * (z * (y / a))) / t) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.3e-160) tmp = Float64(y * Float64(-x)); elseif (z <= 3.3e-198) tmp = Float64(-2.0 * Float64(Float64(Float64(z * x) * Float64(z * Float64(y / a))) / t)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.3e-160)
tmp = y * -x;
elseif (z <= 3.3e-198)
tmp = -2.0 * (((z * x) * (z * (y / a))) / t);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.3e-160], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.3e-198], N[(-2.0 * N[(N[(N[(z * x), $MachinePrecision] * N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-160}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-198}:\\
\;\;\;\;-2 \cdot \frac{\left(z \cdot x\right) \cdot \left(z \cdot \frac{y}{a}\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.30000000000000002e-160Initial program 58.9%
*-commutative58.9%
associate-*l*59.4%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 81.9%
neg-mul-181.9%
Simplified81.9%
if -1.30000000000000002e-160 < z < 3.3e-198Initial program 74.3%
associate-/l*80.0%
Simplified80.0%
*-commutative80.0%
div-inv79.8%
times-frac77.1%
Applied egg-rr77.1%
Taylor expanded in z around inf 40.4%
Taylor expanded in z around 0 40.1%
associate-/r*40.7%
unpow240.7%
associate-*r*43.5%
associate-*l/43.1%
associate-*r*43.3%
Simplified43.3%
if 3.3e-198 < z Initial program 70.5%
*-commutative70.5%
associate-*l*66.1%
associate-*r/67.7%
Simplified67.7%
Taylor expanded in z around inf 79.0%
Final simplification75.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 7e-198) (* (* y x) (/ z (- (* 0.5 (* t (/ a z))) z))) (* y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 7e-198) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 7d-198) then
tmp = (y * x) * (z / ((0.5d0 * (t * (a / z))) - z))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 7e-198) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= 7e-198: tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z)) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 7e-198) tmp = Float64(Float64(y * x) * Float64(z / Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 7e-198)
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, 7e-198], N[(N[(y * x), $MachinePrecision] * N[(z / N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7 \cdot 10^{-198}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < 7.0000000000000005e-198Initial program 62.8%
associate-/l*69.1%
Simplified69.1%
associate-*l/71.1%
associate-/l*68.8%
div-inv68.7%
associate-*l*71.1%
div-inv71.1%
Applied egg-rr71.1%
Taylor expanded in z around -inf 69.7%
add-sqr-sqrt46.7%
sqrt-unprod69.6%
pow269.6%
associate-/l*71.7%
Applied egg-rr71.7%
unpow271.7%
rem-sqrt-square72.9%
associate-/r/72.9%
Simplified72.9%
Taylor expanded in x around 0 57.7%
fma-def57.7%
*-commutative57.7%
associate-*r/58.6%
neg-mul-158.6%
*-commutative58.6%
associate-*r*63.8%
associate-*r/73.6%
fma-udef73.6%
associate-*r/70.5%
*-commutative70.5%
unsub-neg70.5%
Simplified73.5%
if 7.0000000000000005e-198 < z Initial program 70.5%
*-commutative70.5%
associate-*l*66.1%
associate-*r/67.7%
Simplified67.7%
Taylor expanded in z around inf 79.0%
Final simplification76.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-278) (* (* y x) (/ z (- (* 0.5 (* t (/ a z))) z))) (/ (* y x) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-278) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.35d-278)) then
tmp = (y * x) * (z / ((0.5d0 * (t * (a / z))) - z))
else
tmp = (y * x) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-278) {
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
} else {
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-278: tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z)) else: tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e-278) tmp = Float64(Float64(y * x) * Float64(z / Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.35e-278)
tmp = (y * x) * (z / ((0.5 * (t * (a / z))) - z));
else
tmp = (y * x) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-278], N[(N[(y * x), $MachinePrecision] * N[(z / N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-278}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -1.3500000000000001e-278Initial program 60.1%
associate-/l*67.1%
Simplified67.1%
associate-*l/70.2%
associate-/l*67.6%
div-inv67.5%
associate-*l*70.1%
div-inv70.2%
Applied egg-rr70.2%
Taylor expanded in z around -inf 71.0%
add-sqr-sqrt51.1%
sqrt-unprod70.8%
pow270.8%
associate-/l*73.1%
Applied egg-rr73.1%
unpow273.1%
rem-sqrt-square74.4%
associate-/r/74.4%
Simplified74.4%
Taylor expanded in x around 0 57.5%
fma-def57.5%
*-commutative57.5%
associate-*r/58.5%
neg-mul-158.5%
*-commutative58.5%
associate-*r*64.3%
associate-*r/75.2%
fma-udef75.2%
associate-*r/71.8%
*-commutative71.8%
unsub-neg71.8%
Simplified75.2%
if -1.3500000000000001e-278 < z Initial program 72.1%
associate-/l*74.3%
Simplified74.3%
Taylor expanded in z around inf 74.6%
unpow274.6%
associate-/l*78.4%
Simplified78.4%
Final simplification76.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.8e-155) (* y (- x)) (if (<= z 1.65e-270) (/ (* z (* y x)) (- z)) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e-155) {
tmp = y * -x;
} else if (z <= 1.65e-270) {
tmp = (z * (y * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.8d-155)) then
tmp = y * -x
else if (z <= 1.65d-270) then
tmp = (z * (y * x)) / -z
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e-155) {
tmp = y * -x;
} else if (z <= 1.65e-270) {
tmp = (z * (y * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.8e-155: tmp = y * -x elif z <= 1.65e-270: tmp = (z * (y * x)) / -z else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e-155) tmp = Float64(y * Float64(-x)); elseif (z <= 1.65e-270) tmp = Float64(Float64(z * Float64(y * x)) / Float64(-z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.8e-155)
tmp = y * -x;
elseif (z <= 1.65e-270)
tmp = (z * (y * x)) / -z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e-155], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.65e-270], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-155}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-270}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.8e-155Initial program 58.9%
*-commutative58.9%
associate-*l*59.4%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 81.9%
neg-mul-181.9%
Simplified81.9%
if -2.8e-155 < z < 1.65000000000000009e-270Initial program 72.9%
Taylor expanded in z around -inf 35.5%
neg-mul-135.5%
Simplified35.5%
if 1.65000000000000009e-270 < z Initial program 71.0%
*-commutative71.0%
associate-*l*66.2%
associate-*r/67.7%
Simplified67.7%
Taylor expanded in z around inf 76.1%
Final simplification74.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4e-310) (* y (- x)) (* y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-310) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4d-310)) then
tmp = y * -x
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-310) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4e-310: tmp = y * -x else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e-310) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4e-310)
tmp = y * -x;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e-310], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -3.999999999999988e-310Initial program 61.1%
*-commutative61.1%
associate-*l*63.0%
associate-*r/68.4%
Simplified68.4%
Taylor expanded in z around -inf 70.4%
neg-mul-170.4%
Simplified70.4%
if -3.999999999999988e-310 < z Initial program 71.5%
*-commutative71.5%
associate-*l*66.7%
associate-*r/68.2%
Simplified68.2%
Taylor expanded in z around inf 75.0%
Final simplification72.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y x))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return y * x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y * x
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return y * x
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(y * x) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = y * x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot x
\end{array}
Initial program 66.4%
*-commutative66.4%
associate-*l*64.9%
associate-*r/68.3%
Simplified68.3%
Taylor expanded in z around inf 45.9%
Final simplification45.9%
(FPCore (x y z t a)
:precision binary64
(if (< z -3.1921305903852764e+46)
(- (* y x))
(if (< z 5.976268120920894e+90)
(/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
(* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z < (-3.1921305903852764d+46)) then
tmp = -(y * x)
else if (z < 5.976268120920894d+90) then
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z < -3.1921305903852764e+46: tmp = -(y * x) elif z < 5.976268120920894e+90: tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y) else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z < -3.1921305903852764e+46) tmp = Float64(-Float64(y * x)); elseif (z < 5.976268120920894e+90) tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z < -3.1921305903852764e+46) tmp = -(y * x); elseif (z < 5.976268120920894e+90) tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
herbie shell --seed 2023200
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))