
(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 19 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 -1.16e+154) (* x (- y)) (if (<= z 4.2e+54) (* y (* x (/ z (sqrt (- (* z z) (* t a)))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.16e+154) {
tmp = x * -y;
} else if (z <= 4.2e+54) {
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))));
} else {
tmp = x * y;
}
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.16d+154)) then
tmp = x * -y
else if (z <= 4.2d+54) then
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))))
else
tmp = x * y
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.16e+154) {
tmp = x * -y;
} else if (z <= 4.2e+54) {
tmp = y * (x * (z / Math.sqrt(((z * z) - (t * a)))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.16e+154: tmp = x * -y elif z <= 4.2e+54: tmp = y * (x * (z / math.sqrt(((z * z) - (t * a))))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.16e+154) tmp = Float64(x * Float64(-y)); elseif (z <= 4.2e+54) tmp = Float64(y * Float64(x * Float64(z / sqrt(Float64(Float64(z * z) - Float64(t * a)))))); else tmp = Float64(x * y); 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.16e+154)
tmp = x * -y;
elseif (z <= 4.2e+54)
tmp = y * (x * (z / sqrt(((z * z) - (t * a)))));
else
tmp = x * y;
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.16e+154], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 4.2e+54], N[(y * N[(x * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.16 \cdot 10^{+154}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.16000000000000001e154Initial program 19.0%
associate-*l*18.5%
associate-*r/18.7%
*-commutative18.7%
associate-/l*19.6%
Simplified19.6%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.16000000000000001e154 < z < 4.19999999999999972e54Initial program 85.8%
associate-*l*84.3%
associate-*r/87.6%
*-commutative87.6%
associate-*l/88.5%
associate-*r*87.8%
Applied egg-rr87.8%
if 4.19999999999999972e54 < z Initial program 53.2%
associate-*l*51.4%
associate-*r/55.8%
*-commutative55.8%
associate-/l*50.3%
Simplified50.3%
Taylor expanded in z around inf 97.1%
*-commutative97.1%
Simplified97.1%
Final simplification92.5%
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 (* x (/ z (- (* 0.5 (/ a (/ z t))) z)))))
(t_2 (sqrt (* a (- t))))
(t_3 (/ (* z x) (/ t_2 y))))
(if (<= z -1.15e-24)
t_1
(if (<= z -1.52e-75)
t_3
(if (<= z -4.5e-138)
t_1
(if (<= z 3.15e-279)
(* y (* x (/ z t_2)))
(if (<= z 1.1e-57)
t_3
(* y (* x (/ z (+ z (* -0.5 (/ (* t a) z)))))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
double t_2 = sqrt((a * -t));
double t_3 = (z * x) / (t_2 / y);
double tmp;
if (z <= -1.15e-24) {
tmp = t_1;
} else if (z <= -1.52e-75) {
tmp = t_3;
} else if (z <= -4.5e-138) {
tmp = t_1;
} else if (z <= 3.15e-279) {
tmp = y * (x * (z / t_2));
} else if (z <= 1.1e-57) {
tmp = t_3;
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y * (x * (z / ((0.5d0 * (a / (z / t))) - z)))
t_2 = sqrt((a * -t))
t_3 = (z * x) / (t_2 / y)
if (z <= (-1.15d-24)) then
tmp = t_1
else if (z <= (-1.52d-75)) then
tmp = t_3
else if (z <= (-4.5d-138)) then
tmp = t_1
else if (z <= 3.15d-279) then
tmp = y * (x * (z / t_2))
else if (z <= 1.1d-57) then
tmp = t_3
else
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
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 * (x * (z / ((0.5 * (a / (z / t))) - z)));
double t_2 = Math.sqrt((a * -t));
double t_3 = (z * x) / (t_2 / y);
double tmp;
if (z <= -1.15e-24) {
tmp = t_1;
} else if (z <= -1.52e-75) {
tmp = t_3;
} else if (z <= -4.5e-138) {
tmp = t_1;
} else if (z <= 3.15e-279) {
tmp = y * (x * (z / t_2));
} else if (z <= 1.1e-57) {
tmp = t_3;
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z))) t_2 = math.sqrt((a * -t)) t_3 = (z * x) / (t_2 / y) tmp = 0 if z <= -1.15e-24: tmp = t_1 elif z <= -1.52e-75: tmp = t_3 elif z <= -4.5e-138: tmp = t_1 elif z <= 3.15e-279: tmp = y * (x * (z / t_2)) elif z <= 1.1e-57: tmp = t_3 else: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(x * Float64(z / Float64(Float64(0.5 * Float64(a / Float64(z / t))) - z)))) t_2 = sqrt(Float64(a * Float64(-t))) t_3 = Float64(Float64(z * x) / Float64(t_2 / y)) tmp = 0.0 if (z <= -1.15e-24) tmp = t_1; elseif (z <= -1.52e-75) tmp = t_3; elseif (z <= -4.5e-138) tmp = t_1; elseif (z <= 3.15e-279) tmp = Float64(y * Float64(x * Float64(z / t_2))); elseif (z <= 1.1e-57) tmp = t_3; else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
t_2 = sqrt((a * -t));
t_3 = (z * x) / (t_2 / y);
tmp = 0.0;
if (z <= -1.15e-24)
tmp = t_1;
elseif (z <= -1.52e-75)
tmp = t_3;
elseif (z <= -4.5e-138)
tmp = t_1;
elseif (z <= 3.15e-279)
tmp = y * (x * (z / t_2));
elseif (z <= 1.1e-57)
tmp = t_3;
else
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
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[(x * N[(z / N[(N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * x), $MachinePrecision] / N[(t$95$2 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-24], t$95$1, If[LessEqual[z, -1.52e-75], t$95$3, If[LessEqual[z, -4.5e-138], t$95$1, If[LessEqual[z, 3.15e-279], N[(y * N[(x * N[(z / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-57], t$95$3, N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a}{\frac{z}{t}} - z}\right)\\
t_2 := \sqrt{a \cdot \left(-t\right)}\\
t_3 := \frac{z \cdot x}{\frac{t_2}{y}}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.52 \cdot 10^{-75}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.15 \cdot 10^{-279}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{t_2}\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-57}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\end{array}
\end{array}
if z < -1.1500000000000001e-24 or -1.5200000000000001e-75 < z < -4.50000000000000008e-138Initial program 52.2%
associate-*l*49.7%
associate-*r/54.9%
*-commutative54.9%
associate-*l/57.4%
associate-*r*57.4%
Applied egg-rr57.4%
Taylor expanded in z around -inf 90.2%
neg-mul-190.2%
+-commutative90.2%
unsub-neg90.2%
associate-/l*92.2%
Simplified92.2%
if -1.1500000000000001e-24 < z < -1.5200000000000001e-75 or 3.1499999999999999e-279 < z < 1.09999999999999999e-57Initial program 82.1%
associate-*l*84.6%
associate-*r/81.9%
*-commutative81.9%
associate-/l*81.9%
Simplified81.9%
Taylor expanded in z around 0 76.3%
mul-1-neg76.3%
distribute-rgt-neg-out76.3%
Simplified76.3%
associate-*r/76.9%
*-commutative76.9%
Applied egg-rr76.9%
if -4.50000000000000008e-138 < z < 3.1499999999999999e-279Initial program 85.7%
associate-*l*83.1%
associate-*r/85.1%
*-commutative85.1%
associate-/l*85.5%
Simplified85.5%
Taylor expanded in z around 0 83.3%
mul-1-neg83.3%
distribute-rgt-neg-out83.3%
Simplified83.3%
expm1-log1p-u71.8%
expm1-udef50.9%
associate-/r/50.9%
Applied egg-rr50.9%
expm1-def71.8%
expm1-log1p83.3%
associate-*r*83.2%
*-commutative83.2%
Simplified83.2%
if 1.09999999999999999e-57 < z Initial program 63.5%
associate-*l*62.2%
associate-*r/65.5%
*-commutative65.5%
associate-*l/66.9%
associate-*r*66.9%
Applied egg-rr66.9%
Taylor expanded in z around inf 89.1%
Final simplification87.8%
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 (* x (* y (/ z (sqrt (* a (- t)))))))
(t_2 (* y (* x (/ z (- (* 0.5 (/ a (/ z t))) z))))))
(if (<= z -1.15e-24)
t_2
(if (<= z -1.15e-75)
t_1
(if (<= z -2.8e-138)
t_2
(if (<= z 1.08e-57)
t_1
(* y (* x (/ z (+ z (* -0.5 (/ (* t a) z))))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (y * (z / sqrt((a * -t))));
double t_2 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
double tmp;
if (z <= -1.15e-24) {
tmp = t_2;
} else if (z <= -1.15e-75) {
tmp = t_1;
} else if (z <= -2.8e-138) {
tmp = t_2;
} else if (z <= 1.08e-57) {
tmp = t_1;
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
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) :: t_2
real(8) :: tmp
t_1 = x * (y * (z / sqrt((a * -t))))
t_2 = y * (x * (z / ((0.5d0 * (a / (z / t))) - z)))
if (z <= (-1.15d-24)) then
tmp = t_2
else if (z <= (-1.15d-75)) then
tmp = t_1
else if (z <= (-2.8d-138)) then
tmp = t_2
else if (z <= 1.08d-57) then
tmp = t_1
else
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
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 = x * (y * (z / Math.sqrt((a * -t))));
double t_2 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
double tmp;
if (z <= -1.15e-24) {
tmp = t_2;
} else if (z <= -1.15e-75) {
tmp = t_1;
} else if (z <= -2.8e-138) {
tmp = t_2;
} else if (z <= 1.08e-57) {
tmp = t_1;
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = x * (y * (z / math.sqrt((a * -t)))) t_2 = y * (x * (z / ((0.5 * (a / (z / t))) - z))) tmp = 0 if z <= -1.15e-24: tmp = t_2 elif z <= -1.15e-75: tmp = t_1 elif z <= -2.8e-138: tmp = t_2 elif z <= 1.08e-57: tmp = t_1 else: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(x * Float64(y * Float64(z / sqrt(Float64(a * Float64(-t)))))) t_2 = Float64(y * Float64(x * Float64(z / Float64(Float64(0.5 * Float64(a / Float64(z / t))) - z)))) tmp = 0.0 if (z <= -1.15e-24) tmp = t_2; elseif (z <= -1.15e-75) tmp = t_1; elseif (z <= -2.8e-138) tmp = t_2; elseif (z <= 1.08e-57) tmp = t_1; else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = x * (y * (z / sqrt((a * -t))));
t_2 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
tmp = 0.0;
if (z <= -1.15e-24)
tmp = t_2;
elseif (z <= -1.15e-75)
tmp = t_1;
elseif (z <= -2.8e-138)
tmp = t_2;
elseif (z <= 1.08e-57)
tmp = t_1;
else
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
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[(x * N[(y * N[(z / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(x * N[(z / N[(N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e-24], t$95$2, If[LessEqual[z, -1.15e-75], t$95$1, If[LessEqual[z, -2.8e-138], t$95$2, If[LessEqual[z, 1.08e-57], t$95$1, N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot \frac{z}{\sqrt{a \cdot \left(-t\right)}}\right)\\
t_2 := y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a}{\frac{z}{t}} - z}\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-75}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-138}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.08 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\end{array}
\end{array}
if z < -1.1500000000000001e-24 or -1.15e-75 < z < -2.80000000000000001e-138Initial program 52.2%
associate-*l*49.7%
associate-*r/54.9%
*-commutative54.9%
associate-*l/57.4%
associate-*r*57.4%
Applied egg-rr57.4%
Taylor expanded in z around -inf 90.2%
neg-mul-190.2%
+-commutative90.2%
unsub-neg90.2%
associate-/l*92.2%
Simplified92.2%
if -1.1500000000000001e-24 < z < -1.15e-75 or -2.80000000000000001e-138 < z < 1.08e-57Initial program 83.8%
associate-*l*83.9%
associate-*r/83.5%
*-commutative83.5%
associate-/l*83.7%
Simplified83.7%
Taylor expanded in z around 0 79.8%
mul-1-neg79.8%
distribute-rgt-neg-out79.8%
Simplified79.8%
associate-/r/78.4%
Applied egg-rr78.4%
if 1.08e-57 < z Initial program 63.5%
associate-*l*62.2%
associate-*r/65.5%
*-commutative65.5%
associate-*l/66.9%
associate-*r*66.9%
Applied egg-rr66.9%
Taylor expanded in z around inf 89.1%
Final simplification87.3%
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 (* x (/ z (- (* 0.5 (/ a (/ z t))) z)))))
(t_2 (sqrt (* a (- t)))))
(if (<= z -1.75e-24)
t_1
(if (<= z -5.8e-76)
(* x (* y (/ z t_2)))
(if (<= z -1.5e-138)
t_1
(if (<= z 7.5e-57)
(* x (/ (* z y) t_2))
(* y (* x (/ z (+ z (* -0.5 (/ (* t a) z))))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
double t_2 = sqrt((a * -t));
double tmp;
if (z <= -1.75e-24) {
tmp = t_1;
} else if (z <= -5.8e-76) {
tmp = x * (y * (z / t_2));
} else if (z <= -1.5e-138) {
tmp = t_1;
} else if (z <= 7.5e-57) {
tmp = x * ((z * y) / t_2);
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
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) :: t_2
real(8) :: tmp
t_1 = y * (x * (z / ((0.5d0 * (a / (z / t))) - z)))
t_2 = sqrt((a * -t))
if (z <= (-1.75d-24)) then
tmp = t_1
else if (z <= (-5.8d-76)) then
tmp = x * (y * (z / t_2))
else if (z <= (-1.5d-138)) then
tmp = t_1
else if (z <= 7.5d-57) then
tmp = x * ((z * y) / t_2)
else
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
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 * (x * (z / ((0.5 * (a / (z / t))) - z)));
double t_2 = Math.sqrt((a * -t));
double tmp;
if (z <= -1.75e-24) {
tmp = t_1;
} else if (z <= -5.8e-76) {
tmp = x * (y * (z / t_2));
} else if (z <= -1.5e-138) {
tmp = t_1;
} else if (z <= 7.5e-57) {
tmp = x * ((z * y) / t_2);
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z))) t_2 = math.sqrt((a * -t)) tmp = 0 if z <= -1.75e-24: tmp = t_1 elif z <= -5.8e-76: tmp = x * (y * (z / t_2)) elif z <= -1.5e-138: tmp = t_1 elif z <= 7.5e-57: tmp = x * ((z * y) / t_2) else: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(x * Float64(z / Float64(Float64(0.5 * Float64(a / Float64(z / t))) - z)))) t_2 = sqrt(Float64(a * Float64(-t))) tmp = 0.0 if (z <= -1.75e-24) tmp = t_1; elseif (z <= -5.8e-76) tmp = Float64(x * Float64(y * Float64(z / t_2))); elseif (z <= -1.5e-138) tmp = t_1; elseif (z <= 7.5e-57) tmp = Float64(x * Float64(Float64(z * y) / t_2)); else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
t_2 = sqrt((a * -t));
tmp = 0.0;
if (z <= -1.75e-24)
tmp = t_1;
elseif (z <= -5.8e-76)
tmp = x * (y * (z / t_2));
elseif (z <= -1.5e-138)
tmp = t_1;
elseif (z <= 7.5e-57)
tmp = x * ((z * y) / t_2);
else
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
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[(x * N[(z / N[(N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.75e-24], t$95$1, If[LessEqual[z, -5.8e-76], N[(x * N[(y * N[(z / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.5e-138], t$95$1, If[LessEqual[z, 7.5e-57], N[(x * N[(N[(z * y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a}{\frac{z}{t}} - z}\right)\\
t_2 := \sqrt{a \cdot \left(-t\right)}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-76}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{t_2}\right)\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-57}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{t_2}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\end{array}
\end{array}
if z < -1.7499999999999998e-24 or -5.8000000000000003e-76 < z < -1.5e-138Initial program 52.2%
associate-*l*49.7%
associate-*r/54.9%
*-commutative54.9%
associate-*l/57.4%
associate-*r*57.4%
Applied egg-rr57.4%
Taylor expanded in z around -inf 90.2%
neg-mul-190.2%
+-commutative90.2%
unsub-neg90.2%
associate-/l*92.2%
Simplified92.2%
if -1.7499999999999998e-24 < z < -5.8000000000000003e-76Initial program 89.3%
associate-*l*89.5%
associate-*r/89.2%
*-commutative89.2%
associate-/l*89.0%
Simplified89.0%
Taylor expanded in z around 0 82.4%
mul-1-neg82.4%
distribute-rgt-neg-out82.4%
Simplified82.4%
associate-/r/82.4%
Applied egg-rr82.4%
if -1.5e-138 < z < 7.49999999999999973e-57Initial program 83.0%
associate-*l*83.1%
associate-*r/82.6%
Simplified82.6%
Taylor expanded in z around 0 79.1%
mul-1-neg79.4%
distribute-rgt-neg-out79.4%
Simplified79.1%
if 7.49999999999999973e-57 < z Initial program 63.5%
associate-*l*62.2%
associate-*r/65.5%
*-commutative65.5%
associate-*l/66.9%
associate-*r*66.9%
Applied egg-rr66.9%
Taylor expanded in z around inf 89.1%
Final simplification87.6%
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 (* x (/ z (- (* 0.5 (/ a (/ z t))) z)))))
(t_2 (/ z (sqrt (* a (- t))))))
(if (<= z -1.58e-24)
t_1
(if (<= z -3.8e-76)
(* x (* y t_2))
(if (<= z -3.7e-138)
t_1
(if (<= z 2.4e-58)
(* y (* x t_2))
(* y (* x (/ z (+ z (* -0.5 (/ (* t a) z))))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
double t_2 = z / sqrt((a * -t));
double tmp;
if (z <= -1.58e-24) {
tmp = t_1;
} else if (z <= -3.8e-76) {
tmp = x * (y * t_2);
} else if (z <= -3.7e-138) {
tmp = t_1;
} else if (z <= 2.4e-58) {
tmp = y * (x * t_2);
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
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) :: t_2
real(8) :: tmp
t_1 = y * (x * (z / ((0.5d0 * (a / (z / t))) - z)))
t_2 = z / sqrt((a * -t))
if (z <= (-1.58d-24)) then
tmp = t_1
else if (z <= (-3.8d-76)) then
tmp = x * (y * t_2)
else if (z <= (-3.7d-138)) then
tmp = t_1
else if (z <= 2.4d-58) then
tmp = y * (x * t_2)
else
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
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 * (x * (z / ((0.5 * (a / (z / t))) - z)));
double t_2 = z / Math.sqrt((a * -t));
double tmp;
if (z <= -1.58e-24) {
tmp = t_1;
} else if (z <= -3.8e-76) {
tmp = x * (y * t_2);
} else if (z <= -3.7e-138) {
tmp = t_1;
} else if (z <= 2.4e-58) {
tmp = y * (x * t_2);
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z))) t_2 = z / math.sqrt((a * -t)) tmp = 0 if z <= -1.58e-24: tmp = t_1 elif z <= -3.8e-76: tmp = x * (y * t_2) elif z <= -3.7e-138: tmp = t_1 elif z <= 2.4e-58: tmp = y * (x * t_2) else: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(x * Float64(z / Float64(Float64(0.5 * Float64(a / Float64(z / t))) - z)))) t_2 = Float64(z / sqrt(Float64(a * Float64(-t)))) tmp = 0.0 if (z <= -1.58e-24) tmp = t_1; elseif (z <= -3.8e-76) tmp = Float64(x * Float64(y * t_2)); elseif (z <= -3.7e-138) tmp = t_1; elseif (z <= 2.4e-58) tmp = Float64(y * Float64(x * t_2)); else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
t_2 = z / sqrt((a * -t));
tmp = 0.0;
if (z <= -1.58e-24)
tmp = t_1;
elseif (z <= -3.8e-76)
tmp = x * (y * t_2);
elseif (z <= -3.7e-138)
tmp = t_1;
elseif (z <= 2.4e-58)
tmp = y * (x * t_2);
else
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
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[(x * N[(z / N[(N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.58e-24], t$95$1, If[LessEqual[z, -3.8e-76], N[(x * N[(y * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.7e-138], t$95$1, If[LessEqual[z, 2.4e-58], N[(y * N[(x * t$95$2), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a}{\frac{z}{t}} - z}\right)\\
t_2 := \frac{z}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{if}\;z \leq -1.58 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-76}:\\
\;\;\;\;x \cdot \left(y \cdot t_2\right)\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-58}:\\
\;\;\;\;y \cdot \left(x \cdot t_2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\end{array}
\end{array}
if z < -1.5799999999999999e-24 or -3.8000000000000002e-76 < z < -3.69999999999999991e-138Initial program 52.2%
associate-*l*49.7%
associate-*r/54.9%
*-commutative54.9%
associate-*l/57.4%
associate-*r*57.4%
Applied egg-rr57.4%
Taylor expanded in z around -inf 90.2%
neg-mul-190.2%
+-commutative90.2%
unsub-neg90.2%
associate-/l*92.2%
Simplified92.2%
if -1.5799999999999999e-24 < z < -3.8000000000000002e-76Initial program 89.3%
associate-*l*89.5%
associate-*r/89.2%
*-commutative89.2%
associate-/l*89.0%
Simplified89.0%
Taylor expanded in z around 0 82.4%
mul-1-neg82.4%
distribute-rgt-neg-out82.4%
Simplified82.4%
associate-/r/82.4%
Applied egg-rr82.4%
if -3.69999999999999991e-138 < z < 2.4000000000000001e-58Initial program 83.0%
associate-*l*83.1%
associate-*r/82.6%
*-commutative82.6%
associate-/l*82.9%
Simplified82.9%
Taylor expanded in z around 0 79.4%
mul-1-neg79.4%
distribute-rgt-neg-out79.4%
Simplified79.4%
expm1-log1p-u66.3%
expm1-udef41.1%
associate-/r/41.1%
Applied egg-rr41.1%
expm1-def64.8%
expm1-log1p77.9%
associate-*r*76.3%
*-commutative76.3%
Simplified76.3%
if 2.4000000000000001e-58 < z Initial program 63.5%
associate-*l*62.2%
associate-*r/65.5%
*-commutative65.5%
associate-*l/66.9%
associate-*r*66.9%
Applied egg-rr66.9%
Taylor expanded in z around inf 89.1%
Final simplification86.9%
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 (* x (/ z (- (* 0.5 (/ a (/ z t))) z)))))
(t_2 (sqrt (* a (- t)))))
(if (<= z -1.15e-24)
t_1
(if (<= z -1.35e-76)
(* x (* y (/ z t_2)))
(if (<= z -1.65e-140)
t_1
(if (<= z 3.7e-58)
(* z (/ (* x y) t_2))
(* y (* x (/ z (+ z (* -0.5 (/ (* t a) z))))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
double t_2 = sqrt((a * -t));
double tmp;
if (z <= -1.15e-24) {
tmp = t_1;
} else if (z <= -1.35e-76) {
tmp = x * (y * (z / t_2));
} else if (z <= -1.65e-140) {
tmp = t_1;
} else if (z <= 3.7e-58) {
tmp = z * ((x * y) / t_2);
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
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) :: t_2
real(8) :: tmp
t_1 = y * (x * (z / ((0.5d0 * (a / (z / t))) - z)))
t_2 = sqrt((a * -t))
if (z <= (-1.15d-24)) then
tmp = t_1
else if (z <= (-1.35d-76)) then
tmp = x * (y * (z / t_2))
else if (z <= (-1.65d-140)) then
tmp = t_1
else if (z <= 3.7d-58) then
tmp = z * ((x * y) / t_2)
else
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
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 * (x * (z / ((0.5 * (a / (z / t))) - z)));
double t_2 = Math.sqrt((a * -t));
double tmp;
if (z <= -1.15e-24) {
tmp = t_1;
} else if (z <= -1.35e-76) {
tmp = x * (y * (z / t_2));
} else if (z <= -1.65e-140) {
tmp = t_1;
} else if (z <= 3.7e-58) {
tmp = z * ((x * y) / t_2);
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z))) t_2 = math.sqrt((a * -t)) tmp = 0 if z <= -1.15e-24: tmp = t_1 elif z <= -1.35e-76: tmp = x * (y * (z / t_2)) elif z <= -1.65e-140: tmp = t_1 elif z <= 3.7e-58: tmp = z * ((x * y) / t_2) else: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(x * Float64(z / Float64(Float64(0.5 * Float64(a / Float64(z / t))) - z)))) t_2 = sqrt(Float64(a * Float64(-t))) tmp = 0.0 if (z <= -1.15e-24) tmp = t_1; elseif (z <= -1.35e-76) tmp = Float64(x * Float64(y * Float64(z / t_2))); elseif (z <= -1.65e-140) tmp = t_1; elseif (z <= 3.7e-58) tmp = Float64(z * Float64(Float64(x * y) / t_2)); else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
t_2 = sqrt((a * -t));
tmp = 0.0;
if (z <= -1.15e-24)
tmp = t_1;
elseif (z <= -1.35e-76)
tmp = x * (y * (z / t_2));
elseif (z <= -1.65e-140)
tmp = t_1;
elseif (z <= 3.7e-58)
tmp = z * ((x * y) / t_2);
else
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
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[(x * N[(z / N[(N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.15e-24], t$95$1, If[LessEqual[z, -1.35e-76], N[(x * N[(y * N[(z / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.65e-140], t$95$1, If[LessEqual[z, 3.7e-58], N[(z * N[(N[(x * y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a}{\frac{z}{t}} - z}\right)\\
t_2 := \sqrt{a \cdot \left(-t\right)}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-76}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{t_2}\right)\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-140}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-58}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{t_2}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\end{array}
\end{array}
if z < -1.1500000000000001e-24 or -1.35e-76 < z < -1.64999999999999994e-140Initial program 52.7%
associate-*l*50.2%
associate-*r/55.4%
*-commutative55.4%
associate-*l/57.8%
associate-*r*57.9%
Applied egg-rr57.9%
Taylor expanded in z around -inf 89.3%
neg-mul-189.3%
+-commutative89.3%
unsub-neg89.3%
associate-/l*91.3%
Simplified91.3%
if -1.1500000000000001e-24 < z < -1.35e-76Initial program 89.3%
associate-*l*89.5%
associate-*r/89.2%
*-commutative89.2%
associate-/l*89.0%
Simplified89.0%
Taylor expanded in z around 0 82.4%
mul-1-neg82.4%
distribute-rgt-neg-out82.4%
Simplified82.4%
associate-/r/82.4%
Applied egg-rr82.4%
if -1.64999999999999994e-140 < z < 3.7000000000000003e-58Initial program 82.8%
associate-*l/85.3%
Simplified85.3%
Taylor expanded in z around 0 82.1%
mul-1-neg79.0%
distribute-rgt-neg-out79.0%
Simplified82.1%
if 3.7000000000000003e-58 < z Initial program 63.5%
associate-*l*62.2%
associate-*r/65.5%
*-commutative65.5%
associate-*l/66.9%
associate-*r*66.9%
Applied egg-rr66.9%
Taylor expanded in z around inf 89.1%
Final simplification88.0%
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+115) (* x (- y)) (if (<= z 4e+54) (* x (/ z (/ (sqrt (- (* z z) (* t a))) y))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+115) {
tmp = x * -y;
} else if (z <= 4e+54) {
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y));
} else {
tmp = x * y;
}
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+115)) then
tmp = x * -y
else if (z <= 4d+54) then
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y))
else
tmp = x * y
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+115) {
tmp = x * -y;
} else if (z <= 4e+54) {
tmp = x * (z / (Math.sqrt(((z * z) - (t * a))) / y));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2e+115: tmp = x * -y elif z <= 4e+54: tmp = x * (z / (math.sqrt(((z * z) - (t * a))) / y)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+115) tmp = Float64(x * Float64(-y)); elseif (z <= 4e+54) tmp = Float64(x * Float64(z / Float64(sqrt(Float64(Float64(z * z) - Float64(t * a))) / y))); else tmp = Float64(x * y); 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+115)
tmp = x * -y;
elseif (z <= 4e+54)
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y));
else
tmp = x * y;
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+115], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 4e+54], N[(x * N[(z / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+115}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+54}:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{z \cdot z - t \cdot a}}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2e115Initial program 32.3%
associate-*l*30.3%
associate-*r/31.9%
*-commutative31.9%
associate-/l*32.7%
Simplified32.7%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -2e115 < z < 4.0000000000000003e54Initial program 85.4%
associate-*l*84.4%
associate-*r/87.4%
*-commutative87.4%
associate-/l*87.5%
Simplified87.5%
if 4.0000000000000003e54 < z Initial program 53.2%
associate-*l*51.4%
associate-*r/55.8%
*-commutative55.8%
associate-/l*50.3%
Simplified50.3%
Taylor expanded in z around inf 97.1%
*-commutative97.1%
Simplified97.1%
Final simplification92.8%
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.9e+67) (* x (- y)) (if (<= z 3.1e+54) (* x (/ (* z y) (sqrt (- (* z z) (* t a))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+67) {
tmp = x * -y;
} else if (z <= 3.1e+54) {
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))));
} else {
tmp = x * y;
}
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.9d+67)) then
tmp = x * -y
else if (z <= 3.1d+54) then
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))))
else
tmp = x * y
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.9e+67) {
tmp = x * -y;
} else if (z <= 3.1e+54) {
tmp = x * ((z * y) / Math.sqrt(((z * z) - (t * a))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+67: tmp = x * -y elif z <= 3.1e+54: tmp = x * ((z * y) / math.sqrt(((z * z) - (t * a)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+67) tmp = Float64(x * Float64(-y)); elseif (z <= 3.1e+54) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(Float64(z * z) - Float64(t * a))))); else tmp = Float64(x * y); 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.9e+67)
tmp = x * -y;
elseif (z <= 3.1e+54)
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))));
else
tmp = x * y;
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.9e+67], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.1e+54], N[(x * N[(N[(z * y), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+67}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+54}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.9000000000000001e67Initial program 37.5%
associate-*l*34.1%
associate-*r/35.7%
*-commutative35.7%
associate-/l*37.9%
Simplified37.9%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.9000000000000001e67 < z < 3.0999999999999999e54Initial program 84.8%
associate-*l*84.6%
associate-*r/87.6%
Simplified87.6%
if 3.0999999999999999e54 < z Initial program 53.2%
associate-*l*51.4%
associate-*r/55.8%
*-commutative55.8%
associate-/l*50.3%
Simplified50.3%
Taylor expanded in z around inf 97.1%
*-commutative97.1%
Simplified97.1%
Final simplification93.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 -2.3e-183) (* x (- y)) (if (<= z 0.047) (* x (/ z (/ (+ z (* (/ a (/ z t)) -0.5)) y))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-183) {
tmp = x * -y;
} else if (z <= 0.047) {
tmp = x * (z / ((z + ((a / (z / t)) * -0.5)) / y));
} else {
tmp = x * y;
}
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.3d-183)) then
tmp = x * -y
else if (z <= 0.047d0) then
tmp = x * (z / ((z + ((a / (z / t)) * (-0.5d0))) / y))
else
tmp = x * y
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.3e-183) {
tmp = x * -y;
} else if (z <= 0.047) {
tmp = x * (z / ((z + ((a / (z / t)) * -0.5)) / y));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.3e-183: tmp = x * -y elif z <= 0.047: tmp = x * (z / ((z + ((a / (z / t)) * -0.5)) / y)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e-183) tmp = Float64(x * Float64(-y)); elseif (z <= 0.047) tmp = Float64(x * Float64(z / Float64(Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5)) / y))); else tmp = Float64(x * y); 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.3e-183)
tmp = x * -y;
elseif (z <= 0.047)
tmp = x * (z / ((z + ((a / (z / t)) * -0.5)) / y));
else
tmp = x * y;
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.3e-183], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 0.047], N[(x * N[(z / N[(N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-183}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 0.047:\\
\;\;\;\;x \cdot \frac{z}{\frac{z + \frac{a}{\frac{z}{t}} \cdot -0.5}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.30000000000000016e-183Initial program 57.9%
associate-*l*55.8%
associate-*r/60.7%
*-commutative60.7%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around -inf 79.5%
neg-mul-179.5%
Simplified79.5%
if -2.30000000000000016e-183 < z < 0.047Initial program 86.4%
associate-*l*86.4%
associate-*r/84.9%
*-commutative84.9%
associate-/l*84.6%
Simplified84.6%
Taylor expanded in z around inf 59.3%
associate-/l*59.3%
Simplified59.3%
if 0.047 < z Initial program 57.4%
associate-*l*55.9%
associate-*r/59.7%
*-commutative59.7%
associate-/l*54.3%
Simplified54.3%
Taylor expanded in z around inf 92.6%
*-commutative92.6%
Simplified92.6%
Final simplification78.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 -2.6e-183) (* x (- y)) (if (<= z 0.052) (* x (/ (* z y) (+ z (* -0.5 (/ (* t a) z))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-183) {
tmp = x * -y;
} else if (z <= 0.052) {
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = x * y;
}
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.6d-183)) then
tmp = x * -y
else if (z <= 0.052d0) then
tmp = x * ((z * y) / (z + ((-0.5d0) * ((t * a) / z))))
else
tmp = x * y
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.6e-183) {
tmp = x * -y;
} else if (z <= 0.052) {
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.6e-183: tmp = x * -y elif z <= 0.052: tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e-183) tmp = Float64(x * Float64(-y)); elseif (z <= 0.052) tmp = Float64(x * Float64(Float64(z * y) / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))))); else tmp = Float64(x * y); 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.6e-183)
tmp = x * -y;
elseif (z <= 0.052)
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
else
tmp = x * y;
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.6e-183], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 0.052], N[(x * N[(N[(z * y), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-183}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 0.052:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.5999999999999999e-183Initial program 57.9%
associate-*l*55.8%
associate-*r/60.7%
*-commutative60.7%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around -inf 79.5%
neg-mul-179.5%
Simplified79.5%
if -2.5999999999999999e-183 < z < 0.0519999999999999976Initial program 86.4%
associate-*l*86.4%
associate-*r/84.9%
Simplified84.9%
Taylor expanded in z around inf 59.9%
if 0.0519999999999999976 < z Initial program 57.4%
associate-*l*55.9%
associate-*r/59.7%
*-commutative59.7%
associate-/l*54.3%
Simplified54.3%
Taylor expanded in z around inf 92.6%
*-commutative92.6%
Simplified92.6%
Final simplification78.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 -3.6e-183) (* x (- y)) (if (<= z 2.4e-121) (* -2.0 (* (/ x t) (/ (* y (* z z)) a))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.6e-183) {
tmp = x * -y;
} else if (z <= 2.4e-121) {
tmp = -2.0 * ((x / t) * ((y * (z * z)) / a));
} else {
tmp = x * y;
}
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.6d-183)) then
tmp = x * -y
else if (z <= 2.4d-121) then
tmp = (-2.0d0) * ((x / t) * ((y * (z * z)) / a))
else
tmp = x * y
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.6e-183) {
tmp = x * -y;
} else if (z <= 2.4e-121) {
tmp = -2.0 * ((x / t) * ((y * (z * z)) / a));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.6e-183: tmp = x * -y elif z <= 2.4e-121: tmp = -2.0 * ((x / t) * ((y * (z * z)) / a)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.6e-183) tmp = Float64(x * Float64(-y)); elseif (z <= 2.4e-121) tmp = Float64(-2.0 * Float64(Float64(x / t) * Float64(Float64(y * Float64(z * z)) / a))); else tmp = Float64(x * y); 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.6e-183)
tmp = x * -y;
elseif (z <= 2.4e-121)
tmp = -2.0 * ((x / t) * ((y * (z * z)) / a));
else
tmp = x * y;
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.6e-183], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.4e-121], N[(-2.0 * N[(N[(x / t), $MachinePrecision] * N[(N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-183}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-121}:\\
\;\;\;\;-2 \cdot \left(\frac{x}{t} \cdot \frac{y \cdot \left(z \cdot z\right)}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.6000000000000001e-183Initial program 57.9%
associate-*l*55.8%
associate-*r/60.7%
*-commutative60.7%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around -inf 79.5%
neg-mul-179.5%
Simplified79.5%
if -3.6000000000000001e-183 < z < 2.40000000000000003e-121Initial program 84.4%
associate-*l/84.2%
Simplified84.2%
Taylor expanded in z around inf 55.8%
Taylor expanded in z around 0 53.0%
*-commutative53.0%
times-frac52.9%
unpow252.9%
Simplified52.9%
if 2.40000000000000003e-121 < z Initial program 64.6%
associate-*l*63.4%
associate-*r/67.4%
*-commutative67.4%
associate-/l*62.8%
Simplified62.8%
Taylor expanded in z around inf 84.4%
*-commutative84.4%
Simplified84.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 -3.7e-183) (* x (- y)) (if (<= z 2.5e-122) (* -2.0 (/ x (/ t (/ y (/ a (* z z)))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e-183) {
tmp = x * -y;
} else if (z <= 2.5e-122) {
tmp = -2.0 * (x / (t / (y / (a / (z * z)))));
} else {
tmp = x * y;
}
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.7d-183)) then
tmp = x * -y
else if (z <= 2.5d-122) then
tmp = (-2.0d0) * (x / (t / (y / (a / (z * z)))))
else
tmp = x * y
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.7e-183) {
tmp = x * -y;
} else if (z <= 2.5e-122) {
tmp = -2.0 * (x / (t / (y / (a / (z * z)))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.7e-183: tmp = x * -y elif z <= 2.5e-122: tmp = -2.0 * (x / (t / (y / (a / (z * z))))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e-183) tmp = Float64(x * Float64(-y)); elseif (z <= 2.5e-122) tmp = Float64(-2.0 * Float64(x / Float64(t / Float64(y / Float64(a / Float64(z * z)))))); else tmp = Float64(x * y); 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.7e-183)
tmp = x * -y;
elseif (z <= 2.5e-122)
tmp = -2.0 * (x / (t / (y / (a / (z * z)))));
else
tmp = x * y;
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.7e-183], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.5e-122], N[(-2.0 * N[(x / N[(t / N[(y / N[(a / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{-183}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-122}:\\
\;\;\;\;-2 \cdot \frac{x}{\frac{t}{\frac{y}{\frac{a}{z \cdot z}}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.6999999999999999e-183Initial program 57.9%
associate-*l*55.8%
associate-*r/60.7%
*-commutative60.7%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around -inf 79.5%
neg-mul-179.5%
Simplified79.5%
if -3.6999999999999999e-183 < z < 2.4999999999999999e-122Initial program 84.4%
associate-*l/84.2%
Simplified84.2%
Taylor expanded in z around inf 55.8%
Taylor expanded in z around 0 53.0%
*-commutative53.0%
times-frac52.9%
unpow252.9%
Simplified52.9%
Taylor expanded in x around 0 53.0%
associate-/l*53.0%
*-commutative53.0%
*-commutative53.0%
unpow253.0%
associate-/l*55.5%
unpow255.5%
*-commutative55.5%
associate-/l*55.5%
unpow255.5%
Simplified55.5%
if 2.4999999999999999e-122 < z Initial program 64.6%
associate-*l*63.4%
associate-*r/67.4%
*-commutative67.4%
associate-/l*62.8%
Simplified62.8%
Taylor expanded in z around inf 84.4%
*-commutative84.4%
Simplified84.4%
Final simplification77.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 -3.3e-183) (* x (- y)) (if (<= z 1.15e-122) (* z (* -2.0 (* (/ z t) (/ (* x y) a)))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e-183) {
tmp = x * -y;
} else if (z <= 1.15e-122) {
tmp = z * (-2.0 * ((z / t) * ((x * y) / a)));
} else {
tmp = x * y;
}
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.3d-183)) then
tmp = x * -y
else if (z <= 1.15d-122) then
tmp = z * ((-2.0d0) * ((z / t) * ((x * y) / a)))
else
tmp = x * y
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.3e-183) {
tmp = x * -y;
} else if (z <= 1.15e-122) {
tmp = z * (-2.0 * ((z / t) * ((x * y) / a)));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.3e-183: tmp = x * -y elif z <= 1.15e-122: tmp = z * (-2.0 * ((z / t) * ((x * y) / a))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e-183) tmp = Float64(x * Float64(-y)); elseif (z <= 1.15e-122) tmp = Float64(z * Float64(-2.0 * Float64(Float64(z / t) * Float64(Float64(x * y) / a)))); else tmp = Float64(x * y); 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.3e-183)
tmp = x * -y;
elseif (z <= 1.15e-122)
tmp = z * (-2.0 * ((z / t) * ((x * y) / a)));
else
tmp = x * y;
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.3e-183], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.15e-122], N[(z * N[(-2.0 * N[(N[(z / t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-183}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-122}:\\
\;\;\;\;z \cdot \left(-2 \cdot \left(\frac{z}{t} \cdot \frac{x \cdot y}{a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.3e-183Initial program 57.9%
associate-*l*55.8%
associate-*r/60.7%
*-commutative60.7%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around -inf 79.5%
neg-mul-179.5%
Simplified79.5%
if -3.3e-183 < z < 1.15000000000000003e-122Initial program 84.4%
associate-*l/84.2%
Simplified84.2%
Taylor expanded in z around inf 55.8%
Taylor expanded in z around 0 53.1%
associate-*r*53.2%
*-commutative53.2%
*-commutative53.2%
times-frac55.6%
Simplified55.6%
if 1.15000000000000003e-122 < z Initial program 64.6%
associate-*l*63.4%
associate-*r/67.4%
*-commutative67.4%
associate-/l*62.8%
Simplified62.8%
Taylor expanded in z around inf 84.4%
*-commutative84.4%
Simplified84.4%
Final simplification77.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 -2.7e-183) (* x (- y)) (* y (* x (/ z (+ z (* -0.5 (/ (* t a) z))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-183) {
tmp = x * -y;
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
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-183)) then
tmp = x * -y
else
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
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-183) {
tmp = x * -y;
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.7e-183: tmp = x * -y else: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e-183) tmp = Float64(x * Float64(-y)); else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); 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-183)
tmp = x * -y;
else
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
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-183], N[(x * (-y)), $MachinePrecision], N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-183}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\end{array}
\end{array}
if z < -2.70000000000000008e-183Initial program 57.9%
associate-*l*55.8%
associate-*r/60.7%
*-commutative60.7%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around -inf 79.5%
neg-mul-179.5%
Simplified79.5%
if -2.70000000000000008e-183 < z Initial program 70.7%
associate-*l*69.9%
associate-*r/71.3%
*-commutative71.3%
associate-*l/71.7%
associate-*r*71.7%
Applied egg-rr71.7%
Taylor expanded in z around inf 76.7%
Final simplification78.0%
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.45e-207) (* y (* x (/ z (- (* 0.5 (/ a (/ z t))) z)))) (* y (* x (/ z (+ z (* -0.5 (/ (* t a) z))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-207) {
tmp = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
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.45d-207)) then
tmp = y * (x * (z / ((0.5d0 * (a / (z / t))) - z)))
else
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
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.45e-207) {
tmp = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.45e-207: tmp = y * (x * (z / ((0.5 * (a / (z / t))) - z))) else: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e-207) tmp = Float64(y * Float64(x * Float64(z / Float64(Float64(0.5 * Float64(a / Float64(z / t))) - z)))); else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); 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.45e-207)
tmp = y * (x * (z / ((0.5 * (a / (z / t))) - z)));
else
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
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.45e-207], N[(y * N[(x * N[(z / N[(N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-207}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a}{\frac{z}{t}} - z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\end{array}
\end{array}
if z < -1.45000000000000006e-207Initial program 59.2%
associate-*l*57.2%
associate-*r/61.9%
*-commutative61.9%
associate-*l/63.8%
associate-*r*63.1%
Applied egg-rr63.1%
Taylor expanded in z around -inf 78.7%
neg-mul-178.7%
+-commutative78.7%
unsub-neg78.7%
associate-/l*80.3%
Simplified80.3%
if -1.45000000000000006e-207 < z Initial program 70.1%
associate-*l*69.3%
associate-*r/70.7%
*-commutative70.7%
associate-*l/71.1%
associate-*r*71.1%
Applied egg-rr71.1%
Taylor expanded in z around inf 77.8%
Final simplification79.0%
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.45e-207) (* y (* x (/ z (- (* t (/ (* a 0.5) z)) z)))) (* y (* x (/ z (+ z (* -0.5 (/ (* t a) z))))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-207) {
tmp = y * (x * (z / ((t * ((a * 0.5) / z)) - z)));
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
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.45d-207)) then
tmp = y * (x * (z / ((t * ((a * 0.5d0) / z)) - z)))
else
tmp = y * (x * (z / (z + ((-0.5d0) * ((t * a) / z)))))
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.45e-207) {
tmp = y * (x * (z / ((t * ((a * 0.5) / z)) - z)));
} else {
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.45e-207: tmp = y * (x * (z / ((t * ((a * 0.5) / z)) - z))) else: tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z))))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e-207) tmp = Float64(y * Float64(x * Float64(z / Float64(Float64(t * Float64(Float64(a * 0.5) / z)) - z)))); else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z)))))); 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.45e-207)
tmp = y * (x * (z / ((t * ((a * 0.5) / z)) - z)));
else
tmp = y * (x * (z / (z + (-0.5 * ((t * a) / z)))));
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.45e-207], N[(y * N[(x * N[(z / N[(N[(t * N[(N[(a * 0.5), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * N[(z / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-207}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{t \cdot \frac{a \cdot 0.5}{z} - z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + -0.5 \cdot \frac{t \cdot a}{z}}\right)\\
\end{array}
\end{array}
if z < -1.45000000000000006e-207Initial program 59.2%
associate-*l*57.2%
associate-*r/61.9%
*-commutative61.9%
associate-*l/63.8%
associate-*r*63.1%
Applied egg-rr63.1%
Taylor expanded in z around -inf 78.7%
neg-mul-178.7%
+-commutative78.7%
unsub-neg78.7%
associate-/l*80.3%
Simplified80.3%
expm1-log1p-u78.8%
expm1-udef77.6%
associate-*r/77.6%
Applied egg-rr77.6%
expm1-def78.8%
expm1-log1p80.3%
associate-/r/80.2%
*-commutative80.2%
Simplified80.2%
if -1.45000000000000006e-207 < z Initial program 70.1%
associate-*l*69.3%
associate-*r/70.7%
*-commutative70.7%
associate-*l/71.1%
associate-*r*71.1%
Applied egg-rr71.1%
Taylor expanded in z around inf 77.8%
Final simplification79.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5.8e-212) (* x (- y)) (if (<= z 1e-104) (* x (/ (* z y) z)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e-212) {
tmp = x * -y;
} else if (z <= 1e-104) {
tmp = x * ((z * y) / z);
} else {
tmp = x * y;
}
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 <= (-5.8d-212)) then
tmp = x * -y
else if (z <= 1d-104) then
tmp = x * ((z * y) / z)
else
tmp = x * y
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 <= -5.8e-212) {
tmp = x * -y;
} else if (z <= 1e-104) {
tmp = x * ((z * y) / z);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5.8e-212: tmp = x * -y elif z <= 1e-104: tmp = x * ((z * y) / z) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e-212) tmp = Float64(x * Float64(-y)); elseif (z <= 1e-104) tmp = Float64(x * Float64(Float64(z * y) / z)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.8e-212)
tmp = x * -y;
elseif (z <= 1e-104)
tmp = x * ((z * y) / z);
else
tmp = x * y;
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, -5.8e-212], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1e-104], N[(x * N[(N[(z * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-212}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 10^{-104}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -5.7999999999999999e-212Initial program 59.8%
associate-*l*57.9%
associate-*r/62.5%
*-commutative62.5%
associate-/l*63.6%
Simplified63.6%
Taylor expanded in z around -inf 76.2%
neg-mul-176.2%
Simplified76.2%
if -5.7999999999999999e-212 < z < 9.99999999999999927e-105Initial program 82.5%
associate-*l*82.5%
associate-*r/79.9%
Simplified79.9%
Taylor expanded in z around inf 42.1%
if 9.99999999999999927e-105 < z Initial program 64.5%
associate-*l*63.2%
associate-*r/66.4%
*-commutative66.4%
associate-/l*61.6%
Simplified61.6%
Taylor expanded in z around inf 85.9%
*-commutative85.9%
Simplified85.9%
Final simplification74.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 1e-303) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1e-303) {
tmp = x * -y;
} else {
tmp = x * y;
}
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 <= 1d-303) then
tmp = x * -y
else
tmp = x * y
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 <= 1e-303) {
tmp = x * -y;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= 1e-303: tmp = x * -y else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 1e-303) tmp = Float64(x * Float64(-y)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 1e-303)
tmp = x * -y;
else
tmp = x * y;
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, 1e-303], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{-303}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < 9.99999999999999931e-304Initial program 63.4%
associate-*l*61.0%
associate-*r/65.1%
*-commutative65.1%
associate-/l*66.1%
Simplified66.1%
Taylor expanded in z around -inf 72.1%
neg-mul-172.1%
Simplified72.1%
if 9.99999999999999931e-304 < z Initial program 66.7%
associate-*l*66.5%
associate-*r/68.2%
*-commutative68.2%
associate-/l*64.4%
Simplified64.4%
Taylor expanded in z around inf 73.1%
*-commutative73.1%
Simplified73.1%
Final simplification72.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x y))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return x * y;
}
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 = x * y
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return x * y;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return x * y
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(x * y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = x * y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot y
\end{array}
Initial program 64.9%
associate-*l*63.5%
associate-*r/66.5%
*-commutative66.5%
associate-/l*65.3%
Simplified65.3%
Taylor expanded in z around inf 43.4%
*-commutative43.4%
Simplified43.4%
Final simplification43.4%
(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 2023290
(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)))))