
(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 18 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 (sqrt (- (* z z) (* a t)))))
(if (<= z -3e+150)
(/ (* x y) (fma 0.5 (/ a (/ (* z z) t)) -1.0))
(if (<= z -4.2e-208)
(/ (* x y) (/ t_1 z))
(if (<= z 5.2e+51) (/ x (/ t_1 (* z y))) (* x y))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -3e+150) {
tmp = (x * y) / fma(0.5, (a / ((z * z) / t)), -1.0);
} else if (z <= -4.2e-208) {
tmp = (x * y) / (t_1 / z);
} else if (z <= 5.2e+51) {
tmp = x / (t_1 / (z * y));
} else {
tmp = x * y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) tmp = 0.0 if (z <= -3e+150) tmp = Float64(Float64(x * y) / fma(0.5, Float64(a / Float64(Float64(z * z) / t)), -1.0)); elseif (z <= -4.2e-208) tmp = Float64(Float64(x * y) / Float64(t_1 / z)); elseif (z <= 5.2e+51) tmp = Float64(x / Float64(t_1 / Float64(z * y))); else tmp = 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_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -3e+150], N[(N[(x * y), $MachinePrecision] / N[(0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.2e-208], N[(N[(x * y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+51], N[(x / N[(t$95$1 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -3 \cdot 10^{+150}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a}{\frac{z \cdot z}{t}}, -1\right)}\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-208}:\\
\;\;\;\;\frac{x \cdot y}{\frac{t_1}{z}}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\frac{t_1}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.00000000000000012e150Initial program 16.7%
associate-/l*17.3%
Simplified17.3%
Taylor expanded in z around -inf 85.1%
fma-neg85.1%
unpow285.1%
associate-/l*97.6%
metadata-eval97.6%
Simplified97.6%
if -3.00000000000000012e150 < z < -4.20000000000000024e-208Initial program 84.4%
associate-/l*91.2%
Simplified91.2%
if -4.20000000000000024e-208 < z < 5.2000000000000002e51Initial program 81.9%
*-commutative81.9%
associate-*l*84.3%
associate-*r/85.4%
Simplified85.4%
*-commutative85.4%
associate-/l*85.3%
associate-/r/81.4%
associate-/l/84.5%
*-commutative84.5%
Applied egg-rr84.5%
if 5.2000000000000002e51 < z Initial program 53.9%
*-commutative53.9%
associate-*l*52.2%
associate-*r/54.9%
Simplified54.9%
Taylor expanded in z around inf 96.3%
Final simplification91.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* a t)))))
(if (<= z -2e+151)
(* x (- y))
(if (<= z -3.4e-206)
(/ (* x y) (/ t_1 z))
(if (<= z 5.2e+51) (/ x (/ t_1 (* z y))) (* x y))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -2e+151) {
tmp = x * -y;
} else if (z <= -3.4e-206) {
tmp = (x * y) / (t_1 / z);
} else if (z <= 5.2e+51) {
tmp = x / (t_1 / (z * 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) :: t_1
real(8) :: tmp
t_1 = sqrt(((z * z) - (a * t)))
if (z <= (-2d+151)) then
tmp = x * -y
else if (z <= (-3.4d-206)) then
tmp = (x * y) / (t_1 / z)
else if (z <= 5.2d+51) then
tmp = x / (t_1 / (z * 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 t_1 = Math.sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -2e+151) {
tmp = x * -y;
} else if (z <= -3.4e-206) {
tmp = (x * y) / (t_1 / z);
} else if (z <= 5.2e+51) {
tmp = x / (t_1 / (z * y));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (a * t))) tmp = 0 if z <= -2e+151: tmp = x * -y elif z <= -3.4e-206: tmp = (x * y) / (t_1 / z) elif z <= 5.2e+51: tmp = x / (t_1 / (z * y)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) tmp = 0.0 if (z <= -2e+151) tmp = Float64(x * Float64(-y)); elseif (z <= -3.4e-206) tmp = Float64(Float64(x * y) / Float64(t_1 / z)); elseif (z <= 5.2e+51) tmp = Float64(x / Float64(t_1 / Float64(z * 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)
t_1 = sqrt(((z * z) - (a * t)));
tmp = 0.0;
if (z <= -2e+151)
tmp = x * -y;
elseif (z <= -3.4e-206)
tmp = (x * y) / (t_1 / z);
elseif (z <= 5.2e+51)
tmp = x / (t_1 / (z * 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_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -2e+151], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -3.4e-206], N[(N[(x * y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.2e+51], N[(x / N[(t$95$1 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+151}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-206}:\\
\;\;\;\;\frac{x \cdot y}{\frac{t_1}{z}}\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\frac{t_1}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.00000000000000003e151Initial program 16.7%
*-commutative16.7%
associate-*l*16.2%
associate-*r/16.5%
Simplified16.5%
Taylor expanded in z around -inf 97.6%
neg-mul-197.6%
Simplified97.6%
if -2.00000000000000003e151 < z < -3.39999999999999985e-206Initial program 84.4%
associate-/l*91.2%
Simplified91.2%
if -3.39999999999999985e-206 < z < 5.2000000000000002e51Initial program 81.9%
*-commutative81.9%
associate-*l*84.3%
associate-*r/85.4%
Simplified85.4%
*-commutative85.4%
associate-/l*85.3%
associate-/r/81.4%
associate-/l/84.5%
*-commutative84.5%
Applied egg-rr84.5%
if 5.2000000000000002e51 < z Initial program 53.9%
*-commutative53.9%
associate-*l*52.2%
associate-*r/54.9%
Simplified54.9%
Taylor expanded in z around inf 96.3%
Final simplification91.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 -1e+128) (* x (- y)) (if (<= z 1.45e+52) (* y (/ (* z x) (sqrt (- (* 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 <= -1e+128) {
tmp = x * -y;
} else if (z <= 1.45e+52) {
tmp = y * ((z * x) / sqrt(((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 <= (-1d+128)) then
tmp = x * -y
else if (z <= 1.45d+52) then
tmp = y * ((z * x) / sqrt(((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 <= -1e+128) {
tmp = x * -y;
} else if (z <= 1.45e+52) {
tmp = y * ((z * x) / Math.sqrt(((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 <= -1e+128: tmp = x * -y elif z <= 1.45e+52: tmp = y * ((z * x) / math.sqrt(((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 <= -1e+128) tmp = Float64(x * Float64(-y)); elseif (z <= 1.45e+52) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(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 <= -1e+128)
tmp = x * -y;
elseif (z <= 1.45e+52)
tmp = y * ((z * x) / sqrt(((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, -1e+128], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.45e+52], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $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 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.0000000000000001e128Initial program 20.4%
*-commutative20.4%
associate-*l*19.8%
associate-*r/20.1%
Simplified20.1%
Taylor expanded in z around -inf 97.8%
neg-mul-197.8%
Simplified97.8%
if -1.0000000000000001e128 < z < 1.45e52Initial program 83.4%
*-commutative83.4%
associate-*l*82.1%
associate-*r/83.1%
Simplified83.1%
if 1.45e52 < z Initial program 53.9%
*-commutative53.9%
associate-*l*52.2%
associate-*r/54.9%
Simplified54.9%
Taylor expanded in z around inf 96.3%
Final simplification89.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 -2.85e+150) (* x (- y)) (if (<= z 1e+44) (* y (* x (/ z (sqrt (- (* 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.85e+150) {
tmp = x * -y;
} else if (z <= 1e+44) {
tmp = y * (x * (z / sqrt(((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.85d+150)) then
tmp = x * -y
else if (z <= 1d+44) then
tmp = y * (x * (z / sqrt(((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.85e+150) {
tmp = x * -y;
} else if (z <= 1e+44) {
tmp = y * (x * (z / Math.sqrt(((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.85e+150: tmp = x * -y elif z <= 1e+44: tmp = y * (x * (z / math.sqrt(((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.85e+150) tmp = Float64(x * Float64(-y)); elseif (z <= 1e+44) tmp = Float64(y * Float64(x * Float64(z / sqrt(Float64(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.85e+150)
tmp = x * -y;
elseif (z <= 1e+44)
tmp = y * (x * (z / sqrt(((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.85e+150], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1e+44], N[(y * N[(x * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+150}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 10^{+44}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.8500000000000001e150Initial program 16.7%
*-commutative16.7%
associate-*l*16.2%
associate-*r/16.5%
Simplified16.5%
Taylor expanded in z around -inf 97.6%
neg-mul-197.6%
Simplified97.6%
if -2.8500000000000001e150 < z < 1.0000000000000001e44Initial program 83.1%
associate-/l*85.4%
Simplified85.4%
associate-*l/84.9%
associate-/l*82.8%
div-inv82.8%
associate-*l*85.0%
div-inv85.1%
Applied egg-rr85.1%
if 1.0000000000000001e44 < z Initial program 53.9%
*-commutative53.9%
associate-*l*52.2%
associate-*r/54.9%
Simplified54.9%
Taylor expanded in z around inf 96.3%
Final simplification90.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.1e+64) (* x (- y)) (if (<= z 9.5e+51) (/ x (/ (sqrt (- (* z z) (* a t))) (* z y))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.1e+64) {
tmp = x * -y;
} else if (z <= 9.5e+51) {
tmp = x / (sqrt(((z * z) - (a * t))) / (z * 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 <= (-4.1d+64)) then
tmp = x * -y
else if (z <= 9.5d+51) then
tmp = x / (sqrt(((z * z) - (a * t))) / (z * 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 <= -4.1e+64) {
tmp = x * -y;
} else if (z <= 9.5e+51) {
tmp = x / (Math.sqrt(((z * z) - (a * t))) / (z * y));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.1e+64: tmp = x * -y elif z <= 9.5e+51: tmp = x / (math.sqrt(((z * z) - (a * t))) / (z * y)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.1e+64) tmp = Float64(x * Float64(-y)); elseif (z <= 9.5e+51) tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / Float64(z * 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 <= -4.1e+64)
tmp = x * -y;
elseif (z <= 9.5e+51)
tmp = x / (sqrt(((z * z) - (a * t))) / (z * 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, -4.1e+64], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 9.5e+51], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+64}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+51}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.09999999999999978e64Initial program 37.8%
*-commutative37.8%
associate-*l*35.6%
associate-*r/39.1%
Simplified39.1%
Taylor expanded in z around -inf 98.4%
neg-mul-198.4%
Simplified98.4%
if -4.09999999999999978e64 < z < 9.4999999999999999e51Initial program 82.8%
*-commutative82.8%
associate-*l*82.3%
associate-*r/81.9%
Simplified81.9%
*-commutative81.9%
associate-/l*82.6%
associate-/r/82.5%
associate-/l/84.2%
*-commutative84.2%
Applied egg-rr84.2%
if 9.4999999999999999e51 < z Initial program 53.9%
*-commutative53.9%
associate-*l*52.2%
associate-*r/54.9%
Simplified54.9%
Taylor expanded in z around inf 96.3%
Final simplification91.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-53) (/ (* x y) (/ (- (* 0.5 (* a (/ t z))) z) z)) (if (<= z 2.05e-79) (* y (/ (* z x) (sqrt (* a (- t))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-53) {
tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
} else if (z <= 2.05e-79) {
tmp = y * ((z * x) / sqrt((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 <= (-1.35d-53)) then
tmp = (x * y) / (((0.5d0 * (a * (t / z))) - z) / z)
else if (z <= 2.05d-79) then
tmp = y * ((z * x) / sqrt((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 <= -1.35e-53) {
tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
} else if (z <= 2.05e-79) {
tmp = y * ((z * x) / Math.sqrt((a * -t)));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-53: tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z) elif z <= 2.05e-79: tmp = y * ((z * x) / math.sqrt((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 <= -1.35e-53) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / z)); elseif (z <= 2.05e-79) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-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.35e-53)
tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / z);
elseif (z <= 2.05e-79)
tmp = y * ((z * x) / sqrt((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, -1.35e-53], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.05e-79], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[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 -1.35 \cdot 10^{-53}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{z}}\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.35e-53Initial program 54.7%
associate-/l*58.4%
Simplified58.4%
Taylor expanded in z around -inf 88.3%
expm1-log1p-u87.1%
expm1-udef87.1%
*-commutative87.1%
Applied egg-rr87.1%
expm1-def87.1%
expm1-log1p88.3%
*-commutative88.3%
associate-*r/93.1%
Simplified93.1%
if -1.35e-53 < z < 2.04999999999999997e-79Initial program 75.5%
*-commutative75.5%
associate-*l*75.8%
associate-*r/77.5%
Simplified77.5%
Taylor expanded in z around 0 74.1%
mul-1-neg74.1%
*-commutative74.1%
distribute-rgt-neg-in74.1%
Simplified74.1%
if 2.04999999999999997e-79 < z Initial program 62.8%
*-commutative62.8%
associate-*l*60.6%
associate-*r/62.7%
Simplified62.7%
Taylor expanded in z around inf 92.3%
Final simplification87.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 -8.2e-105)
(* x (- y))
(if (<= z 1.2e-140)
(* (* z x) (/ y (- (/ (* a (* t -0.5)) z) z)))
(* x y))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e-105) {
tmp = x * -y;
} else if (z <= 1.2e-140) {
tmp = (z * x) * (y / (((a * (t * -0.5)) / 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 <= (-8.2d-105)) then
tmp = x * -y
else if (z <= 1.2d-140) then
tmp = (z * x) * (y / (((a * (t * (-0.5d0))) / 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 <= -8.2e-105) {
tmp = x * -y;
} else if (z <= 1.2e-140) {
tmp = (z * x) * (y / (((a * (t * -0.5)) / z) - z));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -8.2e-105: tmp = x * -y elif z <= 1.2e-140: tmp = (z * x) * (y / (((a * (t * -0.5)) / 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 <= -8.2e-105) tmp = Float64(x * Float64(-y)); elseif (z <= 1.2e-140) tmp = Float64(Float64(z * x) * Float64(y / Float64(Float64(Float64(a * Float64(t * -0.5)) / 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 <= -8.2e-105)
tmp = x * -y;
elseif (z <= 1.2e-140)
tmp = (z * x) * (y / (((a * (t * -0.5)) / 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, -8.2e-105], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.2e-140], N[(N[(z * x), $MachinePrecision] * N[(y / N[(N[(N[(a * N[(t * -0.5), $MachinePrecision]), $MachinePrecision] / z), $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 -8.2 \cdot 10^{-105}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-140}:\\
\;\;\;\;\left(z \cdot x\right) \cdot \frac{y}{\frac{a \cdot \left(t \cdot -0.5\right)}{z} - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -8.20000000000000061e-105Initial program 56.5%
*-commutative56.5%
associate-*l*54.1%
associate-*r/55.4%
Simplified55.4%
Taylor expanded in z around -inf 86.2%
neg-mul-186.2%
Simplified86.2%
if -8.20000000000000061e-105 < z < 1.19999999999999993e-140Initial program 72.7%
associate-/l*70.2%
Simplified70.2%
Taylor expanded in z around -inf 44.7%
div-inv44.7%
*-commutative44.7%
frac-2neg44.7%
metadata-eval44.7%
add-sqr-sqrt22.2%
sqrt-unprod41.2%
sqr-neg41.2%
sqrt-prod23.0%
add-sqr-sqrt44.8%
Applied egg-rr44.8%
associate-*l*44.8%
Simplified44.8%
Taylor expanded in x around 0 43.2%
associate-/l*44.9%
associate-/r/44.9%
neg-mul-144.9%
+-commutative44.9%
unsub-neg44.9%
associate-*r/44.9%
*-commutative44.9%
associate-*r*44.9%
Simplified44.9%
if 1.19999999999999993e-140 < z Initial program 66.0%
*-commutative66.0%
associate-*l*63.1%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 88.0%
Final simplification78.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.9e+49) (* x (- y)) (if (<= z 2.8e-141) (* 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 <= -1.9e+49) {
tmp = x * -y;
} else if (z <= 2.8e-141) {
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 <= (-1.9d+49)) then
tmp = x * -y
else if (z <= 2.8d-141) 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 <= -1.9e+49) {
tmp = x * -y;
} else if (z <= 2.8e-141) {
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 <= -1.9e+49: tmp = x * -y elif z <= 2.8e-141: 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 <= -1.9e+49) tmp = Float64(x * Float64(-y)); elseif (z <= 2.8e-141) 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 <= -1.9e+49)
tmp = x * -y;
elseif (z <= 2.8e-141)
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, -1.9e+49], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.8e-141], 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 -1.9 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-141}:\\
\;\;\;\;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 < -1.8999999999999999e49Initial program 39.8%
*-commutative39.8%
associate-*l*37.8%
associate-*r/41.2%
Simplified41.2%
Taylor expanded in z around -inf 96.9%
neg-mul-196.9%
Simplified96.9%
if -1.8999999999999999e49 < z < 2.80000000000000012e-141Initial program 78.2%
*-commutative78.2%
associate-*l*79.6%
associate-*r/79.0%
Simplified79.0%
Taylor expanded in z around -inf 53.3%
if 2.80000000000000012e-141 < z Initial program 66.0%
*-commutative66.0%
associate-*l*63.1%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 88.0%
Final simplification78.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -7e-106) (* x (- y)) (if (<= z 2.7e-140) (* -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 <= -7e-106) {
tmp = x * -y;
} else if (z <= 2.7e-140) {
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 <= (-7d-106)) then
tmp = x * -y
else if (z <= 2.7d-140) 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 <= -7e-106) {
tmp = x * -y;
} else if (z <= 2.7e-140) {
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 <= -7e-106: tmp = x * -y elif z <= 2.7e-140: 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 <= -7e-106) tmp = Float64(x * Float64(-y)); elseif (z <= 2.7e-140) 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 <= -7e-106)
tmp = x * -y;
elseif (z <= 2.7e-140)
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, -7e-106], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.7e-140], 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 -7 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-140}:\\
\;\;\;\;-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 < -7e-106Initial program 56.5%
*-commutative56.5%
associate-*l*54.1%
associate-*r/55.4%
Simplified55.4%
Taylor expanded in z around -inf 86.2%
neg-mul-186.2%
Simplified86.2%
if -7e-106 < z < 2.7e-140Initial program 72.7%
associate-/l*70.2%
Simplified70.2%
associate-*l/73.8%
associate-/l*77.2%
div-inv77.2%
associate-*l*74.2%
div-inv74.3%
Applied egg-rr74.3%
Taylor expanded in z around inf 41.3%
Taylor expanded in z around 0 41.1%
times-frac41.0%
unpow241.0%
Simplified41.0%
if 2.7e-140 < z Initial program 66.0%
*-commutative66.0%
associate-*l*63.1%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 88.0%
Final simplification77.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 -7e-106) (* x (- y)) (if (<= z 7.2e-142) (* -2.0 (/ (* y (* 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 <= -7e-106) {
tmp = x * -y;
} else if (z <= 7.2e-142) {
tmp = -2.0 * ((y * (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 <= (-7d-106)) then
tmp = x * -y
else if (z <= 7.2d-142) then
tmp = (-2.0d0) * ((y * (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 <= -7e-106) {
tmp = x * -y;
} else if (z <= 7.2e-142) {
tmp = -2.0 * ((y * (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 <= -7e-106: tmp = x * -y elif z <= 7.2e-142: tmp = -2.0 * ((y * (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 <= -7e-106) tmp = Float64(x * Float64(-y)); elseif (z <= 7.2e-142) tmp = Float64(-2.0 * Float64(Float64(y * 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 <= -7e-106)
tmp = x * -y;
elseif (z <= 7.2e-142)
tmp = -2.0 * ((y * (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, -7e-106], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 7.2e-142], N[(-2.0 * N[(N[(y * N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-142}:\\
\;\;\;\;-2 \cdot \frac{y \cdot \left(z \cdot \left(z \cdot x\right)\right)}{a \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -7e-106Initial program 56.5%
*-commutative56.5%
associate-*l*54.1%
associate-*r/55.4%
Simplified55.4%
Taylor expanded in z around -inf 86.2%
neg-mul-186.2%
Simplified86.2%
if -7e-106 < z < 7.20000000000000001e-142Initial program 72.7%
associate-/l*70.2%
Simplified70.2%
associate-*l/73.8%
associate-/l*77.2%
div-inv77.2%
associate-*l*74.2%
div-inv74.3%
Applied egg-rr74.3%
Taylor expanded in z around inf 41.3%
Taylor expanded in z around 0 41.1%
times-frac41.0%
unpow241.0%
Simplified41.0%
frac-times41.1%
associate-*l*41.1%
*-commutative41.1%
Applied egg-rr41.1%
if 7.20000000000000001e-142 < z Initial program 66.0%
*-commutative66.0%
associate-*l*63.1%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 88.0%
Final simplification77.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.1e-100) (* x (- y)) (if (<= z 1.2e-140) (* 2.0 (/ (* y (/ (* z (* z x)) t)) a)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e-100) {
tmp = x * -y;
} else if (z <= 1.2e-140) {
tmp = 2.0 * ((y * ((z * (z * x)) / t)) / a);
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.1d-100)) then
tmp = x * -y
else if (z <= 1.2d-140) then
tmp = 2.0d0 * ((y * ((z * (z * x)) / t)) / a)
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e-100) {
tmp = x * -y;
} else if (z <= 1.2e-140) {
tmp = 2.0 * ((y * ((z * (z * x)) / t)) / a);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.1e-100: tmp = x * -y elif z <= 1.2e-140: tmp = 2.0 * ((y * ((z * (z * x)) / t)) / a) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e-100) tmp = Float64(x * Float64(-y)); elseif (z <= 1.2e-140) tmp = Float64(2.0 * Float64(Float64(y * Float64(Float64(z * Float64(z * x)) / t)) / a)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.1e-100)
tmp = x * -y;
elseif (z <= 1.2e-140)
tmp = 2.0 * ((y * ((z * (z * x)) / t)) / a);
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e-100], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.2e-140], N[(2.0 * N[(N[(y * N[(N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-100}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-140}:\\
\;\;\;\;2 \cdot \frac{y \cdot \frac{z \cdot \left(z \cdot x\right)}{t}}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.0999999999999999e-100Initial program 54.5%
*-commutative54.5%
associate-*l*52.0%
associate-*r/53.3%
Simplified53.3%
Taylor expanded in z around -inf 86.6%
neg-mul-186.6%
Simplified86.6%
if -3.0999999999999999e-100 < z < 1.19999999999999993e-140Initial program 74.5%
associate-/l*72.3%
Simplified72.3%
Taylor expanded in z around -inf 46.9%
Taylor expanded in a around inf 43.5%
times-frac43.3%
associate-*l/43.7%
unpow243.7%
associate-*l*45.4%
Simplified45.4%
if 1.19999999999999993e-140 < z Initial program 66.0%
*-commutative66.0%
associate-*l*63.1%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 88.0%
Final simplification77.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.5e-141) (* y (* x (/ z (- (* 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 <= 7.5e-141) {
tmp = y * (x * (z / ((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 <= 7.5d-141) then
tmp = y * (x * (z / ((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 <= 7.5e-141) {
tmp = y * (x * (z / ((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 <= 7.5e-141: tmp = y * (x * (z / ((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 <= 7.5e-141) tmp = Float64(y * Float64(x * Float64(z / 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 <= 7.5e-141)
tmp = y * (x * (z / ((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, 7.5e-141], N[(y * N[(x * N[(z / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $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 7.5 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{a \cdot t}{z} - z}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < 7.50000000000000046e-141Initial program 62.6%
associate-/l*65.0%
Simplified65.0%
associate-*l/64.5%
associate-/l*63.5%
div-inv63.5%
associate-*l*64.6%
div-inv64.6%
Applied egg-rr64.6%
Taylor expanded in z around -inf 68.9%
if 7.50000000000000046e-141 < z Initial program 66.0%
*-commutative66.0%
associate-*l*63.1%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 88.0%
Final simplification77.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 7.2e-142) (/ (* x y) (/ (- (* 0.5 (* a (/ t z))) z) z)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 7.2e-142) {
tmp = (x * y) / (((0.5 * (a * (t / z))) - 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 <= 7.2d-142) then
tmp = (x * y) / (((0.5d0 * (a * (t / z))) - 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 <= 7.2e-142) {
tmp = (x * y) / (((0.5 * (a * (t / z))) - z) / 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-142: tmp = (x * y) / (((0.5 * (a * (t / z))) - 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 <= 7.2e-142) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - 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 <= 7.2e-142)
tmp = (x * y) / (((0.5 * (a * (t / z))) - 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, 7.2e-142], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $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^{-142}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < 7.20000000000000001e-142Initial program 62.6%
associate-/l*65.0%
Simplified65.0%
Taylor expanded in z around -inf 69.4%
expm1-log1p-u61.0%
expm1-udef60.9%
*-commutative60.9%
Applied egg-rr60.9%
expm1-def61.0%
expm1-log1p69.4%
*-commutative69.4%
associate-*r/72.1%
Simplified72.1%
if 7.20000000000000001e-142 < z Initial program 66.0%
*-commutative66.0%
associate-*l*63.1%
associate-*r/65.0%
Simplified65.0%
Taylor expanded in z around inf 88.0%
Final simplification78.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+51) (* x (- y)) (if (<= z 9e-160) (* 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 <= -2e+51) {
tmp = x * -y;
} else if (z <= 9e-160) {
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 <= (-2d+51)) then
tmp = x * -y
else if (z <= 9d-160) 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 <= -2e+51) {
tmp = x * -y;
} else if (z <= 9e-160) {
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 <= -2e+51: tmp = x * -y elif z <= 9e-160: 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 <= -2e+51) tmp = Float64(x * Float64(-y)); elseif (z <= 9e-160) tmp = Float64(y * Float64(Float64(z * 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 <= -2e+51)
tmp = x * -y;
elseif (z <= 9e-160)
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, -2e+51], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 9e-160], 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 -2 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-160}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{-z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2e51Initial program 39.8%
*-commutative39.8%
associate-*l*37.8%
associate-*r/41.2%
Simplified41.2%
Taylor expanded in z around -inf 96.9%
neg-mul-196.9%
Simplified96.9%
if -2e51 < z < 9.00000000000000053e-160Initial program 78.8%
*-commutative78.8%
associate-*l*79.1%
associate-*r/78.5%
Simplified78.5%
Taylor expanded in z around -inf 44.8%
neg-mul-144.8%
Simplified44.8%
if 9.00000000000000053e-160 < z Initial program 65.8%
*-commutative65.8%
associate-*l*63.8%
associate-*r/65.7%
Simplified65.7%
Taylor expanded in z around inf 86.5%
Final simplification75.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 -3.2e-100) (* x (- y)) (if (<= z 2.15e-159) (/ (* 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 <= -3.2e-100) {
tmp = x * -y;
} else if (z <= 2.15e-159) {
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 <= (-3.2d-100)) then
tmp = x * -y
else if (z <= 2.15d-159) 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 <= -3.2e-100) {
tmp = x * -y;
} else if (z <= 2.15e-159) {
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 <= -3.2e-100: tmp = x * -y elif z <= 2.15e-159: 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 <= -3.2e-100) tmp = Float64(x * Float64(-y)); elseif (z <= 2.15e-159) tmp = Float64(Float64(y * Float64(z * 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 <= -3.2e-100)
tmp = x * -y;
elseif (z <= 2.15e-159)
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, -3.2e-100], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.15e-159], 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 -3.2 \cdot 10^{-100}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-159}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.20000000000000017e-100Initial program 54.5%
*-commutative54.5%
associate-*l*52.0%
associate-*r/53.3%
Simplified53.3%
Taylor expanded in z around -inf 86.6%
neg-mul-186.6%
Simplified86.6%
if -3.20000000000000017e-100 < z < 2.15e-159Initial program 75.2%
Taylor expanded in z around -inf 30.9%
neg-mul-135.8%
Simplified30.9%
Taylor expanded in x around 0 37.8%
if 2.15e-159 < z Initial program 65.8%
*-commutative65.8%
associate-*l*63.8%
associate-*r/65.7%
Simplified65.7%
Taylor expanded in z around inf 86.5%
Final simplification75.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 -7e-106) (* x (- y)) (if (<= z 1e-126) (* 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 <= -7e-106) {
tmp = x * -y;
} else if (z <= 1e-126) {
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 <= (-7d-106)) then
tmp = x * -y
else if (z <= 1d-126) 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 <= -7e-106) {
tmp = x * -y;
} else if (z <= 1e-126) {
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 <= -7e-106: tmp = x * -y elif z <= 1e-126: 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 <= -7e-106) tmp = Float64(x * Float64(-y)); elseif (z <= 1e-126) 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 <= -7e-106)
tmp = x * -y;
elseif (z <= 1e-126)
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, -7e-106], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1e-126], 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 -7 \cdot 10^{-106}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 10^{-126}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -7e-106Initial program 56.5%
*-commutative56.5%
associate-*l*54.1%
associate-*r/55.4%
Simplified55.4%
Taylor expanded in z around -inf 86.2%
neg-mul-186.2%
Simplified86.2%
if -7e-106 < z < 9.9999999999999995e-127Initial program 73.6%
*-commutative73.6%
associate-*l*77.3%
associate-*r/78.0%
Simplified78.0%
Taylor expanded in z around inf 29.0%
if 9.9999999999999995e-127 < z Initial program 65.4%
*-commutative65.4%
associate-*l*62.4%
associate-*r/64.4%
Simplified64.4%
Taylor expanded in z around inf 88.6%
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 -4e-310) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-310) {
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 <= (-4d-310)) 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 <= -4e-310) {
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 <= -4e-310: 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 <= -4e-310) 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 <= -4e-310)
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, -4e-310], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.999999999999988e-310Initial program 60.0%
*-commutative60.0%
associate-*l*56.9%
associate-*r/58.2%
Simplified58.2%
Taylor expanded in z around -inf 69.8%
neg-mul-169.8%
Simplified69.8%
if -3.999999999999988e-310 < z Initial program 67.7%
*-commutative67.7%
associate-*l*68.0%
associate-*r/69.5%
Simplified69.5%
Taylor expanded in z around inf 73.4%
Final simplification71.7%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x y))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return x * y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x * y
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return x * y;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return x * y
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(x * y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = x * y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot y
\end{array}
Initial program 64.0%
*-commutative64.0%
associate-*l*62.8%
associate-*r/64.2%
Simplified64.2%
Taylor expanded in z around inf 45.0%
Final simplification45.0%
(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 2023195
(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)))))