
(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 21 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
(let* ((t_1 (- (* z z) (* a t))) (t_2 (sqrt t_1)) (t_3 (/ a (/ (* z z) t))))
(if (<= z -4e+110)
(/ (* x y) (fma 0.5 t_3 -1.0))
(if (<= z -1.8e-150)
(/ z (/ t_2 (* x y)))
(if (<= z 5.8e-193)
(* (* x (* z y)) (pow t_1 -0.5))
(if (<= z 1.6e-90)
(* y (* z (/ x t_2)))
(/ (* x y) (sqrt (- 1.0 t_3)))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = (z * z) - (a * t);
double t_2 = sqrt(t_1);
double t_3 = a / ((z * z) / t);
double tmp;
if (z <= -4e+110) {
tmp = (x * y) / fma(0.5, t_3, -1.0);
} else if (z <= -1.8e-150) {
tmp = z / (t_2 / (x * y));
} else if (z <= 5.8e-193) {
tmp = (x * (z * y)) * pow(t_1, -0.5);
} else if (z <= 1.6e-90) {
tmp = y * (z * (x / t_2));
} else {
tmp = (x * y) / sqrt((1.0 - t_3));
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(Float64(z * z) - Float64(a * t)) t_2 = sqrt(t_1) t_3 = Float64(a / Float64(Float64(z * z) / t)) tmp = 0.0 if (z <= -4e+110) tmp = Float64(Float64(x * y) / fma(0.5, t_3, -1.0)); elseif (z <= -1.8e-150) tmp = Float64(z / Float64(t_2 / Float64(x * y))); elseif (z <= 5.8e-193) tmp = Float64(Float64(x * Float64(z * y)) * (t_1 ^ -0.5)); elseif (z <= 1.6e-90) tmp = Float64(y * Float64(z * Float64(x / t_2))); else tmp = Float64(Float64(x * y) / sqrt(Float64(1.0 - t_3))); end return 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[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4e+110], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$3 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.8e-150], N[(z / N[(t$95$2 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-193], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e-90], N[(y * N[(z * N[(x / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$3), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := z \cdot z - a \cdot t\\
t_2 := \sqrt{t_1}\\
t_3 := \frac{a}{\frac{z \cdot z}{t}}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+110}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_3, -1\right)}\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-150}:\\
\;\;\;\;\frac{z}{\frac{t_2}{x \cdot y}}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-193}:\\
\;\;\;\;\left(x \cdot \left(z \cdot y\right)\right) \cdot {t_1}^{-0.5}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-90}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{x}{t_2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1 - t_3}}\\
\end{array}
\end{array}
if z < -4.0000000000000001e110Initial program 29.3%
associate-/l*33.5%
Simplified33.5%
Taylor expanded in z around -inf 93.9%
fma-neg93.9%
unpow293.9%
associate-/l*94.3%
metadata-eval94.3%
Simplified94.3%
if -4.0000000000000001e110 < z < -1.8000000000000001e-150Initial program 89.4%
*-commutative89.4%
associate-*l*84.0%
associate-*r/86.4%
Simplified86.4%
*-commutative86.4%
associate-*l/84.0%
*-commutative84.0%
associate-*r*89.4%
associate-/l*94.5%
Applied egg-rr94.5%
if -1.8000000000000001e-150 < z < 5.80000000000000013e-193Initial program 72.3%
associate-/l*69.5%
Simplified69.5%
associate-/l*72.3%
div-inv72.2%
associate-*l*76.3%
associate-*l*76.3%
*-commutative76.3%
pow1/276.3%
pow-flip76.4%
metadata-eval76.4%
Applied egg-rr76.4%
associate-*r*76.4%
*-commutative76.4%
Simplified76.4%
if 5.80000000000000013e-193 < z < 1.60000000000000004e-90Initial program 88.0%
*-commutative88.0%
associate-*l*88.2%
associate-*r/88.3%
Simplified88.3%
associate-/l*88.4%
associate-/r/83.4%
Applied egg-rr83.4%
if 1.60000000000000004e-90 < z Initial program 53.8%
associate-/l*61.0%
Simplified61.0%
add-sqr-sqrt61.0%
sqrt-unprod61.0%
frac-times55.3%
add-sqr-sqrt55.3%
Applied egg-rr55.3%
div-sub55.3%
*-inverses93.8%
*-commutative93.8%
associate-/l*98.2%
Simplified98.2%
Final simplification92.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.15e+71)
(* x (- y))
(if (<= z 2e-91)
(* y (* z (/ x (sqrt (- (* z z) (* a t))))))
(/ (* x y) (/ (+ z (* -0.5 (/ a (/ z t)))) z)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.15e+71) {
tmp = x * -y;
} else if (z <= 2e-91) {
tmp = y * (z * (x / sqrt(((z * z) - (a * t)))));
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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 <= (-3.15d+71)) then
tmp = x * -y
else if (z <= 2d-91) then
tmp = y * (z * (x / sqrt(((z * z) - (a * t)))))
else
tmp = (x * y) / ((z + ((-0.5d0) * (a / (z / t)))) / 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 <= -3.15e+71) {
tmp = x * -y;
} else if (z <= 2e-91) {
tmp = y * (z * (x / Math.sqrt(((z * z) - (a * t)))));
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.15e+71: tmp = x * -y elif z <= 2e-91: tmp = y * (z * (x / math.sqrt(((z * z) - (a * t))))) else: tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.15e+71) tmp = Float64(x * Float64(-y)); elseif (z <= 2e-91) tmp = Float64(y * Float64(z * Float64(x / sqrt(Float64(Float64(z * z) - Float64(a * t)))))); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(-0.5 * Float64(a / Float64(z / t)))) / 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 <= -3.15e+71)
tmp = x * -y;
elseif (z <= 2e-91)
tmp = y * (z * (x / sqrt(((z * z) - (a * t)))));
else
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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, -3.15e+71], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2e-91], N[(y * N[(z * N[(x / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+71}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-91}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{x}{\sqrt{z \cdot z - a \cdot t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}{z}}\\
\end{array}
\end{array}
if z < -3.15e71Initial program 36.6%
*-commutative36.6%
associate-*l*32.8%
associate-*r/33.1%
Simplified33.1%
Taylor expanded in z around -inf 95.1%
neg-mul-195.1%
Simplified95.1%
if -3.15e71 < z < 2.00000000000000004e-91Initial program 82.9%
*-commutative82.9%
associate-*l*83.6%
associate-*r/82.3%
Simplified82.3%
associate-/l*83.8%
associate-/r/81.3%
Applied egg-rr81.3%
if 2.00000000000000004e-91 < z Initial program 53.8%
associate-/l*61.0%
Simplified61.0%
pow1/261.0%
pow-to-exp57.9%
Applied egg-rr57.9%
Taylor expanded in z around inf 92.3%
associate-/l*95.6%
Simplified95.6%
Final simplification89.6%
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+135)
(* x (- y))
(if (<= z 4e+142)
(* (/ z (sqrt (- (* z z) (* a t)))) (* x y))
(/ (* x y) (/ (+ z (* -0.5 (/ a (/ z t)))) z)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+135) {
tmp = x * -y;
} else if (z <= 4e+142) {
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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 <= (-1d+135)) then
tmp = x * -y
else if (z <= 4d+142) then
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y)
else
tmp = (x * y) / ((z + ((-0.5d0) * (a / (z / t)))) / 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 <= -1e+135) {
tmp = x * -y;
} else if (z <= 4e+142) {
tmp = (z / Math.sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1e+135: tmp = x * -y elif z <= 4e+142: tmp = (z / math.sqrt(((z * z) - (a * t)))) * (x * y) else: tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+135) tmp = Float64(x * Float64(-y)); elseif (z <= 4e+142) tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * y)); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(-0.5 * Float64(a / Float64(z / t)))) / 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 <= -1e+135)
tmp = x * -y;
elseif (z <= 4e+142)
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
else
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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, -1e+135], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 4e+142], N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+135}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+142}:\\
\;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}{z}}\\
\end{array}
\end{array}
if z < -9.99999999999999962e134Initial program 19.7%
*-commutative19.7%
associate-*l*19.3%
associate-*r/19.6%
Simplified19.6%
Taylor expanded in z around -inf 93.2%
neg-mul-193.2%
Simplified93.2%
if -9.99999999999999962e134 < z < 4.0000000000000002e142Initial program 84.6%
associate-/l*89.4%
Simplified89.4%
clear-num89.3%
associate-/r/89.3%
clear-num89.4%
Applied egg-rr89.4%
if 4.0000000000000002e142 < z Initial program 15.8%
associate-/l*20.6%
Simplified20.6%
pow1/220.6%
pow-to-exp20.0%
Applied egg-rr20.0%
Taylor expanded in z around inf 89.5%
associate-/l*96.4%
Simplified96.4%
Final simplification91.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 -2e+142)
(* x (- y))
(if (<= z 4e+29)
(* (/ z (sqrt (- (* z z) (* a t)))) (* x y))
(/ (* x y) (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+142) {
tmp = x * -y;
} else if (z <= 4e+29) {
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = (x * y) / 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+142)) then
tmp = x * -y
else if (z <= 4d+29) then
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y)
else
tmp = (x * y) / 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+142) {
tmp = x * -y;
} else if (z <= 4e+29) {
tmp = (z / Math.sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = (x * y) / 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+142: tmp = x * -y elif z <= 4e+29: tmp = (z / math.sqrt(((z * z) - (a * t)))) * (x * y) else: tmp = (x * y) / 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+142) tmp = Float64(x * Float64(-y)); elseif (z <= 4e+29) tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * y)); else tmp = Float64(Float64(x * y) / 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+142)
tmp = x * -y;
elseif (z <= 4e+29)
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
else
tmp = (x * y) / 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+142], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 4e+29], N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $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^{+142}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+29}:\\
\;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1 - \frac{a}{\frac{z \cdot z}{t}}}}\\
\end{array}
\end{array}
if z < -2.0000000000000001e142Initial program 19.7%
*-commutative19.7%
associate-*l*19.3%
associate-*r/19.6%
Simplified19.6%
Taylor expanded in z around -inf 93.2%
neg-mul-193.2%
Simplified93.2%
if -2.0000000000000001e142 < z < 3.99999999999999966e29Initial program 84.8%
associate-/l*87.4%
Simplified87.4%
clear-num87.3%
associate-/r/87.4%
clear-num87.4%
Applied egg-rr87.4%
if 3.99999999999999966e29 < z Initial program 44.6%
associate-/l*53.2%
Simplified53.2%
add-sqr-sqrt53.2%
sqrt-unprod53.2%
frac-times46.4%
add-sqr-sqrt46.4%
Applied egg-rr46.4%
div-sub46.4%
*-inverses92.6%
*-commutative92.6%
associate-/l*97.9%
Simplified97.9%
Final simplification91.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 (/ a (/ (* z z) t))))
(if (<= z -2e+142)
(/ (* x y) (fma 0.5 t_1 -1.0))
(if (<= z 1e+30)
(* (/ z (sqrt (- (* z z) (* a t)))) (* x y))
(/ (* x y) (sqrt (- 1.0 t_1)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = a / ((z * z) / t);
double tmp;
if (z <= -2e+142) {
tmp = (x * y) / fma(0.5, t_1, -1.0);
} else if (z <= 1e+30) {
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = (x * y) / sqrt((1.0 - t_1));
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(a / Float64(Float64(z * z) / t)) tmp = 0.0 if (z <= -2e+142) tmp = Float64(Float64(x * y) / fma(0.5, t_1, -1.0)); elseif (z <= 1e+30) tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * y)); else tmp = Float64(Float64(x * y) / sqrt(Float64(1.0 - t_1))); end return 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[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+142], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+30], N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z \cdot z}{t}}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+142}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\
\mathbf{elif}\;z \leq 10^{+30}:\\
\;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1 - t_1}}\\
\end{array}
\end{array}
if z < -2.0000000000000001e142Initial program 19.7%
associate-/l*20.2%
Simplified20.2%
Taylor expanded in z around -inf 92.6%
fma-neg92.6%
unpow292.6%
associate-/l*93.2%
metadata-eval93.2%
Simplified93.2%
if -2.0000000000000001e142 < z < 1e30Initial program 84.8%
associate-/l*87.4%
Simplified87.4%
clear-num87.3%
associate-/r/87.4%
clear-num87.4%
Applied egg-rr87.4%
if 1e30 < z Initial program 44.6%
associate-/l*53.2%
Simplified53.2%
add-sqr-sqrt53.2%
sqrt-unprod53.2%
frac-times46.4%
add-sqr-sqrt46.4%
Applied egg-rr46.4%
div-sub46.4%
*-inverses92.6%
*-commutative92.6%
associate-/l*97.9%
Simplified97.9%
Final simplification91.6%
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.18e-15)
(* x (- y))
(if (<= z 2.65e-127)
(* y (* z (/ x (sqrt (* a (- t))))))
(/ (* x y) (/ (+ z (* -0.5 (/ a (/ z t)))) z)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.18e-15) {
tmp = x * -y;
} else if (z <= 2.65e-127) {
tmp = y * (z * (x / sqrt((a * -t))));
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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.18d-15)) then
tmp = x * -y
else if (z <= 2.65d-127) then
tmp = y * (z * (x / sqrt((a * -t))))
else
tmp = (x * y) / ((z + ((-0.5d0) * (a / (z / t)))) / 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.18e-15) {
tmp = x * -y;
} else if (z <= 2.65e-127) {
tmp = y * (z * (x / Math.sqrt((a * -t))));
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.18e-15: tmp = x * -y elif z <= 2.65e-127: tmp = y * (z * (x / math.sqrt((a * -t)))) else: tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.18e-15) tmp = Float64(x * Float64(-y)); elseif (z <= 2.65e-127) tmp = Float64(y * Float64(z * Float64(x / sqrt(Float64(a * Float64(-t)))))); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(-0.5 * Float64(a / Float64(z / t)))) / 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.18e-15)
tmp = x * -y;
elseif (z <= 2.65e-127)
tmp = y * (z * (x / sqrt((a * -t))));
else
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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.18e-15], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.65e-127], N[(y * N[(z * N[(x / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-127}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{x}{\sqrt{a \cdot \left(-t\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}{z}}\\
\end{array}
\end{array}
if z < -1.18000000000000004e-15Initial program 53.4%
*-commutative53.4%
associate-*l*50.6%
associate-*r/50.9%
Simplified50.9%
Taylor expanded in z around -inf 87.2%
neg-mul-187.2%
Simplified87.2%
if -1.18000000000000004e-15 < z < 2.6500000000000001e-127Initial program 80.1%
*-commutative80.1%
associate-*l*81.2%
associate-*r/79.2%
Simplified79.2%
associate-/l*81.3%
associate-/r/77.7%
Applied egg-rr77.7%
Taylor expanded in z around 0 69.0%
associate-*r*69.0%
neg-mul-169.0%
Simplified69.0%
if 2.6500000000000001e-127 < z Initial program 55.6%
associate-/l*62.3%
Simplified62.3%
pow1/262.3%
pow-to-exp59.2%
Applied egg-rr59.2%
Taylor expanded in z around inf 89.9%
associate-/l*93.0%
Simplified93.0%
Final simplification84.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 -5.5e-16)
(* x (- y))
(if (<= z 1.32e-127)
(/ (* y (* z x)) (sqrt (* a (- t))))
(/ (* x y) (/ (+ z (* -0.5 (/ a (/ z t)))) z)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-16) {
tmp = x * -y;
} else if (z <= 1.32e-127) {
tmp = (y * (z * x)) / sqrt((a * -t));
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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 <= (-5.5d-16)) then
tmp = x * -y
else if (z <= 1.32d-127) then
tmp = (y * (z * x)) / sqrt((a * -t))
else
tmp = (x * y) / ((z + ((-0.5d0) * (a / (z / t)))) / 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 <= -5.5e-16) {
tmp = x * -y;
} else if (z <= 1.32e-127) {
tmp = (y * (z * x)) / Math.sqrt((a * -t));
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5.5e-16: tmp = x * -y elif z <= 1.32e-127: tmp = (y * (z * x)) / math.sqrt((a * -t)) else: tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e-16) tmp = Float64(x * Float64(-y)); elseif (z <= 1.32e-127) tmp = Float64(Float64(y * Float64(z * x)) / sqrt(Float64(a * Float64(-t)))); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(-0.5 * Float64(a / Float64(z / t)))) / 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 <= -5.5e-16)
tmp = x * -y;
elseif (z <= 1.32e-127)
tmp = (y * (z * x)) / sqrt((a * -t));
else
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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, -5.5e-16], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.32e-127], N[(N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{-127}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}{z}}\\
\end{array}
\end{array}
if z < -5.49999999999999964e-16Initial program 53.4%
*-commutative53.4%
associate-*l*50.6%
associate-*r/50.9%
Simplified50.9%
Taylor expanded in z around -inf 87.2%
neg-mul-187.2%
Simplified87.2%
if -5.49999999999999964e-16 < z < 1.32e-127Initial program 80.1%
Taylor expanded in z around 0 72.8%
associate-*r*69.0%
neg-mul-169.0%
Simplified72.8%
Taylor expanded in x around 0 75.1%
if 1.32e-127 < z Initial program 55.6%
associate-/l*62.3%
Simplified62.3%
pow1/262.3%
pow-to-exp59.2%
Applied egg-rr59.2%
Taylor expanded in z around inf 89.9%
associate-/l*93.0%
Simplified93.0%
Final simplification86.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 -0.002)
(* x (- y))
(if (<= z -6.2e-81)
(* z (/ (* x y) (- (/ -0.5 (/ (/ z t) a)) z)))
(if (<= z -3.6e-220)
(/ (* z (* x y)) (- z))
(if (<= z 2.1e-136)
(* z (/ (* x y) (+ z (* -0.5 (/ (* a t) z)))))
(* x y))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.002) {
tmp = x * -y;
} else if (z <= -6.2e-81) {
tmp = z * ((x * y) / ((-0.5 / ((z / t) / a)) - z));
} else if (z <= -3.6e-220) {
tmp = (z * (x * y)) / -z;
} else if (z <= 2.1e-136) {
tmp = z * ((x * y) / (z + (-0.5 * ((a * t) / 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 <= (-0.002d0)) then
tmp = x * -y
else if (z <= (-6.2d-81)) then
tmp = z * ((x * y) / (((-0.5d0) / ((z / t) / a)) - z))
else if (z <= (-3.6d-220)) then
tmp = (z * (x * y)) / -z
else if (z <= 2.1d-136) then
tmp = z * ((x * y) / (z + ((-0.5d0) * ((a * t) / 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 <= -0.002) {
tmp = x * -y;
} else if (z <= -6.2e-81) {
tmp = z * ((x * y) / ((-0.5 / ((z / t) / a)) - z));
} else if (z <= -3.6e-220) {
tmp = (z * (x * y)) / -z;
} else if (z <= 2.1e-136) {
tmp = z * ((x * y) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -0.002: tmp = x * -y elif z <= -6.2e-81: tmp = z * ((x * y) / ((-0.5 / ((z / t) / a)) - z)) elif z <= -3.6e-220: tmp = (z * (x * y)) / -z elif z <= 2.1e-136: tmp = z * ((x * y) / (z + (-0.5 * ((a * t) / z)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.002) tmp = Float64(x * Float64(-y)); elseif (z <= -6.2e-81) tmp = Float64(z * Float64(Float64(x * y) / Float64(Float64(-0.5 / Float64(Float64(z / t) / a)) - z))); elseif (z <= -3.6e-220) tmp = Float64(Float64(z * Float64(x * y)) / Float64(-z)); elseif (z <= 2.1e-136) tmp = Float64(z * Float64(Float64(x * y) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / 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 <= -0.002)
tmp = x * -y;
elseif (z <= -6.2e-81)
tmp = z * ((x * y) / ((-0.5 / ((z / t) / a)) - z));
elseif (z <= -3.6e-220)
tmp = (z * (x * y)) / -z;
elseif (z <= 2.1e-136)
tmp = z * ((x * y) / (z + (-0.5 * ((a * t) / 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, -0.002], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -6.2e-81], N[(z * N[(N[(x * y), $MachinePrecision] / N[(N[(-0.5 / N[(N[(z / t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e-220], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, 2.1e-136], N[(z * N[(N[(x * y), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $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 -0.002:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-81}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{\frac{-0.5}{\frac{\frac{z}{t}}{a}} - z}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-220}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{-z}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-136}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2e-3Initial program 49.5%
*-commutative49.5%
associate-*l*46.4%
associate-*r/46.7%
Simplified46.7%
Taylor expanded in z around -inf 89.7%
neg-mul-189.7%
Simplified89.7%
if -2e-3 < z < -6.19999999999999976e-81Initial program 79.0%
associate-*l/89.0%
Simplified89.0%
Taylor expanded in z around -inf 79.1%
frac-2neg79.1%
distribute-rgt-neg-out79.1%
div-inv79.0%
add-sqr-sqrt55.5%
sqrt-unprod61.9%
sqr-neg61.9%
sqrt-unprod16.8%
add-sqr-sqrt40.3%
fma-def40.3%
mul-1-neg40.3%
add-sqr-sqrt0.0%
sqrt-prod78.0%
sqr-neg78.0%
mul-1-neg78.0%
mul-1-neg78.0%
sqrt-unprod78.0%
add-sqr-sqrt78.0%
fma-neg78.0%
Applied egg-rr78.0%
associate-*r/78.1%
*-rgt-identity78.1%
*-commutative78.1%
neg-sub078.1%
fma-udef78.1%
associate-/l*78.1%
associate-*r/78.1%
*-commutative78.1%
associate--r+78.1%
neg-sub078.1%
associate-/l*78.1%
distribute-neg-frac78.1%
metadata-eval78.1%
associate-/r*78.1%
Simplified78.1%
if -6.19999999999999976e-81 < z < -3.60000000000000021e-220Initial program 79.8%
Taylor expanded in z around -inf 54.9%
neg-mul-154.9%
Simplified54.9%
if -3.60000000000000021e-220 < z < 2.0999999999999999e-136Initial program 84.3%
associate-*l/77.9%
Simplified77.9%
Taylor expanded in z around inf 41.2%
if 2.0999999999999999e-136 < z Initial program 55.1%
*-commutative55.1%
associate-*l*53.8%
associate-*r/58.5%
Simplified58.5%
Taylor expanded in z around inf 92.1%
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 -0.058)
(* x (- y))
(if (<= z -5e-79)
(* z (/ (* x y) (- (/ -0.5 (/ (/ z t) a)) z)))
(if (<= z -2.7e-224)
(/ (* z (* x y)) (- z))
(/ (* x y) (/ (+ z (* -0.5 (/ a (/ z t)))) z))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.058) {
tmp = x * -y;
} else if (z <= -5e-79) {
tmp = z * ((x * y) / ((-0.5 / ((z / t) / a)) - z));
} else if (z <= -2.7e-224) {
tmp = (z * (x * y)) / -z;
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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 <= (-0.058d0)) then
tmp = x * -y
else if (z <= (-5d-79)) then
tmp = z * ((x * y) / (((-0.5d0) / ((z / t) / a)) - z))
else if (z <= (-2.7d-224)) then
tmp = (z * (x * y)) / -z
else
tmp = (x * y) / ((z + ((-0.5d0) * (a / (z / t)))) / 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 <= -0.058) {
tmp = x * -y;
} else if (z <= -5e-79) {
tmp = z * ((x * y) / ((-0.5 / ((z / t) / a)) - z));
} else if (z <= -2.7e-224) {
tmp = (z * (x * y)) / -z;
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -0.058: tmp = x * -y elif z <= -5e-79: tmp = z * ((x * y) / ((-0.5 / ((z / t) / a)) - z)) elif z <= -2.7e-224: tmp = (z * (x * y)) / -z else: tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.058) tmp = Float64(x * Float64(-y)); elseif (z <= -5e-79) tmp = Float64(z * Float64(Float64(x * y) / Float64(Float64(-0.5 / Float64(Float64(z / t) / a)) - z))); elseif (z <= -2.7e-224) tmp = Float64(Float64(z * Float64(x * y)) / Float64(-z)); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(-0.5 * Float64(a / Float64(z / t)))) / 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 <= -0.058)
tmp = x * -y;
elseif (z <= -5e-79)
tmp = z * ((x * y) / ((-0.5 / ((z / t) / a)) - z));
elseif (z <= -2.7e-224)
tmp = (z * (x * y)) / -z;
else
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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, -0.058], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -5e-79], N[(z * N[(N[(x * y), $MachinePrecision] / N[(N[(-0.5 / N[(N[(z / t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-224], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.058:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-79}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{\frac{-0.5}{\frac{\frac{z}{t}}{a}} - z}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-224}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}{z}}\\
\end{array}
\end{array}
if z < -0.0580000000000000029Initial program 49.5%
*-commutative49.5%
associate-*l*46.4%
associate-*r/46.7%
Simplified46.7%
Taylor expanded in z around -inf 89.7%
neg-mul-189.7%
Simplified89.7%
if -0.0580000000000000029 < z < -4.99999999999999999e-79Initial program 79.0%
associate-*l/89.0%
Simplified89.0%
Taylor expanded in z around -inf 79.1%
frac-2neg79.1%
distribute-rgt-neg-out79.1%
div-inv79.0%
add-sqr-sqrt55.5%
sqrt-unprod61.9%
sqr-neg61.9%
sqrt-unprod16.8%
add-sqr-sqrt40.3%
fma-def40.3%
mul-1-neg40.3%
add-sqr-sqrt0.0%
sqrt-prod78.0%
sqr-neg78.0%
mul-1-neg78.0%
mul-1-neg78.0%
sqrt-unprod78.0%
add-sqr-sqrt78.0%
fma-neg78.0%
Applied egg-rr78.0%
associate-*r/78.1%
*-rgt-identity78.1%
*-commutative78.1%
neg-sub078.1%
fma-udef78.1%
associate-/l*78.1%
associate-*r/78.1%
*-commutative78.1%
associate--r+78.1%
neg-sub078.1%
associate-/l*78.1%
distribute-neg-frac78.1%
metadata-eval78.1%
associate-/r*78.1%
Simplified78.1%
if -4.99999999999999999e-79 < z < -2.69999999999999998e-224Initial program 79.8%
Taylor expanded in z around -inf 54.9%
neg-mul-154.9%
Simplified54.9%
if -2.69999999999999998e-224 < z Initial program 63.1%
associate-/l*67.2%
Simplified67.2%
pow1/267.2%
pow-to-exp64.3%
Applied egg-rr64.3%
Taylor expanded in z around inf 75.8%
associate-/l*78.0%
Simplified78.0%
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 -26500.0)
(* x (- y))
(if (<= z -9.6e-94)
(* y (* z (/ x (- (* 0.5 (/ (* a t) z)) z))))
(if (<= z -3e-222)
(/ (* z (* x y)) (- z))
(/ (* x y) (/ (+ z (* -0.5 (/ a (/ z t)))) z))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -26500.0) {
tmp = x * -y;
} else if (z <= -9.6e-94) {
tmp = y * (z * (x / ((0.5 * ((a * t) / z)) - z)));
} else if (z <= -3e-222) {
tmp = (z * (x * y)) / -z;
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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 <= (-26500.0d0)) then
tmp = x * -y
else if (z <= (-9.6d-94)) then
tmp = y * (z * (x / ((0.5d0 * ((a * t) / z)) - z)))
else if (z <= (-3d-222)) then
tmp = (z * (x * y)) / -z
else
tmp = (x * y) / ((z + ((-0.5d0) * (a / (z / t)))) / 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 <= -26500.0) {
tmp = x * -y;
} else if (z <= -9.6e-94) {
tmp = y * (z * (x / ((0.5 * ((a * t) / z)) - z)));
} else if (z <= -3e-222) {
tmp = (z * (x * y)) / -z;
} else {
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -26500.0: tmp = x * -y elif z <= -9.6e-94: tmp = y * (z * (x / ((0.5 * ((a * t) / z)) - z))) elif z <= -3e-222: tmp = (z * (x * y)) / -z else: tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -26500.0) tmp = Float64(x * Float64(-y)); elseif (z <= -9.6e-94) tmp = Float64(y * Float64(z * Float64(x / Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z)))); elseif (z <= -3e-222) tmp = Float64(Float64(z * Float64(x * y)) / Float64(-z)); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(-0.5 * Float64(a / Float64(z / t)))) / 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 <= -26500.0)
tmp = x * -y;
elseif (z <= -9.6e-94)
tmp = y * (z * (x / ((0.5 * ((a * t) / z)) - z)));
elseif (z <= -3e-222)
tmp = (z * (x * y)) / -z;
else
tmp = (x * y) / ((z + (-0.5 * (a / (z / t)))) / 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, -26500.0], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -9.6e-94], N[(y * N[(z * N[(x / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3e-222], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -26500:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -9.6 \cdot 10^{-94}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{x}{0.5 \cdot \frac{a \cdot t}{z} - z}\right)\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-222}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}{z}}\\
\end{array}
\end{array}
if z < -26500Initial program 48.8%
*-commutative48.8%
associate-*l*45.7%
associate-*r/45.9%
Simplified45.9%
Taylor expanded in z around -inf 90.9%
neg-mul-190.9%
Simplified90.9%
if -26500 < z < -9.6e-94Initial program 82.7%
*-commutative82.7%
associate-*l*82.7%
associate-*r/88.7%
Simplified88.7%
associate-/l*91.1%
associate-/r/91.1%
Applied egg-rr91.1%
Taylor expanded in z around -inf 75.0%
if -9.6e-94 < z < -3.0000000000000003e-222Initial program 77.2%
Taylor expanded in z around -inf 52.6%
neg-mul-152.6%
Simplified52.6%
if -3.0000000000000003e-222 < z Initial program 63.1%
associate-/l*67.2%
Simplified67.2%
pow1/267.2%
pow-to-exp64.3%
Applied egg-rr64.3%
Taylor expanded in z around inf 75.8%
associate-/l*78.0%
Simplified78.0%
Final simplification79.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.75e-218)
(* x (- y))
(if (<= z 2.55e-191)
(* y (/ (* z x) (+ z (* -0.5 (/ (* a t) z)))))
(* x y))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-218) {
tmp = x * -y;
} else if (z <= 2.55e-191) {
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / 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 <= (-1.75d-218)) then
tmp = x * -y
else if (z <= 2.55d-191) then
tmp = y * ((z * x) / (z + ((-0.5d0) * ((a * t) / 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 <= -1.75e-218) {
tmp = x * -y;
} else if (z <= 2.55e-191) {
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.75e-218: tmp = x * -y elif z <= 2.55e-191: tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e-218) tmp = Float64(x * Float64(-y)); elseif (z <= 2.55e-191) tmp = Float64(y * Float64(Float64(z * x) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / 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 <= -1.75e-218)
tmp = x * -y;
elseif (z <= 2.55e-191)
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / 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, -1.75e-218], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.55e-191], N[(y * N[(N[(z * x), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $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 -1.75 \cdot 10^{-218}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-191}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.75e-218Initial program 60.8%
*-commutative60.8%
associate-*l*57.3%
associate-*r/57.8%
Simplified57.8%
Taylor expanded in z around -inf 75.3%
neg-mul-175.3%
Simplified75.3%
if -1.75e-218 < z < 2.5500000000000001e-191Initial program 79.3%
*-commutative79.3%
associate-*l*88.4%
associate-*r/81.8%
Simplified81.8%
Taylor expanded in z around inf 44.7%
if 2.5500000000000001e-191 < z Initial program 59.1%
*-commutative59.1%
associate-*l*57.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 86.2%
Final simplification76.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 -2.9e-216)
(* x (- y))
(if (<= z 6.2e-135)
(* z (/ (* x y) (+ z (* -0.5 (/ (* a t) z)))))
(* x y))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-216) {
tmp = x * -y;
} else if (z <= 6.2e-135) {
tmp = z * ((x * y) / (z + (-0.5 * ((a * t) / 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.9d-216)) then
tmp = x * -y
else if (z <= 6.2d-135) then
tmp = z * ((x * y) / (z + ((-0.5d0) * ((a * t) / 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.9e-216) {
tmp = x * -y;
} else if (z <= 6.2e-135) {
tmp = z * ((x * y) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.9e-216: tmp = x * -y elif z <= 6.2e-135: tmp = z * ((x * y) / (z + (-0.5 * ((a * t) / 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.9e-216) tmp = Float64(x * Float64(-y)); elseif (z <= 6.2e-135) tmp = Float64(z * Float64(Float64(x * y) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / 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.9e-216)
tmp = x * -y;
elseif (z <= 6.2e-135)
tmp = z * ((x * y) / (z + (-0.5 * ((a * t) / 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.9e-216], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 6.2e-135], N[(z * N[(N[(x * y), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $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.9 \cdot 10^{-216}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-135}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.9000000000000001e-216Initial program 60.8%
*-commutative60.8%
associate-*l*57.3%
associate-*r/57.8%
Simplified57.8%
Taylor expanded in z around -inf 75.3%
neg-mul-175.3%
Simplified75.3%
if -2.9000000000000001e-216 < z < 6.2000000000000001e-135Initial program 84.3%
associate-*l/77.9%
Simplified77.9%
Taylor expanded in z around inf 41.2%
if 6.2000000000000001e-135 < z Initial program 55.1%
*-commutative55.1%
associate-*l*53.8%
associate-*r/58.5%
Simplified58.5%
Taylor expanded in z around inf 92.1%
Final simplification76.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 -380000.0)
(* x (- y))
(if (<= z 2.55e-192)
(* y (/ (* z x) (- (* 0.5 (/ (* a t) z)) z)))
(* x y))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -380000.0) {
tmp = x * -y;
} else if (z <= 2.55e-192) {
tmp = y * ((z * x) / ((0.5 * ((a * t) / 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 <= (-380000.0d0)) then
tmp = x * -y
else if (z <= 2.55d-192) then
tmp = y * ((z * x) / ((0.5d0 * ((a * t) / 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 <= -380000.0) {
tmp = x * -y;
} else if (z <= 2.55e-192) {
tmp = y * ((z * x) / ((0.5 * ((a * t) / z)) - z));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -380000.0: tmp = x * -y elif z <= 2.55e-192: tmp = y * ((z * x) / ((0.5 * ((a * t) / 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 <= -380000.0) tmp = Float64(x * Float64(-y)); elseif (z <= 2.55e-192) tmp = Float64(y * Float64(Float64(z * x) / Float64(Float64(0.5 * Float64(Float64(a * t) / 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 <= -380000.0)
tmp = x * -y;
elseif (z <= 2.55e-192)
tmp = y * ((z * x) / ((0.5 * ((a * t) / 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, -380000.0], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.55e-192], N[(y * N[(N[(z * x), $MachinePrecision] / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -380000:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-192}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{0.5 \cdot \frac{a \cdot t}{z} - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.8e5Initial program 48.8%
*-commutative48.8%
associate-*l*45.7%
associate-*r/45.9%
Simplified45.9%
Taylor expanded in z around -inf 90.9%
neg-mul-190.9%
Simplified90.9%
if -3.8e5 < z < 2.5500000000000001e-192Initial program 79.7%
*-commutative79.7%
associate-*l*80.8%
associate-*r/78.7%
Simplified78.7%
Taylor expanded in z around -inf 53.0%
if 2.5500000000000001e-192 < z Initial program 59.1%
*-commutative59.1%
associate-*l*57.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 86.2%
Final simplification78.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 -1.5e-217) (* x (- y)) (if (<= z 2.1e-192) (* 2.0 (* (/ y a) (/ (* x (* z z)) t))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e-217) {
tmp = x * -y;
} else if (z <= 2.1e-192) {
tmp = 2.0 * ((y / a) * ((x * (z * z)) / t));
} 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.5d-217)) then
tmp = x * -y
else if (z <= 2.1d-192) then
tmp = 2.0d0 * ((y / a) * ((x * (z * z)) / t))
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.5e-217) {
tmp = x * -y;
} else if (z <= 2.1e-192) {
tmp = 2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.5e-217: tmp = x * -y elif z <= 2.1e-192: tmp = 2.0 * ((y / a) * ((x * (z * z)) / t)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e-217) tmp = Float64(x * Float64(-y)); elseif (z <= 2.1e-192) tmp = Float64(2.0 * Float64(Float64(y / a) * Float64(Float64(x * Float64(z * z)) / t))); 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.5e-217)
tmp = x * -y;
elseif (z <= 2.1e-192)
tmp = 2.0 * ((y / a) * ((x * (z * z)) / t));
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.5e-217], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.1e-192], N[(2.0 * N[(N[(y / a), $MachinePrecision] * N[(N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-217}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-192}:\\
\;\;\;\;2 \cdot \left(\frac{y}{a} \cdot \frac{x \cdot \left(z \cdot z\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.50000000000000002e-217Initial program 60.8%
*-commutative60.8%
associate-*l*57.3%
associate-*r/57.8%
Simplified57.8%
Taylor expanded in z around -inf 75.3%
neg-mul-175.3%
Simplified75.3%
if -1.50000000000000002e-217 < z < 2.09999999999999993e-192Initial program 79.3%
associate-*l/76.0%
Simplified76.0%
Taylor expanded in z around -inf 44.4%
Taylor expanded in a around inf 44.4%
times-frac43.7%
*-commutative43.7%
unpow243.7%
Simplified43.7%
if 2.09999999999999993e-192 < z Initial program 59.1%
*-commutative59.1%
associate-*l*57.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 86.2%
Final simplification76.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 -2.9e-216) (* x (- y)) (if (<= z 6.9e-192) (* 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 <= -2.9e-216) {
tmp = x * -y;
} else if (z <= 6.9e-192) {
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 <= (-2.9d-216)) then
tmp = x * -y
else if (z <= 6.9d-192) 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 <= -2.9e-216) {
tmp = x * -y;
} else if (z <= 6.9e-192) {
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 <= -2.9e-216: tmp = x * -y elif z <= 6.9e-192: 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 <= -2.9e-216) tmp = Float64(x * Float64(-y)); elseif (z <= 6.9e-192) 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 <= -2.9e-216)
tmp = x * -y;
elseif (z <= 6.9e-192)
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, -2.9e-216], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 6.9e-192], 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 -2.9 \cdot 10^{-216}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 6.9 \cdot 10^{-192}:\\
\;\;\;\;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 < -2.9000000000000001e-216Initial program 60.8%
*-commutative60.8%
associate-*l*57.3%
associate-*r/57.8%
Simplified57.8%
Taylor expanded in z around -inf 75.3%
neg-mul-175.3%
Simplified75.3%
if -2.9000000000000001e-216 < z < 6.90000000000000016e-192Initial program 79.3%
associate-*l/76.0%
Simplified76.0%
Taylor expanded in z around -inf 44.4%
Taylor expanded in a around inf 44.2%
*-commutative44.2%
associate-*r*44.1%
*-commutative44.1%
times-frac44.0%
*-commutative44.0%
Simplified44.0%
if 6.90000000000000016e-192 < z Initial program 59.1%
*-commutative59.1%
associate-*l*57.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 86.2%
Final simplification76.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 -2.3e-217) (* x (- y)) (if (<= z 5.8e-192) (* z (* 2.0 (/ (* x (* z y)) (* a t)))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-217) {
tmp = x * -y;
} else if (z <= 5.8e-192) {
tmp = z * (2.0 * ((x * (z * y)) / (a * t)));
} 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-217)) then
tmp = x * -y
else if (z <= 5.8d-192) then
tmp = z * (2.0d0 * ((x * (z * y)) / (a * t)))
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-217) {
tmp = x * -y;
} else if (z <= 5.8e-192) {
tmp = z * (2.0 * ((x * (z * y)) / (a * t)));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.3e-217: tmp = x * -y elif z <= 5.8e-192: tmp = z * (2.0 * ((x * (z * y)) / (a * t))) 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-217) tmp = Float64(x * Float64(-y)); elseif (z <= 5.8e-192) tmp = Float64(z * Float64(2.0 * Float64(Float64(x * Float64(z * y)) / Float64(a * t)))); 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-217)
tmp = x * -y;
elseif (z <= 5.8e-192)
tmp = z * (2.0 * ((x * (z * y)) / (a * t)));
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-217], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 5.8e-192], N[(z * N[(2.0 * N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(a * t), $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.3 \cdot 10^{-217}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-192}:\\
\;\;\;\;z \cdot \left(2 \cdot \frac{x \cdot \left(z \cdot y\right)}{a \cdot t}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.30000000000000005e-217Initial program 60.8%
*-commutative60.8%
associate-*l*57.3%
associate-*r/57.8%
Simplified57.8%
Taylor expanded in z around -inf 75.3%
neg-mul-175.3%
Simplified75.3%
if -2.30000000000000005e-217 < z < 5.80000000000000033e-192Initial program 79.3%
associate-*l/76.0%
Simplified76.0%
Taylor expanded in z around -inf 44.4%
Taylor expanded in a around inf 44.2%
*-commutative44.2%
associate-*r*44.1%
*-commutative44.1%
associate-*l*44.2%
Simplified44.2%
if 5.80000000000000033e-192 < z Initial program 59.1%
*-commutative59.1%
associate-*l*57.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 86.2%
Final simplification76.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 -2.2e-216) (* x (- y)) (if (<= z 2.6e-192) (/ (* -2.0 (* y (* x (* z z)))) (* a t)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e-216) {
tmp = x * -y;
} else if (z <= 2.6e-192) {
tmp = (-2.0 * (y * (x * (z * z)))) / (a * t);
} 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.2d-216)) then
tmp = x * -y
else if (z <= 2.6d-192) then
tmp = ((-2.0d0) * (y * (x * (z * z)))) / (a * t)
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.2e-216) {
tmp = x * -y;
} else if (z <= 2.6e-192) {
tmp = (-2.0 * (y * (x * (z * z)))) / (a * t);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.2e-216: tmp = x * -y elif z <= 2.6e-192: tmp = (-2.0 * (y * (x * (z * z)))) / (a * t) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e-216) tmp = Float64(x * Float64(-y)); elseif (z <= 2.6e-192) tmp = Float64(Float64(-2.0 * Float64(y * Float64(x * Float64(z * z)))) / Float64(a * t)); 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.2e-216)
tmp = x * -y;
elseif (z <= 2.6e-192)
tmp = (-2.0 * (y * (x * (z * z)))) / (a * t);
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.2e-216], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.6e-192], N[(N[(-2.0 * N[(y * N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-216}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-192}:\\
\;\;\;\;\frac{-2 \cdot \left(y \cdot \left(x \cdot \left(z \cdot z\right)\right)\right)}{a \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.1999999999999999e-216Initial program 60.8%
*-commutative60.8%
associate-*l*57.3%
associate-*r/57.8%
Simplified57.8%
Taylor expanded in z around -inf 75.3%
neg-mul-175.3%
Simplified75.3%
if -2.1999999999999999e-216 < z < 2.6000000000000002e-192Initial program 79.3%
Taylor expanded in x around 0 88.4%
Taylor expanded in z around inf 44.8%
Taylor expanded in z around 0 44.4%
associate-*r/44.4%
*-commutative44.4%
unpow244.4%
Simplified44.4%
if 2.6000000000000002e-192 < z Initial program 59.1%
*-commutative59.1%
associate-*l*57.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 86.2%
Final simplification76.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 -9e-219) (* x (- y)) (if (<= z 1.6e-192) (/ (* (* y -2.0) (* z (* z x))) (* a t)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9e-219) {
tmp = x * -y;
} else if (z <= 1.6e-192) {
tmp = ((y * -2.0) * (z * (z * x))) / (a * t);
} 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 <= (-9d-219)) then
tmp = x * -y
else if (z <= 1.6d-192) then
tmp = ((y * (-2.0d0)) * (z * (z * x))) / (a * t)
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 <= -9e-219) {
tmp = x * -y;
} else if (z <= 1.6e-192) {
tmp = ((y * -2.0) * (z * (z * x))) / (a * t);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -9e-219: tmp = x * -y elif z <= 1.6e-192: tmp = ((y * -2.0) * (z * (z * x))) / (a * t) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -9e-219) tmp = Float64(x * Float64(-y)); elseif (z <= 1.6e-192) tmp = Float64(Float64(Float64(y * -2.0) * Float64(z * Float64(z * x))) / Float64(a * t)); 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 <= -9e-219)
tmp = x * -y;
elseif (z <= 1.6e-192)
tmp = ((y * -2.0) * (z * (z * x))) / (a * t);
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, -9e-219], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.6e-192], N[(N[(N[(y * -2.0), $MachinePrecision] * N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * t), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-219}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-192}:\\
\;\;\;\;\frac{\left(y \cdot -2\right) \cdot \left(z \cdot \left(z \cdot x\right)\right)}{a \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -9.00000000000000029e-219Initial program 60.8%
*-commutative60.8%
associate-*l*57.3%
associate-*r/57.8%
Simplified57.8%
Taylor expanded in z around -inf 75.3%
neg-mul-175.3%
Simplified75.3%
if -9.00000000000000029e-219 < z < 1.6000000000000001e-192Initial program 79.3%
Taylor expanded in x around 0 88.4%
Taylor expanded in z around inf 44.8%
Taylor expanded in z around 0 44.4%
associate-*r/44.4%
associate-*r*44.4%
unpow244.4%
associate-*l*44.5%
Simplified44.5%
if 1.6000000000000001e-192 < z Initial program 59.1%
*-commutative59.1%
associate-*l*57.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 86.2%
Final simplification76.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 -3e-240) (* x (- y)) (if (<= z 5e-156) (* y (/ (* z x) z)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3e-240) {
tmp = x * -y;
} else if (z <= 5e-156) {
tmp = y * ((z * x) / 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 <= (-3d-240)) then
tmp = x * -y
else if (z <= 5d-156) then
tmp = y * ((z * x) / 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 <= -3e-240) {
tmp = x * -y;
} else if (z <= 5e-156) {
tmp = y * ((z * x) / z);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3e-240: tmp = x * -y elif z <= 5e-156: tmp = y * ((z * x) / z) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3e-240) tmp = Float64(x * Float64(-y)); elseif (z <= 5e-156) tmp = Float64(y * Float64(Float64(z * x) / 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 <= -3e-240)
tmp = x * -y;
elseif (z <= 5e-156)
tmp = y * ((z * x) / 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, -3e-240], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 5e-156], N[(y * N[(N[(z * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{-240}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-156}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.99999999999999991e-240Initial program 61.8%
*-commutative61.8%
associate-*l*57.6%
associate-*r/57.3%
Simplified57.3%
Taylor expanded in z around -inf 73.4%
neg-mul-173.4%
Simplified73.4%
if -2.99999999999999991e-240 < z < 5.00000000000000007e-156Initial program 80.5%
*-commutative80.5%
associate-*l*91.9%
associate-*r/88.9%
Simplified88.9%
Taylor expanded in z around inf 35.1%
if 5.00000000000000007e-156 < z Initial program 57.1%
*-commutative57.1%
associate-*l*55.0%
associate-*r/59.5%
Simplified59.5%
Taylor expanded in z around inf 88.9%
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.22e-294) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.22e-294) {
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 <= (-1.22d-294)) 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 <= -1.22e-294) {
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 <= -1.22e-294: 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 <= -1.22e-294) 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 <= -1.22e-294)
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, -1.22e-294], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{-294}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.21999999999999995e-294Initial program 62.1%
*-commutative62.1%
associate-*l*58.0%
associate-*r/57.7%
Simplified57.7%
Taylor expanded in z around -inf 70.1%
neg-mul-170.1%
Simplified70.1%
if -1.21999999999999995e-294 < z Initial program 62.1%
*-commutative62.1%
associate-*l*63.1%
associate-*r/66.0%
Simplified66.0%
Taylor expanded in z around inf 76.0%
Final simplification73.2%
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 62.1%
*-commutative62.1%
associate-*l*60.6%
associate-*r/62.1%
Simplified62.1%
Taylor expanded in z around inf 46.2%
Final simplification46.2%
(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 2023257
(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)))))