
(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 23 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 (/ a (/ (* z z) t))))
(if (<= z -1.65e+52)
(/ (* x y) (fma 0.5 t_1 -1.0))
(if (<= z 9e-89)
(* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
(/ (* 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 <= -1.65e+52) {
tmp = (x * y) / fma(0.5, t_1, -1.0);
} else if (z <= 9e-89) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} 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 <= -1.65e+52) tmp = Float64(Float64(x * y) / fma(0.5, t_1, -1.0)); elseif (z <= 9e-89) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); 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, -1.65e+52], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-89], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 -1.65 \cdot 10^{+52}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-89}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1 - t_1}}\\
\end{array}
\end{array}
if z < -1.65e52Initial program 30.0%
associate-/l*36.9%
Simplified36.9%
Taylor expanded in z around -inf 83.2%
fma-neg83.2%
unpow283.2%
associate-/l*95.0%
metadata-eval95.0%
Simplified95.0%
if -1.65e52 < z < 8.9999999999999998e-89Initial program 88.6%
*-commutative88.6%
associate-*l*83.8%
associate-*r/86.0%
Simplified86.0%
if 8.9999999999999998e-89 < z Initial program 62.6%
associate-/l*62.8%
Simplified62.8%
add-sqr-sqrt62.8%
sqrt-unprod62.8%
frac-times57.4%
add-sqr-sqrt57.4%
Applied egg-rr57.4%
div-sub57.4%
*-inverses85.5%
*-commutative85.5%
associate-/l*96.5%
Simplified96.5%
Final simplification92.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 -4.2e+65)
(* y (- x))
(if (<= z 8.4e+63)
(* x (* y (/ z (sqrt (- (* z z) (* a t))))))
(/ (* x y) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+65) {
tmp = y * -x;
} else if (z <= 8.4e+63) {
tmp = x * (y * (z / sqrt(((z * z) - (a * t)))));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.2d+65)) then
tmp = y * -x
else if (z <= 8.4d+63) then
tmp = x * (y * (z / sqrt(((z * z) - (a * t)))))
else
tmp = (x * y) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+65) {
tmp = y * -x;
} else if (z <= 8.4e+63) {
tmp = x * (y * (z / Math.sqrt(((z * z) - (a * t)))));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.2e+65: tmp = y * -x elif z <= 8.4e+63: tmp = x * (y * (z / math.sqrt(((z * z) - (a * t))))) else: tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+65) tmp = Float64(y * Float64(-x)); elseif (z <= 8.4e+63) tmp = Float64(x * Float64(y * Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.2e+65)
tmp = y * -x;
elseif (z <= 8.4e+63)
tmp = x * (y * (z / sqrt(((z * z) - (a * t)))));
else
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+65], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8.4e+63], N[(x * N[(y * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{+63}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -4.19999999999999983e65Initial program 30.6%
*-commutative30.6%
associate-*l*27.4%
associate-*r/30.5%
Simplified30.5%
Taylor expanded in z around -inf 94.9%
neg-mul-194.9%
Simplified94.9%
if -4.19999999999999983e65 < z < 8.4000000000000007e63Initial program 90.2%
associate-/l*91.1%
Simplified91.1%
div-inv91.0%
clear-num91.4%
associate-*l*90.7%
Applied egg-rr90.7%
if 8.4000000000000007e63 < z Initial program 41.7%
associate-/l*42.1%
Simplified42.1%
Taylor expanded in z around inf 77.4%
unpow277.4%
associate-/l*88.1%
Simplified88.1%
Final simplification91.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.45e+54)
(* y (- x))
(if (<= z 5.2e+25)
(* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
(/ (* x y) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e+54) {
tmp = y * -x;
} else if (z <= 5.2e+25) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.45d+54)) then
tmp = y * -x
else if (z <= 5.2d+25) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
else
tmp = (x * y) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e+54) {
tmp = y * -x;
} else if (z <= 5.2e+25) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.45e+54: tmp = y * -x elif z <= 5.2e+25: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) else: tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.45e+54) tmp = Float64(y * Float64(-x)); elseif (z <= 5.2e+25) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.45e+54)
tmp = y * -x;
elseif (z <= 5.2e+25)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
else
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.45e+54], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5.2e+25], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+54}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+25}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -2.45e54Initial program 30.0%
*-commutative30.0%
associate-*l*27.0%
associate-*r/32.4%
Simplified32.4%
Taylor expanded in z around -inf 95.0%
neg-mul-195.0%
Simplified95.0%
if -2.45e54 < z < 5.1999999999999997e25Initial program 91.0%
*-commutative91.0%
associate-*l*87.1%
associate-*r/88.8%
Simplified88.8%
if 5.1999999999999997e25 < z Initial program 48.1%
associate-/l*48.4%
Simplified48.4%
Taylor expanded in z around inf 78.4%
unpow278.4%
associate-/l*88.0%
Simplified88.0%
Final simplification90.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 -4.2e+65)
(* y (- x))
(if (<= z 8.4e+63)
(* (/ z (sqrt (- (* z z) (* a t)))) (* x y))
(/ (* x y) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+65) {
tmp = y * -x;
} else if (z <= 8.4e+63) {
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.2d+65)) then
tmp = y * -x
else if (z <= 8.4d+63) then
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y)
else
tmp = (x * y) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+65) {
tmp = y * -x;
} else if (z <= 8.4e+63) {
tmp = (z / Math.sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.2e+65: tmp = y * -x elif z <= 8.4e+63: tmp = (z / math.sqrt(((z * z) - (a * t)))) * (x * y) else: tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+65) tmp = Float64(y * Float64(-x)); elseif (z <= 8.4e+63) tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * y)); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.2e+65)
tmp = y * -x;
elseif (z <= 8.4e+63)
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
else
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+65], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8.4e+63], 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[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{+63}:\\
\;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -4.19999999999999983e65Initial program 30.6%
*-commutative30.6%
associate-*l*27.4%
associate-*r/30.5%
Simplified30.5%
Taylor expanded in z around -inf 94.9%
neg-mul-194.9%
Simplified94.9%
if -4.19999999999999983e65 < z < 8.4000000000000007e63Initial program 90.2%
associate-/l*91.1%
Simplified91.1%
clear-num91.0%
associate-/r/91.0%
clear-num91.4%
Applied egg-rr91.4%
if 8.4000000000000007e63 < z Initial program 41.7%
associate-/l*42.1%
Simplified42.1%
Taylor expanded in z around inf 77.4%
unpow277.4%
associate-/l*88.1%
Simplified88.1%
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 -4.2e+65)
(* y (- x))
(if (<= z 1.15e+168)
(* (/ z (sqrt (- (* z z) (* a t)))) (* x y))
(* (fma 0.5 (/ (* a (/ t z)) z) 1.0) (* x y)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+65) {
tmp = y * -x;
} else if (z <= 1.15e+168) {
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = fma(0.5, ((a * (t / z)) / z), 1.0) * (x * y);
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+65) tmp = Float64(y * Float64(-x)); elseif (z <= 1.15e+168) tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * y)); else tmp = Float64(fma(0.5, Float64(Float64(a * Float64(t / z)) / z), 1.0) * Float64(x * y)); end return 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, -4.2e+65], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.15e+168], N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + 1.0), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+65}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+168}:\\
\;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{a \cdot \frac{t}{z}}{z}, 1\right) \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if z < -4.19999999999999983e65Initial program 30.6%
*-commutative30.6%
associate-*l*27.4%
associate-*r/30.5%
Simplified30.5%
Taylor expanded in z around -inf 94.9%
neg-mul-194.9%
Simplified94.9%
if -4.19999999999999983e65 < z < 1.15e168Initial program 87.6%
associate-/l*88.3%
Simplified88.3%
clear-num88.1%
associate-/r/88.3%
clear-num88.6%
Applied egg-rr88.6%
if 1.15e168 < z Initial program 11.9%
associate-/l*12.4%
Simplified12.4%
clear-num12.4%
associate-/r/12.4%
clear-num12.4%
Applied egg-rr12.4%
Taylor expanded in z around inf 80.0%
fma-def80.0%
*-commutative80.0%
unpow280.0%
associate-/r*83.7%
*-commutative83.7%
associate-*r/99.9%
Simplified99.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 -7e+52)
(* y (- x))
(if (<= z 9e-89)
(* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
(/ (* 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 <= -7e+52) {
tmp = y * -x;
} else if (z <= 9e-89) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} 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 <= (-7d+52)) then
tmp = y * -x
else if (z <= 9d-89) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
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 <= -7e+52) {
tmp = y * -x;
} else if (z <= 9e-89) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} 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 <= -7e+52: tmp = y * -x elif z <= 9e-89: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) 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 <= -7e+52) tmp = Float64(y * Float64(-x)); elseif (z <= 9e-89) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); 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 <= -7e+52)
tmp = y * -x;
elseif (z <= 9e-89)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
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, -7e+52], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 9e-89], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 -7 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-89}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1 - \frac{a}{\frac{z \cdot z}{t}}}}\\
\end{array}
\end{array}
if z < -7e52Initial program 30.0%
*-commutative30.0%
associate-*l*27.0%
associate-*r/32.4%
Simplified32.4%
Taylor expanded in z around -inf 95.0%
neg-mul-195.0%
Simplified95.0%
if -7e52 < z < 8.9999999999999998e-89Initial program 88.6%
*-commutative88.6%
associate-*l*83.8%
associate-*r/86.0%
Simplified86.0%
if 8.9999999999999998e-89 < z Initial program 62.6%
associate-/l*62.8%
Simplified62.8%
add-sqr-sqrt62.8%
sqrt-unprod62.8%
frac-times57.4%
add-sqr-sqrt57.4%
Applied egg-rr57.4%
div-sub57.4%
*-inverses85.5%
*-commutative85.5%
associate-/l*96.5%
Simplified96.5%
Final simplification92.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 -4.2e-5)
(* y (- x))
(if (<= z 1.4e-117)
(* y (/ (* z x) (sqrt (* a (- t)))))
(/ (* x y) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e-5) {
tmp = y * -x;
} else if (z <= 1.4e-117) {
tmp = y * ((z * x) / sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.2d-5)) then
tmp = y * -x
else if (z <= 1.4d-117) then
tmp = y * ((z * x) / sqrt((a * -t)))
else
tmp = (x * y) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e-5) {
tmp = y * -x;
} else if (z <= 1.4e-117) {
tmp = y * ((z * x) / Math.sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.2e-5: tmp = y * -x elif z <= 1.4e-117: tmp = y * ((z * x) / math.sqrt((a * -t))) else: tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e-5) tmp = Float64(y * Float64(-x)); elseif (z <= 1.4e-117) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.2e-5)
tmp = y * -x;
elseif (z <= 1.4e-117)
tmp = y * ((z * x) / sqrt((a * -t)));
else
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e-5], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.4e-117], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-5}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-117}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -4.19999999999999977e-5Initial program 39.0%
*-commutative39.0%
associate-*l*36.4%
associate-*r/42.2%
Simplified42.2%
Taylor expanded in z around -inf 92.4%
neg-mul-192.4%
Simplified92.4%
if -4.19999999999999977e-5 < z < 1.4e-117Initial program 87.3%
*-commutative87.3%
associate-*l*81.3%
associate-*r/82.8%
Simplified82.8%
Taylor expanded in z around 0 74.3%
associate-*r*74.3%
neg-mul-174.3%
Simplified74.3%
if 1.4e-117 < z Initial program 64.9%
associate-/l*65.2%
Simplified65.2%
Taylor expanded in z around inf 79.6%
unpow279.6%
associate-/l*86.1%
Simplified86.1%
Final simplification84.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -0.00024)
(* y (- x))
(if (<= z 1.7e-135)
(* (* z x) (/ y (sqrt (* a (- t)))))
(/ (* x y) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.00024) {
tmp = y * -x;
} else if (z <= 1.7e-135) {
tmp = (z * x) * (y / sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-0.00024d0)) then
tmp = y * -x
else if (z <= 1.7d-135) then
tmp = (z * x) * (y / sqrt((a * -t)))
else
tmp = (x * y) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.00024) {
tmp = y * -x;
} else if (z <= 1.7e-135) {
tmp = (z * x) * (y / Math.sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -0.00024: tmp = y * -x elif z <= 1.7e-135: tmp = (z * x) * (y / math.sqrt((a * -t))) else: tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.00024) tmp = Float64(y * Float64(-x)); elseif (z <= 1.7e-135) tmp = Float64(Float64(z * x) * Float64(y / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -0.00024)
tmp = y * -x;
elseif (z <= 1.7e-135)
tmp = (z * x) * (y / sqrt((a * -t)));
else
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.00024], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.7e-135], N[(N[(z * x), $MachinePrecision] * N[(y / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00024:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-135}:\\
\;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -2.40000000000000006e-4Initial program 39.0%
*-commutative39.0%
associate-*l*36.4%
associate-*r/42.2%
Simplified42.2%
Taylor expanded in z around -inf 92.4%
neg-mul-192.4%
Simplified92.4%
if -2.40000000000000006e-4 < z < 1.69999999999999995e-135Initial program 86.5%
*-commutative86.5%
associate-*l*81.4%
associate-*r/82.9%
Simplified82.9%
clear-num81.7%
un-div-inv81.7%
*-commutative81.7%
Applied egg-rr81.7%
Taylor expanded in z around 0 75.3%
associate-*r*76.4%
neg-mul-176.4%
Simplified75.3%
associate-/r/76.5%
*-commutative76.5%
Applied egg-rr76.5%
if 1.69999999999999995e-135 < z Initial program 66.7%
associate-/l*66.9%
Simplified66.9%
Taylor expanded in z around inf 77.9%
unpow277.9%
associate-/l*84.0%
Simplified84.0%
Final simplification84.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 -6.8e-6)
(* y (- x))
(if (<= z 1.6e-117)
(/ (* y (* z x)) (sqrt (* a (- t))))
(/ (* x y) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e-6) {
tmp = y * -x;
} else if (z <= 1.6e-117) {
tmp = (y * (z * x)) / sqrt((a * -t));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-6.8d-6)) then
tmp = y * -x
else if (z <= 1.6d-117) then
tmp = (y * (z * x)) / sqrt((a * -t))
else
tmp = (x * y) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.8e-6) {
tmp = y * -x;
} else if (z <= 1.6e-117) {
tmp = (y * (z * x)) / Math.sqrt((a * -t));
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -6.8e-6: tmp = y * -x elif z <= 1.6e-117: tmp = (y * (z * x)) / math.sqrt((a * -t)) else: tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.8e-6) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e-117) tmp = Float64(Float64(y * Float64(z * x)) / sqrt(Float64(a * Float64(-t)))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -6.8e-6)
tmp = y * -x;
elseif (z <= 1.6e-117)
tmp = (y * (z * x)) / sqrt((a * -t));
else
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.8e-6], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.6e-117], N[(N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-6}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-117}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -6.80000000000000012e-6Initial program 39.0%
*-commutative39.0%
associate-*l*36.4%
associate-*r/42.2%
Simplified42.2%
Taylor expanded in z around -inf 92.4%
neg-mul-192.4%
Simplified92.4%
if -6.80000000000000012e-6 < z < 1.59999999999999998e-117Initial program 87.3%
*-commutative87.3%
associate-*l*81.3%
associate-*r/82.8%
Simplified82.8%
clear-num81.6%
un-div-inv81.6%
*-commutative81.6%
Applied egg-rr81.6%
Taylor expanded in z around 0 73.3%
associate-*r*74.3%
neg-mul-174.3%
Simplified73.3%
expm1-log1p-u59.7%
expm1-udef44.4%
associate-/r/44.3%
*-commutative44.3%
Applied egg-rr44.3%
expm1-def60.8%
expm1-log1p74.5%
associate-*l/73.0%
distribute-rgt-neg-out73.0%
*-commutative73.0%
distribute-rgt-neg-in73.0%
Simplified73.0%
if 1.59999999999999998e-117 < z Initial program 64.9%
associate-/l*65.2%
Simplified65.2%
Taylor expanded in z around inf 79.6%
unpow279.6%
associate-/l*86.1%
Simplified86.1%
Final simplification84.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 -5.6e-217) (* y (- x)) (if (<= z 1.2e-61) (* 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 <= -5.6e-217) {
tmp = y * -x;
} else if (z <= 1.2e-61) {
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 <= (-5.6d-217)) then
tmp = y * -x
else if (z <= 1.2d-61) 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 <= -5.6e-217) {
tmp = y * -x;
} else if (z <= 1.2e-61) {
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 <= -5.6e-217: tmp = y * -x elif z <= 1.2e-61: 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 <= -5.6e-217) tmp = Float64(y * Float64(-x)); elseif (z <= 1.2e-61) 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 <= -5.6e-217)
tmp = y * -x;
elseif (z <= 1.2e-61)
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, -5.6e-217], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.2e-61], 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 -5.6 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-61}:\\
\;\;\;\;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 < -5.6e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -5.6e-217 < z < 1.2e-61Initial program 91.3%
*-commutative91.3%
associate-*l*83.3%
associate-*r/83.2%
Simplified83.2%
Taylor expanded in z around inf 50.9%
if 1.2e-61 < z Initial program 60.4%
*-commutative60.4%
associate-*l*58.9%
associate-*r/59.2%
Simplified59.2%
Taylor expanded in z around inf 85.3%
Final simplification74.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 -4.8e-217) (* y (- x)) (if (<= z 3.8e-140) (* -2.0 (* (/ y a) (/ z (/ (/ t x) z)))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-217) {
tmp = y * -x;
} else if (z <= 3.8e-140) {
tmp = -2.0 * ((y / a) * (z / ((t / 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 <= (-4.8d-217)) then
tmp = y * -x
else if (z <= 3.8d-140) then
tmp = (-2.0d0) * ((y / a) * (z / ((t / 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 <= -4.8e-217) {
tmp = y * -x;
} else if (z <= 3.8e-140) {
tmp = -2.0 * ((y / a) * (z / ((t / x) / z)));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.8e-217: tmp = y * -x elif z <= 3.8e-140: tmp = -2.0 * ((y / a) * (z / ((t / 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 <= -4.8e-217) tmp = Float64(y * Float64(-x)); elseif (z <= 3.8e-140) tmp = Float64(-2.0 * Float64(Float64(y / a) * Float64(z / Float64(Float64(t / 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 <= -4.8e-217)
tmp = y * -x;
elseif (z <= 3.8e-140)
tmp = -2.0 * ((y / a) * (z / ((t / 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, -4.8e-217], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.8e-140], N[(-2.0 * N[(N[(y / a), $MachinePrecision] * N[(z / N[(N[(t / x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-140}:\\
\;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{z}{\frac{\frac{t}{x}}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.7999999999999997e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -4.7999999999999997e-217 < z < 3.79999999999999998e-140Initial program 88.2%
Taylor expanded in z around inf 45.4%
Taylor expanded in z around 0 43.1%
times-frac43.1%
associate-/l*39.9%
unpow239.9%
associate-/l*40.1%
Simplified40.1%
if 3.79999999999999998e-140 < z Initial program 66.7%
*-commutative66.7%
associate-*l*64.5%
associate-*r/64.7%
Simplified64.7%
Taylor expanded in z around inf 81.9%
Final simplification73.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 -7.2e-128) (* y (- x)) (if (<= z 6.5e-137) (/ (* y (* z x)) (* 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 <= -7.2e-128) {
tmp = y * -x;
} else if (z <= 6.5e-137) {
tmp = (y * (z * x)) / (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 <= (-7.2d-128)) then
tmp = y * -x
else if (z <= 6.5d-137) then
tmp = (y * (z * x)) / (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 <= -7.2e-128) {
tmp = y * -x;
} else if (z <= 6.5e-137) {
tmp = (y * (z * x)) / (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 <= -7.2e-128: tmp = y * -x elif z <= 6.5e-137: tmp = (y * (z * x)) / (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 <= -7.2e-128) tmp = Float64(y * Float64(-x)); elseif (z <= 6.5e-137) tmp = Float64(Float64(y * Float64(z * x)) / 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 <= -7.2e-128)
tmp = y * -x;
elseif (z <= 6.5e-137)
tmp = (y * (z * x)) / (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, -7.2e-128], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 6.5e-137], N[(N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(0.5 * N[(N[(a * t), $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 -7.2 \cdot 10^{-128}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-137}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -7.20000000000000049e-128Initial program 49.0%
*-commutative49.0%
associate-*l*47.8%
associate-*r/53.3%
Simplified53.3%
Taylor expanded in z around -inf 84.2%
neg-mul-184.2%
Simplified84.2%
if -7.20000000000000049e-128 < z < 6.49999999999999991e-137Initial program 86.3%
associate-/l*83.2%
Simplified83.2%
Taylor expanded in z around -inf 38.2%
Taylor expanded in x around 0 38.4%
Taylor expanded in a around inf 38.4%
if 6.49999999999999991e-137 < z Initial program 66.7%
*-commutative66.7%
associate-*l*64.5%
associate-*r/64.7%
Simplified64.7%
Taylor expanded in z around inf 81.9%
Final simplification74.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 -4.8e-217) (* y (- x)) (if (<= z 2.1e-149) (/ (* z (* x y)) (* -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 <= -4.8e-217) {
tmp = y * -x;
} else if (z <= 2.1e-149) {
tmp = (z * (x * y)) / (-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 <= (-4.8d-217)) then
tmp = y * -x
else if (z <= 2.1d-149) then
tmp = (z * (x * y)) / ((-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 <= -4.8e-217) {
tmp = y * -x;
} else if (z <= 2.1e-149) {
tmp = (z * (x * y)) / (-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 <= -4.8e-217: tmp = y * -x elif z <= 2.1e-149: tmp = (z * (x * y)) / (-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 <= -4.8e-217) tmp = Float64(y * Float64(-x)); elseif (z <= 2.1e-149) tmp = Float64(Float64(z * Float64(x * y)) / 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 <= -4.8e-217)
tmp = y * -x;
elseif (z <= 2.1e-149)
tmp = (z * (x * y)) / (-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, -4.8e-217], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.1e-149], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(-0.5 * N[(N[(a * t), $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 -4.8 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-149}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{-0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.7999999999999997e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -4.7999999999999997e-217 < z < 2.10000000000000011e-149Initial program 88.2%
Taylor expanded in z around inf 45.4%
Taylor expanded in z around 0 45.4%
if 2.10000000000000011e-149 < z Initial program 66.7%
*-commutative66.7%
associate-*l*64.5%
associate-*r/64.7%
Simplified64.7%
Taylor expanded in z around inf 81.9%
Final simplification74.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5.6e-217) (* y (- x)) (if (<= z 1.7e-139) (/ (* z (* x y)) (/ (* a -0.5) (/ z t))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e-217) {
tmp = y * -x;
} else if (z <= 1.7e-139) {
tmp = (z * (x * y)) / ((a * -0.5) / (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 <= (-5.6d-217)) then
tmp = y * -x
else if (z <= 1.7d-139) then
tmp = (z * (x * y)) / ((a * (-0.5d0)) / (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 <= -5.6e-217) {
tmp = y * -x;
} else if (z <= 1.7e-139) {
tmp = (z * (x * y)) / ((a * -0.5) / (z / t));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5.6e-217: tmp = y * -x elif z <= 1.7e-139: tmp = (z * (x * y)) / ((a * -0.5) / (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 <= -5.6e-217) tmp = Float64(y * Float64(-x)); elseif (z <= 1.7e-139) tmp = Float64(Float64(z * Float64(x * y)) / Float64(Float64(a * -0.5) / Float64(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 <= -5.6e-217)
tmp = y * -x;
elseif (z <= 1.7e-139)
tmp = (z * (x * y)) / ((a * -0.5) / (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, -5.6e-217], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.7e-139], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(N[(a * -0.5), $MachinePrecision] / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-139}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{\frac{a \cdot -0.5}{\frac{z}{t}}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -5.6e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -5.6e-217 < z < 1.69999999999999999e-139Initial program 88.2%
Taylor expanded in z around inf 45.4%
Taylor expanded in z around 0 45.4%
associate-/l*45.4%
associate-*r/45.4%
Simplified45.4%
if 1.69999999999999999e-139 < z Initial program 66.7%
*-commutative66.7%
associate-*l*64.5%
associate-*r/64.7%
Simplified64.7%
Taylor expanded in z around inf 81.9%
Final simplification74.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5.6e-217) (* y (- x)) (/ (* x y) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e-217) {
tmp = y * -x;
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.6d-217)) then
tmp = y * -x
else
tmp = (x * y) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e-217) {
tmp = y * -x;
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5.6e-217: tmp = y * -x else: tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.6e-217) tmp = Float64(y * Float64(-x)); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.6e-217)
tmp = y * -x;
else
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.6e-217], N[(y * (-x)), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -5.6e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -5.6e-217 < z Initial program 73.0%
associate-/l*71.8%
Simplified71.8%
Taylor expanded in z around inf 67.5%
unpow267.5%
associate-/l*71.8%
Simplified71.8%
Final simplification74.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-264) (/ (* x y) (/ (- (* 0.5 (* t (/ a z))) z) z)) (/ (* x y) (+ 1.0 (* (/ a (/ (* z z) t)) -0.5)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-264) {
tmp = (x * y) / (((0.5 * (t * (a / z))) - z) / z);
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.9d-264)) then
tmp = (x * y) / (((0.5d0 * (t * (a / z))) - z) / z)
else
tmp = (x * y) / (1.0d0 + ((a / ((z * z) / t)) * (-0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-264) {
tmp = (x * y) / (((0.5 * (t * (a / z))) - z) / z);
} else {
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-264: tmp = (x * y) / (((0.5 * (t * (a / z))) - z) / z) else: tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-264) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(t * Float64(a / z))) - z) / z)); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(Float64(a / Float64(Float64(z * z) / t)) * -0.5))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.9e-264)
tmp = (x * y) / (((0.5 * (t * (a / z))) - z) / z);
else
tmp = (x * y) / (1.0 + ((a / ((z * z) / t)) * -0.5));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-264], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-264}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + \frac{a}{\frac{z \cdot z}{t}} \cdot -0.5}\\
\end{array}
\end{array}
if z < -1.90000000000000007e-264Initial program 54.7%
associate-/l*58.9%
Simplified58.9%
Taylor expanded in z around -inf 71.8%
*-commutative71.8%
*-un-lft-identity71.8%
times-frac76.7%
Applied egg-rr76.7%
if -1.90000000000000007e-264 < z Initial program 71.6%
associate-/l*71.0%
Simplified71.0%
Taylor expanded in z around inf 69.2%
unpow269.2%
associate-/l*73.8%
Simplified73.8%
Final simplification75.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5.6e-217) (* y (- x)) (if (<= z 5e-93) (/ (/ (* x (* y (- z))) z) -1.0) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e-217) {
tmp = y * -x;
} else if (z <= 5e-93) {
tmp = ((x * (y * -z)) / z) / -1.0;
} 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.6d-217)) then
tmp = y * -x
else if (z <= 5d-93) then
tmp = ((x * (y * -z)) / z) / (-1.0d0)
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.6e-217) {
tmp = y * -x;
} else if (z <= 5e-93) {
tmp = ((x * (y * -z)) / z) / -1.0;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5.6e-217: tmp = y * -x elif z <= 5e-93: tmp = ((x * (y * -z)) / z) / -1.0 else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.6e-217) tmp = Float64(y * Float64(-x)); elseif (z <= 5e-93) tmp = Float64(Float64(Float64(x * Float64(y * Float64(-z))) / z) / -1.0); 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.6e-217)
tmp = y * -x;
elseif (z <= 5e-93)
tmp = ((x * (y * -z)) / z) / -1.0;
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.6e-217], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5e-93], N[(N[(N[(x * N[(y * (-z)), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / -1.0), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-93}:\\
\;\;\;\;\frac{\frac{x \cdot \left(y \cdot \left(-z\right)\right)}{z}}{-1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -5.6e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -5.6e-217 < z < 4.99999999999999994e-93Initial program 90.5%
Taylor expanded in z around -inf 30.0%
neg-mul-130.0%
Simplified30.0%
*-un-lft-identity30.0%
neg-mul-130.0%
*-commutative30.0%
times-frac30.0%
frac-2neg30.0%
metadata-eval30.0%
add-sqr-sqrt12.2%
sqrt-unprod16.8%
sqr-neg16.8%
sqrt-prod28.1%
add-sqr-sqrt39.9%
*-commutative39.9%
Applied egg-rr39.9%
associate-*r*41.9%
*-commutative41.9%
Simplified41.9%
associate-*r/41.9%
Applied egg-rr41.9%
associate-*l/41.9%
mul-1-neg41.9%
associate-*r*41.8%
*-commutative41.8%
distribute-rgt-neg-in41.8%
Simplified41.8%
if 4.99999999999999994e-93 < z Initial program 62.6%
*-commutative62.6%
associate-*l*61.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 84.9%
Final simplification73.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 -7.2e-226)
(* y (- x))
(if (<= z 4.2e+15)
(* y (/ (* z x) z))
(if (<= z 1.15e+168) (* z (/ y (/ z x))) (* x y)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e-226) {
tmp = y * -x;
} else if (z <= 4.2e+15) {
tmp = y * ((z * x) / z);
} else if (z <= 1.15e+168) {
tmp = z * (y / (z / x));
} 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 <= (-7.2d-226)) then
tmp = y * -x
else if (z <= 4.2d+15) then
tmp = y * ((z * x) / z)
else if (z <= 1.15d+168) then
tmp = z * (y / (z / x))
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 <= -7.2e-226) {
tmp = y * -x;
} else if (z <= 4.2e+15) {
tmp = y * ((z * x) / z);
} else if (z <= 1.15e+168) {
tmp = z * (y / (z / x));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -7.2e-226: tmp = y * -x elif z <= 4.2e+15: tmp = y * ((z * x) / z) elif z <= 1.15e+168: tmp = z * (y / (z / x)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e-226) tmp = Float64(y * Float64(-x)); elseif (z <= 4.2e+15) tmp = Float64(y * Float64(Float64(z * x) / z)); elseif (z <= 1.15e+168) tmp = Float64(z * Float64(y / Float64(z / x))); 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 <= -7.2e-226)
tmp = y * -x;
elseif (z <= 4.2e+15)
tmp = y * ((z * x) / z);
elseif (z <= 1.15e+168)
tmp = z * (y / (z / x));
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, -7.2e-226], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.2e+15], N[(y * N[(N[(z * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+168], N[(z * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-226}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+15}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+168}:\\
\;\;\;\;z \cdot \frac{y}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -7.19999999999999988e-226Initial program 53.3%
*-commutative53.3%
associate-*l*51.4%
associate-*r/56.5%
Simplified56.5%
Taylor expanded in z around -inf 76.5%
neg-mul-176.5%
Simplified76.5%
if -7.19999999999999988e-226 < z < 4.2e15Initial program 92.8%
*-commutative92.8%
associate-*l*86.1%
associate-*r/86.1%
Simplified86.1%
Taylor expanded in z around inf 49.3%
if 4.2e15 < z < 1.15e168Initial program 81.6%
associate-*l/78.7%
Simplified78.7%
Taylor expanded in z around inf 76.8%
associate-/l*71.4%
Simplified71.4%
if 1.15e168 < z Initial program 11.9%
*-commutative11.9%
associate-*l*11.5%
associate-*r/11.7%
Simplified11.7%
Taylor expanded in z around inf 99.0%
Final simplification71.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 -4e-217) (* y (- x)) (if (<= z 5e-93) (/ (* 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 <= -4e-217) {
tmp = y * -x;
} else if (z <= 5e-93) {
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 <= (-4d-217)) then
tmp = y * -x
else if (z <= 5d-93) 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 <= -4e-217) {
tmp = y * -x;
} else if (z <= 5e-93) {
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 <= -4e-217: tmp = y * -x elif z <= 5e-93: 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 <= -4e-217) tmp = Float64(y * Float64(-x)); elseif (z <= 5e-93) tmp = Float64(Float64(y * Float64(z * Float64(-x))) / Float64(-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 <= -4e-217)
tmp = y * -x;
elseif (z <= 5e-93)
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, -4e-217], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5e-93], N[(N[(y * N[(z * (-x)), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-93}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot \left(-x\right)\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.00000000000000033e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -4.00000000000000033e-217 < z < 4.99999999999999994e-93Initial program 90.5%
Taylor expanded in z around -inf 30.0%
neg-mul-130.0%
Simplified30.0%
*-un-lft-identity30.0%
neg-mul-130.0%
*-commutative30.0%
times-frac30.0%
frac-2neg30.0%
metadata-eval30.0%
add-sqr-sqrt12.2%
sqrt-unprod16.8%
sqr-neg16.8%
sqrt-prod28.1%
add-sqr-sqrt39.9%
*-commutative39.9%
Applied egg-rr39.9%
associate-*r*41.9%
*-commutative41.9%
Simplified41.9%
expm1-log1p-u35.7%
expm1-udef41.2%
frac-times41.2%
*-commutative41.2%
mul-1-neg41.2%
Applied egg-rr41.2%
expm1-def35.7%
expm1-log1p41.9%
associate-*r*41.9%
mul-1-neg41.9%
Simplified41.9%
if 4.99999999999999994e-93 < z Initial program 62.6%
*-commutative62.6%
associate-*l*61.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 84.9%
Final simplification73.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-217) (* y (- x)) (if (<= z 5e-93) (* 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 <= -2.6e-217) {
tmp = y * -x;
} else if (z <= 5e-93) {
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 <= (-2.6d-217)) then
tmp = y * -x
else if (z <= 5d-93) 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 <= -2.6e-217) {
tmp = y * -x;
} else if (z <= 5e-93) {
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 <= -2.6e-217: tmp = y * -x elif z <= 5e-93: 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 <= -2.6e-217) tmp = Float64(y * Float64(-x)); elseif (z <= 5e-93) 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 <= -2.6e-217)
tmp = y * -x;
elseif (z <= 5e-93)
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, -2.6e-217], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5e-93], 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 -2.6 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-93}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.59999999999999993e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -2.59999999999999993e-217 < z < 4.99999999999999994e-93Initial program 90.5%
associate-/l*87.0%
Simplified87.0%
clear-num87.0%
associate-/r/86.9%
clear-num87.6%
Applied egg-rr87.6%
expm1-log1p-u77.6%
expm1-udef50.0%
cancel-sign-sub-inv50.0%
fma-def50.0%
Applied egg-rr50.0%
expm1-def77.6%
expm1-log1p87.6%
associate-*l/90.5%
associate-*r*81.8%
*-commutative81.8%
associate-*l/80.0%
associate-*r*84.8%
associate-*l/86.4%
distribute-lft-neg-out86.4%
fma-neg86.4%
unpow286.4%
*-commutative86.4%
unpow286.4%
Simplified86.4%
Taylor expanded in z around inf 34.7%
if 4.99999999999999994e-93 < z Initial program 62.6%
*-commutative62.6%
associate-*l*61.2%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around inf 84.9%
Final simplification71.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.65e-217) (* y (- x)) (if (<= z 1.6e+15) (/ (* z (* x y)) z) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e-217) {
tmp = y * -x;
} else if (z <= 1.6e+15) {
tmp = (z * (x * 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 <= (-1.65d-217)) then
tmp = y * -x
else if (z <= 1.6d+15) then
tmp = (z * (x * 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 <= -1.65e-217) {
tmp = y * -x;
} else if (z <= 1.6e+15) {
tmp = (z * (x * y)) / z;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.65e-217: tmp = y * -x elif z <= 1.6e+15: tmp = (z * (x * 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 <= -1.65e-217) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e+15) tmp = Float64(Float64(z * Float64(x * 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 <= -1.65e-217)
tmp = y * -x;
elseif (z <= 1.6e+15)
tmp = (z * (x * 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, -1.65e-217], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.6e+15], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-217}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+15}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.64999999999999996e-217Initial program 51.3%
*-commutative51.3%
associate-*l*49.3%
associate-*r/54.6%
Simplified54.6%
Taylor expanded in z around -inf 78.8%
neg-mul-178.8%
Simplified78.8%
if -1.64999999999999996e-217 < z < 1.6e15Initial program 93.3%
Taylor expanded in z around inf 52.4%
if 1.6e15 < z Initial program 50.4%
*-commutative50.4%
associate-*l*48.6%
associate-*r/48.9%
Simplified48.9%
Taylor expanded in z around inf 85.7%
Final simplification72.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 -2e-310) (* y (- x)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-310) {
tmp = y * -x;
} 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-310)) then
tmp = y * -x
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-310) {
tmp = y * -x;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2e-310: tmp = y * -x else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-310) tmp = Float64(y * Float64(-x)); 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-310)
tmp = y * -x;
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-310], N[(y * (-x)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 56.4%
*-commutative56.4%
associate-*l*53.3%
associate-*r/57.9%
Simplified57.9%
Taylor expanded in z around -inf 70.1%
neg-mul-170.1%
Simplified70.1%
if -1.999999999999994e-310 < z Initial program 70.8%
*-commutative70.8%
associate-*l*67.5%
associate-*r/67.6%
Simplified67.6%
Taylor expanded in z around inf 68.4%
Final simplification69.3%
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 63.3%
*-commutative63.3%
associate-*l*60.2%
associate-*r/62.6%
Simplified62.6%
Taylor expanded in z around inf 42.1%
Final simplification42.1%
(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 2023185
(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)))))