
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* a t)))) (t_2 (* x (- y))))
(if (<= z -8.8e+114)
t_2
(if (<= z -3.3e-147)
(* (/ x t_1) (* z y))
(if (<= z -3.35e-180)
t_2
(if (<= z 3.2e+26) (* y (/ (* z x) t_1)) (* x y)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double t_2 = x * -y;
double tmp;
if (z <= -8.8e+114) {
tmp = t_2;
} else if (z <= -3.3e-147) {
tmp = (x / t_1) * (z * y);
} else if (z <= -3.35e-180) {
tmp = t_2;
} else if (z <= 3.2e+26) {
tmp = y * ((z * x) / t_1);
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(((z * z) - (a * t)))
t_2 = x * -y
if (z <= (-8.8d+114)) then
tmp = t_2
else if (z <= (-3.3d-147)) then
tmp = (x / t_1) * (z * y)
else if (z <= (-3.35d-180)) then
tmp = t_2
else if (z <= 3.2d+26) then
tmp = y * ((z * x) / t_1)
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (a * t)));
double t_2 = x * -y;
double tmp;
if (z <= -8.8e+114) {
tmp = t_2;
} else if (z <= -3.3e-147) {
tmp = (x / t_1) * (z * y);
} else if (z <= -3.35e-180) {
tmp = t_2;
} else if (z <= 3.2e+26) {
tmp = y * ((z * x) / t_1);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (a * t))) t_2 = x * -y tmp = 0 if z <= -8.8e+114: tmp = t_2 elif z <= -3.3e-147: tmp = (x / t_1) * (z * y) elif z <= -3.35e-180: tmp = t_2 elif z <= 3.2e+26: tmp = y * ((z * x) / t_1) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) t_2 = Float64(x * Float64(-y)) tmp = 0.0 if (z <= -8.8e+114) tmp = t_2; elseif (z <= -3.3e-147) tmp = Float64(Float64(x / t_1) * Float64(z * y)); elseif (z <= -3.35e-180) tmp = t_2; elseif (z <= 3.2e+26) tmp = Float64(y * Float64(Float64(z * x) / t_1)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (a * t)));
t_2 = x * -y;
tmp = 0.0;
if (z <= -8.8e+114)
tmp = t_2;
elseif (z <= -3.3e-147)
tmp = (x / t_1) * (z * y);
elseif (z <= -3.35e-180)
tmp = t_2;
elseif (z <= 3.2e+26)
tmp = y * ((z * x) / t_1);
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -8.8e+114], t$95$2, If[LessEqual[z, -3.3e-147], N[(N[(x / t$95$1), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.35e-180], t$95$2, If[LessEqual[z, 3.2e+26], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
t_2 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{+114}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-147}:\\
\;\;\;\;\frac{x}{t_1} \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+26}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -8.8000000000000001e114 or -3.29999999999999987e-147 < z < -3.3499999999999999e-180Initial program 27.2%
*-commutative27.2%
associate-*l*26.4%
associate-*r/28.4%
Simplified28.4%
Taylor expanded in z around -inf 94.9%
neg-mul-194.9%
Simplified94.9%
if -8.8000000000000001e114 < z < -3.29999999999999987e-147Initial program 90.8%
*-commutative90.8%
associate-*l*89.3%
associate-*r/91.9%
Simplified91.9%
*-commutative91.9%
associate-/l*94.5%
associate-/r/95.7%
associate-/l/89.6%
*-commutative89.6%
Applied egg-rr89.6%
associate-/r/89.4%
Applied egg-rr89.4%
if -3.3499999999999999e-180 < z < 3.20000000000000029e26Initial program 77.8%
*-commutative77.8%
associate-*l*74.1%
associate-*r/75.6%
Simplified75.6%
if 3.20000000000000029e26 < z Initial program 36.8%
*-commutative36.8%
associate-*l*34.8%
associate-*r/35.1%
Simplified35.1%
Taylor expanded in z around inf 96.9%
Final simplification88.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* a t)))) (t_2 (* x (- y))))
(if (<= z -5.3e+106)
t_2
(if (<= z -3.3e-147)
(* z (* y (/ x t_1)))
(if (<= z -3.35e-180)
t_2
(if (<= z 3.8e+26) (* y (/ (* z x) t_1)) (* x y)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double t_2 = x * -y;
double tmp;
if (z <= -5.3e+106) {
tmp = t_2;
} else if (z <= -3.3e-147) {
tmp = z * (y * (x / t_1));
} else if (z <= -3.35e-180) {
tmp = t_2;
} else if (z <= 3.8e+26) {
tmp = y * ((z * x) / t_1);
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(((z * z) - (a * t)))
t_2 = x * -y
if (z <= (-5.3d+106)) then
tmp = t_2
else if (z <= (-3.3d-147)) then
tmp = z * (y * (x / t_1))
else if (z <= (-3.35d-180)) then
tmp = t_2
else if (z <= 3.8d+26) then
tmp = y * ((z * x) / t_1)
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (a * t)));
double t_2 = x * -y;
double tmp;
if (z <= -5.3e+106) {
tmp = t_2;
} else if (z <= -3.3e-147) {
tmp = z * (y * (x / t_1));
} else if (z <= -3.35e-180) {
tmp = t_2;
} else if (z <= 3.8e+26) {
tmp = y * ((z * x) / t_1);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (a * t))) t_2 = x * -y tmp = 0 if z <= -5.3e+106: tmp = t_2 elif z <= -3.3e-147: tmp = z * (y * (x / t_1)) elif z <= -3.35e-180: tmp = t_2 elif z <= 3.8e+26: tmp = y * ((z * x) / t_1) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) t_2 = Float64(x * Float64(-y)) tmp = 0.0 if (z <= -5.3e+106) tmp = t_2; elseif (z <= -3.3e-147) tmp = Float64(z * Float64(y * Float64(x / t_1))); elseif (z <= -3.35e-180) tmp = t_2; elseif (z <= 3.8e+26) tmp = Float64(y * Float64(Float64(z * x) / t_1)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (a * t)));
t_2 = x * -y;
tmp = 0.0;
if (z <= -5.3e+106)
tmp = t_2;
elseif (z <= -3.3e-147)
tmp = z * (y * (x / t_1));
elseif (z <= -3.35e-180)
tmp = t_2;
elseif (z <= 3.8e+26)
tmp = y * ((z * x) / t_1);
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -5.3e+106], t$95$2, If[LessEqual[z, -3.3e-147], N[(z * N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.35e-180], t$95$2, If[LessEqual[z, 3.8e+26], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
t_2 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -5.3 \cdot 10^{+106}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-147}:\\
\;\;\;\;z \cdot \left(y \cdot \frac{x}{t_1}\right)\\
\mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+26}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -5.3e106 or -3.29999999999999987e-147 < z < -3.3499999999999999e-180Initial program 30.5%
*-commutative30.5%
associate-*l*29.8%
associate-*r/33.1%
Simplified33.1%
Taylor expanded in z around -inf 95.2%
neg-mul-195.2%
Simplified95.2%
if -5.3e106 < z < -3.29999999999999987e-147Initial program 91.6%
associate-*l/93.5%
Simplified93.5%
associate-/l*93.5%
associate-/r/90.6%
Applied egg-rr90.6%
if -3.3499999999999999e-180 < z < 3.8000000000000002e26Initial program 77.8%
*-commutative77.8%
associate-*l*74.1%
associate-*r/75.6%
Simplified75.6%
if 3.8000000000000002e26 < z Initial program 36.8%
*-commutative36.8%
associate-*l*34.8%
associate-*r/35.1%
Simplified35.1%
Taylor expanded in z around inf 96.9%
Final simplification89.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.4e+19) (* x (- y)) (if (<= z 2.15e+26) (* y (/ (* z x) (sqrt (- (* z z) (* a t))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e+19) {
tmp = x * -y;
} else if (z <= 2.15e+26) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.4d+19)) then
tmp = x * -y
else if (z <= 2.15d+26) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e+19) {
tmp = x * -y;
} else if (z <= 2.15e+26) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.4e+19: tmp = x * -y elif z <= 2.15e+26: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e+19) tmp = Float64(x * Float64(-y)); elseif (z <= 2.15e+26) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.4e+19)
tmp = x * -y;
elseif (z <= 2.15e+26)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e+19], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.15e+26], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+26}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.4e19Initial program 50.7%
*-commutative50.7%
associate-*l*49.4%
associate-*r/52.9%
Simplified52.9%
Taylor expanded in z around -inf 92.0%
neg-mul-192.0%
Simplified92.0%
if -1.4e19 < z < 2.1499999999999999e26Initial program 81.5%
*-commutative81.5%
associate-*l*79.0%
associate-*r/79.9%
Simplified79.9%
if 2.1499999999999999e26 < z Initial program 36.8%
*-commutative36.8%
associate-*l*34.8%
associate-*r/35.1%
Simplified35.1%
Taylor expanded in z around inf 96.9%
Final simplification87.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.4e+154) (* (fma -0.5 (* (/ a z) (/ t z)) -1.0) (* x y)) (if (<= z 3.8e+26) (* (/ z (sqrt (- (* z z) (* a t)))) (* x y)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e+154) {
tmp = fma(-0.5, ((a / z) * (t / z)), -1.0) * (x * y);
} else if (z <= 3.8e+26) {
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = x * y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e+154) tmp = Float64(fma(-0.5, Float64(Float64(a / z) * Float64(t / z)), -1.0) * Float64(x * y)); elseif (z <= 3.8e+26) tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * y)); else tmp = Float64(x * y); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e+154], N[(N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+26], N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{a}{z} \cdot \frac{t}{z}, -1\right) \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+26}:\\
\;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.4e154Initial program 10.0%
associate-/l*10.6%
Simplified10.6%
clear-num10.6%
associate-/r/10.6%
clear-num10.6%
Applied egg-rr10.6%
Taylor expanded in z around -inf 83.8%
fma-neg83.8%
unpow283.8%
times-frac100.0%
metadata-eval100.0%
Simplified100.0%
if -1.4e154 < z < 3.8000000000000002e26Initial program 81.7%
associate-/l*84.9%
Simplified84.9%
clear-num84.5%
associate-/r/84.9%
clear-num84.9%
Applied egg-rr84.9%
if 3.8000000000000002e26 < z Initial program 36.8%
*-commutative36.8%
associate-*l*34.8%
associate-*r/35.1%
Simplified35.1%
Taylor expanded in z around inf 96.9%
Final simplification89.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1e+121) (* x (- y)) (if (<= z 3.4e+26) (* (/ z (sqrt (- (* z z) (* a t)))) (* x y)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+121) {
tmp = x * -y;
} else if (z <= 3.4e+26) {
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1d+121)) then
tmp = x * -y
else if (z <= 3.4d+26) then
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y)
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1e+121) {
tmp = x * -y;
} else if (z <= 3.4e+26) {
tmp = (z / Math.sqrt(((z * z) - (a * t)))) * (x * y);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1e+121: tmp = x * -y elif z <= 3.4e+26: tmp = (z / math.sqrt(((z * z) - (a * t)))) * (x * y) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1e+121) tmp = Float64(x * Float64(-y)); elseif (z <= 3.4e+26) tmp = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(x * y)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1e+121)
tmp = x * -y;
elseif (z <= 3.4e+26)
tmp = (z / sqrt(((z * z) - (a * t)))) * (x * y);
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+121], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.4e+26], N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+121}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+26}:\\
\;\;\;\;\frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.00000000000000004e121Initial program 27.6%
*-commutative27.6%
associate-*l*27.4%
associate-*r/29.5%
Simplified29.5%
Taylor expanded in z around -inf 95.7%
neg-mul-195.7%
Simplified95.7%
if -1.00000000000000004e121 < z < 3.4000000000000003e26Initial program 82.0%
associate-/l*84.9%
Simplified84.9%
clear-num84.4%
associate-/r/84.9%
clear-num84.9%
Applied egg-rr84.9%
if 3.4000000000000003e26 < z Initial program 36.8%
*-commutative36.8%
associate-*l*34.8%
associate-*r/35.1%
Simplified35.1%
Taylor expanded in z around inf 96.9%
Final simplification89.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.7e+56)
(* x (- y))
(if (<= z -3.35e-180)
(/ (* x y) (/ (- (* 0.5 (/ (* a t) z)) z) z))
(if (<= z 7.2e-106)
(* y (/ (* z x) (sqrt (* a (- t)))))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t)))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+56) {
tmp = x * -y;
} else if (z <= -3.35e-180) {
tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
} else if (z <= 7.2e-106) {
tmp = y * ((z * x) / sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.7d+56)) then
tmp = x * -y
else if (z <= (-3.35d-180)) then
tmp = (x * y) / (((0.5d0 * ((a * t) / z)) - z) / z)
else if (z <= 7.2d-106) then
tmp = y * ((z * x) / sqrt((a * -t)))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+56) {
tmp = x * -y;
} else if (z <= -3.35e-180) {
tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
} else if (z <= 7.2e-106) {
tmp = y * ((z * x) / Math.sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.7e+56: tmp = x * -y elif z <= -3.35e-180: tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z) elif z <= 7.2e-106: tmp = y * ((z * x) / math.sqrt((a * -t))) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+56) tmp = Float64(x * Float64(-y)); elseif (z <= -3.35e-180) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z) / z)); elseif (z <= 7.2e-106) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.7e+56)
tmp = x * -y;
elseif (z <= -3.35e-180)
tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
elseif (z <= 7.2e-106)
tmp = y * ((z * x) / sqrt((a * -t)));
else
tmp = (x * y) / (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. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+56], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -3.35e-180], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e-106], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -3.35 \cdot 10^{-180}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \frac{a \cdot t}{z} - z}{z}}\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{-106}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -3.69999999999999997e56Initial program 44.2%
*-commutative44.2%
associate-*l*44.0%
associate-*r/47.9%
Simplified47.9%
Taylor expanded in z around -inf 92.2%
neg-mul-192.2%
Simplified92.2%
if -3.69999999999999997e56 < z < -3.3499999999999999e-180Initial program 89.5%
associate-/l*89.7%
Simplified89.7%
Taylor expanded in z around -inf 83.9%
if -3.3499999999999999e-180 < z < 7.20000000000000025e-106Initial program 64.6%
*-commutative64.6%
associate-*l*58.3%
associate-*r/60.8%
Simplified60.8%
Taylor expanded in z around 0 60.8%
associate-*r*60.8%
neg-mul-160.8%
Simplified60.8%
if 7.20000000000000025e-106 < z Initial program 55.6%
associate-/l*57.1%
Simplified57.1%
Taylor expanded in z around inf 84.7%
unpow284.7%
associate-/l*89.4%
Simplified89.4%
Final simplification84.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (- y))))
(if (<= z -210000.0)
t_1
(if (<= z -9e-132)
(* y (/ z (/ (- (* 0.5 (* a (/ t z))) z) x)))
(if (<= z -2.2e-195)
t_1
(if (<= z 2.1e+23)
(* y (/ (* z x) (+ z (* -0.5 (/ (* a t) z)))))
(* x y)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = x * -y;
double tmp;
if (z <= -210000.0) {
tmp = t_1;
} else if (z <= -9e-132) {
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
} else if (z <= -2.2e-195) {
tmp = t_1;
} else if (z <= 2.1e+23) {
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x * -y
if (z <= (-210000.0d0)) then
tmp = t_1
else if (z <= (-9d-132)) then
tmp = y * (z / (((0.5d0 * (a * (t / z))) - z) / x))
else if (z <= (-2.2d-195)) then
tmp = t_1
else if (z <= 2.1d+23) then
tmp = y * ((z * x) / (z + ((-0.5d0) * ((a * t) / z))))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * -y;
double tmp;
if (z <= -210000.0) {
tmp = t_1;
} else if (z <= -9e-132) {
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
} else if (z <= -2.2e-195) {
tmp = t_1;
} else if (z <= 2.1e+23) {
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = x * -y tmp = 0 if z <= -210000.0: tmp = t_1 elif z <= -9e-132: tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x)) elif z <= -2.2e-195: tmp = t_1 elif z <= 2.1e+23: tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(x * Float64(-y)) tmp = 0.0 if (z <= -210000.0) tmp = t_1; elseif (z <= -9e-132) tmp = Float64(y * Float64(z / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / x))); elseif (z <= -2.2e-195) tmp = t_1; elseif (z <= 2.1e+23) tmp = Float64(y * Float64(Float64(z * x) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / z))))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = x * -y;
tmp = 0.0;
if (z <= -210000.0)
tmp = t_1;
elseif (z <= -9e-132)
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
elseif (z <= -2.2e-195)
tmp = t_1;
elseif (z <= 2.1e+23)
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -210000.0], t$95$1, If[LessEqual[z, -9e-132], N[(y * N[(z / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-195], t$95$1, If[LessEqual[z, 2.1e+23], N[(y * N[(N[(z * x), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -210000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-132}:\\
\;\;\;\;y \cdot \frac{z}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{x}}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-195}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+23}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.1e5 or -8.9999999999999999e-132 < z < -2.20000000000000005e-195Initial program 52.6%
*-commutative52.6%
associate-*l*50.1%
associate-*r/53.1%
Simplified53.1%
Taylor expanded in z around -inf 89.5%
neg-mul-189.5%
Simplified89.5%
if -2.1e5 < z < -8.9999999999999999e-132Initial program 96.8%
*-commutative96.8%
associate-*l*96.7%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in z around -inf 82.5%
Taylor expanded in x around 0 82.5%
associate-/l*82.2%
neg-mul-182.2%
+-commutative82.2%
neg-mul-182.2%
neg-mul-182.2%
+-commutative82.2%
associate-*r/82.2%
unsub-neg82.2%
Simplified82.2%
if -2.20000000000000005e-195 < z < 2.1000000000000001e23Initial program 77.5%
*-commutative77.5%
associate-*l*75.2%
associate-*r/76.7%
Simplified76.7%
Taylor expanded in z around inf 49.9%
if 2.1000000000000001e23 < z Initial program 36.8%
*-commutative36.8%
associate-*l*34.8%
associate-*r/35.1%
Simplified35.1%
Taylor expanded in z around inf 96.9%
Final simplification80.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (- y))))
(if (<= z -180000.0)
t_1
(if (<= z -3e-135)
(* y (/ z (/ (- (* 0.5 (* a (/ t z))) z) x)))
(if (<= z -2.05e-194)
t_1
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = x * -y;
double tmp;
if (z <= -180000.0) {
tmp = t_1;
} else if (z <= -3e-135) {
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
} else if (z <= -2.05e-194) {
tmp = t_1;
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x * -y
if (z <= (-180000.0d0)) then
tmp = t_1
else if (z <= (-3d-135)) then
tmp = y * (z / (((0.5d0 * (a * (t / z))) - z) / x))
else if (z <= (-2.05d-194)) then
tmp = t_1
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * -y;
double tmp;
if (z <= -180000.0) {
tmp = t_1;
} else if (z <= -3e-135) {
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
} else if (z <= -2.05e-194) {
tmp = t_1;
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = x * -y tmp = 0 if z <= -180000.0: tmp = t_1 elif z <= -3e-135: tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x)) elif z <= -2.05e-194: tmp = t_1 else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(x * Float64(-y)) tmp = 0.0 if (z <= -180000.0) tmp = t_1; elseif (z <= -3e-135) tmp = Float64(y * Float64(z / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / x))); elseif (z <= -2.05e-194) tmp = t_1; else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = x * -y;
tmp = 0.0;
if (z <= -180000.0)
tmp = t_1;
elseif (z <= -3e-135)
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
elseif (z <= -2.05e-194)
tmp = t_1;
else
tmp = (x * y) / (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.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -180000.0], t$95$1, If[LessEqual[z, -3e-135], N[(y * N[(z / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.05e-194], t$95$1, N[(N[(x * y), $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])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -180000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-135}:\\
\;\;\;\;y \cdot \frac{z}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{x}}\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-194}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -1.8e5 or -3.00000000000000012e-135 < z < -2.0500000000000001e-194Initial program 52.6%
*-commutative52.6%
associate-*l*50.1%
associate-*r/53.1%
Simplified53.1%
Taylor expanded in z around -inf 89.5%
neg-mul-189.5%
Simplified89.5%
if -1.8e5 < z < -3.00000000000000012e-135Initial program 96.8%
*-commutative96.8%
associate-*l*96.7%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in z around -inf 82.5%
Taylor expanded in x around 0 82.5%
associate-/l*82.2%
neg-mul-182.2%
+-commutative82.2%
neg-mul-182.2%
neg-mul-182.2%
+-commutative82.2%
associate-*r/82.2%
unsub-neg82.2%
Simplified82.2%
if -2.0500000000000001e-194 < z Initial program 58.1%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in z around inf 67.2%
unpow267.2%
associate-/l*71.3%
Simplified71.3%
Final simplification79.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (- y))))
(if (<= z -2.05e+49)
t_1
(if (<= z -9.2e-137)
(/ (* z (* x y)) (- (* 0.5 (* a (/ t z))) z))
(if (<= z -9e-195)
t_1
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = x * -y;
double tmp;
if (z <= -2.05e+49) {
tmp = t_1;
} else if (z <= -9.2e-137) {
tmp = (z * (x * y)) / ((0.5 * (a * (t / z))) - z);
} else if (z <= -9e-195) {
tmp = t_1;
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x * -y
if (z <= (-2.05d+49)) then
tmp = t_1
else if (z <= (-9.2d-137)) then
tmp = (z * (x * y)) / ((0.5d0 * (a * (t / z))) - z)
else if (z <= (-9d-195)) then
tmp = t_1
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * -y;
double tmp;
if (z <= -2.05e+49) {
tmp = t_1;
} else if (z <= -9.2e-137) {
tmp = (z * (x * y)) / ((0.5 * (a * (t / z))) - z);
} else if (z <= -9e-195) {
tmp = t_1;
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = x * -y tmp = 0 if z <= -2.05e+49: tmp = t_1 elif z <= -9.2e-137: tmp = (z * (x * y)) / ((0.5 * (a * (t / z))) - z) elif z <= -9e-195: tmp = t_1 else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(x * Float64(-y)) tmp = 0.0 if (z <= -2.05e+49) tmp = t_1; elseif (z <= -9.2e-137) tmp = Float64(Float64(z * Float64(x * y)) / Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z)); elseif (z <= -9e-195) tmp = t_1; else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = x * -y;
tmp = 0.0;
if (z <= -2.05e+49)
tmp = t_1;
elseif (z <= -9.2e-137)
tmp = (z * (x * y)) / ((0.5 * (a * (t / z))) - z);
elseif (z <= -9e-195)
tmp = t_1;
else
tmp = (x * y) / (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.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[z, -2.05e+49], t$95$1, If[LessEqual[z, -9.2e-137], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9e-195], t$95$1, N[(N[(x * y), $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])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-137}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-195}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -2.05e49 or -9.20000000000000032e-137 < z < -9e-195Initial program 44.7%
*-commutative44.7%
associate-*l*43.0%
associate-*r/46.5%
Simplified46.5%
Taylor expanded in z around -inf 89.9%
neg-mul-189.9%
Simplified89.9%
if -2.05e49 < z < -9.20000000000000032e-137Initial program 97.7%
*-commutative97.7%
associate-*l*95.5%
associate-*r/95.6%
Simplified95.6%
Taylor expanded in z around -inf 82.6%
Taylor expanded in y around 0 82.4%
fma-def82.4%
associate-*r/82.4%
neg-mul-182.4%
associate-*r*83.0%
*-commutative83.0%
associate-*r*84.7%
fma-udef84.7%
unsub-neg84.7%
Simplified84.7%
if -9e-195 < z Initial program 58.1%
associate-/l*59.3%
Simplified59.3%
Taylor expanded in z around inf 67.2%
unpow267.2%
associate-/l*71.3%
Simplified71.3%
Final simplification79.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -200000.0) (* x (- y)) (if (<= z 2.2e-176) (* y (/ z (/ (- (* 0.5 (* a (/ t z))) z) x))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -200000.0) {
tmp = x * -y;
} else if (z <= 2.2e-176) {
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-200000.0d0)) then
tmp = x * -y
else if (z <= 2.2d-176) then
tmp = y * (z / (((0.5d0 * (a * (t / z))) - z) / x))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -200000.0) {
tmp = x * -y;
} else if (z <= 2.2e-176) {
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -200000.0: tmp = x * -y elif z <= 2.2e-176: tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -200000.0) tmp = Float64(x * Float64(-y)); elseif (z <= 2.2e-176) tmp = Float64(y * Float64(z / Float64(Float64(Float64(0.5 * Float64(a * Float64(t / z))) - z) / x))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -200000.0)
tmp = x * -y;
elseif (z <= 2.2e-176)
tmp = y * (z / (((0.5 * (a * (t / z))) - z) / x));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -200000.0], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.2e-176], N[(y * N[(z / N[(N[(N[(0.5 * N[(a * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -200000:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-176}:\\
\;\;\;\;y \cdot \frac{z}{\frac{0.5 \cdot \left(a \cdot \frac{t}{z}\right) - z}{x}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2e5Initial program 53.5%
*-commutative53.5%
associate-*l*52.2%
associate-*r/55.5%
Simplified55.5%
Taylor expanded in z around -inf 91.4%
neg-mul-191.4%
Simplified91.4%
if -2e5 < z < 2.1999999999999999e-176Initial program 77.0%
*-commutative77.0%
associate-*l*71.8%
associate-*r/73.1%
Simplified73.1%
Taylor expanded in z around -inf 56.5%
Taylor expanded in x around 0 56.5%
associate-/l*59.3%
neg-mul-159.3%
+-commutative59.3%
neg-mul-159.3%
neg-mul-159.3%
+-commutative59.3%
associate-*r/59.5%
unsub-neg59.5%
Simplified59.5%
if 2.1999999999999999e-176 < z Initial program 55.5%
*-commutative55.5%
associate-*l*55.2%
associate-*r/55.5%
Simplified55.5%
Taylor expanded in z around inf 82.1%
Final simplification79.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e+51)
(* x (- y))
(if (<= z 1.45e-282)
(* z (/ (* x y) (- (* 0.5 (/ (* a t) z)) z)))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+51) {
tmp = x * -y;
} else if (z <= 1.45e-282) {
tmp = z * ((x * y) / ((0.5 * ((a * t) / z)) - z));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.2d+51)) then
tmp = x * -y
else if (z <= 1.45d-282) then
tmp = z * ((x * y) / ((0.5d0 * ((a * t) / z)) - z))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+51) {
tmp = x * -y;
} else if (z <= 1.45e-282) {
tmp = z * ((x * y) / ((0.5 * ((a * t) / z)) - z));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+51: tmp = x * -y elif z <= 1.45e-282: tmp = z * ((x * y) / ((0.5 * ((a * t) / z)) - z)) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+51) tmp = Float64(x * Float64(-y)); elseif (z <= 1.45e-282) tmp = Float64(z * Float64(Float64(x * y) / Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.2e+51)
tmp = x * -y;
elseif (z <= 1.45e-282)
tmp = z * ((x * y) / ((0.5 * ((a * t) / z)) - z));
else
tmp = (x * y) / (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. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+51], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.45e-282], N[(z * N[(N[(x * y), $MachinePrecision] / N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+51}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-282}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{0.5 \cdot \frac{a \cdot t}{z} - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -5.2000000000000002e51Initial program 44.9%
*-commutative44.9%
associate-*l*44.7%
associate-*r/48.5%
Simplified48.5%
Taylor expanded in z around -inf 92.3%
neg-mul-192.3%
Simplified92.3%
if -5.2000000000000002e51 < z < 1.44999999999999999e-282Initial program 83.1%
associate-*l/81.1%
Simplified81.1%
Taylor expanded in z around -inf 68.5%
if 1.44999999999999999e-282 < z Initial program 56.9%
associate-/l*58.4%
Simplified58.4%
Taylor expanded in z around inf 74.0%
unpow274.0%
associate-/l*77.9%
Simplified77.9%
Final simplification79.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.5e+56)
(* x (- y))
(if (<= z 3.2e-297)
(/ (* x y) (/ (- (* 0.5 (/ (* a t) z)) z) z))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+56) {
tmp = x * -y;
} else if (z <= 3.2e-297) {
tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-6.5d+56)) then
tmp = x * -y
else if (z <= 3.2d-297) then
tmp = (x * y) / (((0.5d0 * ((a * t) / z)) - z) / z)
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+56) {
tmp = x * -y;
} else if (z <= 3.2e-297) {
tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+56: tmp = x * -y elif z <= 3.2e-297: tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+56) tmp = Float64(x * Float64(-y)); elseif (z <= 3.2e-297) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(0.5 * Float64(Float64(a * t) / z)) - z) / z)); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -6.5e+56)
tmp = x * -y;
elseif (z <= 3.2e-297)
tmp = (x * y) / (((0.5 * ((a * t) / z)) - z) / z);
else
tmp = (x * y) / (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. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+56], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.2e-297], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-297}:\\
\;\;\;\;\frac{x \cdot y}{\frac{0.5 \cdot \frac{a \cdot t}{z} - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -6.5000000000000001e56Initial program 44.2%
*-commutative44.2%
associate-*l*44.0%
associate-*r/47.9%
Simplified47.9%
Taylor expanded in z around -inf 92.2%
neg-mul-192.2%
Simplified92.2%
if -6.5000000000000001e56 < z < 3.19999999999999972e-297Initial program 85.5%
associate-/l*85.6%
Simplified85.6%
Taylor expanded in z around -inf 72.2%
if 3.19999999999999972e-297 < z Initial program 55.9%
associate-/l*57.4%
Simplified57.4%
Taylor expanded in z around inf 72.6%
unpow272.6%
associate-/l*76.4%
Simplified76.4%
Final simplification79.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4e-44) (* x (- y)) (if (<= z 6.6e-173) (/ (* y (* z x)) (- z)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-44) {
tmp = x * -y;
} else if (z <= 6.6e-173) {
tmp = (y * (z * x)) / -z;
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4d-44)) then
tmp = x * -y
else if (z <= 6.6d-173) then
tmp = (y * (z * x)) / -z
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-44) {
tmp = x * -y;
} else if (z <= 6.6e-173) {
tmp = (y * (z * x)) / -z;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4e-44: tmp = x * -y elif z <= 6.6e-173: tmp = (y * (z * x)) / -z else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e-44) tmp = Float64(x * Float64(-y)); elseif (z <= 6.6e-173) tmp = Float64(Float64(y * Float64(z * x)) / Float64(-z)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4e-44)
tmp = x * -y;
elseif (z <= 6.6e-173)
tmp = (y * (z * x)) / -z;
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e-44], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 6.6e-173], N[(N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-44}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-173}:\\
\;\;\;\;\frac{y \cdot \left(z \cdot x\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.99999999999999981e-44Initial program 56.8%
*-commutative56.8%
associate-*l*55.6%
associate-*r/58.7%
Simplified58.7%
Taylor expanded in z around -inf 91.1%
neg-mul-191.1%
Simplified91.1%
if -3.99999999999999981e-44 < z < 6.6000000000000006e-173Initial program 74.5%
Taylor expanded in z around -inf 45.2%
neg-mul-145.2%
Simplified45.2%
Taylor expanded in x around 0 45.2%
if 6.6000000000000006e-173 < z Initial program 55.5%
*-commutative55.5%
associate-*l*55.2%
associate-*r/55.5%
Simplified55.5%
Taylor expanded in z around inf 82.1%
Final simplification76.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5e-290) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-290) {
tmp = x * -y;
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5d-290)) then
tmp = x * -y
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-290) {
tmp = x * -y;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -5e-290: tmp = x * -y else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e-290) tmp = Float64(x * Float64(-y)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5e-290)
tmp = x * -y;
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-290], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-290}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -5.0000000000000001e-290Initial program 63.7%
*-commutative63.7%
associate-*l*60.0%
associate-*r/62.7%
Simplified62.7%
Taylor expanded in z around -inf 77.7%
neg-mul-177.7%
Simplified77.7%
if -5.0000000000000001e-290 < z Initial program 57.1%
*-commutative57.1%
associate-*l*57.3%
associate-*r/57.5%
Simplified57.5%
Taylor expanded in z around inf 71.3%
Final simplification74.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x y))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return x * y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x * y
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return x * y;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return x * y
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(x * y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = x * y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot y
\end{array}
Initial program 60.8%
*-commutative60.8%
associate-*l*58.8%
associate-*r/60.4%
Simplified60.4%
Taylor expanded in z around inf 40.7%
Final simplification40.7%
(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 2023196
(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)))))