
(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 13 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) (* t a)))))
(if (<= z -1.7e+84)
(* y (- x))
(if (<= z 7.5e-223)
(* y (/ (* z x) t_1))
(if (<= z 2.8e+106) (/ (* y x) (/ t_1 z)) (* y x))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (t * a)));
double tmp;
if (z <= -1.7e+84) {
tmp = y * -x;
} else if (z <= 7.5e-223) {
tmp = y * ((z * x) / t_1);
} else if (z <= 2.8e+106) {
tmp = (y * x) / (t_1 / z);
} else {
tmp = y * x;
}
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 = sqrt(((z * z) - (t * a)))
if (z <= (-1.7d+84)) then
tmp = y * -x
else if (z <= 7.5d-223) then
tmp = y * ((z * x) / t_1)
else if (z <= 2.8d+106) then
tmp = (y * x) / (t_1 / z)
else
tmp = y * x
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) - (t * a)));
double tmp;
if (z <= -1.7e+84) {
tmp = y * -x;
} else if (z <= 7.5e-223) {
tmp = y * ((z * x) / t_1);
} else if (z <= 2.8e+106) {
tmp = (y * x) / (t_1 / z);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (t * a))) tmp = 0 if z <= -1.7e+84: tmp = y * -x elif z <= 7.5e-223: tmp = y * ((z * x) / t_1) elif z <= 2.8e+106: tmp = (y * x) / (t_1 / z) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(t * a))) tmp = 0.0 if (z <= -1.7e+84) tmp = Float64(y * Float64(-x)); elseif (z <= 7.5e-223) tmp = Float64(y * Float64(Float64(z * x) / t_1)); elseif (z <= 2.8e+106) tmp = Float64(Float64(y * x) / Float64(t_1 / z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (t * a)));
tmp = 0.0;
if (z <= -1.7e+84)
tmp = y * -x;
elseif (z <= 7.5e-223)
tmp = y * ((z * x) / t_1);
elseif (z <= 2.8e+106)
tmp = (y * x) / (t_1 / z);
else
tmp = y * x;
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[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.7e+84], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 7.5e-223], N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+106], N[(N[(y * x), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+84}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-223}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{t_1}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+106}:\\
\;\;\;\;\frac{y \cdot x}{\frac{t_1}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.6999999999999999e84Initial program 38.6%
*-commutative38.6%
associate-*l*34.8%
associate-*r/38.3%
Simplified38.3%
Taylor expanded in z around -inf 98.3%
neg-mul-198.3%
Simplified98.3%
if -1.6999999999999999e84 < z < 7.50000000000000074e-223Initial program 87.5%
*-commutative87.5%
associate-*l*88.4%
associate-*r/90.8%
Simplified90.8%
if 7.50000000000000074e-223 < z < 2.79999999999999993e106Initial program 96.8%
associate-/l*98.3%
Simplified98.3%
if 2.79999999999999993e106 < z Initial program 31.6%
*-commutative31.6%
associate-*l*31.4%
associate-*r/33.3%
Simplified33.3%
Taylor expanded in z around inf 98.4%
Final simplification96.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 (sqrt (- (* z z) (* t a)))) (t_2 (* y (/ (* z x) t_1))))
(if (<= z -2.3e+86)
(* y (- x))
(if (<= z 1.1e-192)
t_2
(if (<= z 1.12e-46)
(* x (* z (/ y t_1)))
(if (<= z 1.25e+88)
t_2
(/ (* y x) (+ 1.0 (* -0.5 (* (/ t z) (/ a z)))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (t * a)));
double t_2 = y * ((z * x) / t_1);
double tmp;
if (z <= -2.3e+86) {
tmp = y * -x;
} else if (z <= 1.1e-192) {
tmp = t_2;
} else if (z <= 1.12e-46) {
tmp = x * (z * (y / t_1));
} else if (z <= 1.25e+88) {
tmp = t_2;
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
}
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) - (t * a)))
t_2 = y * ((z * x) / t_1)
if (z <= (-2.3d+86)) then
tmp = y * -x
else if (z <= 1.1d-192) then
tmp = t_2
else if (z <= 1.12d-46) then
tmp = x * (z * (y / t_1))
else if (z <= 1.25d+88) then
tmp = t_2
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((t / z) * (a / z))))
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) - (t * a)));
double t_2 = y * ((z * x) / t_1);
double tmp;
if (z <= -2.3e+86) {
tmp = y * -x;
} else if (z <= 1.1e-192) {
tmp = t_2;
} else if (z <= 1.12e-46) {
tmp = x * (z * (y / t_1));
} else if (z <= 1.25e+88) {
tmp = t_2;
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (t * a))) t_2 = y * ((z * x) / t_1) tmp = 0 if z <= -2.3e+86: tmp = y * -x elif z <= 1.1e-192: tmp = t_2 elif z <= 1.12e-46: tmp = x * (z * (y / t_1)) elif z <= 1.25e+88: tmp = t_2 else: tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(t * a))) t_2 = Float64(y * Float64(Float64(z * x) / t_1)) tmp = 0.0 if (z <= -2.3e+86) tmp = Float64(y * Float64(-x)); elseif (z <= 1.1e-192) tmp = t_2; elseif (z <= 1.12e-46) tmp = Float64(x * Float64(z * Float64(y / t_1))); elseif (z <= 1.25e+88) tmp = t_2; else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(t / z) * Float64(a / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (t * a)));
t_2 = y * ((z * x) / t_1);
tmp = 0.0;
if (z <= -2.3e+86)
tmp = y * -x;
elseif (z <= 1.1e-192)
tmp = t_2;
elseif (z <= 1.12e-46)
tmp = x * (z * (y / t_1));
elseif (z <= 1.25e+88)
tmp = t_2;
else
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
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[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+86], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.1e-192], t$95$2, If[LessEqual[z, 1.12e-46], N[(x * N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+88], t$95$2, N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(t / z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
t_2 := y \cdot \frac{z \cdot x}{t_1}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-192}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{-46}:\\
\;\;\;\;x \cdot \left(z \cdot \frac{y}{t_1}\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+88}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{t}{z} \cdot \frac{a}{z}\right)}\\
\end{array}
\end{array}
if z < -2.2999999999999999e86Initial program 38.6%
*-commutative38.6%
associate-*l*34.8%
associate-*r/38.3%
Simplified38.3%
Taylor expanded in z around -inf 98.3%
neg-mul-198.3%
Simplified98.3%
if -2.2999999999999999e86 < z < 1.10000000000000003e-192 or 1.11999999999999997e-46 < z < 1.24999999999999999e88Initial program 91.0%
*-commutative91.0%
associate-*l*91.5%
associate-*r/93.3%
Simplified93.3%
if 1.10000000000000003e-192 < z < 1.11999999999999997e-46Initial program 96.4%
*-commutative96.4%
associate-*l*96.1%
associate-*r/96.3%
Simplified96.3%
associate-*r/96.1%
associate-*r*96.4%
*-commutative96.4%
expm1-log1p-u81.6%
expm1-udef36.0%
div-inv36.0%
associate-*l*36.0%
div-inv36.0%
Applied egg-rr36.0%
expm1-def84.9%
expm1-log1p99.7%
associate-*r*92.4%
associate-*r/75.8%
associate-*l/92.6%
*-commutative92.6%
Simplified92.6%
if 1.24999999999999999e88 < z Initial program 36.4%
associate-/l*38.3%
Simplified38.3%
Taylor expanded in z around inf 86.6%
unpow286.6%
associate-*r/86.6%
Simplified86.6%
Taylor expanded in a around 0 86.6%
*-commutative86.6%
unpow286.6%
times-frac95.7%
Simplified95.7%
Final simplification95.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 -1.7e+100) (* y (- x)) (if (<= z 2.65e+106) (* x (* z (/ y (sqrt (- (* z z) (* t a)))))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.7e+100) {
tmp = y * -x;
} else if (z <= 2.65e+106) {
tmp = x * (z * (y / sqrt(((z * z) - (t * a)))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.7d+100)) then
tmp = y * -x
else if (z <= 2.65d+106) then
tmp = x * (z * (y / sqrt(((z * z) - (t * a)))))
else
tmp = y * x
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.7e+100) {
tmp = y * -x;
} else if (z <= 2.65e+106) {
tmp = x * (z * (y / Math.sqrt(((z * z) - (t * a)))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.7e+100: tmp = y * -x elif z <= 2.65e+106: tmp = x * (z * (y / math.sqrt(((z * z) - (t * a))))) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.7e+100) tmp = Float64(y * Float64(-x)); elseif (z <= 2.65e+106) tmp = Float64(x * Float64(z * Float64(y / sqrt(Float64(Float64(z * z) - Float64(t * a)))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.7e+100)
tmp = y * -x;
elseif (z <= 2.65e+106)
tmp = x * (z * (y / sqrt(((z * z) - (t * a)))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.7e+100], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.65e+106], N[(x * N[(z * N[(y / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+100}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{+106}:\\
\;\;\;\;x \cdot \left(z \cdot \frac{y}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.69999999999999997e100Initial program 36.3%
*-commutative36.3%
associate-*l*32.4%
associate-*r/36.0%
Simplified36.0%
Taylor expanded in z around -inf 98.3%
neg-mul-198.3%
Simplified98.3%
if -1.69999999999999997e100 < z < 2.65e106Initial program 91.8%
*-commutative91.8%
associate-*l*91.5%
associate-*r/92.9%
Simplified92.9%
associate-*r/91.5%
associate-*r*91.8%
*-commutative91.8%
expm1-log1p-u73.5%
expm1-udef39.7%
div-inv39.7%
associate-*l*39.7%
div-inv39.7%
Applied egg-rr39.7%
expm1-def74.7%
expm1-log1p93.1%
associate-*r*90.6%
associate-*r/86.1%
associate-*l/89.2%
*-commutative89.2%
Simplified89.2%
if 2.65e106 < z Initial program 31.6%
*-commutative31.6%
associate-*l*31.4%
associate-*r/33.3%
Simplified33.3%
Taylor expanded in z around inf 98.4%
Final simplification93.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 -8.5e-58)
(* y (- x))
(if (<= z 3.6e-135)
(* y (/ (* z x) (sqrt (* t (- a)))))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ t z) (/ a z))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e-58) {
tmp = y * -x;
} else if (z <= 3.6e-135) {
tmp = y * ((z * x) / sqrt((t * -a)));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8.5d-58)) then
tmp = y * -x
else if (z <= 3.6d-135) then
tmp = y * ((z * x) / sqrt((t * -a)))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((t / z) * (a / z))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e-58) {
tmp = y * -x;
} else if (z <= 3.6e-135) {
tmp = y * ((z * x) / Math.sqrt((t * -a)));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -8.5e-58: tmp = y * -x elif z <= 3.6e-135: tmp = y * ((z * x) / math.sqrt((t * -a))) else: tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e-58) tmp = Float64(y * Float64(-x)); elseif (z <= 3.6e-135) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(t * Float64(-a))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(t / z) * Float64(a / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -8.5e-58)
tmp = y * -x;
elseif (z <= 3.6e-135)
tmp = y * ((z * x) / sqrt((t * -a)));
else
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e-58], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.6e-135], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(t / z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-58}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-135}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{t}{z} \cdot \frac{a}{z}\right)}\\
\end{array}
\end{array}
if z < -8.5000000000000004e-58Initial program 59.0%
*-commutative59.0%
associate-*l*56.4%
associate-*r/58.8%
Simplified58.8%
Taylor expanded in z around -inf 93.7%
neg-mul-193.7%
Simplified93.7%
if -8.5000000000000004e-58 < z < 3.59999999999999978e-135Initial program 81.4%
*-commutative81.4%
associate-*l*82.8%
associate-*r/87.5%
Simplified87.5%
Taylor expanded in z around 0 78.9%
mul-1-neg78.9%
*-commutative78.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
if 3.59999999999999978e-135 < z Initial program 63.6%
associate-/l*64.8%
Simplified64.8%
Taylor expanded in z around inf 83.7%
unpow283.7%
associate-*r/83.7%
Simplified83.7%
Taylor expanded in a around 0 83.7%
*-commutative83.7%
unpow283.7%
times-frac88.9%
Simplified88.9%
Final simplification88.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.2e-141) (* y (- x)) (if (<= z 1.2e+88) (* y (/ (* z x) (+ z (* -0.5 (/ (* t a) z))))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e-141) {
tmp = y * -x;
} else if (z <= 1.2e+88) {
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.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.2d-141)) then
tmp = y * -x
else if (z <= 1.2d+88) then
tmp = y * ((z * x) / (z + ((-0.5d0) * ((t * a) / z))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e-141) {
tmp = y * -x;
} else if (z <= 1.2e+88) {
tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.2e-141: tmp = y * -x elif z <= 1.2e+88: tmp = y * ((z * x) / (z + (-0.5 * ((t * a) / z)))) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e-141) tmp = Float64(y * Float64(-x)); elseif (z <= 1.2e+88) 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])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.2e-141)
tmp = y * -x;
elseif (z <= 1.2e+88)
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. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e-141], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.2e+88], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+88}:\\
\;\;\;\;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 < -3.2000000000000001e-141Initial program 63.3%
*-commutative63.3%
associate-*l*61.1%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 86.5%
neg-mul-186.5%
Simplified86.5%
if -3.2000000000000001e-141 < z < 1.2e88Initial program 91.4%
*-commutative91.4%
associate-*l*92.1%
associate-*r/93.1%
Simplified93.1%
Taylor expanded in z around inf 65.9%
if 1.2e88 < z Initial program 36.4%
*-commutative36.4%
associate-*l*34.6%
associate-*r/36.4%
Simplified36.4%
Taylor expanded in z around inf 95.7%
Final simplification81.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.25e-136) (* y (- x)) (if (<= z 4.2e-263) (* -2.0 (* (/ y a) (/ (* x (* z z)) t))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.25e-136) {
tmp = y * -x;
} else if (z <= 4.2e-263) {
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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.25d-136)) then
tmp = y * -x
else if (z <= 4.2d-263) then
tmp = (-2.0d0) * ((y / a) * ((x * (z * z)) / t))
else
tmp = y * x
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.25e-136) {
tmp = y * -x;
} else if (z <= 4.2e-263) {
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.25e-136: tmp = y * -x elif z <= 4.2e-263: tmp = -2.0 * ((y / a) * ((x * (z * z)) / t)) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.25e-136) tmp = Float64(y * Float64(-x)); elseif (z <= 4.2e-263) tmp = Float64(-2.0 * Float64(Float64(y / a) * Float64(Float64(x * Float64(z * z)) / t))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.25e-136)
tmp = y * -x;
elseif (z <= 4.2e-263)
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.25e-136], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.2e-263], N[(-2.0 * N[(N[(y / a), $MachinePrecision] * N[(N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-136}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-263}:\\
\;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{x \cdot \left(z \cdot z\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.25e-136Initial program 63.3%
*-commutative63.3%
associate-*l*61.1%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 86.5%
neg-mul-186.5%
Simplified86.5%
if -1.25e-136 < z < 4.20000000000000005e-263Initial program 76.1%
Taylor expanded in z around inf 57.7%
Taylor expanded in z around 0 57.9%
times-frac57.9%
unpow257.9%
Simplified57.9%
if 4.20000000000000005e-263 < z Initial program 66.0%
*-commutative66.0%
associate-*l*64.9%
associate-*r/66.0%
Simplified66.0%
Taylor expanded in z around inf 80.1%
Final simplification80.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.8e-141) (* y (- x)) (if (<= z 1.25e-167) (* -2.0 (/ (* y (* z (* z x))) (* t a))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e-141) {
tmp = y * -x;
} else if (z <= 1.25e-167) {
tmp = -2.0 * ((y * (z * (z * x))) / (t * a));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.8d-141)) then
tmp = y * -x
else if (z <= 1.25d-167) then
tmp = (-2.0d0) * ((y * (z * (z * x))) / (t * a))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e-141) {
tmp = y * -x;
} else if (z <= 1.25e-167) {
tmp = -2.0 * ((y * (z * (z * x))) / (t * a));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.8e-141: tmp = y * -x elif z <= 1.25e-167: tmp = -2.0 * ((y * (z * (z * x))) / (t * a)) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e-141) tmp = Float64(y * Float64(-x)); elseif (z <= 1.25e-167) tmp = Float64(-2.0 * Float64(Float64(y * Float64(z * Float64(z * x))) / Float64(t * a))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.8e-141)
tmp = y * -x;
elseif (z <= 1.25e-167)
tmp = -2.0 * ((y * (z * (z * x))) / (t * a));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e-141], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.25e-167], N[(-2.0 * N[(N[(y * N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-167}:\\
\;\;\;\;-2 \cdot \frac{y \cdot \left(z \cdot \left(z \cdot x\right)\right)}{t \cdot a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.80000000000000012e-141Initial program 63.3%
*-commutative63.3%
associate-*l*61.1%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 86.5%
neg-mul-186.5%
Simplified86.5%
if -2.80000000000000012e-141 < z < 1.25000000000000005e-167Initial program 80.5%
Taylor expanded in z around inf 47.6%
Taylor expanded in z around 0 47.5%
times-frac47.5%
unpow247.5%
Simplified47.5%
frac-times47.5%
associate-*l*47.6%
*-commutative47.6%
Applied egg-rr47.6%
if 1.25000000000000005e-167 < z Initial program 63.6%
*-commutative63.6%
associate-*l*62.5%
associate-*r/62.9%
Simplified62.9%
Taylor expanded in z around inf 85.7%
Final simplification80.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -8.5e-139) (* y (- x)) (if (<= z 4.2e-263) (* 2.0 (* (/ y a) (* x (/ (* z z) t)))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e-139) {
tmp = y * -x;
} else if (z <= 4.2e-263) {
tmp = 2.0 * ((y / a) * (x * ((z * z) / t)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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-139)) then
tmp = y * -x
else if (z <= 4.2d-263) then
tmp = 2.0d0 * ((y / a) * (x * ((z * z) / t)))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.5e-139) {
tmp = y * -x;
} else if (z <= 4.2e-263) {
tmp = 2.0 * ((y / a) * (x * ((z * z) / t)));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -8.5e-139: tmp = y * -x elif z <= 4.2e-263: tmp = 2.0 * ((y / a) * (x * ((z * z) / t))) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.5e-139) tmp = Float64(y * Float64(-x)); elseif (z <= 4.2e-263) tmp = Float64(2.0 * Float64(Float64(y / a) * Float64(x * Float64(Float64(z * z) / t)))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -8.5e-139)
tmp = y * -x;
elseif (z <= 4.2e-263)
tmp = 2.0 * ((y / a) * (x * ((z * z) / t)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.5e-139], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.2e-263], N[(2.0 * N[(N[(y / a), $MachinePrecision] * N[(x * N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-139}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-263}:\\
\;\;\;\;2 \cdot \left(\frac{y}{a} \cdot \left(x \cdot \frac{z \cdot z}{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -8.5000000000000003e-139Initial program 63.3%
*-commutative63.3%
associate-*l*61.1%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 86.5%
neg-mul-186.5%
Simplified86.5%
if -8.5000000000000003e-139 < z < 4.20000000000000005e-263Initial program 76.1%
*-commutative76.1%
associate-*l*79.7%
associate-*r/82.2%
Simplified82.2%
associate-*r/79.7%
associate-*r*76.1%
*-commutative76.1%
expm1-log1p-u72.2%
expm1-udef57.9%
div-inv57.9%
associate-*l*57.9%
div-inv57.9%
Applied egg-rr57.9%
expm1-def74.5%
expm1-log1p78.4%
associate-*r*75.8%
associate-*r/78.5%
associate-*l/78.1%
*-commutative78.1%
Simplified78.1%
Taylor expanded in z around -inf 58.7%
Taylor expanded in a around inf 57.9%
times-frac58.0%
associate-/l*54.0%
associate-/r/58.0%
unpow258.0%
Simplified58.0%
if 4.20000000000000005e-263 < z Initial program 66.0%
*-commutative66.0%
associate-*l*64.9%
associate-*r/66.0%
Simplified66.0%
Taylor expanded in z around inf 80.1%
Final simplification80.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.8e-141) (* y (- x)) (if (<= z 4.2e-263) (* x (* z (* 2.0 (/ y (/ a (/ z t)))))) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-141) {
tmp = y * -x;
} else if (z <= 4.2e-263) {
tmp = x * (z * (2.0 * (y / (a / (z / t)))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.8d-141)) then
tmp = y * -x
else if (z <= 4.2d-263) then
tmp = x * (z * (2.0d0 * (y / (a / (z / t)))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-141) {
tmp = y * -x;
} else if (z <= 4.2e-263) {
tmp = x * (z * (2.0 * (y / (a / (z / t)))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4.8e-141: tmp = y * -x elif z <= 4.2e-263: tmp = x * (z * (2.0 * (y / (a / (z / t))))) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e-141) tmp = Float64(y * Float64(-x)); elseif (z <= 4.2e-263) tmp = Float64(x * Float64(z * Float64(2.0 * Float64(y / Float64(a / Float64(z / t)))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.8e-141)
tmp = y * -x;
elseif (z <= 4.2e-263)
tmp = x * (z * (2.0 * (y / (a / (z / t)))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e-141], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.2e-263], N[(x * N[(z * N[(2.0 * N[(y / N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-263}:\\
\;\;\;\;x \cdot \left(z \cdot \left(2 \cdot \frac{y}{\frac{a}{\frac{z}{t}}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.8000000000000002e-141Initial program 63.3%
*-commutative63.3%
associate-*l*61.1%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 86.5%
neg-mul-186.5%
Simplified86.5%
if -4.8000000000000002e-141 < z < 4.20000000000000005e-263Initial program 76.1%
*-commutative76.1%
associate-*l*79.7%
associate-*r/82.2%
Simplified82.2%
associate-*r/79.7%
associate-*r*76.1%
*-commutative76.1%
expm1-log1p-u72.2%
expm1-udef57.9%
div-inv57.9%
associate-*l*57.9%
div-inv57.9%
Applied egg-rr57.9%
expm1-def74.5%
expm1-log1p78.4%
associate-*r*75.8%
associate-*r/78.5%
associate-*l/78.1%
*-commutative78.1%
Simplified78.1%
Taylor expanded in z around -inf 58.7%
Taylor expanded in a around inf 58.4%
associate-/l*58.5%
associate-/l*58.7%
Simplified58.7%
if 4.20000000000000005e-263 < z Initial program 66.0%
*-commutative66.0%
associate-*l*64.9%
associate-*r/66.0%
Simplified66.0%
Taylor expanded in z around inf 80.1%
Final simplification80.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4e-140) (* y (- x)) (/ (* y x) (+ 1.0 (* -0.5 (* (/ t z) (/ a z)))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-140) {
tmp = y * -x;
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
}
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-140)) then
tmp = y * -x
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((t / z) * (a / z))))
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-140) {
tmp = y * -x;
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4e-140: tmp = y * -x else: tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e-140) tmp = Float64(y * Float64(-x)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(t / z) * Float64(a / z))))); 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-140)
tmp = y * -x;
else
tmp = (y * x) / (1.0 + (-0.5 * ((t / z) * (a / z))));
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-140], N[(y * (-x)), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(t / z), $MachinePrecision] * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-140}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{t}{z} \cdot \frac{a}{z}\right)}\\
\end{array}
\end{array}
if z < -3.9999999999999999e-140Initial program 63.3%
*-commutative63.3%
associate-*l*61.1%
associate-*r/64.1%
Simplified64.1%
Taylor expanded in z around -inf 86.5%
neg-mul-186.5%
Simplified86.5%
if -3.9999999999999999e-140 < z Initial program 67.8%
associate-/l*69.0%
Simplified69.0%
Taylor expanded in z around inf 74.7%
unpow274.7%
associate-*r/74.7%
Simplified74.7%
Taylor expanded in a around 0 74.7%
*-commutative74.7%
unpow274.7%
times-frac78.7%
Simplified78.7%
Final simplification81.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.9e-171) (* y (- x)) (if (<= z 4.2e-263) (* x (/ (* z y) z)) (* y x))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-171) {
tmp = y * -x;
} else if (z <= 4.2e-263) {
tmp = x * ((z * y) / z);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.9d-171)) then
tmp = y * -x
else if (z <= 4.2d-263) then
tmp = x * ((z * y) / z)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e-171) {
tmp = y * -x;
} else if (z <= 4.2e-263) {
tmp = x * ((z * y) / z);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.9e-171: tmp = y * -x elif z <= 4.2e-263: tmp = x * ((z * y) / z) else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e-171) tmp = Float64(y * Float64(-x)); elseif (z <= 4.2e-263) tmp = Float64(x * Float64(Float64(z * y) / z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.9e-171)
tmp = y * -x;
elseif (z <= 4.2e-263)
tmp = x * ((z * y) / z);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e-171], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 4.2e-263], N[(x * N[(N[(z * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-171}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-263}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.90000000000000011e-171Initial program 64.7%
*-commutative64.7%
associate-*l*61.8%
associate-*r/64.6%
Simplified64.6%
Taylor expanded in z around -inf 82.2%
neg-mul-182.2%
Simplified82.2%
if -1.90000000000000011e-171 < z < 4.20000000000000005e-263Initial program 72.8%
*-commutative72.8%
associate-*l*82.4%
associate-*r/85.8%
Simplified85.8%
associate-*r/82.4%
associate-*r*72.8%
*-commutative72.8%
expm1-log1p-u67.5%
expm1-udef62.3%
div-inv62.3%
associate-*l*62.3%
div-inv62.3%
Applied egg-rr62.3%
expm1-def70.5%
expm1-log1p75.7%
associate-*r*77.0%
associate-*r/84.6%
associate-*l/84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in z around inf 17.7%
associate-*l/48.0%
Applied egg-rr48.0%
if 4.20000000000000005e-263 < z Initial program 66.0%
*-commutative66.0%
associate-*l*64.9%
associate-*r/66.0%
Simplified66.0%
Taylor expanded in z around inf 80.1%
Final simplification78.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 -4e-311) (* y (- x)) (* y x)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-311) {
tmp = y * -x;
} else {
tmp = y * x;
}
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-311)) then
tmp = y * -x
else
tmp = y * x
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-311) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4e-311: tmp = y * -x else: tmp = y * x return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e-311) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * x); 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-311)
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. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e-311], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-311}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -3.99999999999979e-311Initial program 66.1%
*-commutative66.1%
associate-*l*63.5%
associate-*r/66.1%
Simplified66.1%
Taylor expanded in z around -inf 75.5%
neg-mul-175.5%
Simplified75.5%
if -3.99999999999979e-311 < z Initial program 65.9%
*-commutative65.9%
associate-*l*66.2%
associate-*r/67.7%
Simplified67.7%
Taylor expanded in z around inf 76.9%
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 (* y x))
assert(x < y);
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.
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;
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return y * x
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(y * x) end
x, y = num2cell(sort([x, y])){:}
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. code[x_, y_, z_, t_, a_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
y \cdot x
\end{array}
Initial program 66.0%
*-commutative66.0%
associate-*l*64.9%
associate-*r/66.9%
Simplified66.9%
Taylor expanded in z around inf 46.4%
Final simplification46.4%
(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 2023224
(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)))))