
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: 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) (* a t)))))
(if (<= z -5.1e+99)
(/ y (/ (fma 0.5 (/ a (log (exp (/ (* z z) t)))) -1.0) 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(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -5.1e+99) {
tmp = y / (fma(0.5, (a / log(exp(((z * z) / t)))), -1.0) / 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;
}
t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) tmp = 0.0 if (z <= -5.1e+99) tmp = Float64(y / Float64(fma(0.5, Float64(a / log(exp(Float64(Float64(z * z) / t)))), -1.0) / 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
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[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -5.1e+99], N[(y / N[(N[(0.5 * N[(a / N[Log[N[Exp[N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $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}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -5.1 \cdot 10^{+99}:\\
\;\;\;\;\frac{y}{\frac{\mathsf{fma}\left(0.5, \frac{a}{\log \left(e^{\frac{z \cdot z}{t}}\right)}, -1\right)}{x}}\\
\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 < -5.09999999999999952e99Initial program 38.4%
associate-*l*36.0%
associate-*r/38.2%
*-commutative38.2%
associate-/l*36.7%
Simplified36.7%
associate-*r/33.9%
associate-*l/34.7%
associate-/l*40.8%
associate-/r/42.8%
*-commutative42.8%
associate-/l*42.9%
Applied egg-rr42.9%
Taylor expanded in z around -inf 91.0%
fma-neg91.0%
associate-/l*97.6%
unpow297.6%
metadata-eval97.6%
Simplified97.6%
add-log-exp99.6%
Applied egg-rr99.6%
if -5.09999999999999952e99 < 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%
*-commutative98.1%
Simplified98.1%
Final simplification85.9%
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.75e+101) (/ y (/ (fma 0.5 (/ a (log (exp (/ (* z z) t)))) -1.0) x)) (if (<= z 1.6e+36) (* x (/ (* z y) (sqrt (- (* z z) (* a t))))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e+101) {
tmp = y / (fma(0.5, (a / log(exp(((z * z) / t)))), -1.0) / x);
} else if (z <= 1.6e+36) {
tmp = x * ((z * y) / sqrt(((z * z) - (a * t))));
} else {
tmp = y * x;
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e+101) tmp = Float64(y / Float64(fma(0.5, Float64(a / log(exp(Float64(Float64(z * z) / t)))), -1.0) / x)); elseif (z <= 1.6e+36) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(y * x); end return tmp end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e+101], N[(y / N[(N[(0.5 * N[(a / N[Log[N[Exp[N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+36], N[(x * N[(N[(z * y), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+101}:\\
\;\;\;\;\frac{y}{\frac{\mathsf{fma}\left(0.5, \frac{a}{\log \left(e^{\frac{z \cdot z}{t}}\right)}, -1\right)}{x}}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.75000000000000012e101Initial program 38.4%
associate-*l*36.0%
associate-*r/38.2%
*-commutative38.2%
associate-/l*36.7%
Simplified36.7%
associate-*r/33.9%
associate-*l/34.7%
associate-/l*40.8%
associate-/r/42.8%
*-commutative42.8%
associate-/l*42.9%
Applied egg-rr42.9%
Taylor expanded in z around -inf 91.0%
fma-neg91.0%
associate-/l*97.6%
unpow297.6%
metadata-eval97.6%
Simplified97.6%
add-log-exp99.6%
Applied egg-rr99.6%
if -1.75000000000000012e101 < 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%
*-commutative94.6%
Simplified94.6%
Final simplification89.9%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.3e+93) (* y (- x)) (if (<= z 1.6e+36) (* x (* z (/ y (sqrt (- (* z z) (* a t)))))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e+93) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * (z * (y / sqrt(((z * z) - (a * t)))));
} else {
tmp = y * x;
}
return tmp;
}
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 <= (-3.3d+93)) then
tmp = y * -x
else if (z <= 1.6d+36) then
tmp = x * (z * (y / sqrt(((z * z) - (a * t)))))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.3e+93) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * (z * (y / Math.sqrt(((z * z) - (a * t)))));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -3.3e+93: tmp = y * -x elif z <= 1.6e+36: tmp = x * (z * (y / math.sqrt(((z * z) - (a * t))))) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.3e+93) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e+36) tmp = Float64(x * Float64(z * Float64(y / sqrt(Float64(Float64(z * z) - Float64(a * t)))))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.3e+93)
tmp = y * -x;
elseif (z <= 1.6e+36)
tmp = x * (z * (y / sqrt(((z * z) - (a * t)))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.3e+93], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.6e+36], N[(x * N[(z * N[(y / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+93}:\\
\;\;\;\;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 - a \cdot t}}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -3.30000000000000009e93Initial 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%
neg-mul-196.2%
Simplified96.2%
if -3.30000000000000009e93 < 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%
*-commutative94.6%
Simplified94.6%
Final simplification89.3%
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.9e+92) (* y (- x)) (if (<= z 1.6e+36) (* x (/ z (/ (sqrt (- (* z z) (* a t))) y))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+92) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * (z / (sqrt(((z * z) - (a * t))) / y));
} else {
tmp = y * x;
}
return tmp;
}
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.9d+92)) then
tmp = y * -x
else if (z <= 1.6d+36) then
tmp = x * (z / (sqrt(((z * z) - (a * t))) / y))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+92) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * (z / (Math.sqrt(((z * z) - (a * t))) / y));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.9e+92: tmp = y * -x elif z <= 1.6e+36: tmp = x * (z / (math.sqrt(((z * z) - (a * t))) / y)) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e+92) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e+36) tmp = Float64(x * Float64(z / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.9e+92)
tmp = y * -x;
elseif (z <= 1.6e+36)
tmp = x * (z / (sqrt(((z * z) - (a * t))) / y));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e+92], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.6e+36], N[(x * N[(z / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+92}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.9000000000000001e92Initial 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%
neg-mul-196.2%
Simplified96.2%
if -2.9000000000000001e92 < 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%
*-commutative94.6%
Simplified94.6%
Final simplification89.6%
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.72e+100) (* y (- x)) (if (<= z 1.6e+36) (* x (/ (* z y) (sqrt (- (* z z) (* a t))))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.72e+100) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * ((z * y) / sqrt(((z * z) - (a * t))));
} else {
tmp = y * x;
}
return tmp;
}
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.72d+100)) then
tmp = y * -x
else if (z <= 1.6d+36) then
tmp = x * ((z * y) / sqrt(((z * z) - (a * t))))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.72e+100) {
tmp = y * -x;
} else if (z <= 1.6e+36) {
tmp = x * ((z * y) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.72e+100: tmp = y * -x elif z <= 1.6e+36: tmp = x * ((z * y) / math.sqrt(((z * z) - (a * t)))) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.72e+100) tmp = Float64(y * Float64(-x)); elseif (z <= 1.6e+36) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.72e+100)
tmp = y * -x;
elseif (z <= 1.6e+36)
tmp = x * ((z * y) / sqrt(((z * z) - (a * t))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.72e+100], 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[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.72 \cdot 10^{+100}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.7200000000000001e100Initial 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%
neg-mul-198.0%
Simplified98.0%
if -1.7200000000000001e100 < 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%
*-commutative94.6%
Simplified94.6%
Final simplification89.6%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4e+99) (* x (/ y (fma 0.5 (* t (/ a (* z z))) -1.0))) (if (<= z 1.6e+36) (* x (/ (* z y) (sqrt (- (* z z) (* a t))))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+99) {
tmp = x * (y / fma(0.5, (t * (a / (z * z))), -1.0));
} else if (z <= 1.6e+36) {
tmp = x * ((z * y) / sqrt(((z * z) - (a * t))));
} else {
tmp = y * x;
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+99) tmp = Float64(x * Float64(y / fma(0.5, Float64(t * Float64(a / Float64(z * z))), -1.0))); elseif (z <= 1.6e+36) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(y * x); end return tmp end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+99], N[(x * N[(y / N[(0.5 * N[(t * N[(a / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+36], N[(x * N[(N[(z * y), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{y}{\mathsf{fma}\left(0.5, t \cdot \frac{a}{z \cdot z}, -1\right)}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -3.9999999999999999e99Initial program 38.4%
associate-*l*36.0%
associate-*r/38.2%
*-commutative38.2%
associate-/l*36.7%
Simplified36.7%
associate-*r/33.9%
associate-*l/34.7%
associate-/l*40.8%
associate-/r/42.8%
*-commutative42.8%
associate-/l*42.9%
Applied egg-rr42.9%
Taylor expanded in z around -inf 91.0%
fma-neg91.0%
associate-/l*97.6%
unpow297.6%
metadata-eval97.6%
Simplified97.6%
associate-/r/98.0%
associate-/r/98.0%
Applied egg-rr98.0%
if -3.9999999999999999e99 < 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%
*-commutative94.6%
Simplified94.6%
Final simplification89.6%
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 (/ a (/ z t))))
(if (<= z -1.55e+140)
(* y (- x))
(if (<= z -1.16e-169)
(/ (* z (* y x)) (- (* 0.5 t_1) z))
(if (<= z 9.2e-36)
(* x (* z (/ y (sqrt (* t (- a))))))
(/ y (/ (/ (+ z (* -0.5 t_1)) z) x)))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z / t);
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -1.16e-169) {
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
} else if (z <= 9.2e-36) {
tmp = x * (z * (y / sqrt((t * -a))));
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
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 = a / (z / t)
if (z <= (-1.55d+140)) then
tmp = y * -x
else if (z <= (-1.16d-169)) then
tmp = (z * (y * x)) / ((0.5d0 * t_1) - z)
else if (z <= 9.2d-36) then
tmp = x * (z * (y / sqrt((t * -a))))
else
tmp = y / (((z + ((-0.5d0) * t_1)) / z) / x)
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z / t);
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -1.16e-169) {
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
} else if (z <= 9.2e-36) {
tmp = x * (z * (y / Math.sqrt((t * -a))));
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = a / (z / t) tmp = 0 if z <= -1.55e+140: tmp = y * -x elif z <= -1.16e-169: tmp = (z * (y * x)) / ((0.5 * t_1) - z) elif z <= 9.2e-36: tmp = x * (z * (y / math.sqrt((t * -a)))) else: tmp = y / (((z + (-0.5 * t_1)) / z) / x) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(a / Float64(z / t)) 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(0.5 * t_1) - z)); elseif (z <= 9.2e-36) tmp = Float64(x * Float64(z * Float64(y / sqrt(Float64(t * Float64(-a)))))); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * t_1)) / z) / x)); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = a / (z / t);
tmp = 0.0;
if (z <= -1.55e+140)
tmp = y * -x;
elseif (z <= -1.16e-169)
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
elseif (z <= 9.2e-36)
tmp = x * (z * (y / sqrt((t * -a))));
else
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
end
tmp_2 = tmp;
end
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[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]}, 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[(0.5 * t$95$1), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e-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 * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z}{t}}\\
\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)}{0.5 \cdot t_1 - z}\\
\mathbf{elif}\;z \leq 9.2 \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 t_1}{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%
neg-mul-1100.0%
Simplified100.0%
if -1.55e140 < z < -1.16e-169Initial program 91.6%
Taylor expanded in z around -inf 83.4%
neg-mul-180.1%
+-commutative80.1%
unsub-neg80.1%
associate-/l*80.2%
Simplified85.2%
if -1.16e-169 < z < 9.19999999999999986e-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.19999999999999986e-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%
associate-/l*84.2%
Simplified93.8%
Final simplification86.0%
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 (/ a (/ z t))))
(if (<= z -1.55e+140)
(* y (- x))
(if (<= z -8.5e-171)
(/ (* z (* y x)) (- (* 0.5 t_1) z))
(if (<= z 1.05e-35)
(* x (/ (* z y) (sqrt (* t (- a)))))
(/ y (/ (/ (+ z (* -0.5 t_1)) z) x)))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z / t);
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -8.5e-171) {
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
} else if (z <= 1.05e-35) {
tmp = x * ((z * y) / sqrt((t * -a)));
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
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 = a / (z / t)
if (z <= (-1.55d+140)) then
tmp = y * -x
else if (z <= (-8.5d-171)) then
tmp = (z * (y * x)) / ((0.5d0 * t_1) - z)
else if (z <= 1.05d-35) then
tmp = x * ((z * y) / sqrt((t * -a)))
else
tmp = y / (((z + ((-0.5d0) * t_1)) / z) / x)
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z / t);
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -8.5e-171) {
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
} else if (z <= 1.05e-35) {
tmp = x * ((z * y) / Math.sqrt((t * -a)));
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = a / (z / t) tmp = 0 if z <= -1.55e+140: tmp = y * -x elif z <= -8.5e-171: tmp = (z * (y * x)) / ((0.5 * t_1) - z) elif z <= 1.05e-35: tmp = x * ((z * y) / math.sqrt((t * -a))) else: tmp = y / (((z + (-0.5 * t_1)) / z) / x) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(a / Float64(z / t)) tmp = 0.0 if (z <= -1.55e+140) tmp = Float64(y * Float64(-x)); elseif (z <= -8.5e-171) tmp = Float64(Float64(z * Float64(y * x)) / Float64(Float64(0.5 * t_1) - z)); elseif (z <= 1.05e-35) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(t * Float64(-a))))); else tmp = Float64(y / Float64(Float64(Float64(z + Float64(-0.5 * t_1)) / z) / x)); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = a / (z / t);
tmp = 0.0;
if (z <= -1.55e+140)
tmp = y * -x;
elseif (z <= -8.5e-171)
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
elseif (z <= 1.05e-35)
tmp = x * ((z * y) / sqrt((t * -a)));
else
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
end
tmp_2 = tmp;
end
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[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+140], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -8.5e-171], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 * t$95$1), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e-35], 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 * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z}{t}}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+140}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-171}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{0.5 \cdot t_1 - z}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-35}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{\frac{z + -0.5 \cdot t_1}{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%
neg-mul-1100.0%
Simplified100.0%
if -1.55e140 < z < -8.50000000000000032e-171Initial program 91.6%
Taylor expanded in z around -inf 83.4%
neg-mul-180.1%
+-commutative80.1%
unsub-neg80.1%
associate-/l*80.2%
Simplified85.2%
if -8.50000000000000032e-171 < z < 1.05e-35Initial 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 1.05e-35 < 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%
associate-/l*84.2%
Simplified93.8%
Final simplification86.6%
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+141)
(* y (- x))
(if (<= z -8e-214)
(* x (/ (* z y) (- (* 0.5 (/ a (/ z t))) z)))
(if (<= z 1.05e+36)
(* x (/ (* z y) (+ z (* -0.5 (/ (* a t) z)))))
(* y x)))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+141) {
tmp = y * -x;
} else if (z <= -8e-214) {
tmp = x * ((z * y) / ((0.5 * (a / (z / t))) - z));
} else if (z <= 1.05e+36) {
tmp = x * ((z * y) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = y * x;
}
return tmp;
}
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+141)) then
tmp = y * -x
else if (z <= (-8d-214)) then
tmp = x * ((z * y) / ((0.5d0 * (a / (z / t))) - z))
else if (z <= 1.05d+36) then
tmp = x * ((z * y) / (z + ((-0.5d0) * ((a * t) / z))))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+141) {
tmp = y * -x;
} else if (z <= -8e-214) {
tmp = x * ((z * y) / ((0.5 * (a / (z / t))) - z));
} else if (z <= 1.05e+36) {
tmp = x * ((z * y) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.7e+141: tmp = y * -x elif z <= -8e-214: tmp = x * ((z * y) / ((0.5 * (a / (z / t))) - z)) elif z <= 1.05e+36: tmp = x * ((z * y) / (z + (-0.5 * ((a * t) / z)))) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+141) tmp = Float64(y * Float64(-x)); elseif (z <= -8e-214) tmp = Float64(x * Float64(Float64(z * y) / Float64(Float64(0.5 * Float64(a / Float64(z / t))) - z))); elseif (z <= 1.05e+36) tmp = Float64(x * Float64(Float64(z * y) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / z))))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.7e+141)
tmp = y * -x;
elseif (z <= -8e-214)
tmp = x * ((z * y) / ((0.5 * (a / (z / t))) - z));
elseif (z <= 1.05e+36)
tmp = x * ((z * y) / (z + (-0.5 * ((a * t) / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
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+141], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -8e-214], N[(x * N[(N[(z * y), $MachinePrecision] / N[(N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+36], N[(x * N[(N[(z * y), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+141}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-214}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{0.5 \cdot \frac{a}{\frac{z}{t}} - z}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.6999999999999999e141Initial program 28.7%
associate-*l*28.3%
associate-*r/28.4%
*-commutative28.4%
associate-/l*26.6%
Simplified26.6%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.6999999999999999e141 < z < -7.9999999999999993e-214Initial program 89.2%
associate-*l*87.8%
associate-*r/88.0%
Simplified88.0%
Taylor expanded in z around -inf 74.8%
neg-mul-174.8%
+-commutative74.8%
unsub-neg74.8%
associate-/l*74.8%
Simplified74.8%
if -7.9999999999999993e-214 < z < 1.05000000000000002e36Initial program 78.2%
associate-*l*77.0%
associate-*r/80.3%
Simplified80.3%
Taylor expanded in z around inf 58.6%
if 1.05000000000000002e36 < 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%
*-commutative94.6%
Simplified94.6%
Final simplification78.9%
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.3e-173)
(* y (- x))
(if (<= z 1.55e+36)
(* x (/ (* z y) (+ z (* -0.5 (/ (* a t) z)))))
(* y x))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.3e-173) {
tmp = y * -x;
} else if (z <= 1.55e+36) {
tmp = x * ((z * y) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = y * x;
}
return tmp;
}
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.3d-173)) then
tmp = y * -x
else if (z <= 1.55d+36) then
tmp = x * ((z * y) / (z + ((-0.5d0) * ((a * t) / z))))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.3e-173) {
tmp = y * -x;
} else if (z <= 1.55e+36) {
tmp = x * ((z * y) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4.3e-173: tmp = y * -x elif z <= 1.55e+36: tmp = x * ((z * y) / (z + (-0.5 * ((a * t) / z)))) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.3e-173) tmp = Float64(y * Float64(-x)); elseif (z <= 1.55e+36) tmp = Float64(x * Float64(Float64(z * y) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / z))))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.3e-173)
tmp = y * -x;
elseif (z <= 1.55e+36)
tmp = x * ((z * y) / (z + (-0.5 * ((a * t) / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.3e-173], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.55e+36], N[(x * N[(N[(z * y), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-173}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.3000000000000003e-173Initial 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%
neg-mul-184.5%
Simplified84.5%
if -4.3000000000000003e-173 < z < 1.55e36Initial program 79.1%
associate-*l*78.2%
associate-*r/81.1%
Simplified81.1%
Taylor expanded in z around inf 57.1%
if 1.55e36 < 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%
*-commutative94.6%
Simplified94.6%
Final simplification77.5%
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 (/ a (/ z t))))
(if (<= z -1.7e+141)
(* y (- x))
(if (<= z -2.2e-291)
(* x (/ (* z y) (- (* 0.5 t_1) z)))
(/ y (/ (/ (+ z (* -0.5 t_1)) z) x))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z / t);
double tmp;
if (z <= -1.7e+141) {
tmp = y * -x;
} else if (z <= -2.2e-291) {
tmp = x * ((z * y) / ((0.5 * t_1) - z));
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
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 = a / (z / t)
if (z <= (-1.7d+141)) then
tmp = y * -x
else if (z <= (-2.2d-291)) 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 t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z / t);
double tmp;
if (z <= -1.7e+141) {
tmp = y * -x;
} else if (z <= -2.2e-291) {
tmp = x * ((z * y) / ((0.5 * t_1) - z));
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = a / (z / t) tmp = 0 if z <= -1.7e+141: tmp = y * -x elif z <= -2.2e-291: tmp = x * ((z * y) / ((0.5 * t_1) - z)) else: tmp = y / (((z + (-0.5 * t_1)) / z) / x) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(a / Float64(z / t)) tmp = 0.0 if (z <= -1.7e+141) tmp = Float64(y * Float64(-x)); elseif (z <= -2.2e-291) tmp = Float64(x * Float64(Float64(z * 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
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = a / (z / t);
tmp = 0.0;
if (z <= -1.7e+141)
tmp = y * -x;
elseif (z <= -2.2e-291)
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: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+141], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -2.2e-291], N[(x * N[(N[(z * y), $MachinePrecision] / N[(N[(0.5 * t$95$1), $MachinePrecision] - z), $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}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z}{t}}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+141}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-291}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{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.6999999999999999e141Initial program 28.7%
associate-*l*28.3%
associate-*r/28.4%
*-commutative28.4%
associate-/l*26.6%
Simplified26.6%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.6999999999999999e141 < z < -2.20000000000000002e-291Initial program 87.6%
associate-*l*86.3%
associate-*r/86.4%
Simplified86.4%
Taylor expanded in z around -inf 73.2%
neg-mul-173.2%
+-commutative73.2%
unsub-neg73.2%
associate-/l*73.2%
Simplified73.2%
if -2.20000000000000002e-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%
associate-/l*71.8%
Simplified79.0%
Final simplification80.3%
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 (/ a (/ z t))))
(if (<= z -1.55e+140)
(* y (- x))
(if (<= z -8.2e-289)
(/ (* z (* y x)) (- (* 0.5 t_1) z))
(/ y (/ (/ (+ z (* -0.5 t_1)) z) x))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z / t);
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -8.2e-289) {
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
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 = a / (z / t)
if (z <= (-1.55d+140)) then
tmp = y * -x
else if (z <= (-8.2d-289)) 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 t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z / t);
double tmp;
if (z <= -1.55e+140) {
tmp = y * -x;
} else if (z <= -8.2e-289) {
tmp = (z * (y * x)) / ((0.5 * t_1) - z);
} else {
tmp = y / (((z + (-0.5 * t_1)) / z) / x);
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = a / (z / t) tmp = 0 if z <= -1.55e+140: tmp = y * -x elif z <= -8.2e-289: tmp = (z * (y * x)) / ((0.5 * t_1) - z) else: tmp = y / (((z + (-0.5 * t_1)) / z) / x) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(a / Float64(z / t)) tmp = 0.0 if (z <= -1.55e+140) tmp = Float64(y * Float64(-x)); elseif (z <= -8.2e-289) 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
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = a / (z / t);
tmp = 0.0;
if (z <= -1.55e+140)
tmp = y * -x;
elseif (z <= -8.2e-289)
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: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+140], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -8.2e-289], 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}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z}{t}}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+140}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-289}:\\
\;\;\;\;\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.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%
neg-mul-1100.0%
Simplified100.0%
if -1.55e140 < z < -8.1999999999999996e-289Initial program 88.7%
Taylor expanded in z around -inf 75.3%
neg-mul-172.8%
+-commutative72.8%
unsub-neg72.8%
associate-/l*72.9%
Simplified76.5%
if -8.1999999999999996e-289 < 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%
associate-/l*71.8%
Simplified79.0%
Final simplification81.4%
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 (* (/ x a) (/ (* y (* z z)) t))) (* y x))))
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 * ((x / a) * ((y * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
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) * ((x / a) * ((y * (z * z)) / t))
else
tmp = y * x
end if
code = tmp
end function
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 * ((x / a) * ((y * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
[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 * ((x / a) * ((y * (z * z)) / t)) else: tmp = y * x return tmp
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(x / a) * Float64(Float64(y * Float64(z * z)) / t))); else tmp = Float64(y * x); end return tmp end
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 * ((x / a) * ((y * (z * z)) / t));
else
tmp = y * x;
end
tmp_2 = tmp;
end
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[(x / a), $MachinePrecision] * N[(N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[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{x}{a} \cdot \frac{y \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%
neg-mul-190.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 2.9e-183Initial program 77.5%
Taylor expanded in z around inf 50.8%
associate-/l*50.8%
Simplified50.8%
Taylor expanded in z around 0 50.5%
times-frac50.8%
*-commutative50.8%
unpow250.8%
Simplified50.8%
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%
*-commutative82.4%
Simplified82.4%
Final simplification76.5%
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 3.2e-176) (* (/ -2.0 t) (/ (* (* z z) (* y x)) a)) (* y x))))
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 <= 3.2e-176) {
tmp = (-2.0 / t) * (((z * z) * (y * x)) / a);
} else {
tmp = y * x;
}
return tmp;
}
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 <= 3.2d-176) then
tmp = ((-2.0d0) / t) * (((z * z) * (y * x)) / a)
else
tmp = y * x
end if
code = tmp
end function
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 <= 3.2e-176) {
tmp = (-2.0 / t) * (((z * z) * (y * x)) / a);
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-57: tmp = y * -x elif z <= 3.2e-176: tmp = (-2.0 / t) * (((z * z) * (y * x)) / a) else: tmp = y * x return tmp
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 <= 3.2e-176) tmp = Float64(Float64(-2.0 / t) * Float64(Float64(Float64(z * z) * Float64(y * x)) / a)); else tmp = Float64(y * x); end return tmp end
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 <= 3.2e-176)
tmp = (-2.0 / t) * (((z * z) * (y * x)) / a);
else
tmp = y * x;
end
tmp_2 = tmp;
end
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, 3.2e-176], N[(N[(-2.0 / t), $MachinePrecision] * N[(N[(N[(z * z), $MachinePrecision] * N[(y * x), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[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 3.2 \cdot 10^{-176}:\\
\;\;\;\;\frac{-2}{t} \cdot \frac{\left(z \cdot z\right) \cdot \left(y \cdot x\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%
neg-mul-190.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 3.19999999999999985e-176Initial 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*50.9%
unpow250.9%
Simplified50.9%
if 3.19999999999999985e-176 < 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%
*-commutative82.4%
Simplified82.4%
Final simplification76.5%
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.95e-146) (* (/ y -0.5) (/ x (* (/ a z) (/ t z)))) (* y x))))
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.95e-146) {
tmp = (y / -0.5) * (x / ((a / z) * (t / z)));
} else {
tmp = y * x;
}
return tmp;
}
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.95d-146) then
tmp = (y / (-0.5d0)) * (x / ((a / z) * (t / z)))
else
tmp = y * x
end if
code = tmp
end function
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.95e-146) {
tmp = (y / -0.5) * (x / ((a / z) * (t / z)));
} else {
tmp = y * x;
}
return tmp;
}
[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.95e-146: tmp = (y / -0.5) * (x / ((a / z) * (t / z))) else: tmp = y * x return tmp
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.95e-146) tmp = Float64(Float64(y / -0.5) * Float64(x / Float64(Float64(a / z) * Float64(t / z)))); else tmp = Float64(y * x); end return tmp end
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.95e-146)
tmp = (y / -0.5) * (x / ((a / z) * (t / z)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
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.95e-146], N[(N[(y / -0.5), $MachinePrecision] * N[(x / N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[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.95 \cdot 10^{-146}:\\
\;\;\;\;\frac{y}{-0.5} \cdot \frac{x}{\frac{a}{z} \cdot \frac{t}{z}}\\
\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%
neg-mul-190.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 1.95000000000000001e-146Initial 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%
associate-/l*49.7%
unpow249.7%
associate-/l*51.2%
Simplified51.2%
expm1-log1p-u49.4%
expm1-udef49.4%
associate-/l*49.4%
associate-/r/49.5%
Applied egg-rr49.5%
expm1-def49.5%
expm1-log1p51.4%
associate-/r/51.4%
Simplified51.4%
if 1.95000000000000001e-146 < 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%
*-commutative83.5%
Simplified83.5%
Final simplification76.7%
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 5.1e-145) (* x (/ y (* -0.5 (* (/ a z) (/ t z))))) (* y x))))
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 <= 5.1e-145) {
tmp = x * (y / (-0.5 * ((a / z) * (t / z))));
} else {
tmp = y * x;
}
return tmp;
}
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 <= 5.1d-145) then
tmp = x * (y / ((-0.5d0) * ((a / z) * (t / z))))
else
tmp = y * x
end if
code = tmp
end function
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 <= 5.1e-145) {
tmp = x * (y / (-0.5 * ((a / z) * (t / z))));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-57: tmp = y * -x elif z <= 5.1e-145: tmp = x * (y / (-0.5 * ((a / z) * (t / z)))) else: tmp = y * x return tmp
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 <= 5.1e-145) tmp = Float64(x * Float64(y / Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); else tmp = Float64(y * x); end return tmp end
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 <= 5.1e-145)
tmp = x * (y / (-0.5 * ((a / z) * (t / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
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, 5.1e-145], N[(x * N[(y / N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[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 5.1 \cdot 10^{-145}:\\
\;\;\;\;x \cdot \frac{y}{-0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{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%
neg-mul-190.1%
Simplified90.1%
if -1.8999999999999999e-57 < z < 5.09999999999999983e-145Initial 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%
associate-/l*49.7%
unpow249.7%
associate-/l*51.2%
Simplified51.2%
associate-/r/51.2%
associate-/r/51.4%
Applied egg-rr51.4%
if 5.09999999999999983e-145 < 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%
*-commutative83.5%
Simplified83.5%
Final simplification76.7%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.5e-55) (* y (- x)) (if (<= z 2.9e-178) (/ 1.0 (/ (- z) (* y (* z x)))) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e-55) {
tmp = y * -x;
} else if (z <= 2.9e-178) {
tmp = 1.0 / (-z / (y * (z * x)));
} else {
tmp = y * x;
}
return tmp;
}
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 <= (-3.5d-55)) then
tmp = y * -x
else if (z <= 2.9d-178) then
tmp = 1.0d0 / (-z / (y * (z * x)))
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e-55) {
tmp = y * -x;
} else if (z <= 2.9e-178) {
tmp = 1.0 / (-z / (y * (z * x)));
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -3.5e-55: tmp = y * -x elif z <= 2.9e-178: tmp = 1.0 / (-z / (y * (z * x))) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e-55) tmp = Float64(y * Float64(-x)); elseif (z <= 2.9e-178) tmp = Float64(1.0 / Float64(Float64(-z) / Float64(y * Float64(z * x)))); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.5e-55)
tmp = y * -x;
elseif (z <= 2.9e-178)
tmp = 1.0 / (-z / (y * (z * x)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e-55], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.9e-178], N[(1.0 / N[((-z) / N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-55}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-178}:\\
\;\;\;\;\frac{1}{\frac{-z}{y \cdot \left(z \cdot x\right)}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -3.50000000000000025e-55Initial 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%
neg-mul-190.1%
Simplified90.1%
if -3.50000000000000025e-55 < z < 2.8999999999999998e-178Initial program 77.5%
Taylor expanded in z around -inf 44.0%
neg-mul-144.0%
Simplified44.0%
clear-num44.0%
inv-pow44.0%
*-commutative44.0%
*-commutative44.0%
Applied egg-rr44.0%
unpow-144.0%
associate-*r*49.2%
*-commutative49.2%
associate-*r*46.9%
Simplified46.9%
if 2.8999999999999998e-178 < 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%
*-commutative82.4%
Simplified82.4%
Final simplification75.5%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4e+61) (* y (- x)) (if (<= z 6e-191) (/ (* z (* y x)) (- z)) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+61) {
tmp = y * -x;
} else if (z <= 6e-191) {
tmp = (z * (y * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
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 <= (-4d+61)) then
tmp = y * -x
else if (z <= 6d-191) then
tmp = (z * (y * x)) / -z
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+61) {
tmp = y * -x;
} else if (z <= 6e-191) {
tmp = (z * (y * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4e+61: tmp = y * -x elif z <= 6e-191: tmp = (z * (y * x)) / -z else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+61) tmp = Float64(y * Float64(-x)); elseif (z <= 6e-191) tmp = Float64(Float64(z * Float64(y * x)) / Float64(-z)); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4e+61)
tmp = y * -x;
elseif (z <= 6e-191)
tmp = (z * (y * x)) / -z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+61], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 6e-191], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+61}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-191}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -3.9999999999999998e61Initial 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%
neg-mul-193.3%
Simplified93.3%
if -3.9999999999999998e61 < z < 6.0000000000000001e-191Initial program 81.4%
Taylor expanded in z around -inf 54.2%
neg-mul-154.2%
Simplified54.2%
if 6.0000000000000001e-191 < 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%
*-commutative82.4%
Simplified82.4%
Final simplification74.7%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -7e-57) (* y (- x)) (if (<= z 1.4e-184) (/ (* x (* z y)) (- z)) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e-57) {
tmp = y * -x;
} else if (z <= 1.4e-184) {
tmp = (x * (z * y)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
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 <= (-7d-57)) then
tmp = y * -x
else if (z <= 1.4d-184) then
tmp = (x * (z * y)) / -z
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e-57) {
tmp = y * -x;
} else if (z <= 1.4e-184) {
tmp = (x * (z * y)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -7e-57: tmp = y * -x elif z <= 1.4e-184: tmp = (x * (z * y)) / -z else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e-57) tmp = Float64(y * Float64(-x)); elseif (z <= 1.4e-184) tmp = Float64(Float64(x * Float64(z * y)) / Float64(-z)); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -7e-57)
tmp = y * -x;
elseif (z <= 1.4e-184)
tmp = (x * (z * y)) / -z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e-57], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.4e-184], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-57}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-184}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -6.99999999999999983e-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%
neg-mul-190.1%
Simplified90.1%
if -6.99999999999999983e-57 < z < 1.3999999999999999e-184Initial program 77.5%
Taylor expanded in z around -inf 44.0%
neg-mul-144.0%
Simplified44.0%
expm1-log1p-u40.4%
expm1-udef46.2%
*-commutative46.2%
*-commutative46.2%
Applied egg-rr46.2%
expm1-def40.4%
expm1-log1p44.0%
associate-*r*49.2%
*-commutative49.2%
Simplified49.2%
if 1.3999999999999999e-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%
*-commutative82.4%
Simplified82.4%
Final simplification76.1%
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.6e-178) (* y (- x)) (if (<= z 1.1e-208) (* x (/ (* z y) z)) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-178) {
tmp = y * -x;
} else if (z <= 1.1e-208) {
tmp = x * ((z * y) / z);
} else {
tmp = y * x;
}
return tmp;
}
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.6d-178)) then
tmp = y * -x
else if (z <= 1.1d-208) then
tmp = x * ((z * y) / z)
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-178) {
tmp = y * -x;
} else if (z <= 1.1e-208) {
tmp = x * ((z * y) / z);
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-178: tmp = y * -x elif z <= 1.1e-208: tmp = x * ((z * y) / z) else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-178) tmp = Float64(y * Float64(-x)); elseif (z <= 1.1e-208) tmp = Float64(x * Float64(Float64(z * y) / z)); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.6e-178)
tmp = y * -x;
elseif (z <= 1.1e-208)
tmp = x * ((z * y) / z);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-178], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.1e-208], N[(x * N[(N[(z * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-178}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-208}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.6e-178Initial 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%
neg-mul-184.5%
Simplified84.5%
if -1.6e-178 < z < 1.1e-208Initial program 72.0%
associate-*l*72.4%
associate-*r/74.4%
Simplified74.4%
Taylor expanded in z around inf 35.7%
if 1.1e-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%
*-commutative80.4%
Simplified80.4%
Final simplification73.7%
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.3e-172) (* y (- x)) (if (<= z 5e-41) (/ (* z (* y x)) z) (* y x))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-172) {
tmp = y * -x;
} else if (z <= 5e-41) {
tmp = (z * (y * x)) / z;
} else {
tmp = y * x;
}
return tmp;
}
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.3d-172)) then
tmp = y * -x
else if (z <= 5d-41) then
tmp = (z * (y * x)) / z
else
tmp = y * x
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-172) {
tmp = y * -x;
} else if (z <= 5e-41) {
tmp = (z * (y * x)) / z;
} else {
tmp = y * x;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.3e-172: tmp = y * -x elif z <= 5e-41: tmp = (z * (y * x)) / z else: tmp = y * x return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e-172) tmp = Float64(y * Float64(-x)); elseif (z <= 5e-41) tmp = Float64(Float64(z * Float64(y * x)) / z); else tmp = Float64(y * x); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.3e-172)
tmp = y * -x;
elseif (z <= 5e-41)
tmp = (z * (y * x)) / z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e-172], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5e-41], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-172}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-41}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.29999999999999995e-172Initial 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%
neg-mul-184.5%
Simplified84.5%
if -2.29999999999999995e-172 < z < 4.9999999999999996e-41Initial program 74.7%
Taylor expanded in z around inf 41.9%
if 4.9999999999999996e-41 < z Initial program 52.3%
associate-*l*47.6%
associate-*r/49.9%
*-commutative49.9%
associate-/l*50.5%
Simplified50.5%
Taylor expanded in z around inf 90.1%
*-commutative90.1%
Simplified90.1%
Final simplification74.6%
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(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: 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 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;
}
[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
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
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: 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}
[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%
neg-mul-172.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%
*-commutative69.9%
Simplified69.9%
Final simplification71.0%
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(t < a);
double code(double x, double y, double z, double t, double a) {
return y * x;
}
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 t < a;
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): return y * x
t, a = sort([t, a]) function code(x, y, z, t, a) return Float64(y * x) end
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = y * x;
end
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}
[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%
*-commutative46.5%
Simplified46.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)))))