
(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 22 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.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* t a)))))
(if (<= z -6.5e+99)
(* y (- x))
(if (<= z -1.9e-206)
(/ (* z (* y x)) t_1)
(if (<= z 6e-156)
(* (* x (exp (* -0.5 (- (log (- t)) (log (/ 1.0 a)))))) (* z y))
(if (<= z 1.7e+137) (/ y (/ (/ t_1 z) x)) (* y x)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -6.5e+99) {
tmp = y * -x;
} else if (z <= -1.9e-206) {
tmp = (z * (y * x)) / t_1;
} else if (z <= 6e-156) {
tmp = (x * exp((-0.5 * (log(-t) - log((1.0 / a)))))) * (z * y);
} else if (z <= 1.7e+137) {
tmp = y / ((t_1 / z) / x);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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) - (t * a)))
if (z <= (-6.5d+99)) then
tmp = y * -x
else if (z <= (-1.9d-206)) then
tmp = (z * (y * x)) / t_1
else if (z <= 6d-156) then
tmp = (x * exp(((-0.5d0) * (log(-t) - log((1.0d0 / a)))))) * (z * y)
else if (z <= 1.7d+137) then
tmp = y / ((t_1 / z) / x)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -6.5e+99) {
tmp = y * -x;
} else if (z <= -1.9e-206) {
tmp = (z * (y * x)) / t_1;
} else if (z <= 6e-156) {
tmp = (x * Math.exp((-0.5 * (Math.log(-t) - Math.log((1.0 / a)))))) * (z * y);
} else if (z <= 1.7e+137) {
tmp = y / ((t_1 / z) / x);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (t * a))) tmp = 0 if z <= -6.5e+99: tmp = y * -x elif z <= -1.9e-206: tmp = (z * (y * x)) / t_1 elif z <= 6e-156: tmp = (x * math.exp((-0.5 * (math.log(-t) - math.log((1.0 / a)))))) * (z * y) elif z <= 1.7e+137: tmp = y / ((t_1 / z) / x) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(t * a))) tmp = 0.0 if (z <= -6.5e+99) tmp = Float64(y * Float64(-x)); elseif (z <= -1.9e-206) tmp = Float64(Float64(z * Float64(y * x)) / t_1); elseif (z <= 6e-156) tmp = Float64(Float64(x * exp(Float64(-0.5 * Float64(log(Float64(-t)) - log(Float64(1.0 / a)))))) * Float64(z * y)); elseif (z <= 1.7e+137) tmp = Float64(y / Float64(Float64(t_1 / z) / x)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (t * a)));
tmp = 0.0;
if (z <= -6.5e+99)
tmp = y * -x;
elseif (z <= -1.9e-206)
tmp = (z * (y * x)) / t_1;
elseif (z <= 6e-156)
tmp = (x * exp((-0.5 * (log(-t) - log((1.0 / a)))))) * (z * y);
elseif (z <= 1.7e+137)
tmp = y / ((t_1 / z) / x);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -6.5e+99], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -1.9e-206], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 6e-156], N[(N[(x * N[Exp[N[(-0.5 * N[(N[Log[(-t)], $MachinePrecision] - N[Log[N[(1.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+137], N[(y / N[(N[(t$95$1 / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{+99}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-206}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{t_1}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-156}:\\
\;\;\;\;\left(x \cdot e^{-0.5 \cdot \left(\log \left(-t\right) - \log \left(\frac{1}{a}\right)\right)}\right) \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+137}:\\
\;\;\;\;\frac{y}{\frac{\frac{t_1}{z}}{x}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -6.5000000000000004e99Initial program 38.4%
associate-*l*36.0%
associate-*r/38.2%
*-commutative38.2%
associate-/l*36.7%
Simplified36.7%
Taylor expanded in z around -inf 98.0%
mul-1-neg98.0%
distribute-rgt-neg-out98.0%
Simplified98.0%
if -6.5000000000000004e99 < z < -1.90000000000000001e-206Initial program 92.1%
if -1.90000000000000001e-206 < z < 6e-156Initial program 67.3%
associate-*l*72.0%
associate-*r/74.1%
*-commutative74.1%
div-inv74.1%
associate-*l*71.9%
*-commutative71.9%
pow1/271.9%
pow-flip72.0%
metadata-eval72.0%
Applied egg-rr72.0%
Taylor expanded in a around inf 39.4%
if 6e-156 < z < 1.69999999999999993e137Initial program 87.8%
associate-*l*79.0%
associate-*r/83.8%
*-commutative83.8%
associate-/l*89.5%
Simplified89.5%
associate-*r/89.0%
associate-*l/87.5%
associate-/l*91.3%
associate-/r/91.2%
*-commutative91.2%
associate-/l*92.8%
Applied egg-rr92.8%
if 1.69999999999999993e137 < z Initial program 21.5%
associate-*l*18.9%
associate-*r/21.0%
*-commutative21.0%
associate-/l*20.1%
Simplified20.1%
Taylor expanded in z around inf 98.1%
Final simplification85.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5e+92) (* y (- x)) (if (<= z 1.6e+36) (* x (* z (/ y (sqrt (- (* z z) (* t a)))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+92) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * (z * (y / sqrt(((z * z) - (t * a)))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-5d+92)) then
tmp = y * -x
else if (z <= 1.6d+36) then
tmp = x * (z * (y / sqrt(((z * z) - (t * a)))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+92) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * (z * (y / Math.sqrt(((z * z) - (t * a)))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5e+92: tmp = y * -x elif z <= 1.6e+36: tmp = x * (z * (y / math.sqrt(((z * z) - (t * a))))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e+92) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e+36) tmp = Float64(x * Float64(z * Float64(y / sqrt(Float64(Float64(z * z) - Float64(t * a)))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5e+92)
tmp = y * -x;
elseif (z <= 1.6e+36)
tmp = x * (z * (y / sqrt(((z * z) - (t * a)))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e+92], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.6e+36], N[(x * N[(z * N[(y / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+92}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \left(z \cdot \frac{y}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -5.00000000000000022e92Initial program 42.2%
associate-*l*39.8%
associate-*r/41.9%
*-commutative41.9%
associate-/l*38.7%
Simplified38.7%
Taylor expanded in z around -inf 96.2%
mul-1-neg96.2%
distribute-rgt-neg-out96.2%
Simplified96.2%
if -5.00000000000000022e92 < z < 1.5999999999999999e36Initial program 83.5%
associate-*l*82.8%
associate-*r/84.0%
*-commutative84.0%
associate-/l*84.7%
Simplified84.7%
clear-num84.6%
associate-/r/84.2%
clear-num84.2%
Applied egg-rr84.2%
if 1.5999999999999999e36 < z Initial program 40.0%
associate-*l*33.9%
associate-*r/36.9%
*-commutative36.9%
associate-/l*37.6%
Simplified37.6%
Taylor expanded in z around inf 94.6%
Final simplification89.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.55e+93) (* y (- x)) (if (<= z 1.6e+36) (* x (/ z (/ (sqrt (- (* z z) (* t a))) y))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+93) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.55d+93)) then
tmp = y * -x
else if (z <= 1.6d+36) then
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+93) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * (z / (Math.sqrt(((z * z) - (t * a))) / y));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.55e+93: tmp = y * -x elif z <= 1.6e+36: tmp = x * (z / (math.sqrt(((z * z) - (t * a))) / y)) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e+93) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e+36) tmp = Float64(x * Float64(z / Float64(sqrt(Float64(Float64(z * z) - Float64(t * a))) / y))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.55e+93)
tmp = y * -x;
elseif (z <= 1.6e+36)
tmp = x * (z / (sqrt(((z * z) - (t * a))) / y));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e+93], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.6e+36], N[(x * N[(z / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+93}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{z \cdot z - t \cdot a}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.5500000000000001e93Initial program 42.2%
associate-*l*39.8%
associate-*r/41.9%
*-commutative41.9%
associate-/l*38.7%
Simplified38.7%
Taylor expanded in z around -inf 96.2%
mul-1-neg96.2%
distribute-rgt-neg-out96.2%
Simplified96.2%
if -1.5500000000000001e93 < z < 1.5999999999999999e36Initial program 83.5%
associate-*l*82.8%
associate-*r/84.0%
*-commutative84.0%
associate-/l*84.7%
Simplified84.7%
if 1.5999999999999999e36 < z Initial program 40.0%
associate-*l*33.9%
associate-*r/36.9%
*-commutative36.9%
associate-/l*37.6%
Simplified37.6%
Taylor expanded in z around inf 94.6%
Final simplification89.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2e+101) (* y (- x)) (if (<= z 1.6e+36) (* x (/ (* z y) (sqrt (- (* z z) (* t a))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+101) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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+101)) then
tmp = y * -x
else if (z <= 1.6d+36) then
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+101) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * ((z * y) / Math.sqrt(((z * z) - (t * a))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2e+101: tmp = y * -x elif z <= 1.6e+36: tmp = x * ((z * y) / math.sqrt(((z * z) - (t * a)))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+101) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e+36) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(Float64(z * z) - Float64(t * a))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2e+101)
tmp = y * -x;
elseif (z <= 1.6e+36)
tmp = x * ((z * y) / sqrt(((z * z) - (t * a))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+101], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.6e+36], N[(x * N[(N[(z * y), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+101}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2e101Initial program 38.4%
associate-*l*36.0%
associate-*r/38.2%
*-commutative38.2%
associate-/l*36.7%
Simplified36.7%
Taylor expanded in z around -inf 98.0%
mul-1-neg98.0%
distribute-rgt-neg-out98.0%
Simplified98.0%
if -2e101 < z < 1.5999999999999999e36Initial program 83.8%
associate-*l*83.1%
associate-*r/84.4%
Simplified84.4%
if 1.5999999999999999e36 < z Initial program 40.0%
associate-*l*33.9%
associate-*r/36.9%
*-commutative36.9%
associate-/l*37.6%
Simplified37.6%
Taylor expanded in z around inf 94.6%
Final simplification89.6%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.55e+140)
(* y (- x))
(if (<= z -1.16e-169)
(/ (* z (* y x)) (- (/ (* t 0.5) (/ z a)) z))
(if (<= z 9.5e-36)
(* x (* z (/ y (sqrt (* t (- a))))))
(/ y (/ (/ (+ z (* -0.5 (/ (* t a) z))) z) x))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -1.16e-169) {
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
} else if (z <= 9.5e-36) {
tmp = x * (z * (y / sqrt((t * -a))));
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.55d+140)) then
tmp = y * -x
else if (z <= (-1.16d-169)) then
tmp = (z * (y * x)) / (((t * 0.5d0) / (z / a)) - z)
else if (z <= 9.5d-36) then
tmp = x * (z * (y / sqrt((t * -a))))
else
tmp = y / (((z + ((-0.5d0) * ((t * a) / z))) / z) / x)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -1.16e-169) {
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
} else if (z <= 9.5e-36) {
tmp = x * (z * (y / Math.sqrt((t * -a))));
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.55e+140: tmp = y * -x elif z <= -1.16e-169: tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z) elif z <= 9.5e-36: tmp = x * (z * (y / math.sqrt((t * -a)))) else: tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e+140) tmp = Float64(y * Float64(-x)); elseif (z <= -1.16e-169) tmp = Float64(Float64(z * Float64(y * x)) / Float64(Float64(Float64(t * 0.5) / Float64(z / a)) - z)); elseif (z <= 9.5e-36) tmp = Float64(x * Float64(z * Float64(y / sqrt(Float64(t * Float64(-a)))))); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))) / z) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.55e+140)
tmp = y * -x;
elseif (z <= -1.16e-169)
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
elseif (z <= 9.5e-36)
tmp = x * (z * (y / sqrt((t * -a))));
else
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e+140], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -1.16e-169], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(t * 0.5), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-36], N[(x * N[(z * N[(y / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[(N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+140}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-169}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{\frac{t \cdot 0.5}{\frac{z}{a}} - z}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(z \cdot \frac{y}{\sqrt{t \cdot \left(-a\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{z + -0.5 \cdot \frac{t \cdot a}{z}}{z}}{x}}\\
\end{array}
\end{array}
if z < -1.55e140Initial program 28.1%
associate-*l*27.7%
associate-*r/30.3%
*-commutative30.3%
associate-/l*28.5%
Simplified28.5%
Taylor expanded in z around -inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
if -1.55e140 < z < -1.16e-169Initial program 91.6%
Taylor expanded in z around -inf 83.4%
expm1-log1p-u81.7%
expm1-udef81.7%
associate-/l*83.4%
Applied egg-rr83.4%
expm1-def83.4%
expm1-log1p85.2%
associate-/l*83.4%
*-commutative83.4%
associate-*r/83.4%
associate-*r*83.4%
associate-/l*85.1%
Simplified85.1%
if -1.16e-169 < z < 9.5000000000000003e-36Initial program 75.1%
associate-*l*74.0%
associate-*r/77.5%
*-commutative77.5%
associate-/l*78.7%
Simplified78.7%
clear-num78.7%
associate-/r/77.9%
clear-num77.9%
Applied egg-rr77.9%
Taylor expanded in z around 0 69.9%
mul-1-neg69.9%
distribute-rgt-neg-out69.9%
Simplified69.9%
if 9.5000000000000003e-36 < z Initial program 51.8%
associate-*l*47.0%
associate-*r/49.4%
*-commutative49.4%
associate-/l*50.0%
Simplified50.0%
associate-*r/49.2%
associate-*l/49.8%
associate-/l*53.1%
associate-/r/54.2%
*-commutative54.2%
associate-/l*54.2%
Applied egg-rr54.2%
Taylor expanded in z around inf 92.7%
Final simplification85.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.55e+140)
(* y (- x))
(if (<= z -3.4e-174)
(/ (* z (* y x)) (- (/ (* t 0.5) (/ z a)) z))
(if (<= z 8.8e-36)
(* x (/ (* z y) (sqrt (* t (- a)))))
(/ y (/ (/ (+ z (* -0.5 (/ (* t a) z))) z) x))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -3.4e-174) {
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
} else if (z <= 8.8e-36) {
tmp = x * ((z * y) / sqrt((t * -a)));
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.55d+140)) then
tmp = y * -x
else if (z <= (-3.4d-174)) then
tmp = (z * (y * x)) / (((t * 0.5d0) / (z / a)) - z)
else if (z <= 8.8d-36) then
tmp = x * ((z * y) / sqrt((t * -a)))
else
tmp = y / (((z + ((-0.5d0) * ((t * a) / z))) / z) / x)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -3.4e-174) {
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
} else if (z <= 8.8e-36) {
tmp = x * ((z * y) / Math.sqrt((t * -a)));
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.55e+140: tmp = y * -x elif z <= -3.4e-174: tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z) elif z <= 8.8e-36: tmp = x * ((z * y) / math.sqrt((t * -a))) else: tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e+140) tmp = Float64(y * Float64(-x)); elseif (z <= -3.4e-174) tmp = Float64(Float64(z * Float64(y * x)) / Float64(Float64(Float64(t * 0.5) / Float64(z / a)) - z)); elseif (z <= 8.8e-36) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(t * Float64(-a))))); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))) / z) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.55e+140)
tmp = y * -x;
elseif (z <= -3.4e-174)
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
elseif (z <= 8.8e-36)
tmp = x * ((z * y) / sqrt((t * -a)));
else
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e+140], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -3.4e-174], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(t * 0.5), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.8e-36], N[(x * N[(N[(z * y), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[(N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+140}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-174}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{\frac{t \cdot 0.5}{\frac{z}{a}} - z}\\
\mathbf{elif}\;z \leq 8.8 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{z + -0.5 \cdot \frac{t \cdot a}{z}}{z}}{x}}\\
\end{array}
\end{array}
if z < -1.55e140Initial program 28.1%
associate-*l*27.7%
associate-*r/30.3%
*-commutative30.3%
associate-/l*28.5%
Simplified28.5%
Taylor expanded in z around -inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
if -1.55e140 < z < -3.4000000000000002e-174Initial program 91.6%
Taylor expanded in z around -inf 83.4%
expm1-log1p-u81.7%
expm1-udef81.7%
associate-/l*83.4%
Applied egg-rr83.4%
expm1-def83.4%
expm1-log1p85.2%
associate-/l*83.4%
*-commutative83.4%
associate-*r/83.4%
associate-*r*83.4%
associate-/l*85.1%
Simplified85.1%
if -3.4000000000000002e-174 < z < 8.7999999999999997e-36Initial program 75.1%
associate-*l*74.0%
associate-*r/77.5%
Simplified77.5%
Taylor expanded in z around 0 72.0%
mul-1-neg69.9%
distribute-rgt-neg-out69.9%
Simplified72.0%
if 8.7999999999999997e-36 < z Initial program 51.8%
associate-*l*47.0%
associate-*r/49.4%
*-commutative49.4%
associate-/l*50.0%
Simplified50.0%
associate-*r/49.2%
associate-*l/49.8%
associate-/l*53.1%
associate-/r/54.2%
*-commutative54.2%
associate-/l*54.2%
Applied egg-rr54.2%
Taylor expanded in z around inf 92.7%
Final simplification86.2%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.7e-175) (* y (- x)) (if (<= z 1.1e+36) (* x (/ (* z y) (+ z (* -0.5 (/ (* t a) z))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e-175) {
tmp = y * -x;
} else if (z <= 1.1e+36) {
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.7d-175)) then
tmp = y * -x
else if (z <= 1.1d+36) then
tmp = x * ((z * y) / (z + ((-0.5d0) * ((t * a) / z))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e-175) {
tmp = y * -x;
} else if (z <= 1.1e+36) {
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.7e-175: tmp = y * -x elif z <= 1.1e+36: tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z)))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e-175) tmp = Float64(y * Float64(-x)); elseif (z <= 1.1e+36) tmp = Float64(x * Float64(Float64(z * y) / Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.7e-175)
tmp = y * -x;
elseif (z <= 1.1e+36)
tmp = x * ((z * y) / (z + (-0.5 * ((t * a) / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e-175], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.1e+36], N[(x * N[(N[(z * y), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-175}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.7e-175Initial program 66.5%
associate-*l*65.2%
associate-*r/65.3%
*-commutative65.3%
associate-/l*63.7%
Simplified63.7%
Taylor expanded in z around -inf 84.5%
mul-1-neg84.5%
distribute-rgt-neg-out84.5%
Simplified84.5%
if -1.7e-175 < z < 1.1e36Initial program 79.1%
associate-*l*78.2%
associate-*r/81.1%
Simplified81.1%
Taylor expanded in z around inf 57.1%
if 1.1e36 < z Initial program 40.0%
associate-*l*33.9%
associate-*r/36.9%
*-commutative36.9%
associate-/l*37.6%
Simplified37.6%
Taylor expanded in z around inf 94.6%
Final simplification77.5%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.8e+83)
(* y (- x))
(if (<= z -2.6e-291)
(/ z (/ (- (/ (* t 0.5) (/ z a)) z) (* y x)))
(/ y (/ (/ (+ z (* -0.5 (/ (* t a) z))) z) x)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+83) {
tmp = y * -x;
} else if (z <= -2.6e-291) {
tmp = z / ((((t * 0.5) / (z / a)) - z) / (y * x));
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.8d+83)) then
tmp = y * -x
else if (z <= (-2.6d-291)) then
tmp = z / ((((t * 0.5d0) / (z / a)) - z) / (y * x))
else
tmp = y / (((z + ((-0.5d0) * ((t * a) / z))) / z) / x)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+83) {
tmp = y * -x;
} else if (z <= -2.6e-291) {
tmp = z / ((((t * 0.5) / (z / a)) - z) / (y * x));
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.8e+83: tmp = y * -x elif z <= -2.6e-291: tmp = z / ((((t * 0.5) / (z / a)) - z) / (y * x)) else: tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e+83) tmp = Float64(y * Float64(-x)); elseif (z <= -2.6e-291) tmp = Float64(z / Float64(Float64(Float64(Float64(t * 0.5) / Float64(z / a)) - z) / Float64(y * x))); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))) / z) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.8e+83)
tmp = y * -x;
elseif (z <= -2.6e-291)
tmp = z / ((((t * 0.5) / (z / a)) - z) / (y * x));
else
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e+83], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -2.6e-291], N[(z / N[(N[(N[(N[(t * 0.5), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[(N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-291}:\\
\;\;\;\;\frac{z}{\frac{\frac{t \cdot 0.5}{\frac{z}{a}} - z}{y \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{z + -0.5 \cdot \frac{t \cdot a}{z}}{z}}{x}}\\
\end{array}
\end{array}
if z < -2.8e83Initial program 43.6%
associate-*l*41.4%
associate-*r/43.4%
*-commutative43.4%
associate-/l*40.3%
Simplified40.3%
Taylor expanded in z around -inf 92.8%
mul-1-neg92.8%
distribute-rgt-neg-out92.8%
Simplified92.8%
if -2.8e83 < z < -2.5999999999999999e-291Initial program 89.3%
Taylor expanded in z around -inf 76.0%
Taylor expanded in x around 0 75.0%
*-commutative75.0%
associate-*r*76.0%
/-rgt-identity76.0%
associate-/l*73.8%
associate-/l*73.7%
mul-1-neg73.7%
unsub-neg73.7%
associate-/l*73.8%
*-commutative73.8%
associate-*r/73.8%
associate-*r*73.8%
associate-/l*73.7%
/-rgt-identity73.7%
Simplified73.7%
if -2.5999999999999999e-291 < z Initial program 59.9%
associate-*l*56.3%
associate-*r/59.6%
*-commutative59.6%
associate-/l*60.6%
Simplified60.6%
associate-*r/60.0%
associate-*l/58.1%
associate-/l*60.6%
associate-/r/62.1%
*-commutative62.1%
associate-/l*61.5%
Applied egg-rr61.5%
Taylor expanded in z around inf 78.4%
Final simplification80.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* t a) z)))
(if (<= z -4.5e+82)
(* y (- x))
(if (<= z -1.05e-259)
(* x (* z (/ y (- (* 0.5 t_1) z))))
(/ y (/ (/ (+ z (* -0.5 t_1)) z) x))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * a) / z;
double tmp;
if (z <= -4.5e+82) {
tmp = y * -x;
} else if (z <= -1.05e-259) {
tmp = x * (z * (y / ((0.5 * t_1) - z)));
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 = (t * a) / z
if (z <= (-4.5d+82)) then
tmp = y * -x
else if (z <= (-1.05d-259)) then
tmp = x * (z * (y / ((0.5d0 * t_1) - z)))
else
tmp = y / (((z + ((-0.5d0) * t_1)) / z) / x)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * a) / z;
double tmp;
if (z <= -4.5e+82) {
tmp = y * -x;
} else if (z <= -1.05e-259) {
tmp = x * (z * (y / ((0.5 * t_1) - z)));
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = (t * a) / z tmp = 0 if z <= -4.5e+82: tmp = y * -x elif z <= -1.05e-259: tmp = x * (z * (y / ((0.5 * t_1) - z))) else: tmp = y / (((z + (-0.5 * t_1)) / z) / x) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(t * a) / z) tmp = 0.0 if (z <= -4.5e+82) tmp = Float64(y * Float64(-x)); elseif (z <= -1.05e-259) tmp = Float64(x * Float64(z * Float64(y / Float64(Float64(0.5 * t_1) - z)))); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * t_1)) / z) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (t * a) / z;
tmp = 0.0;
if (z <= -4.5e+82)
tmp = y * -x;
elseif (z <= -1.05e-259)
tmp = x * (z * (y / ((0.5 * t_1) - z)));
else
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -4.5e+82], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -1.05e-259], N[(x * N[(z * N[(y / N[(N[(0.5 * t$95$1), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[(N[(z + N[(-0.5 * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{t \cdot a}{z}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+82}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-259}:\\
\;\;\;\;x \cdot \left(z \cdot \frac{y}{0.5 \cdot t_1 - z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{z + -0.5 \cdot t_1}{z}}{x}}\\
\end{array}
\end{array}
if z < -4.4999999999999997e82Initial program 43.6%
associate-*l*41.4%
associate-*r/43.4%
*-commutative43.4%
associate-/l*40.3%
Simplified40.3%
Taylor expanded in z around -inf 92.8%
mul-1-neg92.8%
distribute-rgt-neg-out92.8%
Simplified92.8%
if -4.4999999999999997e82 < z < -1.04999999999999999e-259Initial program 89.0%
associate-*l*89.0%
associate-*r/87.5%
*-commutative87.5%
associate-/l*87.5%
Simplified87.5%
clear-num87.4%
associate-/r/87.5%
clear-num87.5%
Applied egg-rr87.5%
Taylor expanded in z around -inf 73.6%
if -1.04999999999999999e-259 < z Initial program 60.5%
associate-*l*56.9%
associate-*r/60.1%
*-commutative60.1%
associate-/l*61.2%
Simplified61.2%
associate-*r/59.9%
associate-*l/58.7%
associate-/l*61.1%
associate-/r/62.7%
*-commutative62.7%
associate-/l*61.4%
Applied egg-rr61.4%
Taylor expanded in z around inf 78.0%
Final simplification80.0%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* t a) z)))
(if (<= z -1.75e+64)
(* y (- x))
(if (<= z -2e-259)
(/ (* z (* y x)) (- (* 0.5 t_1) z))
(/ y (/ (/ (+ z (* -0.5 t_1)) z) x))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * a) / z;
double tmp;
if (z <= -1.75e+64) {
tmp = y * -x;
} else if (z <= -2e-259) {
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 = (t * a) / z
if (z <= (-1.75d+64)) then
tmp = y * -x
else if (z <= (-2d-259)) then
tmp = (z * (y * x)) / ((0.5d0 * t_1) - z)
else
tmp = y / (((z + ((-0.5d0) * t_1)) / z) / x)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * a) / z;
double tmp;
if (z <= -1.75e+64) {
tmp = y * -x;
} else if (z <= -2e-259) {
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = (t * a) / z tmp = 0 if z <= -1.75e+64: tmp = y * -x elif z <= -2e-259: tmp = (z * (y * x)) / ((0.5 * t_1) - z) else: tmp = y / (((z + (-0.5 * t_1)) / z) / x) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(t * a) / z) tmp = 0.0 if (z <= -1.75e+64) tmp = Float64(y * Float64(-x)); elseif (z <= -2e-259) tmp = Float64(Float64(z * Float64(y * x)) / Float64(Float64(0.5 * t_1) - z)); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * t_1)) / z) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (t * a) / z;
tmp = 0.0;
if (z <= -1.75e+64)
tmp = y * -x;
elseif (z <= -2e-259)
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
else
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1.75e+64], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -2e-259], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 * t$95$1), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[(N[(z + N[(-0.5 * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{t \cdot a}{z}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+64}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-259}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{0.5 \cdot t_1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{z + -0.5 \cdot t_1}{z}}{x}}\\
\end{array}
\end{array}
if z < -1.7499999999999999e64Initial program 47.6%
associate-*l*45.5%
associate-*r/47.4%
*-commutative47.4%
associate-/l*44.6%
Simplified44.6%
Taylor expanded in z around -inf 93.3%
mul-1-neg93.3%
distribute-rgt-neg-out93.3%
Simplified93.3%
if -1.7499999999999999e64 < z < -2.0000000000000001e-259Initial program 88.3%
Taylor expanded in z around -inf 75.1%
if -2.0000000000000001e-259 < z Initial program 60.5%
associate-*l*56.9%
associate-*r/60.1%
*-commutative60.1%
associate-/l*61.2%
Simplified61.2%
associate-*r/59.9%
associate-*l/58.7%
associate-/l*61.1%
associate-/r/62.7%
*-commutative62.7%
associate-/l*61.4%
Applied egg-rr61.4%
Taylor expanded in z around inf 78.0%
Final simplification80.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.55e+140)
(* y (- x))
(if (<= z -2.8e-286)
(/ (* z (* y x)) (- (/ (* t 0.5) (/ z a)) z))
(/ y (/ (/ (+ z (* -0.5 (/ (* t a) z))) z) x)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -2.8e-286) {
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.55d+140)) then
tmp = y * -x
else if (z <= (-2.8d-286)) then
tmp = (z * (y * x)) / (((t * 0.5d0) / (z / a)) - z)
else
tmp = y / (((z + ((-0.5d0) * ((t * a) / z))) / z) / x)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -2.8e-286) {
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.55e+140: tmp = y * -x elif z <= -2.8e-286: tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z) else: tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e+140) tmp = Float64(y * Float64(-x)); elseif (z <= -2.8e-286) tmp = Float64(Float64(z * Float64(y * x)) / Float64(Float64(Float64(t * 0.5) / Float64(z / a)) - z)); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))) / z) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.55e+140)
tmp = y * -x;
elseif (z <= -2.8e-286)
tmp = (z * (y * x)) / (((t * 0.5) / (z / a)) - z);
else
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e+140], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -2.8e-286], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(t * 0.5), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(y / N[(N[(N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+140}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-286}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{\frac{t \cdot 0.5}{\frac{z}{a}} - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{z + -0.5 \cdot \frac{t \cdot a}{z}}{z}}{x}}\\
\end{array}
\end{array}
if z < -1.55e140Initial program 28.1%
associate-*l*27.7%
associate-*r/30.3%
*-commutative30.3%
associate-/l*28.5%
Simplified28.5%
Taylor expanded in z around -inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
if -1.55e140 < z < -2.8e-286Initial program 88.7%
Taylor expanded in z around -inf 75.3%
expm1-log1p-u74.0%
expm1-udef74.0%
associate-/l*75.2%
Applied egg-rr75.2%
expm1-def75.2%
expm1-log1p76.5%
associate-/l*75.3%
*-commutative75.3%
associate-*r/75.3%
associate-*r*75.3%
associate-/l*76.6%
Simplified76.6%
if -2.8e-286 < z Initial program 59.9%
associate-*l*56.3%
associate-*r/59.6%
*-commutative59.6%
associate-/l*60.6%
Simplified60.6%
associate-*r/60.0%
associate-*l/58.1%
associate-/l*60.6%
associate-/r/62.1%
*-commutative62.1%
associate-/l*61.5%
Applied egg-rr61.5%
Taylor expanded in z around inf 78.4%
Final simplification81.0%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-57) (* y (- x)) (if (<= z 2.9e-183) (* -2.0 (* (/ y a) (/ (* x (* z z)) t))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 2.9e-183) {
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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-57)) then
tmp = y * -x
else if (z <= 2.9d-183) then
tmp = (-2.0d0) * ((y / a) * ((x * (z * z)) / t))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 2.9e-183) {
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-57: tmp = y * -x elif z <= 2.9e-183: tmp = -2.0 * ((y / a) * ((x * (z * z)) / t)) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-57) tmp = Float64(y * Float64(-x)); elseif (z <= 2.9e-183) tmp = Float64(-2.0 * Float64(Float64(y / a) * Float64(Float64(x * Float64(z * z)) / t))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.9e-57)
tmp = y * -x;
elseif (z <= 2.9e-183)
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-57], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.9e-183], N[(-2.0 * N[(N[(y / a), $MachinePrecision] * N[(N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-57}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-183}:\\
\;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{x \cdot \left(z \cdot z\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.8999999999999999e-57Initial program 61.0%
associate-*l*59.4%
associate-*r/60.7%
*-commutative60.7%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in z around -inf 90.1%
mul-1-neg90.1%
distribute-rgt-neg-out90.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 2.9e-183Initial program 77.5%
associate-*l*77.8%
associate-*r/77.8%
*-commutative77.8%
associate-/l*74.5%
Simplified74.5%
associate-*r/72.8%
associate-*l/70.9%
associate-/l*74.3%
associate-/r/77.7%
*-commutative77.7%
associate-/l*73.6%
Applied egg-rr73.6%
Taylor expanded in z around inf 53.6%
Taylor expanded in z around 0 50.5%
times-frac50.4%
unpow250.4%
Simplified50.4%
if 2.9e-183 < z Initial program 57.6%
associate-*l*52.8%
associate-*r/56.2%
*-commutative56.2%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in z around inf 82.4%
Final simplification76.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-57) (* y (- x)) (if (<= z 1.7e-179) (* -2.0 (* x (* (/ z (/ t z)) (/ y a)))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 1.7e-179) {
tmp = -2.0 * (x * ((z / (t / z)) * (y / a)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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-57)) then
tmp = y * -x
else if (z <= 1.7d-179) then
tmp = (-2.0d0) * (x * ((z / (t / z)) * (y / a)))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 1.7e-179) {
tmp = -2.0 * (x * ((z / (t / z)) * (y / a)));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-57: tmp = y * -x elif z <= 1.7e-179: tmp = -2.0 * (x * ((z / (t / z)) * (y / a))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-57) tmp = Float64(y * Float64(-x)); elseif (z <= 1.7e-179) tmp = Float64(-2.0 * Float64(x * Float64(Float64(z / Float64(t / z)) * Float64(y / a)))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.9e-57)
tmp = y * -x;
elseif (z <= 1.7e-179)
tmp = -2.0 * (x * ((z / (t / z)) * (y / a)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-57], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.7e-179], N[(-2.0 * N[(x * N[(N[(z / N[(t / z), $MachinePrecision]), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-57}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-179}:\\
\;\;\;\;-2 \cdot \left(x \cdot \left(\frac{z}{\frac{t}{z}} \cdot \frac{y}{a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.8999999999999999e-57Initial program 61.0%
associate-*l*59.4%
associate-*r/60.7%
*-commutative60.7%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in z around -inf 90.1%
mul-1-neg90.1%
distribute-rgt-neg-out90.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 1.6999999999999999e-179Initial program 77.5%
associate-*l*77.8%
associate-*r/77.8%
*-commutative77.8%
associate-/l*74.5%
Simplified74.5%
associate-*r/72.8%
associate-*l/70.9%
associate-/l*74.3%
associate-/r/77.7%
*-commutative77.7%
associate-/l*73.6%
Applied egg-rr73.6%
Taylor expanded in z around inf 48.8%
fma-def48.8%
associate-/l*49.3%
associate-/l*47.6%
unpow247.6%
Simplified47.6%
Taylor expanded in a around inf 50.5%
*-commutative50.5%
times-frac50.4%
associate-*l/50.4%
unpow250.4%
associate-*r*50.5%
unpow250.5%
times-frac50.5%
*-commutative50.5%
*-commutative50.5%
times-frac50.5%
unpow250.5%
associate-/l*50.8%
Simplified50.8%
if 1.6999999999999999e-179 < z Initial program 57.6%
associate-*l*52.8%
associate-*r/56.2%
*-commutative56.2%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in z around inf 82.4%
Final simplification76.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-57) (* y (- x)) (if (<= z 1.8e-175) (* (/ -2.0 t) (/ (* x (* y (* z z))) a)) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 1.8e-175) {
tmp = (-2.0 / t) * ((x * (y * (z * z))) / a);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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-57)) then
tmp = y * -x
else if (z <= 1.8d-175) then
tmp = ((-2.0d0) / t) * ((x * (y * (z * z))) / a)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 1.8e-175) {
tmp = (-2.0 / t) * ((x * (y * (z * z))) / a);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-57: tmp = y * -x elif z <= 1.8e-175: tmp = (-2.0 / t) * ((x * (y * (z * z))) / a) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-57) tmp = Float64(y * Float64(-x)); elseif (z <= 1.8e-175) tmp = Float64(Float64(-2.0 / t) * Float64(Float64(x * Float64(y * Float64(z * z))) / a)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.9e-57)
tmp = y * -x;
elseif (z <= 1.8e-175)
tmp = (-2.0 / t) * ((x * (y * (z * z))) / a);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-57], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.8e-175], N[(N[(-2.0 / t), $MachinePrecision] * N[(N[(x * N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-57}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-175}:\\
\;\;\;\;\frac{-2}{t} \cdot \frac{x \cdot \left(y \cdot \left(z \cdot z\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.8999999999999999e-57Initial program 61.0%
associate-*l*59.4%
associate-*r/60.7%
*-commutative60.7%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in z around -inf 90.1%
mul-1-neg90.1%
distribute-rgt-neg-out90.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 1.8e-175Initial program 77.5%
associate-*l*77.8%
associate-*r/77.8%
*-commutative77.8%
associate-/l*74.5%
Simplified74.5%
associate-*r/72.8%
associate-*l/70.9%
associate-/l*74.3%
associate-/r/77.7%
*-commutative77.7%
associate-/l*73.6%
Applied egg-rr73.6%
Taylor expanded in z around inf 53.6%
Taylor expanded in z around 0 50.5%
associate-*r/50.5%
*-commutative50.5%
times-frac51.0%
*-commutative51.0%
*-commutative51.0%
associate-*l*51.0%
unpow251.0%
Simplified51.0%
if 1.8e-175 < z Initial program 57.6%
associate-*l*52.8%
associate-*r/56.2%
*-commutative56.2%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in z around inf 82.4%
Final simplification76.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-57) (* y (- x)) (if (<= z 8e-184) (/ y (* (/ -0.5 x) (* t (/ a (* z z))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 8e-184) {
tmp = y / ((-0.5 / x) * (t * (a / (z * z))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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-57)) then
tmp = y * -x
else if (z <= 8d-184) then
tmp = y / (((-0.5d0) / x) * (t * (a / (z * z))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 8e-184) {
tmp = y / ((-0.5 / x) * (t * (a / (z * z))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-57: tmp = y * -x elif z <= 8e-184: tmp = y / ((-0.5 / x) * (t * (a / (z * z)))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-57) tmp = Float64(y * Float64(-x)); elseif (z <= 8e-184) tmp = Float64(y / Float64(Float64(-0.5 / x) * Float64(t * Float64(a / Float64(z * z))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.9e-57)
tmp = y * -x;
elseif (z <= 8e-184)
tmp = y / ((-0.5 / x) * (t * (a / (z * z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-57], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8e-184], N[(y / N[(N[(-0.5 / x), $MachinePrecision] * N[(t * N[(a / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-57}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{\frac{-0.5}{x} \cdot \left(t \cdot \frac{a}{z \cdot z}\right)}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.8999999999999999e-57Initial program 61.0%
associate-*l*59.4%
associate-*r/60.7%
*-commutative60.7%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in z around -inf 90.1%
mul-1-neg90.1%
distribute-rgt-neg-out90.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 8.0000000000000005e-184Initial program 77.5%
associate-*l*77.8%
associate-*r/77.8%
*-commutative77.8%
associate-/l*74.5%
Simplified74.5%
associate-*r/72.8%
associate-*l/70.9%
associate-/l*74.3%
associate-/r/77.7%
*-commutative77.7%
associate-/l*73.6%
Applied egg-rr73.6%
Taylor expanded in z around inf 48.8%
fma-def48.8%
associate-/l*49.3%
associate-/l*47.6%
unpow247.6%
Simplified47.6%
Taylor expanded in a around inf 50.5%
associate-*r/50.5%
*-commutative50.5%
times-frac50.5%
associate-*l/51.0%
unpow251.0%
Simplified51.0%
if 8.0000000000000005e-184 < z Initial program 57.6%
associate-*l*52.8%
associate-*r/56.2%
*-commutative56.2%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in z around inf 82.4%
Final simplification76.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-57) (* y (- x)) (if (<= z 2.36e-141) (/ y (/ (* -0.5 (* (/ a z) (/ t z))) x)) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 2.36e-141) {
tmp = y / ((-0.5 * ((a / z) * (t / z))) / x);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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-57)) then
tmp = y * -x
else if (z <= 2.36d-141) then
tmp = y / (((-0.5d0) * ((a / z) * (t / z))) / x)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-57) {
tmp = y * -x;
} else if (z <= 2.36e-141) {
tmp = y / ((-0.5 * ((a / z) * (t / z))) / x);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-57: tmp = y * -x elif z <= 2.36e-141: tmp = y / ((-0.5 * ((a / z) * (t / z))) / x) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-57) tmp = Float64(y * Float64(-x)); elseif (z <= 2.36e-141) tmp = Float64(y / Float64(Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))) / x)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.9e-57)
tmp = y * -x;
elseif (z <= 2.36e-141)
tmp = y / ((-0.5 * ((a / z) * (t / z))) / x);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-57], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.36e-141], N[(y / N[(N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-57}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.36 \cdot 10^{-141}:\\
\;\;\;\;\frac{y}{\frac{-0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}{x}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.8999999999999999e-57Initial program 61.0%
associate-*l*59.4%
associate-*r/60.7%
*-commutative60.7%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in z around -inf 90.1%
mul-1-neg90.1%
distribute-rgt-neg-out90.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 2.35999999999999986e-141Initial program 77.4%
associate-*l*79.1%
associate-*r/79.0%
*-commutative79.0%
associate-/l*75.9%
Simplified75.9%
associate-*r/74.3%
associate-*l/71.3%
associate-/l*74.4%
associate-/r/77.6%
*-commutative77.6%
associate-/l*73.8%
Applied egg-rr73.8%
Taylor expanded in z around inf 53.6%
Taylor expanded in z around 0 49.2%
unpow249.2%
times-frac51.4%
Simplified51.4%
if 2.35999999999999986e-141 < z Initial program 56.9%
associate-*l*51.0%
associate-*r/54.5%
*-commutative54.5%
associate-/l*57.1%
Simplified57.1%
Taylor expanded in z around inf 83.5%
Final simplification76.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5.2e-176) (* y (- x)) (/ y (/ (/ (+ z (* -0.5 (/ (* t a) z))) z) x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e-176) {
tmp = y * -x;
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.2d-176)) then
tmp = y * -x
else
tmp = y / (((z + ((-0.5d0) * ((t * a) / z))) / z) / x)
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e-176) {
tmp = y * -x;
} else {
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5.2e-176: tmp = y * -x else: tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e-176) tmp = Float64(y * Float64(-x)); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * Float64(Float64(t * a) / z))) / z) / x)); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.2e-176)
tmp = y * -x;
else
tmp = y / (((z + (-0.5 * ((t * a) / z))) / z) / x);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e-176], N[(y * (-x)), $MachinePrecision], N[(y / N[(N[(N[(z + N[(-0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-176}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{z + -0.5 \cdot \frac{t \cdot a}{z}}{z}}{x}}\\
\end{array}
\end{array}
if z < -5.19999999999999984e-176Initial program 66.5%
associate-*l*65.2%
associate-*r/65.3%
*-commutative65.3%
associate-/l*63.7%
Simplified63.7%
Taylor expanded in z around -inf 84.5%
mul-1-neg84.5%
distribute-rgt-neg-out84.5%
Simplified84.5%
if -5.19999999999999984e-176 < z Initial program 62.3%
associate-*l*59.1%
associate-*r/62.0%
*-commutative62.0%
associate-/l*62.9%
Simplified62.9%
associate-*r/61.2%
associate-*l/59.6%
associate-/l*62.2%
associate-/r/64.2%
*-commutative64.2%
associate-/l*63.1%
Applied egg-rr63.1%
Taylor expanded in z around inf 74.9%
Final simplification78.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.2e-50) (* y (- x)) (if (<= z 2.9e-181) (/ (* y (* z x)) (- z)) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e-50) {
tmp = y * -x;
} else if (z <= 2.9e-181) {
tmp = (y * (z * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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.2d-50)) then
tmp = y * -x
else if (z <= 2.9d-181) then
tmp = (y * (z * x)) / -z
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e-50) {
tmp = y * -x;
} else if (z <= 2.9e-181) {
tmp = (y * (z * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.2e-50: tmp = y * -x elif z <= 2.9e-181: tmp = (y * (z * x)) / -z else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e-50) tmp = Float64(y * Float64(-x)); elseif (z <= 2.9e-181) tmp = Float64(Float64(y * Float64(z * x)) / Float64(-z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.2e-50)
tmp = y * -x;
elseif (z <= 2.9e-181)
tmp = (y * (z * x)) / -z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e-50], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.9e-181], N[(N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-50}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-181}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.20000000000000001e-50Initial program 61.0%
associate-*l*59.4%
associate-*r/60.7%
*-commutative60.7%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in z around -inf 90.1%
mul-1-neg90.1%
distribute-rgt-neg-out90.1%
Simplified90.1%
if -1.20000000000000001e-50 < z < 2.8999999999999998e-181Initial program 77.5%
Taylor expanded in z around -inf 44.0%
neg-mul-144.0%
Simplified44.0%
Taylor expanded in x around 0 46.9%
if 2.8999999999999998e-181 < z Initial program 57.6%
associate-*l*52.8%
associate-*r/56.2%
*-commutative56.2%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in z around inf 82.4%
Final simplification75.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.2e-174) (* y (- x)) (if (<= z 9.2e-208) (* x (/ (* z y) z)) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e-174) {
tmp = y * -x;
} else if (z <= 9.2e-208) {
tmp = x * ((z * y) / z);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.2d-174)) then
tmp = y * -x
else if (z <= 9.2d-208) then
tmp = x * ((z * y) / z)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e-174) {
tmp = y * -x;
} else if (z <= 9.2e-208) {
tmp = x * ((z * y) / z);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4.2e-174: tmp = y * -x elif z <= 9.2e-208: tmp = x * ((z * y) / z) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e-174) tmp = Float64(y * Float64(-x)); elseif (z <= 9.2e-208) tmp = Float64(x * Float64(Float64(z * y) / z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.2e-174)
tmp = y * -x;
elseif (z <= 9.2e-208)
tmp = x * ((z * y) / z);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e-174], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 9.2e-208], N[(x * N[(N[(z * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-174}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-208}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.20000000000000021e-174Initial program 66.5%
associate-*l*65.2%
associate-*r/65.3%
*-commutative65.3%
associate-/l*63.7%
Simplified63.7%
Taylor expanded in z around -inf 84.5%
mul-1-neg84.5%
distribute-rgt-neg-out84.5%
Simplified84.5%
if -4.20000000000000021e-174 < z < 9.19999999999999986e-208Initial program 72.0%
associate-*l*72.4%
associate-*r/74.4%
Simplified74.4%
Taylor expanded in z around inf 35.7%
if 9.19999999999999986e-208 < z Initial program 58.2%
associate-*l*53.6%
associate-*r/56.9%
*-commutative56.9%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in z around inf 80.4%
Final simplification73.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2e-171) (* y (- x)) (if (<= z 2.3e-122) (/ (* x (* z y)) z) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-171) {
tmp = y * -x;
} else if (z <= 2.3e-122) {
tmp = (x * (z * y)) / z;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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-171)) then
tmp = y * -x
else if (z <= 2.3d-122) then
tmp = (x * (z * y)) / z
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-171) {
tmp = y * -x;
} else if (z <= 2.3e-122) {
tmp = (x * (z * y)) / z;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2e-171: tmp = y * -x elif z <= 2.3e-122: tmp = (x * (z * y)) / z else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-171) tmp = Float64(y * Float64(-x)); elseif (z <= 2.3e-122) tmp = Float64(Float64(x * Float64(z * y)) / z); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2e-171)
tmp = y * -x;
elseif (z <= 2.3e-122)
tmp = (x * (z * y)) / z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-171], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.3e-122], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-171}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-122}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2e-171Initial program 66.5%
associate-*l*65.2%
associate-*r/65.3%
*-commutative65.3%
associate-/l*63.7%
Simplified63.7%
Taylor expanded in z around -inf 84.5%
mul-1-neg84.5%
distribute-rgt-neg-out84.5%
Simplified84.5%
if -2e-171 < z < 2.30000000000000007e-122Initial program 72.4%
Taylor expanded in z around inf 41.9%
div-inv41.9%
*-commutative41.9%
Applied egg-rr41.9%
associate-*r/41.9%
*-rgt-identity41.9%
/-rgt-identity41.9%
*-commutative41.9%
/-rgt-identity41.9%
associate-*l*43.0%
Simplified43.0%
if 2.30000000000000007e-122 < z Initial program 56.5%
associate-*l*52.3%
associate-*r/55.3%
*-commutative55.3%
associate-/l*55.8%
Simplified55.8%
Taylor expanded in z around inf 83.9%
Final simplification74.8%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5e-293) (* y (- x)) (* y x)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-293) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 <= (-5d-293)) then
tmp = y * -x
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-293) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5e-293: tmp = y * -x else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e-293) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5e-293)
tmp = y * -x;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-293], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-293}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -5.0000000000000003e-293Initial program 68.1%
associate-*l*67.1%
associate-*r/67.2%
*-commutative67.2%
associate-/l*65.9%
Simplified65.9%
Taylor expanded in z around -inf 72.3%
mul-1-neg72.3%
distribute-rgt-neg-out72.3%
Simplified72.3%
if -5.0000000000000003e-293 < z Initial program 60.3%
associate-*l*56.6%
associate-*r/60.0%
*-commutative60.0%
associate-/l*61.0%
Simplified61.0%
Taylor expanded in z around inf 69.9%
Final simplification71.0%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y x))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
return y * x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a 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 = y * x
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): return y * x
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) return Float64(y * x) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = y * x;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
y \cdot x
\end{array}
Initial program 63.8%
associate-*l*61.4%
associate-*r/63.3%
*-commutative63.3%
associate-/l*63.2%
Simplified63.2%
Taylor expanded in z around inf 46.5%
Final simplification46.5%
(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 2023279
(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)))))