
(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 16 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
(if (<= z -6.2e+21)
(* y (- x))
(if (<= z 3.6e-272)
(/ x (/ (sqrt (- (* z z) (* t a))) (* z y)))
(pow (/ (sqrt (- 1.0 (/ a (/ z (/ t z))))) (* y x)) -1.0))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e+21) {
tmp = y * -x;
} else if (z <= 3.6e-272) {
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y));
} else {
tmp = pow((sqrt((1.0 - (a / (z / (t / z))))) / (y * x)), -1.0);
}
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 <= (-6.2d+21)) then
tmp = y * -x
else if (z <= 3.6d-272) then
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y))
else
tmp = (sqrt((1.0d0 - (a / (z / (t / z))))) / (y * x)) ** (-1.0d0)
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 <= -6.2e+21) {
tmp = y * -x;
} else if (z <= 3.6e-272) {
tmp = x / (Math.sqrt(((z * z) - (t * a))) / (z * y));
} else {
tmp = Math.pow((Math.sqrt((1.0 - (a / (z / (t / z))))) / (y * x)), -1.0);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -6.2e+21: tmp = y * -x elif z <= 3.6e-272: tmp = x / (math.sqrt(((z * z) - (t * a))) / (z * y)) else: tmp = math.pow((math.sqrt((1.0 - (a / (z / (t / z))))) / (y * x)), -1.0) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e+21) tmp = Float64(y * Float64(-x)); elseif (z <= 3.6e-272) tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(t * a))) / Float64(z * y))); else tmp = Float64(sqrt(Float64(1.0 - Float64(a / Float64(z / Float64(t / z))))) / Float64(y * x)) ^ -1.0; 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 <= -6.2e+21)
tmp = y * -x;
elseif (z <= 3.6e-272)
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y));
else
tmp = (sqrt((1.0 - (a / (z / (t / z))))) / (y * x)) ^ -1.0;
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, -6.2e+21], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.6e-272], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[N[(1.0 - N[(a / N[(z / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(y * x), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-272}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{\sqrt{1 - \frac{a}{\frac{z}{\frac{t}{z}}}}}{y \cdot x}\right)}^{-1}\\
\end{array}
\end{array}
if z < -6.2e21Initial program 39.4%
*-commutative39.4%
associate-*l*36.4%
associate-*r/41.7%
Simplified41.7%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -6.2e21 < z < 3.59999999999999968e-272Initial program 78.5%
*-commutative78.5%
associate-*l*82.4%
associate-*r/86.6%
Simplified86.6%
*-commutative86.6%
associate-/l*84.3%
associate-/r/84.8%
associate-/l/86.3%
*-commutative86.3%
Applied egg-rr86.3%
if 3.59999999999999968e-272 < z Initial program 56.3%
associate-/l*60.0%
Simplified60.0%
add-sqr-sqrt60.0%
sqrt-unprod59.1%
frac-times50.2%
add-sqr-sqrt50.2%
Applied egg-rr50.2%
div-sub45.6%
*-inverses79.1%
*-commutative79.1%
associate-/l*85.7%
Simplified85.7%
clear-num85.6%
inv-pow85.6%
associate-/l*90.9%
Applied egg-rr90.9%
Final simplification92.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))
(t_2 (sqrt (* a (- t))))
(t_3 (* y (/ (* z x) t_2))))
(if (<= z -5e-10)
(* y (- x))
(if (<= z -5.8e-60)
t_3
(if (<= z -1.48e-92)
(/ (* y x) (/ (- (* 0.5 t_1) z) z))
(if (<= z -2.45e-226)
(* z (/ (* y x) t_2))
(if (<= z 1.65e-167)
t_3
(if (<= z 5.5e-80)
(* z (/ (* y x) (+ z (* -0.5 t_1))))
(if (<= z 2.55e-57)
t_3
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))))))))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 t_2 = sqrt((a * -t));
double t_3 = y * ((z * x) / t_2);
double tmp;
if (z <= -5e-10) {
tmp = y * -x;
} else if (z <= -5.8e-60) {
tmp = t_3;
} else if (z <= -1.48e-92) {
tmp = (y * x) / (((0.5 * t_1) - z) / z);
} else if (z <= -2.45e-226) {
tmp = z * ((y * x) / t_2);
} else if (z <= 1.65e-167) {
tmp = t_3;
} else if (z <= 5.5e-80) {
tmp = z * ((y * x) / (z + (-0.5 * t_1)));
} else if (z <= 2.55e-57) {
tmp = t_3;
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (t * a) / z
t_2 = sqrt((a * -t))
t_3 = y * ((z * x) / t_2)
if (z <= (-5d-10)) then
tmp = y * -x
else if (z <= (-5.8d-60)) then
tmp = t_3
else if (z <= (-1.48d-92)) then
tmp = (y * x) / (((0.5d0 * t_1) - z) / z)
else if (z <= (-2.45d-226)) then
tmp = z * ((y * x) / t_2)
else if (z <= 1.65d-167) then
tmp = t_3
else if (z <= 5.5d-80) then
tmp = z * ((y * x) / (z + ((-0.5d0) * t_1)))
else if (z <= 2.55d-57) then
tmp = t_3
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
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 t_2 = Math.sqrt((a * -t));
double t_3 = y * ((z * x) / t_2);
double tmp;
if (z <= -5e-10) {
tmp = y * -x;
} else if (z <= -5.8e-60) {
tmp = t_3;
} else if (z <= -1.48e-92) {
tmp = (y * x) / (((0.5 * t_1) - z) / z);
} else if (z <= -2.45e-226) {
tmp = z * ((y * x) / t_2);
} else if (z <= 1.65e-167) {
tmp = t_3;
} else if (z <= 5.5e-80) {
tmp = z * ((y * x) / (z + (-0.5 * t_1)));
} else if (z <= 2.55e-57) {
tmp = t_3;
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = (t * a) / z t_2 = math.sqrt((a * -t)) t_3 = y * ((z * x) / t_2) tmp = 0 if z <= -5e-10: tmp = y * -x elif z <= -5.8e-60: tmp = t_3 elif z <= -1.48e-92: tmp = (y * x) / (((0.5 * t_1) - z) / z) elif z <= -2.45e-226: tmp = z * ((y * x) / t_2) elif z <= 1.65e-167: tmp = t_3 elif z <= 5.5e-80: tmp = z * ((y * x) / (z + (-0.5 * t_1))) elif z <= 2.55e-57: tmp = t_3 else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) 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) t_2 = sqrt(Float64(a * Float64(-t))) t_3 = Float64(y * Float64(Float64(z * x) / t_2)) tmp = 0.0 if (z <= -5e-10) tmp = Float64(y * Float64(-x)); elseif (z <= -5.8e-60) tmp = t_3; elseif (z <= -1.48e-92) tmp = Float64(Float64(y * x) / Float64(Float64(Float64(0.5 * t_1) - z) / z)); elseif (z <= -2.45e-226) tmp = Float64(z * Float64(Float64(y * x) / t_2)); elseif (z <= 1.65e-167) tmp = t_3; elseif (z <= 5.5e-80) tmp = Float64(z * Float64(Float64(y * x) / Float64(z + Float64(-0.5 * t_1)))); elseif (z <= 2.55e-57) tmp = t_3; else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); 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;
t_2 = sqrt((a * -t));
t_3 = y * ((z * x) / t_2);
tmp = 0.0;
if (z <= -5e-10)
tmp = y * -x;
elseif (z <= -5.8e-60)
tmp = t_3;
elseif (z <= -1.48e-92)
tmp = (y * x) / (((0.5 * t_1) - z) / z);
elseif (z <= -2.45e-226)
tmp = z * ((y * x) / t_2);
elseif (z <= 1.65e-167)
tmp = t_3;
elseif (z <= 5.5e-80)
tmp = z * ((y * x) / (z + (-0.5 * t_1)));
elseif (z <= 2.55e-57)
tmp = t_3;
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
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]}, Block[{t$95$2 = N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y * N[(N[(z * x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e-10], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -5.8e-60], t$95$3, If[LessEqual[z, -1.48e-92], N[(N[(y * x), $MachinePrecision] / N[(N[(N[(0.5 * t$95$1), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.45e-226], N[(z * N[(N[(y * x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-167], t$95$3, If[LessEqual[z, 5.5e-80], N[(z * N[(N[(y * x), $MachinePrecision] / N[(z + N[(-0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e-57], t$95$3, N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\\
t_2 := \sqrt{a \cdot \left(-t\right)}\\
t_3 := y \cdot \frac{z \cdot x}{t_2}\\
\mathbf{if}\;z \leq -5 \cdot 10^{-10}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-60}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -1.48 \cdot 10^{-92}:\\
\;\;\;\;\frac{y \cdot x}{\frac{0.5 \cdot t_1 - z}{z}}\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-226}:\\
\;\;\;\;z \cdot \frac{y \cdot x}{t_2}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-167}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-80}:\\
\;\;\;\;z \cdot \frac{y \cdot x}{z + -0.5 \cdot t_1}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-57}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -5.00000000000000031e-10Initial program 45.4%
*-commutative45.4%
associate-*l*42.6%
associate-*r/47.4%
Simplified47.4%
Taylor expanded in z around -inf 98.7%
neg-mul-198.7%
Simplified98.7%
if -5.00000000000000031e-10 < z < -5.7999999999999999e-60 or -2.44999999999999993e-226 < z < 1.64999999999999998e-167 or 5.4999999999999997e-80 < z < 2.55e-57Initial program 67.1%
*-commutative67.1%
associate-*l*74.3%
associate-*r/75.3%
Simplified75.3%
Taylor expanded in z around 0 75.3%
associate-*r*75.3%
neg-mul-175.3%
Simplified75.3%
if -5.7999999999999999e-60 < z < -1.48000000000000001e-92Initial program 89.6%
associate-/l*89.6%
Simplified89.6%
Taylor expanded in z around -inf 80.0%
if -1.48000000000000001e-92 < z < -2.44999999999999993e-226Initial program 80.2%
associate-*l/94.8%
Simplified94.8%
Taylor expanded in z around 0 84.4%
associate-*r*77.9%
neg-mul-177.9%
Simplified84.4%
if 1.64999999999999998e-167 < z < 5.4999999999999997e-80Initial program 80.4%
associate-*l/89.7%
Simplified89.7%
Taylor expanded in z around inf 71.9%
if 2.55e-57 < z Initial program 52.3%
associate-/l*56.1%
Simplified56.1%
Taylor expanded in z around inf 86.4%
unpow286.4%
associate-/l*94.9%
Simplified94.9%
Final simplification89.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
(let* ((t_1 (sqrt (* a (- t)))))
(if (<= z -6.5e-10)
(* y (- x))
(if (<= z -6e-60)
(* y (/ (* z x) t_1))
(if (<= z -2.3e-141)
(* y (/ (* z x) (- z)))
(if (<= z 1.75e-167)
(/ x (/ t_1 (* z y)))
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t)))))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt((a * -t));
double tmp;
if (z <= -6.5e-10) {
tmp = y * -x;
} else if (z <= -6e-60) {
tmp = y * ((z * x) / t_1);
} else if (z <= -2.3e-141) {
tmp = y * ((z * x) / -z);
} else if (z <= 1.75e-167) {
tmp = x / (t_1 / (z * y));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
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((a * -t))
if (z <= (-6.5d-10)) then
tmp = y * -x
else if (z <= (-6d-60)) then
tmp = y * ((z * x) / t_1)
else if (z <= (-2.3d-141)) then
tmp = y * ((z * x) / -z)
else if (z <= 1.75d-167) then
tmp = x / (t_1 / (z * y))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
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((a * -t));
double tmp;
if (z <= -6.5e-10) {
tmp = y * -x;
} else if (z <= -6e-60) {
tmp = y * ((z * x) / t_1);
} else if (z <= -2.3e-141) {
tmp = y * ((z * x) / -z);
} else if (z <= 1.75e-167) {
tmp = x / (t_1 / (z * y));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = math.sqrt((a * -t)) tmp = 0 if z <= -6.5e-10: tmp = y * -x elif z <= -6e-60: tmp = y * ((z * x) / t_1) elif z <= -2.3e-141: tmp = y * ((z * x) / -z) elif z <= 1.75e-167: tmp = x / (t_1 / (z * y)) else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = sqrt(Float64(a * Float64(-t))) tmp = 0.0 if (z <= -6.5e-10) tmp = Float64(y * Float64(-x)); elseif (z <= -6e-60) tmp = Float64(y * Float64(Float64(z * x) / t_1)); elseif (z <= -2.3e-141) tmp = Float64(y * Float64(Float64(z * x) / Float64(-z))); elseif (z <= 1.75e-167) tmp = Float64(x / Float64(t_1 / Float64(z * y))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); 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((a * -t));
tmp = 0.0;
if (z <= -6.5e-10)
tmp = y * -x;
elseif (z <= -6e-60)
tmp = y * ((z * x) / t_1);
elseif (z <= -2.3e-141)
tmp = y * ((z * x) / -z);
elseif (z <= 1.75e-167)
tmp = x / (t_1 / (z * y));
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
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[(a * (-t)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -6.5e-10], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -6e-60], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-141], N[(y * N[(N[(z * x), $MachinePrecision] / (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e-167], N[(x / N[(t$95$1 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \sqrt{a \cdot \left(-t\right)}\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{-10}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-60}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{-z}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-167}:\\
\;\;\;\;\frac{x}{\frac{t_1}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -6.5000000000000003e-10Initial program 45.4%
*-commutative45.4%
associate-*l*42.6%
associate-*r/47.4%
Simplified47.4%
Taylor expanded in z around -inf 98.7%
neg-mul-198.7%
Simplified98.7%
if -6.5000000000000003e-10 < z < -6.00000000000000038e-60Initial program 61.4%
*-commutative61.4%
associate-*l*84.6%
associate-*r/79.0%
Simplified79.0%
Taylor expanded in z around 0 79.0%
associate-*r*79.0%
neg-mul-179.0%
Simplified79.0%
if -6.00000000000000038e-60 < z < -2.29999999999999995e-141Initial program 88.8%
*-commutative88.8%
associate-*l*94.2%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in z around -inf 72.5%
neg-mul-167.0%
Simplified72.5%
if -2.29999999999999995e-141 < z < 1.75e-167Initial program 70.8%
*-commutative70.8%
associate-*l*72.7%
associate-*r/77.5%
Simplified77.5%
*-commutative77.5%
associate-/l*76.1%
associate-/r/77.8%
associate-/l/79.7%
*-commutative79.7%
Applied egg-rr79.7%
Taylor expanded in z around 0 79.7%
associate-*r*77.5%
neg-mul-177.5%
Simplified79.7%
if 1.75e-167 < z Initial program 55.2%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in z around inf 80.4%
unpow280.4%
associate-/l*88.8%
Simplified88.8%
Final simplification88.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 -7e+160)
(* y (- x))
(if (<= z 4e+54)
(* x (* y (/ z (sqrt (- (* z z) (* t a))))))
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+160) {
tmp = y * -x;
} else if (z <= 4e+54) {
tmp = x * (y * (z / sqrt(((z * z) - (t * a)))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
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 <= (-7d+160)) then
tmp = y * -x
else if (z <= 4d+54) then
tmp = x * (y * (z / sqrt(((z * z) - (t * a)))))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
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 <= -7e+160) {
tmp = y * -x;
} else if (z <= 4e+54) {
tmp = x * (y * (z / Math.sqrt(((z * z) - (t * a)))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -7e+160: tmp = y * -x elif z <= 4e+54: tmp = x * (y * (z / math.sqrt(((z * z) - (t * a))))) else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e+160) tmp = Float64(y * Float64(-x)); elseif (z <= 4e+54) tmp = Float64(x * Float64(y * Float64(z / sqrt(Float64(Float64(z * z) - Float64(t * a)))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); 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 <= -7e+160)
tmp = y * -x;
elseif (z <= 4e+54)
tmp = x * (y * (z / sqrt(((z * z) - (t * a)))));
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
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, -7e+160], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4e+54], N[(x * N[(y * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+160}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+54}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -7.00000000000000051e160Initial program 5.7%
*-commutative5.7%
associate-*l*5.3%
associate-*r/5.5%
Simplified5.5%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -7.00000000000000051e160 < z < 4.0000000000000003e54Initial program 79.2%
associate-/l*85.9%
Simplified85.9%
div-inv85.9%
clear-num86.5%
associate-*l*87.7%
Applied egg-rr87.7%
if 4.0000000000000003e54 < z Initial program 40.4%
associate-/l*45.3%
Simplified45.3%
Taylor expanded in z around inf 86.0%
unpow286.0%
associate-/l*97.1%
Simplified97.1%
Final simplification92.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 -7e+160)
(* y (- x))
(if (<= z 3.6e-272)
(* x (* y (/ z (sqrt (- (* z z) (* t a))))))
(/ x (/ (sqrt (- 1.0 (* (/ t z) (/ a z)))) y)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+160) {
tmp = y * -x;
} else if (z <= 3.6e-272) {
tmp = x * (y * (z / sqrt(((z * z) - (t * a)))));
} else {
tmp = x / (sqrt((1.0 - ((t / z) * (a / z)))) / y);
}
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 <= (-7d+160)) then
tmp = y * -x
else if (z <= 3.6d-272) then
tmp = x * (y * (z / sqrt(((z * z) - (t * a)))))
else
tmp = x / (sqrt((1.0d0 - ((t / z) * (a / z)))) / y)
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 <= -7e+160) {
tmp = y * -x;
} else if (z <= 3.6e-272) {
tmp = x * (y * (z / Math.sqrt(((z * z) - (t * a)))));
} else {
tmp = x / (Math.sqrt((1.0 - ((t / z) * (a / z)))) / y);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -7e+160: tmp = y * -x elif z <= 3.6e-272: tmp = x * (y * (z / math.sqrt(((z * z) - (t * a))))) else: tmp = x / (math.sqrt((1.0 - ((t / z) * (a / z)))) / y) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e+160) tmp = Float64(y * Float64(-x)); elseif (z <= 3.6e-272) tmp = Float64(x * Float64(y * Float64(z / sqrt(Float64(Float64(z * z) - Float64(t * a)))))); else tmp = Float64(x / Float64(sqrt(Float64(1.0 - Float64(Float64(t / z) * Float64(a / z)))) / y)); 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 <= -7e+160)
tmp = y * -x;
elseif (z <= 3.6e-272)
tmp = x * (y * (z / sqrt(((z * z) - (t * a)))));
else
tmp = x / (sqrt((1.0 - ((t / z) * (a / z)))) / y);
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, -7e+160], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.6e-272], N[(x * N[(y * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[Sqrt[N[(1.0 - N[(N[(t / z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+160}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-272}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{1 - \frac{t}{z} \cdot \frac{a}{z}}}{y}}\\
\end{array}
\end{array}
if z < -7.00000000000000051e160Initial program 5.7%
*-commutative5.7%
associate-*l*5.3%
associate-*r/5.5%
Simplified5.5%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -7.00000000000000051e160 < z < 3.59999999999999968e-272Initial program 79.7%
associate-/l*88.6%
Simplified88.6%
div-inv88.6%
clear-num89.4%
associate-*l*91.1%
Applied egg-rr91.1%
if 3.59999999999999968e-272 < z Initial program 56.3%
associate-/l*60.0%
Simplified60.0%
add-sqr-sqrt60.0%
sqrt-unprod59.1%
frac-times50.2%
add-sqr-sqrt50.2%
Applied egg-rr50.2%
div-sub45.6%
*-inverses79.1%
*-commutative79.1%
associate-/l*85.7%
Simplified85.7%
expm1-log1p-u62.0%
expm1-udef39.1%
associate-/l*40.6%
Applied egg-rr40.6%
expm1-def66.4%
expm1-log1p91.0%
associate-/l*90.0%
associate-/r/93.2%
Simplified93.2%
Final simplification93.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 -6.2e+21)
(* y (- x))
(if (<= z 6e-273)
(/ x (/ (sqrt (- (* z z) (* t a))) (* z y)))
(/ x (/ (sqrt (- 1.0 (* (/ t z) (/ a z)))) y)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e+21) {
tmp = y * -x;
} else if (z <= 6e-273) {
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y));
} else {
tmp = x / (sqrt((1.0 - ((t / z) * (a / z)))) / y);
}
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 <= (-6.2d+21)) then
tmp = y * -x
else if (z <= 6d-273) then
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y))
else
tmp = x / (sqrt((1.0d0 - ((t / z) * (a / z)))) / y)
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 <= -6.2e+21) {
tmp = y * -x;
} else if (z <= 6e-273) {
tmp = x / (Math.sqrt(((z * z) - (t * a))) / (z * y));
} else {
tmp = x / (Math.sqrt((1.0 - ((t / z) * (a / z)))) / y);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -6.2e+21: tmp = y * -x elif z <= 6e-273: tmp = x / (math.sqrt(((z * z) - (t * a))) / (z * y)) else: tmp = x / (math.sqrt((1.0 - ((t / z) * (a / z)))) / y) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e+21) tmp = Float64(y * Float64(-x)); elseif (z <= 6e-273) tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(t * a))) / Float64(z * y))); else tmp = Float64(x / Float64(sqrt(Float64(1.0 - Float64(Float64(t / z) * Float64(a / z)))) / y)); 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 <= -6.2e+21)
tmp = y * -x;
elseif (z <= 6e-273)
tmp = x / (sqrt(((z * z) - (t * a))) / (z * y));
else
tmp = x / (sqrt((1.0 - ((t / z) * (a / z)))) / y);
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, -6.2e+21], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 6e-273], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[Sqrt[N[(1.0 - N[(N[(t / z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-273}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{1 - \frac{t}{z} \cdot \frac{a}{z}}}{y}}\\
\end{array}
\end{array}
if z < -6.2e21Initial program 39.4%
*-commutative39.4%
associate-*l*36.4%
associate-*r/41.7%
Simplified41.7%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -6.2e21 < z < 5.99999999999999975e-273Initial program 78.5%
*-commutative78.5%
associate-*l*82.4%
associate-*r/86.6%
Simplified86.6%
*-commutative86.6%
associate-/l*84.3%
associate-/r/84.8%
associate-/l/86.3%
*-commutative86.3%
Applied egg-rr86.3%
if 5.99999999999999975e-273 < z Initial program 56.3%
associate-/l*60.0%
Simplified60.0%
add-sqr-sqrt60.0%
sqrt-unprod59.1%
frac-times50.2%
add-sqr-sqrt50.2%
Applied egg-rr50.2%
div-sub45.6%
*-inverses79.1%
*-commutative79.1%
associate-/l*85.7%
Simplified85.7%
expm1-log1p-u62.0%
expm1-udef39.1%
associate-/l*40.6%
Applied egg-rr40.6%
expm1-def66.4%
expm1-log1p91.0%
associate-/l*90.0%
associate-/r/93.2%
Simplified93.2%
Final simplification93.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 -5.6e-10)
(* y (- x))
(if (<= z 1.75e-167)
(* y (/ (* z x) (sqrt (* a (- t)))))
(/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e-10) {
tmp = y * -x;
} else if (z <= 1.75e-167) {
tmp = y * ((z * x) / sqrt((a * -t)));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
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.6d-10)) then
tmp = y * -x
else if (z <= 1.75d-167) then
tmp = y * ((z * x) / sqrt((a * -t)))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
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.6e-10) {
tmp = y * -x;
} else if (z <= 1.75e-167) {
tmp = y * ((z * x) / Math.sqrt((a * -t)));
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5.6e-10: tmp = y * -x elif z <= 1.75e-167: tmp = y * ((z * x) / math.sqrt((a * -t))) else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) 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.6e-10) tmp = Float64(y * Float64(-x)); elseif (z <= 1.75e-167) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); 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.6e-10)
tmp = y * -x;
elseif (z <= 1.75e-167)
tmp = y * ((z * x) / sqrt((a * -t)));
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
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.6e-10], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.75e-167], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.6 \cdot 10^{-10}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-167}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -5.60000000000000031e-10Initial program 45.4%
*-commutative45.4%
associate-*l*42.6%
associate-*r/47.4%
Simplified47.4%
Taylor expanded in z around -inf 98.7%
neg-mul-198.7%
Simplified98.7%
if -5.60000000000000031e-10 < z < 1.75e-167Initial program 73.8%
*-commutative73.8%
associate-*l*78.6%
associate-*r/82.5%
Simplified82.5%
Taylor expanded in z around 0 73.0%
associate-*r*73.0%
neg-mul-173.0%
Simplified73.0%
if 1.75e-167 < z Initial program 55.2%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in z around inf 80.4%
unpow280.4%
associate-/l*88.8%
Simplified88.8%
Final simplification87.1%
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.32e-198)
(* y (- x))
(if (<= z 1.25e+49)
(* y (/ (* z x) (+ 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.32e-198) {
tmp = y * -x;
} else if (z <= 1.25e+49) {
tmp = y * ((z * x) / (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.32d-198)) then
tmp = y * -x
else if (z <= 1.25d+49) then
tmp = y * ((z * x) / (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.32e-198) {
tmp = y * -x;
} else if (z <= 1.25e+49) {
tmp = y * ((z * x) / (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.32e-198: tmp = y * -x elif z <= 1.25e+49: tmp = y * ((z * x) / (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.32e-198) tmp = Float64(y * Float64(-x)); elseif (z <= 1.25e+49) tmp = Float64(y * Float64(Float64(z * x) / 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.32e-198)
tmp = y * -x;
elseif (z <= 1.25e+49)
tmp = y * ((z * x) / (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.32e-198], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.25e+49], N[(y * N[(N[(z * x), $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.32 \cdot 10^{-198}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+49}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.3200000000000001e-198Initial program 55.6%
*-commutative55.6%
associate-*l*56.1%
associate-*r/60.1%
Simplified60.1%
Taylor expanded in z around -inf 83.1%
neg-mul-183.1%
Simplified83.1%
if -1.3200000000000001e-198 < z < 1.2500000000000001e49Initial program 74.8%
*-commutative74.8%
associate-*l*74.9%
associate-*r/79.0%
Simplified79.0%
Taylor expanded in z around inf 54.7%
if 1.2500000000000001e49 < z Initial program 40.4%
*-commutative40.4%
associate-*l*37.3%
associate-*r/40.5%
Simplified40.5%
Taylor expanded in z around inf 95.6%
Final simplification77.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.85e-198)
(* y (- x))
(if (<= z 6.3e+112)
(* z (/ (* y x) (+ 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.85e-198) {
tmp = y * -x;
} else if (z <= 6.3e+112) {
tmp = z * ((y * x) / (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.85d-198)) then
tmp = y * -x
else if (z <= 6.3d+112) then
tmp = z * ((y * x) / (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.85e-198) {
tmp = y * -x;
} else if (z <= 6.3e+112) {
tmp = z * ((y * x) / (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.85e-198: tmp = y * -x elif z <= 6.3e+112: tmp = z * ((y * x) / (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.85e-198) tmp = Float64(y * Float64(-x)); elseif (z <= 6.3e+112) tmp = Float64(z * Float64(Float64(y * x) / 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.85e-198)
tmp = y * -x;
elseif (z <= 6.3e+112)
tmp = z * ((y * x) / (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.85e-198], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 6.3e+112], N[(z * N[(N[(y * x), $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.85 \cdot 10^{-198}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{+112}:\\
\;\;\;\;z \cdot \frac{y \cdot x}{z + -0.5 \cdot \frac{t \cdot a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.84999999999999986e-198Initial program 55.6%
*-commutative55.6%
associate-*l*56.1%
associate-*r/60.1%
Simplified60.1%
Taylor expanded in z around -inf 83.1%
neg-mul-183.1%
Simplified83.1%
if -1.84999999999999986e-198 < z < 6.2999999999999997e112Initial program 76.8%
associate-*l/79.0%
Simplified79.0%
Taylor expanded in z around inf 59.3%
if 6.2999999999999997e112 < z Initial program 30.0%
*-commutative30.0%
associate-*l*28.0%
associate-*r/31.8%
Simplified31.8%
Taylor expanded in z around inf 98.3%
Final simplification77.9%
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 3.5e-138) (* y (* x (/ z (- (* 0.5 (/ (* 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 <= 3.5e-138) {
tmp = y * (x * (z / ((0.5 * ((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 <= 3.5d-138) then
tmp = y * (x * (z / ((0.5d0 * ((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 <= 3.5e-138) {
tmp = y * (x * (z / ((0.5 * ((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 <= 3.5e-138: tmp = y * (x * (z / ((0.5 * ((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 <= 3.5e-138) tmp = Float64(y * Float64(x * Float64(z / Float64(Float64(0.5 * Float64(Float64(t * a) / 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 <= 3.5e-138)
tmp = y * (x * (z / ((0.5 * ((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, 3.5e-138], N[(y * N[(x * N[(z / N[(N[(0.5 * N[(N[(t * a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $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 3.5 \cdot 10^{-138}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{0.5 \cdot \frac{t \cdot a}{z} - z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < 3.4999999999999999e-138Initial program 59.7%
*-commutative59.7%
associate-*l*60.1%
associate-*r/64.3%
Simplified64.3%
Taylor expanded in z around -inf 62.0%
Taylor expanded in x around 0 62.0%
fma-def62.0%
*-commutative62.0%
neg-mul-162.0%
associate-/l*60.9%
associate-/r/70.2%
*-commutative70.2%
fma-udef70.2%
unsub-neg70.2%
*-commutative70.2%
Simplified70.2%
if 3.4999999999999999e-138 < z Initial program 54.3%
*-commutative54.3%
associate-*l*52.1%
associate-*r/55.4%
Simplified55.4%
Taylor expanded in z around inf 85.7%
Final simplification75.9%
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.45e-198) (* y (- x)) (/ (* y x) (+ 1.0 (* -0.5 (/ a (/ (* z z) t)))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-198) {
tmp = y * -x;
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
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.45d-198)) then
tmp = y * -x
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
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.45e-198) {
tmp = y * -x;
} else {
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.45e-198: tmp = y * -x else: tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t)))) 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.45e-198) tmp = Float64(y * Float64(-x)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); 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.45e-198)
tmp = y * -x;
else
tmp = (y * x) / (1.0 + (-0.5 * (a / ((z * z) / t))));
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.45e-198], N[(y * (-x)), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.45 \cdot 10^{-198}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -1.45e-198Initial program 55.6%
*-commutative55.6%
associate-*l*56.1%
associate-*r/60.1%
Simplified60.1%
Taylor expanded in z around -inf 83.1%
neg-mul-183.1%
Simplified83.1%
if -1.45e-198 < z Initial program 59.4%
associate-/l*63.5%
Simplified63.5%
Taylor expanded in z around inf 66.4%
unpow266.4%
associate-/l*72.8%
Simplified72.8%
Final simplification77.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.85e-199) (* y (- x)) (if (<= z 1e-200) (* y (* z (/ 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.85e-199) {
tmp = y * -x;
} else if (z <= 1e-200) {
tmp = y * (z * (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.85d-199)) then
tmp = y * -x
else if (z <= 1d-200) then
tmp = y * (z * (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.85e-199) {
tmp = y * -x;
} else if (z <= 1e-200) {
tmp = y * (z * (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.85e-199: tmp = y * -x elif z <= 1e-200: tmp = y * (z * (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.85e-199) tmp = Float64(y * Float64(-x)); elseif (z <= 1e-200) tmp = Float64(y * Float64(z * Float64(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.85e-199)
tmp = y * -x;
elseif (z <= 1e-200)
tmp = y * (z * (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.85e-199], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1e-200], N[(y * N[(z * N[(z / x), $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.85 \cdot 10^{-199}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 10^{-200}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.85e-199Initial program 55.6%
*-commutative55.6%
associate-*l*56.1%
associate-*r/60.1%
Simplified60.1%
Taylor expanded in z around -inf 83.1%
neg-mul-183.1%
Simplified83.1%
if -1.85e-199 < z < 9.9999999999999998e-201Initial program 66.1%
*-commutative66.1%
associate-*l*66.4%
associate-*r/72.1%
Simplified72.1%
Taylor expanded in z around inf 32.8%
Applied egg-rr32.8%
if 9.9999999999999998e-201 < z Initial program 56.8%
*-commutative56.8%
associate-*l*54.8%
associate-*r/57.8%
Simplified57.8%
Taylor expanded in z around inf 81.6%
Final simplification74.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 -7.2e-200) (* y (- x)) (if (<= z 1.4e-143) (* y (* z (* 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 <= -7.2e-200) {
tmp = y * -x;
} else if (z <= 1.4e-143) {
tmp = y * (z * (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 <= (-7.2d-200)) then
tmp = y * -x
else if (z <= 1.4d-143) then
tmp = y * (z * (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 <= -7.2e-200) {
tmp = y * -x;
} else if (z <= 1.4e-143) {
tmp = y * (z * (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 <= -7.2e-200: tmp = y * -x elif z <= 1.4e-143: tmp = y * (z * (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 <= -7.2e-200) tmp = Float64(y * Float64(-x)); elseif (z <= 1.4e-143) tmp = Float64(y * Float64(z * Float64(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 <= -7.2e-200)
tmp = y * -x;
elseif (z <= 1.4e-143)
tmp = y * (z * (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, -7.2e-200], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.4e-143], N[(y * N[(z * N[(z * x), $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 -7.2 \cdot 10^{-200}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-143}:\\
\;\;\;\;y \cdot \left(z \cdot \left(z \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -7.2000000000000003e-200Initial program 55.6%
*-commutative55.6%
associate-*l*56.1%
associate-*r/60.1%
Simplified60.1%
Taylor expanded in z around -inf 83.1%
neg-mul-183.1%
Simplified83.1%
if -7.2000000000000003e-200 < z < 1.3999999999999999e-143Initial program 69.0%
*-commutative69.0%
associate-*l*69.1%
associate-*r/73.7%
Simplified73.7%
Taylor expanded in z around inf 36.7%
Applied egg-rr42.6%
if 1.3999999999999999e-143 < z Initial program 54.3%
*-commutative54.3%
associate-*l*52.1%
associate-*r/55.4%
Simplified55.4%
Taylor expanded in z around inf 85.7%
Final simplification76.1%
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.85e-198) (* y (- x)) (if (<= z 2.6e-140) (* z (* z (* 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 <= -1.85e-198) {
tmp = y * -x;
} else if (z <= 2.6e-140) {
tmp = z * (z * (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 <= (-1.85d-198)) then
tmp = y * -x
else if (z <= 2.6d-140) then
tmp = z * (z * (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 <= -1.85e-198) {
tmp = y * -x;
} else if (z <= 2.6e-140) {
tmp = z * (z * (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 <= -1.85e-198: tmp = y * -x elif z <= 2.6e-140: tmp = z * (z * (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 <= -1.85e-198) tmp = Float64(y * Float64(-x)); elseif (z <= 2.6e-140) tmp = Float64(z * Float64(z * Float64(y * 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.85e-198)
tmp = y * -x;
elseif (z <= 2.6e-140)
tmp = z * (z * (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, -1.85e-198], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.6e-140], N[(z * N[(z * N[(y * x), $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.85 \cdot 10^{-198}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-140}:\\
\;\;\;\;z \cdot \left(z \cdot \left(y \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.84999999999999986e-198Initial program 55.6%
*-commutative55.6%
associate-*l*56.1%
associate-*r/60.1%
Simplified60.1%
Taylor expanded in z around -inf 83.1%
neg-mul-183.1%
Simplified83.1%
if -1.84999999999999986e-198 < z < 2.5999999999999998e-140Initial program 69.0%
Taylor expanded in z around -inf 32.1%
neg-mul-132.1%
Simplified32.1%
Applied egg-rr44.6%
if 2.5999999999999998e-140 < z Initial program 54.3%
*-commutative54.3%
associate-*l*52.1%
associate-*r/55.4%
Simplified55.4%
Taylor expanded in z around inf 85.7%
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 -8.5e-307) (* 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 <= -8.5e-307) {
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 <= (-8.5d-307)) 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 <= -8.5e-307) {
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 <= -8.5e-307: 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 <= -8.5e-307) 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 <= -8.5e-307)
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, -8.5e-307], 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 -8.5 \cdot 10^{-307}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -8.4999999999999995e-307Initial program 57.1%
*-commutative57.1%
associate-*l*56.8%
associate-*r/61.4%
Simplified61.4%
Taylor expanded in z around -inf 76.1%
neg-mul-176.1%
Simplified76.1%
if -8.4999999999999995e-307 < z Initial program 58.4%
*-commutative58.4%
associate-*l*57.5%
associate-*r/60.6%
Simplified60.6%
Taylor expanded in z around inf 68.8%
Final simplification72.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 (* 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 57.7%
*-commutative57.7%
associate-*l*57.2%
associate-*r/61.0%
Simplified61.0%
Taylor expanded in z around inf 41.3%
Final simplification41.3%
(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 2023171
(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)))))