
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.2e+41) (* x (- y)) (if (<= z 1.4e+45) (* x (/ (* z y) (sqrt (- (* z z) (* t a))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+41) {
tmp = x * -y;
} else if (z <= 1.4e+45) {
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.2d+41)) then
tmp = x * -y
else if (z <= 1.4d+45) then
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e+41) {
tmp = x * -y;
} else if (z <= 1.4e+45) {
tmp = x * ((z * y) / Math.sqrt(((z * z) - (t * a))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.2e+41: tmp = x * -y elif z <= 1.4e+45: tmp = x * ((z * y) / math.sqrt(((z * z) - (t * a)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e+41) tmp = Float64(x * Float64(-y)); elseif (z <= 1.4e+45) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(Float64(z * z) - Float64(t * a))))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.2e+41)
tmp = x * -y;
elseif (z <= 1.4e+45)
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e+41], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.4e+45], N[(x * N[(N[(z * y), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+41}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+45}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.2000000000000001e41Initial program 36.5%
associate-*l*31.6%
associate-*r/31.9%
*-commutative31.9%
associate-/l*31.2%
Simplified31.2%
Taylor expanded in z around -inf 93.0%
neg-mul-193.0%
Simplified93.0%
if -3.2000000000000001e41 < z < 1.4e45Initial program 86.4%
associate-*l*86.0%
associate-*r/87.9%
Simplified87.9%
if 1.4e45 < z Initial program 33.7%
associate-*l*30.4%
associate-*r/32.2%
*-commutative32.2%
associate-/l*36.0%
Simplified36.0%
Taylor expanded in z around inf 94.1%
*-commutative94.1%
Simplified94.1%
Final simplification90.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 -6.5e+130) (* x (- y)) (if (<= z 1.5e+86) (* x (/ z (/ (sqrt (- (* z z) (* t a))) y))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+130) {
tmp = x * -y;
} else if (z <= 1.5e+86) {
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-6.5d+130)) then
tmp = x * -y
else if (z <= 1.5d+86) then
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+130) {
tmp = x * -y;
} else if (z <= 1.5e+86) {
tmp = x * (z / (Math.sqrt(((z * z) - (t * a))) / y));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+130: tmp = x * -y elif z <= 1.5e+86: tmp = x * (z / (math.sqrt(((z * z) - (t * a))) / y)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+130) tmp = Float64(x * Float64(-y)); elseif (z <= 1.5e+86) tmp = Float64(x * Float64(z / Float64(sqrt(Float64(Float64(z * z) - Float64(t * a))) / y))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -6.5e+130)
tmp = x * -y;
elseif (z <= 1.5e+86)
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+130], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.5e+86], N[(x * N[(z / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+130}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+86}:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{z \cdot z - t \cdot a}}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -6.5e130Initial program 17.1%
associate-*l*14.4%
associate-*r/14.7%
*-commutative14.7%
associate-/l*15.7%
Simplified15.7%
Taylor expanded in z around -inf 98.1%
neg-mul-198.1%
Simplified98.1%
if -6.5e130 < z < 1.49999999999999988e86Initial program 86.1%
associate-*l*83.9%
associate-*r/85.5%
*-commutative85.5%
associate-/l*87.6%
Simplified87.6%
if 1.49999999999999988e86 < z Initial program 27.1%
associate-*l*25.1%
associate-*r/27.2%
*-commutative27.2%
associate-/l*29.6%
Simplified29.6%
Taylor expanded in z around inf 96.7%
*-commutative96.7%
Simplified96.7%
Final simplification91.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 -1.5e-119) (* x (- y)) (if (<= z 3e-66) (* x (/ z (/ (sqrt (* t (- a))) y))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e-119) {
tmp = x * -y;
} else if (z <= 3e-66) {
tmp = x * (z / (sqrt((t * -a)) / y));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.5d-119)) then
tmp = x * -y
else if (z <= 3d-66) then
tmp = x * (z / (sqrt((t * -a)) / y))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e-119) {
tmp = x * -y;
} else if (z <= 3e-66) {
tmp = x * (z / (Math.sqrt((t * -a)) / y));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.5e-119: tmp = x * -y elif z <= 3e-66: tmp = x * (z / (math.sqrt((t * -a)) / y)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e-119) tmp = Float64(x * Float64(-y)); elseif (z <= 3e-66) tmp = Float64(x * Float64(z / Float64(sqrt(Float64(t * Float64(-a))) / y))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.5e-119)
tmp = x * -y;
elseif (z <= 3e-66)
tmp = x * (z / (sqrt((t * -a)) / y));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e-119], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3e-66], N[(x * N[(z / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{-119}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-66}:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{t \cdot \left(-a\right)}}{y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.5000000000000001e-119Initial program 56.0%
associate-*l*52.4%
associate-*r/53.6%
*-commutative53.6%
associate-/l*52.6%
Simplified52.6%
Taylor expanded in z around -inf 85.6%
neg-mul-185.6%
Simplified85.6%
if -1.5000000000000001e-119 < z < 3.0000000000000002e-66Initial program 80.4%
associate-*l*81.9%
associate-*r/82.6%
*-commutative82.6%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in z around 0 79.9%
mul-1-neg79.9%
distribute-rgt-neg-out79.9%
Simplified79.9%
if 3.0000000000000002e-66 < z Initial program 52.2%
associate-*l*48.7%
associate-*r/51.1%
*-commutative51.1%
associate-/l*54.8%
Simplified54.8%
Taylor expanded in z around inf 88.8%
*-commutative88.8%
Simplified88.8%
Final simplification85.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.8e-154) (* x (- y)) (if (<= z 7.8e-66) (* y (/ (* z x) (sqrt (* t (- a))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-154) {
tmp = x * -y;
} else if (z <= 7.8e-66) {
tmp = y * ((z * x) / sqrt((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 <= (-4.8d-154)) then
tmp = x * -y
else if (z <= 7.8d-66) then
tmp = y * ((z * x) / sqrt((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 <= -4.8e-154) {
tmp = x * -y;
} else if (z <= 7.8e-66) {
tmp = y * ((z * x) / Math.sqrt((t * -a)));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.8e-154: tmp = x * -y elif z <= 7.8e-66: tmp = y * ((z * x) / math.sqrt((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 <= -4.8e-154) tmp = Float64(x * Float64(-y)); elseif (z <= 7.8e-66) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(t * Float64(-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 <= -4.8e-154)
tmp = x * -y;
elseif (z <= 7.8e-66)
tmp = y * ((z * x) / sqrt((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, -4.8e-154], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 7.8e-66], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-154}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-66}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.79999999999999974e-154Initial program 57.6%
associate-*l*53.4%
associate-*r/54.5%
*-commutative54.5%
associate-/l*55.2%
Simplified55.2%
Taylor expanded in z around -inf 83.8%
neg-mul-183.8%
Simplified83.8%
if -4.79999999999999974e-154 < z < 7.79999999999999965e-66Initial program 80.0%
*-commutative80.0%
associate-/l*79.9%
Simplified79.9%
associate-/r/79.7%
*-commutative79.7%
associate-*r*80.4%
associate-/r/85.7%
*-commutative85.7%
associate-*r/86.6%
associate-/r/86.7%
*-commutative86.7%
Applied egg-rr86.7%
Taylor expanded in z around 0 83.3%
mul-1-neg82.3%
distribute-rgt-neg-out82.3%
Simplified83.3%
if 7.79999999999999965e-66 < z Initial program 52.2%
associate-*l*48.7%
associate-*r/51.1%
*-commutative51.1%
associate-/l*54.8%
Simplified54.8%
Taylor expanded in z around inf 88.8%
*-commutative88.8%
Simplified88.8%
Final simplification85.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 -2.5e-231) (* x (- y)) (if (<= z 3.2e-73) (* x (/ (* z y) (+ z (* -0.5 (/ (* t a) z))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.5e-231) {
tmp = x * -y;
} else if (z <= 3.2e-73) {
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.5d-231)) then
tmp = x * -y
else if (z <= 3.2d-73) then
tmp = x * ((z * y) / (z + ((-0.5d0) * ((t * a) / z))))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.5e-231) {
tmp = x * -y;
} else if (z <= 3.2e-73) {
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.5e-231: tmp = x * -y elif z <= 3.2e-73: tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.5e-231) tmp = Float64(x * Float64(-y)); elseif (z <= 3.2e-73) tmp = Float64(x * Float64(Float64(z * y) / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.5e-231)
tmp = x * -y;
elseif (z <= 3.2e-73)
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.5e-231], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.2e-73], N[(x * N[(N[(z * y), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-231}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-73}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.50000000000000012e-231Initial program 60.5%
associate-*l*56.7%
associate-*r/57.7%
*-commutative57.7%
associate-/l*58.4%
Simplified58.4%
Taylor expanded in z around -inf 77.7%
neg-mul-177.7%
Simplified77.7%
if -2.50000000000000012e-231 < z < 3.19999999999999986e-73Initial program 79.0%
associate-*l*83.7%
associate-*r/84.7%
Simplified84.7%
Taylor expanded in z around inf 61.5%
if 3.19999999999999986e-73 < z Initial program 53.2%
associate-*l*49.8%
associate-*r/52.2%
*-commutative52.2%
associate-/l*55.6%
Simplified55.6%
Taylor expanded in z around inf 86.3%
*-commutative86.3%
Simplified86.3%
Final simplification78.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -6.5e-25) (* x (- y)) (if (<= z 8.2e-98) (* x (/ (* z y) (- (/ (* a 0.5) (/ z t)) z))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e-25) {
tmp = x * -y;
} else if (z <= 8.2e-98) {
tmp = x * ((z * y) / (((a * 0.5) / (z / 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 <= (-6.5d-25)) then
tmp = x * -y
else if (z <= 8.2d-98) then
tmp = x * ((z * y) / (((a * 0.5d0) / (z / 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 <= -6.5e-25) {
tmp = x * -y;
} else if (z <= 8.2e-98) {
tmp = x * ((z * y) / (((a * 0.5) / (z / t)) - z));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -6.5e-25: tmp = x * -y elif z <= 8.2e-98: tmp = x * ((z * y) / (((a * 0.5) / (z / 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 <= -6.5e-25) tmp = Float64(x * Float64(-y)); elseif (z <= 8.2e-98) tmp = Float64(x * Float64(Float64(z * y) / Float64(Float64(Float64(a * 0.5) / Float64(z / 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 <= -6.5e-25)
tmp = x * -y;
elseif (z <= 8.2e-98)
tmp = x * ((z * y) / (((a * 0.5) / (z / 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, -6.5e-25], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 8.2e-98], N[(x * N[(N[(z * y), $MachinePrecision] / N[(N[(N[(a * 0.5), $MachinePrecision] / N[(z / t), $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 -6.5 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-98}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\frac{a \cdot 0.5}{\frac{z}{t}} - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -6.5e-25Initial program 47.2%
associate-*l*43.4%
associate-*r/44.8%
*-commutative44.8%
associate-/l*44.3%
Simplified44.3%
Taylor expanded in z around -inf 86.9%
neg-mul-186.9%
Simplified86.9%
if -6.5e-25 < z < 8.1999999999999996e-98Initial program 84.8%
associate-*l*85.5%
associate-*r/86.1%
Simplified86.1%
Taylor expanded in z around -inf 59.1%
neg-mul-159.1%
+-commutative59.1%
unsub-neg59.1%
associate-/l*59.1%
associate-*r/59.1%
Simplified59.1%
if 8.1999999999999996e-98 < z Initial program 53.6%
associate-*l*50.4%
associate-*r/52.7%
*-commutative52.7%
associate-/l*56.0%
Simplified56.0%
Taylor expanded in z around inf 85.5%
*-commutative85.5%
Simplified85.5%
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 -2.7e-229) (* x (- y)) (if (<= z 1e+35) (/ z (/ (+ z (* -0.5 (/ a (/ z t)))) (* x y))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-229) {
tmp = x * -y;
} else if (z <= 1e+35) {
tmp = z / ((z + (-0.5 * (a / (z / t)))) / (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 <= (-2.7d-229)) then
tmp = x * -y
else if (z <= 1d+35) then
tmp = z / ((z + ((-0.5d0) * (a / (z / t)))) / (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 <= -2.7e-229) {
tmp = x * -y;
} else if (z <= 1e+35) {
tmp = z / ((z + (-0.5 * (a / (z / t)))) / (x * y));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.7e-229: tmp = x * -y elif z <= 1e+35: tmp = z / ((z + (-0.5 * (a / (z / t)))) / (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 <= -2.7e-229) tmp = Float64(x * Float64(-y)); elseif (z <= 1e+35) tmp = Float64(z / Float64(Float64(z + Float64(-0.5 * Float64(a / Float64(z / t)))) / Float64(x * y))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.7e-229)
tmp = x * -y;
elseif (z <= 1e+35)
tmp = z / ((z + (-0.5 * (a / (z / t)))) / (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, -2.7e-229], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1e+35], N[(z / N[(N[(z + N[(-0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-229}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 10^{+35}:\\
\;\;\;\;\frac{z}{\frac{z + -0.5 \cdot \frac{a}{\frac{z}{t}}}{x \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.6999999999999998e-229Initial program 60.5%
associate-*l*56.7%
associate-*r/57.7%
*-commutative57.7%
associate-/l*58.4%
Simplified58.4%
Taylor expanded in z around -inf 77.7%
neg-mul-177.7%
Simplified77.7%
if -2.6999999999999998e-229 < z < 9.9999999999999997e34Initial program 83.3%
*-commutative83.3%
associate-/l*83.2%
Simplified83.2%
Taylor expanded in z around inf 67.4%
associate-/l*67.6%
Simplified67.6%
if 9.9999999999999997e34 < z Initial program 37.7%
associate-*l*34.6%
associate-*r/36.3%
*-commutative36.3%
associate-/l*39.8%
Simplified39.8%
Taylor expanded in z around inf 93.1%
*-commutative93.1%
Simplified93.1%
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 -2.2e-229) (* x (- y)) (if (<= z 5e-77) (* -2.0 (* (/ x a) (/ (* y (* z z)) t))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e-229) {
tmp = x * -y;
} else if (z <= 5e-77) {
tmp = -2.0 * ((x / a) * ((y * (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 <= (-2.2d-229)) then
tmp = x * -y
else if (z <= 5d-77) then
tmp = (-2.0d0) * ((x / a) * ((y * (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 <= -2.2e-229) {
tmp = x * -y;
} else if (z <= 5e-77) {
tmp = -2.0 * ((x / a) * ((y * (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 <= -2.2e-229: tmp = x * -y elif z <= 5e-77: tmp = -2.0 * ((x / a) * ((y * (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 <= -2.2e-229) tmp = Float64(x * Float64(-y)); elseif (z <= 5e-77) tmp = Float64(-2.0 * Float64(Float64(x / a) * Float64(Float64(y * 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 <= -2.2e-229)
tmp = x * -y;
elseif (z <= 5e-77)
tmp = -2.0 * ((x / a) * ((y * (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, -2.2e-229], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 5e-77], N[(-2.0 * N[(N[(x / a), $MachinePrecision] * N[(N[(y * 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 -2.2 \cdot 10^{-229}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-77}:\\
\;\;\;\;-2 \cdot \left(\frac{x}{a} \cdot \frac{y \cdot \left(z \cdot z\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.1999999999999999e-229Initial program 60.5%
associate-*l*56.7%
associate-*r/57.7%
*-commutative57.7%
associate-/l*58.4%
Simplified58.4%
Taylor expanded in z around -inf 77.7%
neg-mul-177.7%
Simplified77.7%
if -2.1999999999999999e-229 < z < 4.99999999999999963e-77Initial program 79.0%
*-commutative79.0%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in z around inf 63.4%
Taylor expanded in z around 0 55.7%
Taylor expanded in z around 0 55.6%
times-frac58.7%
unpow258.7%
Simplified58.7%
if 4.99999999999999963e-77 < z Initial program 53.2%
associate-*l*49.8%
associate-*r/52.2%
*-commutative52.2%
associate-/l*55.6%
Simplified55.6%
Taylor expanded in z around inf 86.3%
*-commutative86.3%
Simplified86.3%
Final simplification77.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-233) (* x (- y)) (if (<= z 1.14e-97) (* z (/ -2.0 (/ (* (/ a z) (/ t y)) x))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-233) {
tmp = x * -y;
} else if (z <= 1.14e-97) {
tmp = z * (-2.0 / (((a / z) * (t / 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 <= (-1.9d-233)) then
tmp = x * -y
else if (z <= 1.14d-97) then
tmp = z * ((-2.0d0) / (((a / z) * (t / 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 <= -1.9e-233) {
tmp = x * -y;
} else if (z <= 1.14e-97) {
tmp = z * (-2.0 / (((a / z) * (t / y)) / x));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-233: tmp = x * -y elif z <= 1.14e-97: tmp = z * (-2.0 / (((a / z) * (t / 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 <= -1.9e-233) tmp = Float64(x * Float64(-y)); elseif (z <= 1.14e-97) tmp = Float64(z * Float64(-2.0 / Float64(Float64(Float64(a / z) * Float64(t / y)) / 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 <= -1.9e-233)
tmp = x * -y;
elseif (z <= 1.14e-97)
tmp = z * (-2.0 / (((a / z) * (t / 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, -1.9e-233], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.14e-97], N[(z * N[(-2.0 / N[(N[(N[(a / z), $MachinePrecision] * N[(t / y), $MachinePrecision]), $MachinePrecision] / x), $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^{-233}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.14 \cdot 10^{-97}:\\
\;\;\;\;z \cdot \frac{-2}{\frac{\frac{a}{z} \cdot \frac{t}{y}}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.9e-233Initial program 60.5%
associate-*l*56.7%
associate-*r/57.7%
*-commutative57.7%
associate-/l*58.4%
Simplified58.4%
Taylor expanded in z around -inf 77.7%
neg-mul-177.7%
Simplified77.7%
if -1.9e-233 < z < 1.14e-97Initial program 78.5%
*-commutative78.5%
associate-/l*80.6%
Simplified80.6%
Taylor expanded in z around inf 64.8%
Taylor expanded in z around 0 56.9%
expm1-log1p-u56.9%
expm1-udef56.9%
*-commutative56.9%
times-frac60.1%
*-commutative60.1%
Applied egg-rr60.1%
expm1-def60.1%
expm1-log1p60.3%
*-rgt-identity60.3%
associate-*r/60.3%
*-commutative60.3%
associate-/r*60.3%
metadata-eval60.3%
associate-*l/60.4%
associate-*r/56.9%
times-frac60.7%
Simplified60.7%
if 1.14e-97 < z Initial program 53.6%
associate-*l*50.4%
associate-*r/52.7%
*-commutative52.7%
associate-/l*56.0%
Simplified56.0%
Taylor expanded in z around inf 85.5%
*-commutative85.5%
Simplified85.5%
Final simplification77.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 -8.2e-238) (* x (- y)) (if (<= z 5e-57) (/ 1.0 (/ 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 <= -8.2e-238) {
tmp = x * -y;
} else if (z <= 5e-57) {
tmp = 1.0 / (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 <= (-8.2d-238)) then
tmp = x * -y
else if (z <= 5d-57) then
tmp = 1.0d0 / (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 <= -8.2e-238) {
tmp = x * -y;
} else if (z <= 5e-57) {
tmp = 1.0 / (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 <= -8.2e-238: tmp = x * -y elif z <= 5e-57: tmp = 1.0 / (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 <= -8.2e-238) tmp = Float64(x * Float64(-y)); elseif (z <= 5e-57) tmp = Float64(1.0 / 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 <= -8.2e-238)
tmp = x * -y;
elseif (z <= 5e-57)
tmp = 1.0 / (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, -8.2e-238], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 5e-57], N[(1.0 / N[(z / N[(y * N[(z * x), $MachinePrecision]), $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^{-238}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-57}:\\
\;\;\;\;\frac{1}{\frac{z}{y \cdot \left(z \cdot x\right)}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -8.2000000000000002e-238Initial program 60.8%
associate-*l*57.0%
associate-*r/58.1%
*-commutative58.1%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in z around -inf 77.1%
neg-mul-177.1%
Simplified77.1%
if -8.2000000000000002e-238 < z < 5.0000000000000002e-57Initial program 77.5%
*-commutative77.5%
associate-/l*77.3%
Simplified77.3%
Taylor expanded in z around -inf 17.9%
associate-*r/17.9%
neg-mul-117.9%
associate-/r*17.8%
Simplified17.8%
clear-num17.8%
inv-pow17.8%
associate-/l/17.9%
add-sqr-sqrt0.7%
sqrt-unprod11.3%
sqr-neg11.3%
sqrt-prod24.8%
add-sqr-sqrt25.2%
Applied egg-rr25.2%
unpow-125.2%
associate-/l/46.2%
associate-*r*50.0%
*-commutative50.0%
associate-*l*48.2%
Simplified48.2%
if 5.0000000000000002e-57 < z Initial program 51.6%
associate-*l*48.1%
associate-*r/50.5%
*-commutative50.5%
associate-/l*54.3%
Simplified54.3%
Taylor expanded in z around inf 90.5%
*-commutative90.5%
Simplified90.5%
Final simplification76.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 -2.65e-241) (* x (- y)) (if (<= z 2.6e-110) (* 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 <= -2.65e-241) {
tmp = x * -y;
} else if (z <= 2.6e-110) {
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 <= (-2.65d-241)) then
tmp = x * -y
else if (z <= 2.6d-110) 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 <= -2.65e-241) {
tmp = x * -y;
} else if (z <= 2.6e-110) {
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 <= -2.65e-241: tmp = x * -y elif z <= 2.6e-110: 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 <= -2.65e-241) tmp = Float64(x * Float64(-y)); elseif (z <= 2.6e-110) 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 <= -2.65e-241)
tmp = x * -y;
elseif (z <= 2.6e-110)
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, -2.65e-241], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.6e-110], 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.65 \cdot 10^{-241}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.6499999999999999e-241Initial program 60.8%
associate-*l*57.0%
associate-*r/58.1%
*-commutative58.1%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in z around -inf 77.1%
neg-mul-177.1%
Simplified77.1%
if -2.6499999999999999e-241 < z < 2.5999999999999999e-110Initial program 76.8%
*-commutative76.8%
associate-/l*79.1%
Simplified79.1%
associate-/r/76.3%
*-commutative76.3%
associate-*r*78.9%
associate-/r/85.8%
*-commutative85.8%
associate-*r/84.6%
associate-/r/84.6%
*-commutative84.6%
Applied egg-rr84.6%
Taylor expanded in z around inf 44.5%
if 2.5999999999999999e-110 < z Initial program 54.6%
associate-*l*51.4%
associate-*r/53.6%
*-commutative53.6%
associate-/l*56.9%
Simplified56.9%
Taylor expanded in z around inf 83.8%
*-commutative83.8%
Simplified83.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 -4.1e-286) (* x (- y)) (if (<= z 4e-140) (/ x (/ z (* 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-286) {
tmp = x * -y;
} else if (z <= 4e-140) {
tmp = x / (z / (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-286)) then
tmp = x * -y
else if (z <= 4d-140) then
tmp = x / (z / (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-286) {
tmp = x * -y;
} else if (z <= 4e-140) {
tmp = x / (z / (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-286: tmp = x * -y elif z <= 4e-140: tmp = x / (z / (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-286) tmp = Float64(x * Float64(-y)); elseif (z <= 4e-140) tmp = Float64(x / Float64(z / 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-286)
tmp = x * -y;
elseif (z <= 4e-140)
tmp = x / (z / (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-286], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 4e-140], N[(x / N[(z / 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^{-286}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-140}:\\
\;\;\;\;\frac{x}{\frac{z}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.1e-286Initial program 59.9%
associate-*l*57.8%
associate-*r/59.4%
*-commutative59.4%
associate-/l*60.0%
Simplified60.0%
Taylor expanded in z around -inf 74.7%
neg-mul-174.7%
Simplified74.7%
if -4.1e-286 < z < 3.9999999999999999e-140Initial program 83.6%
associate-*l*83.5%
associate-*r/82.3%
*-commutative82.3%
associate-/l*85.8%
Simplified85.8%
clear-num83.7%
un-div-inv83.8%
associate-/l/80.3%
Applied egg-rr80.3%
Taylor expanded in z around inf 34.3%
if 3.9999999999999999e-140 < z Initial program 55.0%
associate-*l*51.9%
associate-*r/54.1%
*-commutative54.1%
associate-/l*57.3%
Simplified57.3%
Taylor expanded in z around inf 82.4%
*-commutative82.4%
Simplified82.4%
Final simplification73.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2e-268) (* x (- y)) (if (<= z 5e-134) (/ (* 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 <= -2e-268) {
tmp = x * -y;
} else if (z <= 5e-134) {
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 <= (-2d-268)) then
tmp = x * -y
else if (z <= 5d-134) 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 <= -2e-268) {
tmp = x * -y;
} else if (z <= 5e-134) {
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 <= -2e-268: tmp = x * -y elif z <= 5e-134: 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 <= -2e-268) tmp = Float64(x * Float64(-y)); elseif (z <= 5e-134) tmp = Float64(Float64(x * 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 <= -2e-268)
tmp = x * -y;
elseif (z <= 5e-134)
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, -2e-268], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 5e-134], N[(N[(x * N[(z * 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 -2 \cdot 10^{-268}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-134}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.99999999999999992e-268Initial program 60.7%
associate-*l*57.7%
associate-*r/58.7%
*-commutative58.7%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in z around -inf 75.9%
neg-mul-175.9%
Simplified75.9%
if -1.99999999999999992e-268 < z < 5.0000000000000003e-134Initial program 79.2%
associate-*l*82.1%
Simplified82.1%
Taylor expanded in z around inf 56.3%
if 5.0000000000000003e-134 < z Initial program 55.0%
associate-*l*51.9%
associate-*r/54.1%
*-commutative54.1%
associate-/l*57.3%
Simplified57.3%
Taylor expanded in z around inf 82.4%
*-commutative82.4%
Simplified82.4%
Final simplification76.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 -2.9e-301) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-301) {
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 <= (-2.9d-301)) 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 <= -2.9e-301) {
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 <= -2.9e-301: 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 <= -2.9e-301) 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 <= -2.9e-301)
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, -2.9e-301], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-301}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.89999999999999984e-301Initial program 60.4%
associate-*l*59.1%
associate-*r/60.6%
*-commutative60.6%
associate-/l*61.2%
Simplified61.2%
Taylor expanded in z around -inf 72.5%
neg-mul-172.5%
Simplified72.5%
if -2.89999999999999984e-301 < z Initial program 61.1%
associate-*l*57.9%
associate-*r/59.4%
*-commutative59.4%
associate-/l*62.7%
Simplified62.7%
Taylor expanded in z around inf 71.8%
*-commutative71.8%
Simplified71.8%
Final simplification72.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x y))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return x * y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x * y
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return x * y;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return x * y
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(x * y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = x * y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot y
\end{array}
Initial program 60.8%
associate-*l*58.5%
associate-*r/60.0%
*-commutative60.0%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around inf 39.8%
*-commutative39.8%
Simplified39.8%
Final simplification39.8%
(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 2023293
(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)))))