
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (sqrt (- (* z z) (* a t))) z)))
(if (<= z -2e+153)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z -2.9e-201)
(* y (/ x t_1))
(if (<= z 8.5e-223)
(* x (* (* z y) (pow (exp -0.5) (- (log a) (log (/ -1.0 t))))))
(if (<= z 4.6e+85)
(/ x (/ t_1 y))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z)))))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t))) / z;
double tmp;
if (z <= -2e+153) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= -2.9e-201) {
tmp = y * (x / t_1);
} else if (z <= 8.5e-223) {
tmp = x * ((z * y) * pow(exp(-0.5), (log(a) - log((-1.0 / t)))));
} else if (z <= 4.6e+85) {
tmp = x / (t_1 / y);
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((z * z) - (a * t))) / z
if (z <= (-2d+153)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= (-2.9d-201)) then
tmp = y * (x / t_1)
else if (z <= 8.5d-223) then
tmp = x * ((z * y) * (exp((-0.5d0)) ** (log(a) - log(((-1.0d0) / t)))))
else if (z <= 4.6d+85) then
tmp = x / (t_1 / y)
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (a * t))) / z;
double tmp;
if (z <= -2e+153) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= -2.9e-201) {
tmp = y * (x / t_1);
} else if (z <= 8.5e-223) {
tmp = x * ((z * y) * Math.pow(Math.exp(-0.5), (Math.log(a) - Math.log((-1.0 / t)))));
} else if (z <= 4.6e+85) {
tmp = x / (t_1 / y);
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (a * t))) / z tmp = 0 if z <= -2e+153: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= -2.9e-201: tmp = y * (x / t_1) elif z <= 8.5e-223: tmp = x * ((z * y) * math.pow(math.exp(-0.5), (math.log(a) - math.log((-1.0 / t))))) elif z <= 4.6e+85: tmp = x / (t_1 / y) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z) tmp = 0.0 if (z <= -2e+153) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= -2.9e-201) tmp = Float64(y * Float64(x / t_1)); elseif (z <= 8.5e-223) tmp = Float64(x * Float64(Float64(z * y) * (exp(-0.5) ^ Float64(log(a) - log(Float64(-1.0 / t)))))); elseif (z <= 4.6e+85) tmp = Float64(x / Float64(t_1 / y)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (a * t))) / z;
tmp = 0.0;
if (z <= -2e+153)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= -2.9e-201)
tmp = y * (x / t_1);
elseif (z <= 8.5e-223)
tmp = x * ((z * y) * (exp(-0.5) ^ (log(a) - log((-1.0 / t)))));
elseif (z <= 4.6e+85)
tmp = x / (t_1 / y);
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -2e+153], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -2.9e-201], N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-223], N[(x * N[(N[(z * y), $MachinePrecision] * N[Power[N[Exp[-0.5], $MachinePrecision], N[(N[Log[a], $MachinePrecision] - N[Log[N[(-1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+85], N[(x / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{\sqrt{z \cdot z - a \cdot t}}{z}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+153}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-201}:\\
\;\;\;\;y \cdot \frac{x}{t_1}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-223}:\\
\;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot {\left(e^{-0.5}\right)}^{\left(\log a - \log \left(\frac{-1}{t}\right)\right)}\right)\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+85}:\\
\;\;\;\;\frac{x}{\frac{t_1}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -2e153Initial program 22.9%
associate-/l*23.6%
associate-/l*23.7%
Simplified23.7%
Taylor expanded in z around -inf 79.7%
*-commutative79.7%
associate-*r/79.7%
*-commutative79.7%
associate-*r*79.7%
unpow279.7%
Simplified79.7%
associate-*l*79.7%
*-commutative79.7%
associate-*r*79.8%
times-frac83.2%
*-commutative83.2%
associate-*l/93.2%
associate-/r/93.2%
div-inv93.2%
clear-num93.2%
Applied egg-rr93.2%
Taylor expanded in y around -inf 80.0%
associate-*r/80.0%
mul-1-neg80.0%
distribute-rgt-neg-in80.0%
+-commutative80.0%
associate-/l*93.5%
unpow293.5%
associate-*r/93.5%
Simplified93.5%
div-inv93.5%
associate-*l*93.5%
*-commutative93.5%
div-inv93.5%
Applied egg-rr93.5%
if -2e153 < z < -2.9000000000000002e-201Initial program 83.4%
associate-/l*86.4%
associate-*l/89.5%
Simplified89.5%
if -2.9000000000000002e-201 < z < 8.5000000000000003e-223Initial program 78.5%
Taylor expanded in z around 0 78.5%
associate-*r*78.5%
neg-mul-178.5%
*-commutative78.5%
Simplified78.5%
div-inv78.6%
associate-*l*77.5%
associate-*l*73.3%
distribute-rgt-neg-out73.3%
pow1/273.3%
pow-flip73.3%
distribute-rgt-neg-out73.3%
metadata-eval73.3%
Applied egg-rr73.3%
Taylor expanded in t around -inf 40.8%
exp-prod40.8%
mul-1-neg40.8%
Simplified40.8%
if 8.5000000000000003e-223 < z < 4.5999999999999998e85Initial program 88.1%
associate-/l*89.6%
associate-/l*89.5%
Simplified89.5%
if 4.5999999999999998e85 < z Initial program 38.5%
associate-/l*42.0%
Simplified42.0%
Taylor expanded in z around inf 90.3%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around 0 88.3%
unpow288.3%
*-commutative88.3%
times-frac98.5%
Simplified98.5%
Final simplification87.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (sqrt (- (* z z) (* a t))) z)))
(if (<= z -1e+154)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z -8.2e-196)
(* y (/ x t_1))
(if (<= z 9e-223)
(* x (* (* z y) (exp (* -0.5 (+ (log a) (log (- t)))))))
(if (<= z 2.6e+85)
(/ x (/ t_1 y))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z)))))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t))) / z;
double tmp;
if (z <= -1e+154) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= -8.2e-196) {
tmp = y * (x / t_1);
} else if (z <= 9e-223) {
tmp = x * ((z * y) * exp((-0.5 * (log(a) + log(-t)))));
} else if (z <= 2.6e+85) {
tmp = x / (t_1 / y);
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(((z * z) - (a * t))) / z
if (z <= (-1d+154)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= (-8.2d-196)) then
tmp = y * (x / t_1)
else if (z <= 9d-223) then
tmp = x * ((z * y) * exp(((-0.5d0) * (log(a) + log(-t)))))
else if (z <= 2.6d+85) then
tmp = x / (t_1 / y)
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (a * t))) / z;
double tmp;
if (z <= -1e+154) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= -8.2e-196) {
tmp = y * (x / t_1);
} else if (z <= 9e-223) {
tmp = x * ((z * y) * Math.exp((-0.5 * (Math.log(a) + Math.log(-t)))));
} else if (z <= 2.6e+85) {
tmp = x / (t_1 / y);
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (a * t))) / z tmp = 0 if z <= -1e+154: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= -8.2e-196: tmp = y * (x / t_1) elif z <= 9e-223: tmp = x * ((z * y) * math.exp((-0.5 * (math.log(a) + math.log(-t))))) elif z <= 2.6e+85: tmp = x / (t_1 / y) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z) tmp = 0.0 if (z <= -1e+154) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= -8.2e-196) tmp = Float64(y * Float64(x / t_1)); elseif (z <= 9e-223) tmp = Float64(x * Float64(Float64(z * y) * exp(Float64(-0.5 * Float64(log(a) + log(Float64(-t))))))); elseif (z <= 2.6e+85) tmp = Float64(x / Float64(t_1 / y)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (a * t))) / z;
tmp = 0.0;
if (z <= -1e+154)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= -8.2e-196)
tmp = y * (x / t_1);
elseif (z <= 9e-223)
tmp = x * ((z * y) * exp((-0.5 * (log(a) + log(-t)))));
elseif (z <= 2.6e+85)
tmp = x / (t_1 / y);
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -1e+154], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, -8.2e-196], N[(y * N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-223], N[(x * N[(N[(z * y), $MachinePrecision] * N[Exp[N[(-0.5 * N[(N[Log[a], $MachinePrecision] + N[Log[(-t)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e+85], N[(x / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{\sqrt{z \cdot z - a \cdot t}}{z}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-196}:\\
\;\;\;\;y \cdot \frac{x}{t_1}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-223}:\\
\;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot e^{-0.5 \cdot \left(\log a + \log \left(-t\right)\right)}\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+85}:\\
\;\;\;\;\frac{x}{\frac{t_1}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -1.00000000000000004e154Initial program 22.9%
associate-/l*23.6%
associate-/l*23.7%
Simplified23.7%
Taylor expanded in z around -inf 79.7%
*-commutative79.7%
associate-*r/79.7%
*-commutative79.7%
associate-*r*79.7%
unpow279.7%
Simplified79.7%
associate-*l*79.7%
*-commutative79.7%
associate-*r*79.8%
times-frac83.2%
*-commutative83.2%
associate-*l/93.2%
associate-/r/93.2%
div-inv93.2%
clear-num93.2%
Applied egg-rr93.2%
Taylor expanded in y around -inf 80.0%
associate-*r/80.0%
mul-1-neg80.0%
distribute-rgt-neg-in80.0%
+-commutative80.0%
associate-/l*93.5%
unpow293.5%
associate-*r/93.5%
Simplified93.5%
div-inv93.5%
associate-*l*93.5%
*-commutative93.5%
div-inv93.5%
Applied egg-rr93.5%
if -1.00000000000000004e154 < z < -8.20000000000000043e-196Initial program 83.4%
associate-/l*86.4%
associate-*l/89.5%
Simplified89.5%
if -8.20000000000000043e-196 < z < 8.99999999999999935e-223Initial program 78.5%
Taylor expanded in z around 0 78.5%
associate-*r*78.5%
neg-mul-178.5%
*-commutative78.5%
Simplified78.5%
div-inv78.6%
associate-*l*77.5%
associate-*l*73.3%
distribute-rgt-neg-out73.3%
pow1/273.3%
pow-flip73.3%
distribute-rgt-neg-out73.3%
metadata-eval73.3%
Applied egg-rr73.3%
Taylor expanded in a around 0 40.8%
if 8.99999999999999935e-223 < z < 2.60000000000000011e85Initial program 88.1%
associate-/l*89.6%
associate-/l*89.5%
Simplified89.5%
if 2.60000000000000011e85 < z Initial program 38.5%
associate-/l*42.0%
Simplified42.0%
Taylor expanded in z around inf 90.3%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around 0 88.3%
unpow288.3%
*-commutative88.3%
times-frac98.5%
Simplified98.5%
Final simplification87.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e+34)
(/ (* y (- x)) (+ 1.0 (* -0.5 (/ a (* z (/ z t))))))
(if (<= z 1.1e+86)
(* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+34) {
tmp = (y * -x) / (1.0 + (-0.5 * (a / (z * (z / t)))));
} else if (z <= 1.1e+86) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.5d+34)) then
tmp = (y * -x) / (1.0d0 + ((-0.5d0) * (a / (z * (z / t)))))
else if (z <= 1.1d+86) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+34) {
tmp = (y * -x) / (1.0 + (-0.5 * (a / (z * (z / t)))));
} else if (z <= 1.1e+86) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+34: tmp = (y * -x) / (1.0 + (-0.5 * (a / (z * (z / t))))) elif z <= 1.1e+86: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+34) tmp = Float64(Float64(y * Float64(-x)) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(z * Float64(z / t)))))); elseif (z <= 1.1e+86) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.5e+34)
tmp = (y * -x) / (1.0 + (-0.5 * (a / (z * (z / t)))));
elseif (z <= 1.1e+86)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+34], N[(N[(y * (-x)), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+86], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+34}:\\
\;\;\;\;\frac{y \cdot \left(-x\right)}{1 + -0.5 \cdot \frac{a}{z \cdot \frac{z}{t}}}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -5.4999999999999996e34Initial program 47.3%
associate-/l*50.8%
associate-/l*50.7%
Simplified50.7%
Taylor expanded in z around -inf 83.2%
*-commutative83.2%
associate-*r/83.2%
*-commutative83.2%
associate-*r*83.2%
unpow283.2%
Simplified83.2%
associate-*l*83.2%
*-commutative83.2%
associate-*r*83.3%
times-frac85.4%
*-commutative85.4%
associate-*l/91.5%
associate-/r/91.5%
div-inv91.5%
clear-num91.5%
Applied egg-rr91.5%
Taylor expanded in y around -inf 83.6%
associate-*r/83.6%
mul-1-neg83.6%
distribute-rgt-neg-in83.6%
+-commutative83.6%
associate-/l*91.8%
unpow291.8%
associate-*r/91.8%
Simplified91.8%
if -5.4999999999999996e34 < z < 1.10000000000000002e86Initial program 84.4%
associate-/l*83.2%
associate-*l/86.1%
associate-/l*86.6%
*-commutative86.6%
Simplified86.6%
if 1.10000000000000002e86 < z Initial program 38.5%
associate-/l*42.0%
Simplified42.0%
Taylor expanded in z around inf 90.3%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around 0 88.3%
unpow288.3%
*-commutative88.3%
times-frac98.5%
Simplified98.5%
Final simplification90.7%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -2e+153)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z 1.25e+86)
(* y (/ x (/ (sqrt (- (* z z) (* a t))) z)))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+153) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 1.25e+86) {
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2d+153)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= 1.25d+86) then
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+153) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 1.25e+86) {
tmp = y * (x / (Math.sqrt(((z * z) - (a * t))) / z));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2e+153: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= 1.25e+86: tmp = y * (x / (math.sqrt(((z * z) - (a * t))) / z)) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+153) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= 1.25e+86) tmp = Float64(y * Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2e+153)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= 1.25e+86)
tmp = y * (x / (sqrt(((z * z) - (a * t))) / z));
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+153], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.25e+86], N[(y * N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+153}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+86}:\\
\;\;\;\;y \cdot \frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -2e153Initial program 22.9%
associate-/l*23.6%
associate-/l*23.7%
Simplified23.7%
Taylor expanded in z around -inf 79.7%
*-commutative79.7%
associate-*r/79.7%
*-commutative79.7%
associate-*r*79.7%
unpow279.7%
Simplified79.7%
associate-*l*79.7%
*-commutative79.7%
associate-*r*79.8%
times-frac83.2%
*-commutative83.2%
associate-*l/93.2%
associate-/r/93.2%
div-inv93.2%
clear-num93.2%
Applied egg-rr93.2%
Taylor expanded in y around -inf 80.0%
associate-*r/80.0%
mul-1-neg80.0%
distribute-rgt-neg-in80.0%
+-commutative80.0%
associate-/l*93.5%
unpow293.5%
associate-*r/93.5%
Simplified93.5%
div-inv93.5%
associate-*l*93.5%
*-commutative93.5%
div-inv93.5%
Applied egg-rr93.5%
if -2e153 < z < 1.2499999999999999e86Initial program 84.5%
associate-/l*84.7%
associate-*l/87.2%
Simplified87.2%
if 1.2499999999999999e86 < z Initial program 38.5%
associate-/l*42.0%
Simplified42.0%
Taylor expanded in z around inf 90.3%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around 0 88.3%
unpow288.3%
*-commutative88.3%
times-frac98.5%
Simplified98.5%
Final simplification90.8%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.8e+115)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z 9.8e+85)
(/ x (/ (/ (sqrt (- (* z z) (* a t))) z) y))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+115) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 9.8e+85) {
tmp = x / ((sqrt(((z * z) - (a * t))) / z) / y);
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.8d+115)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= 9.8d+85) then
tmp = x / ((sqrt(((z * z) - (a * t))) / z) / y)
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e+115) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 9.8e+85) {
tmp = x / ((Math.sqrt(((z * z) - (a * t))) / z) / y);
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -3.8e+115: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= 9.8e+85: tmp = x / ((math.sqrt(((z * z) - (a * t))) / z) / y) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e+115) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= 9.8e+85) tmp = Float64(x / Float64(Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z) / y)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.8e+115)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= 9.8e+85)
tmp = x / ((sqrt(((z * z) - (a * t))) / z) / y);
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+115], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 9.8e+85], N[(x / N[(N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+115}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+85}:\\
\;\;\;\;\frac{x}{\frac{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -3.8000000000000001e115Initial program 33.1%
associate-/l*37.6%
associate-/l*37.6%
Simplified37.6%
Taylor expanded in z around -inf 83.4%
*-commutative83.4%
associate-*r/83.4%
*-commutative83.4%
associate-*r*83.4%
unpow283.4%
Simplified83.4%
associate-*l*83.4%
*-commutative83.4%
associate-*r*83.4%
times-frac86.2%
*-commutative86.2%
associate-*l/94.4%
associate-/r/94.4%
div-inv94.4%
clear-num94.4%
Applied egg-rr94.4%
Taylor expanded in y around -inf 83.7%
associate-*r/83.7%
mul-1-neg83.7%
distribute-rgt-neg-in83.7%
+-commutative83.7%
associate-/l*94.7%
unpow294.7%
associate-*r/94.7%
Simplified94.7%
div-inv94.7%
associate-*l*94.7%
*-commutative94.7%
div-inv94.7%
Applied egg-rr94.7%
if -3.8000000000000001e115 < z < 9.7999999999999993e85Initial program 84.8%
associate-/l*83.8%
associate-/l*85.0%
Simplified85.0%
if 9.7999999999999993e85 < z Initial program 38.5%
associate-/l*42.0%
Simplified42.0%
Taylor expanded in z around inf 90.3%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around 0 88.3%
unpow288.3%
*-commutative88.3%
times-frac98.5%
Simplified98.5%
Final simplification90.0%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.16e-82)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z 3e-124)
(* x (* (* z y) (pow (* a (- t)) -0.5)))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.16e-82) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 3e-124) {
tmp = x * ((z * y) * pow((a * -t), -0.5));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.16d-82)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= 3d-124) then
tmp = x * ((z * y) * ((a * -t) ** (-0.5d0)))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.16e-82) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 3e-124) {
tmp = x * ((z * y) * Math.pow((a * -t), -0.5));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.16e-82: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= 3e-124: tmp = x * ((z * y) * math.pow((a * -t), -0.5)) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.16e-82) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= 3e-124) tmp = Float64(x * Float64(Float64(z * y) * (Float64(a * Float64(-t)) ^ -0.5))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.16e-82)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= 3e-124)
tmp = x * ((z * y) * ((a * -t) ^ -0.5));
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.16e-82], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3e-124], N[(x * N[(N[(z * y), $MachinePrecision] * N[Power[N[(a * (-t)), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.16 \cdot 10^{-82}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-124}:\\
\;\;\;\;x \cdot \left(\left(z \cdot y\right) \cdot {\left(a \cdot \left(-t\right)\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -1.16e-82Initial program 57.3%
associate-/l*59.9%
associate-/l*59.8%
Simplified59.8%
Taylor expanded in z around -inf 77.8%
*-commutative77.8%
associate-*r/77.8%
*-commutative77.8%
associate-*r*77.8%
unpow277.8%
Simplified77.8%
associate-*l*77.8%
*-commutative77.8%
associate-*r*77.8%
times-frac79.4%
*-commutative79.4%
associate-*l/84.1%
associate-/r/84.1%
div-inv84.1%
clear-num84.1%
Applied egg-rr84.1%
Taylor expanded in y around -inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-rgt-neg-in78.1%
+-commutative78.1%
associate-/l*84.4%
unpow284.4%
associate-*r/84.4%
Simplified84.4%
div-inv84.4%
associate-*l*84.4%
*-commutative84.4%
div-inv84.4%
Applied egg-rr84.4%
if -1.16e-82 < z < 3e-124Initial program 78.3%
Taylor expanded in z around 0 76.6%
associate-*r*76.6%
neg-mul-176.6%
*-commutative76.6%
Simplified76.6%
div-inv76.7%
associate-*l*81.0%
associate-*l*79.1%
distribute-rgt-neg-out79.1%
pow1/279.2%
pow-flip79.1%
distribute-rgt-neg-out79.1%
metadata-eval79.1%
Applied egg-rr79.1%
if 3e-124 < z Initial program 61.9%
associate-/l*64.7%
Simplified64.7%
Taylor expanded in z around inf 85.5%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in z around 0 84.5%
unpow284.5%
*-commutative84.5%
times-frac89.9%
Simplified89.9%
Final simplification85.6%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.4e-87)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z 1.8e-127)
(* y (/ (* z x) (sqrt (* a (- t)))))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-87) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 1.8e-127) {
tmp = y * ((z * x) / sqrt((a * -t)));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.4d-87)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= 1.8d-127) then
tmp = y * ((z * x) / sqrt((a * -t)))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-87) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 1.8e-127) {
tmp = y * ((z * x) / Math.sqrt((a * -t)));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.4e-87: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= 1.8e-127: tmp = y * ((z * x) / math.sqrt((a * -t))) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e-87) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= 1.8e-127) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.4e-87)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= 1.8e-127)
tmp = y * ((z * x) / sqrt((a * -t)));
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e-87], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.8e-127], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-127}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -2.4e-87Initial program 57.3%
associate-/l*59.9%
associate-/l*59.8%
Simplified59.8%
Taylor expanded in z around -inf 77.8%
*-commutative77.8%
associate-*r/77.8%
*-commutative77.8%
associate-*r*77.8%
unpow277.8%
Simplified77.8%
associate-*l*77.8%
*-commutative77.8%
associate-*r*77.8%
times-frac79.4%
*-commutative79.4%
associate-*l/84.1%
associate-/r/84.1%
div-inv84.1%
clear-num84.1%
Applied egg-rr84.1%
Taylor expanded in y around -inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-rgt-neg-in78.1%
+-commutative78.1%
associate-/l*84.4%
unpow284.4%
associate-*r/84.4%
Simplified84.4%
div-inv84.4%
associate-*l*84.4%
*-commutative84.4%
div-inv84.4%
Applied egg-rr84.4%
if -2.4e-87 < z < 1.8e-127Initial program 78.3%
Taylor expanded in z around 0 76.6%
associate-*r*76.6%
neg-mul-176.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in x around 0 81.0%
*-commutative81.0%
Simplified81.0%
div-inv81.0%
associate-*l*79.1%
associate-*l*72.5%
un-div-inv72.5%
distribute-rgt-neg-out72.5%
*-commutative72.5%
Applied egg-rr72.5%
associate-*r*78.1%
*-commutative78.1%
associate-*l/81.3%
associate-*r/81.5%
distribute-rgt-neg-in81.5%
Simplified81.5%
if 1.8e-127 < z Initial program 61.9%
associate-/l*64.7%
Simplified64.7%
Taylor expanded in z around inf 85.5%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in z around 0 84.5%
unpow284.5%
*-commutative84.5%
times-frac89.9%
Simplified89.9%
Final simplification86.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.2e-87)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z 2.1e-126)
(* x (* z (/ y (sqrt (* a (- t))))))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e-87) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 2.1e-126) {
tmp = x * (z * (y / sqrt((a * -t))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.2d-87)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= 2.1d-126) then
tmp = x * (z * (y / sqrt((a * -t))))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e-87) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 2.1e-126) {
tmp = x * (z * (y / Math.sqrt((a * -t))));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -3.2e-87: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= 2.1e-126: tmp = x * (z * (y / math.sqrt((a * -t)))) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e-87) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= 2.1e-126) tmp = Float64(x * Float64(z * Float64(y / sqrt(Float64(a * Float64(-t)))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.2e-87)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= 2.1e-126)
tmp = x * (z * (y / sqrt((a * -t))));
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e-87], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 2.1e-126], N[(x * N[(z * N[(y / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-126}:\\
\;\;\;\;x \cdot \left(z \cdot \frac{y}{\sqrt{a \cdot \left(-t\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -3.19999999999999979e-87Initial program 57.3%
associate-/l*59.9%
associate-/l*59.8%
Simplified59.8%
Taylor expanded in z around -inf 77.8%
*-commutative77.8%
associate-*r/77.8%
*-commutative77.8%
associate-*r*77.8%
unpow277.8%
Simplified77.8%
associate-*l*77.8%
*-commutative77.8%
associate-*r*77.8%
times-frac79.4%
*-commutative79.4%
associate-*l/84.1%
associate-/r/84.1%
div-inv84.1%
clear-num84.1%
Applied egg-rr84.1%
Taylor expanded in y around -inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-rgt-neg-in78.1%
+-commutative78.1%
associate-/l*84.4%
unpow284.4%
associate-*r/84.4%
Simplified84.4%
div-inv84.4%
associate-*l*84.4%
*-commutative84.4%
div-inv84.4%
Applied egg-rr84.4%
if -3.19999999999999979e-87 < z < 2.0999999999999999e-126Initial program 78.3%
Taylor expanded in z around 0 76.6%
associate-*r*76.6%
neg-mul-176.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in x around 0 81.0%
*-commutative81.0%
Simplified81.0%
div-inv81.0%
associate-*l*79.1%
*-commutative79.1%
associate-*l*72.5%
un-div-inv72.5%
distribute-rgt-neg-out72.5%
*-commutative72.5%
Applied egg-rr72.5%
if 2.0999999999999999e-126 < z Initial program 61.9%
associate-/l*64.7%
Simplified64.7%
Taylor expanded in z around inf 85.5%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in z around 0 84.5%
unpow284.5%
*-commutative84.5%
times-frac89.9%
Simplified89.9%
Final simplification84.1%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.6e-87)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z 3e-122)
(* (* z y) (/ x (sqrt (* a (- t)))))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-87) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 3e-122) {
tmp = (z * y) * (x / sqrt((a * -t)));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.6d-87)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= 3d-122) then
tmp = (z * y) * (x / sqrt((a * -t)))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e-87) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 3e-122) {
tmp = (z * y) * (x / Math.sqrt((a * -t)));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.6e-87: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= 3e-122: tmp = (z * y) * (x / math.sqrt((a * -t))) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e-87) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= 3e-122) tmp = Float64(Float64(z * y) * Float64(x / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.6e-87)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= 3e-122)
tmp = (z * y) * (x / sqrt((a * -t)));
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e-87], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3e-122], N[(N[(z * y), $MachinePrecision] * N[(x / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-122}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \frac{x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -2.60000000000000002e-87Initial program 57.3%
associate-/l*59.9%
associate-/l*59.8%
Simplified59.8%
Taylor expanded in z around -inf 77.8%
*-commutative77.8%
associate-*r/77.8%
*-commutative77.8%
associate-*r*77.8%
unpow277.8%
Simplified77.8%
associate-*l*77.8%
*-commutative77.8%
associate-*r*77.8%
times-frac79.4%
*-commutative79.4%
associate-*l/84.1%
associate-/r/84.1%
div-inv84.1%
clear-num84.1%
Applied egg-rr84.1%
Taylor expanded in y around -inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-rgt-neg-in78.1%
+-commutative78.1%
associate-/l*84.4%
unpow284.4%
associate-*r/84.4%
Simplified84.4%
div-inv84.4%
associate-*l*84.4%
*-commutative84.4%
div-inv84.4%
Applied egg-rr84.4%
if -2.60000000000000002e-87 < z < 3.00000000000000004e-122Initial program 78.3%
Taylor expanded in z around 0 76.6%
associate-*r*76.6%
neg-mul-176.6%
*-commutative76.6%
Simplified76.6%
clear-num75.3%
div-inv75.3%
clear-num76.6%
associate-*l*81.0%
associate-/l*78.8%
Applied egg-rr78.8%
*-lft-identity78.8%
associate-/r/77.8%
Simplified77.8%
if 3.00000000000000004e-122 < z Initial program 61.9%
associate-/l*64.7%
Simplified64.7%
Taylor expanded in z around inf 85.5%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in z around 0 84.5%
unpow284.5%
*-commutative84.5%
times-frac89.9%
Simplified89.9%
Final simplification85.3%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -5e-85)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z 3.1e-122)
(/ x (/ (/ (sqrt (* a (- t))) z) y))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-85) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 3.1e-122) {
tmp = x / ((sqrt((a * -t)) / z) / y);
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5d-85)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= 3.1d-122) then
tmp = x / ((sqrt((a * -t)) / z) / y)
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e-85) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 3.1e-122) {
tmp = x / ((Math.sqrt((a * -t)) / z) / y);
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5e-85: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= 3.1e-122: tmp = x / ((math.sqrt((a * -t)) / z) / y) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e-85) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= 3.1e-122) tmp = Float64(x / Float64(Float64(sqrt(Float64(a * Float64(-t))) / z) / y)); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5e-85)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= 3.1e-122)
tmp = x / ((sqrt((a * -t)) / z) / y);
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e-85], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 3.1e-122], N[(x / N[(N[(N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{-85}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-122}:\\
\;\;\;\;\frac{x}{\frac{\frac{\sqrt{a \cdot \left(-t\right)}}{z}}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -5.0000000000000002e-85Initial program 57.3%
associate-/l*59.9%
associate-/l*59.8%
Simplified59.8%
Taylor expanded in z around -inf 77.8%
*-commutative77.8%
associate-*r/77.8%
*-commutative77.8%
associate-*r*77.8%
unpow277.8%
Simplified77.8%
associate-*l*77.8%
*-commutative77.8%
associate-*r*77.8%
times-frac79.4%
*-commutative79.4%
associate-*l/84.1%
associate-/r/84.1%
div-inv84.1%
clear-num84.1%
Applied egg-rr84.1%
Taylor expanded in y around -inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-rgt-neg-in78.1%
+-commutative78.1%
associate-/l*84.4%
unpow284.4%
associate-*r/84.4%
Simplified84.4%
div-inv84.4%
associate-*l*84.4%
*-commutative84.4%
div-inv84.4%
Applied egg-rr84.4%
if -5.0000000000000002e-85 < z < 3.0999999999999998e-122Initial program 78.3%
associate-/l*73.9%
associate-/l*78.9%
Simplified78.9%
Taylor expanded in z around 0 77.2%
associate-*r*76.6%
neg-mul-176.6%
*-commutative76.6%
Simplified77.2%
if 3.0999999999999998e-122 < z Initial program 61.9%
associate-/l*64.7%
Simplified64.7%
Taylor expanded in z around inf 85.5%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in z around 0 84.5%
unpow284.5%
*-commutative84.5%
times-frac89.9%
Simplified89.9%
Final simplification85.2%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.6e-87)
(* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x)
(if (<= z 1.7e-123)
(/ (* x (* z y)) (sqrt (* a (- t))))
(/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.6e-87) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 1.7e-123) {
tmp = (x * (z * y)) / sqrt((a * -t));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.6d-87)) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else if (z <= 1.7d-123) then
tmp = (x * (z * y)) / sqrt((a * -t))
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.6e-87) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else if (z <= 1.7e-123) {
tmp = (x * (z * y)) / Math.sqrt((a * -t));
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -7.6e-87: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x elif z <= 1.7e-123: tmp = (x * (z * y)) / math.sqrt((a * -t)) else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.6e-87) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); elseif (z <= 1.7e-123) tmp = Float64(Float64(x * Float64(z * y)) / sqrt(Float64(a * Float64(-t)))); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -7.6e-87)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
elseif (z <= 1.7e-123)
tmp = (x * (z * y)) / sqrt((a * -t));
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.6e-87], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.7e-123], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-123}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < -7.6e-87Initial program 57.3%
associate-/l*59.9%
associate-/l*59.8%
Simplified59.8%
Taylor expanded in z around -inf 77.8%
*-commutative77.8%
associate-*r/77.8%
*-commutative77.8%
associate-*r*77.8%
unpow277.8%
Simplified77.8%
associate-*l*77.8%
*-commutative77.8%
associate-*r*77.8%
times-frac79.4%
*-commutative79.4%
associate-*l/84.1%
associate-/r/84.1%
div-inv84.1%
clear-num84.1%
Applied egg-rr84.1%
Taylor expanded in y around -inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-rgt-neg-in78.1%
+-commutative78.1%
associate-/l*84.4%
unpow284.4%
associate-*r/84.4%
Simplified84.4%
div-inv84.4%
associate-*l*84.4%
*-commutative84.4%
div-inv84.4%
Applied egg-rr84.4%
if -7.6e-87 < z < 1.7e-123Initial program 78.3%
Taylor expanded in z around 0 76.6%
associate-*r*76.6%
neg-mul-176.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in x around 0 81.0%
*-commutative81.0%
Simplified81.0%
if 1.7e-123 < z Initial program 61.9%
associate-/l*64.7%
Simplified64.7%
Taylor expanded in z around inf 85.5%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in z around 0 84.5%
unpow284.5%
*-commutative84.5%
times-frac89.9%
Simplified89.9%
Final simplification86.0%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ 1.0 (* -0.5 (* (/ a z) (/ t z)))))) (if (<= z 5e-306) (/ (* y (- x)) t_1) (/ (* y x) t_1))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = 1.0 + (-0.5 * ((a / z) * (t / z)));
double tmp;
if (z <= 5e-306) {
tmp = (y * -x) / t_1;
} else {
tmp = (y * x) / t_1;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 + ((-0.5d0) * ((a / z) * (t / z)))
if (z <= 5d-306) then
tmp = (y * -x) / t_1
else
tmp = (y * x) / t_1
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = 1.0 + (-0.5 * ((a / z) * (t / z)));
double tmp;
if (z <= 5e-306) {
tmp = (y * -x) / t_1;
} else {
tmp = (y * x) / t_1;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = 1.0 + (-0.5 * ((a / z) * (t / z))) tmp = 0 if z <= 5e-306: tmp = (y * -x) / t_1 else: tmp = (y * x) / t_1 return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z)))) tmp = 0.0 if (z <= 5e-306) tmp = Float64(Float64(y * Float64(-x)) / t_1); else tmp = Float64(Float64(y * x) / t_1); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = 1.0 + (-0.5 * ((a / z) * (t / z)));
tmp = 0.0;
if (z <= 5e-306)
tmp = (y * -x) / t_1;
else
tmp = (y * x) / t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e-306], N[(N[(y * (-x)), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)\\
\mathbf{if}\;z \leq 5 \cdot 10^{-306}:\\
\;\;\;\;\frac{y \cdot \left(-x\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{t_1}\\
\end{array}
\end{array}
if z < 4.99999999999999998e-306Initial program 63.1%
associate-/l*64.2%
associate-/l*65.8%
Simplified65.8%
Taylor expanded in z around -inf 68.2%
*-commutative68.2%
associate-*r/68.2%
*-commutative68.2%
associate-*r*68.2%
unpow268.2%
Simplified68.2%
Taylor expanded in y around -inf 68.4%
*-commutative68.4%
associate-*r/68.4%
mul-1-neg68.4%
distribute-rgt-neg-out68.4%
unpow268.4%
*-commutative68.4%
times-frac76.5%
Simplified76.5%
if 4.99999999999999998e-306 < z Initial program 64.9%
associate-/l*66.0%
Simplified66.0%
Taylor expanded in z around inf 77.4%
associate-/l*80.9%
Simplified80.9%
Taylor expanded in z around 0 76.3%
unpow276.3%
*-commutative76.3%
times-frac80.9%
Simplified80.9%
Final simplification78.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -5.3e-107) (* y (- x)) (if (<= z 1.45e-137) (* 2.0 (* (/ x a) (* y (/ (* z z) t)))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.3e-107) {
tmp = y * -x;
} else if (z <= 1.45e-137) {
tmp = 2.0 * ((x / a) * (y * ((z * z) / t)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.3d-107)) then
tmp = y * -x
else if (z <= 1.45d-137) then
tmp = 2.0d0 * ((x / a) * (y * ((z * z) / t)))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.3e-107) {
tmp = y * -x;
} else if (z <= 1.45e-137) {
tmp = 2.0 * ((x / a) * (y * ((z * z) / t)));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5.3e-107: tmp = y * -x elif z <= 1.45e-137: tmp = 2.0 * ((x / a) * (y * ((z * z) / t))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.3e-107) tmp = Float64(y * Float64(-x)); elseif (z <= 1.45e-137) tmp = Float64(2.0 * Float64(Float64(x / a) * Float64(y * Float64(Float64(z * z) / t)))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.3e-107)
tmp = y * -x;
elseif (z <= 1.45e-137)
tmp = 2.0 * ((x / a) * (y * ((z * z) / t)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.3e-107], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.45e-137], N[(2.0 * N[(N[(x / a), $MachinePrecision] * N[(y * N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.3 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-137}:\\
\;\;\;\;2 \cdot \left(\frac{x}{a} \cdot \left(y \cdot \frac{z \cdot z}{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -5.3e-107Initial program 57.9%
associate-/l*60.3%
associate-*l/60.4%
associate-/l*59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in z around -inf 79.6%
mul-1-neg79.6%
Simplified79.6%
if -5.3e-107 < z < 1.44999999999999993e-137Initial program 79.2%
associate-/l*74.2%
associate-/l*79.9%
Simplified79.9%
Taylor expanded in z around -inf 43.5%
*-commutative43.5%
associate-*r/43.5%
*-commutative43.5%
associate-*r*43.5%
unpow243.5%
Simplified43.5%
times-frac43.3%
associate-*l/43.8%
sub-div43.8%
*-commutative43.8%
Applied egg-rr43.8%
Taylor expanded in a around inf 43.5%
times-frac43.6%
unpow243.6%
associate-*r/43.5%
Simplified43.5%
if 1.44999999999999993e-137 < z Initial program 62.3%
associate-/l*65.0%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
Simplified86.2%
Final simplification75.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-107) (* y (- x)) (if (<= z 8.2e-136) (* y (* -2.0 (/ x (* t (/ (/ a z) z))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-107) {
tmp = y * -x;
} else if (z <= 8.2e-136) {
tmp = y * (-2.0 * (x / (t * ((a / z) / z))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.35d-107)) then
tmp = y * -x
else if (z <= 8.2d-136) then
tmp = y * ((-2.0d0) * (x / (t * ((a / z) / z))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-107) {
tmp = y * -x;
} else if (z <= 8.2e-136) {
tmp = y * (-2.0 * (x / (t * ((a / z) / z))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-107: tmp = y * -x elif z <= 8.2e-136: tmp = y * (-2.0 * (x / (t * ((a / z) / z)))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e-107) tmp = Float64(y * Float64(-x)); elseif (z <= 8.2e-136) tmp = Float64(y * Float64(-2.0 * Float64(x / Float64(t * Float64(Float64(a / z) / z))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.35e-107)
tmp = y * -x;
elseif (z <= 8.2e-136)
tmp = y * (-2.0 * (x / (t * ((a / z) / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-107], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 8.2e-136], N[(y * N[(-2.0 * N[(x / N[(t * N[(N[(a / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-136}:\\
\;\;\;\;y \cdot \left(-2 \cdot \frac{x}{t \cdot \frac{\frac{a}{z}}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.35e-107Initial program 57.9%
associate-/l*60.3%
associate-*l/60.4%
associate-/l*59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in z around -inf 79.6%
mul-1-neg79.6%
Simplified79.6%
if -1.35e-107 < z < 8.20000000000000051e-136Initial program 79.2%
associate-/l*74.2%
associate-*l/81.7%
Simplified81.7%
Taylor expanded in z around inf 43.9%
associate-/l*43.8%
Simplified44.0%
associate-/r/44.0%
Applied egg-rr44.0%
Taylor expanded in z around 0 43.4%
associate-*r/43.4%
unpow243.4%
associate-/r*43.8%
associate-*r/43.8%
*-commutative43.8%
associate-*r/43.9%
*-commutative43.9%
associate-/r/44.0%
associate-*l/44.0%
Simplified44.0%
Taylor expanded in x around 0 43.5%
times-frac43.5%
unpow243.5%
associate-/l*43.5%
times-frac44.0%
associate-/l*43.9%
*-commutative43.9%
associate-*r/44.0%
associate-*l/44.0%
associate-*r/43.9%
Simplified43.9%
if 8.20000000000000051e-136 < z Initial program 62.3%
associate-/l*65.0%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
Simplified86.2%
Final simplification75.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.1e-107) (* y (- x)) (if (<= z 1.3e-131) (* y (* z (* (/ x a) (* -2.0 (/ z t))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.1e-107) {
tmp = y * -x;
} else if (z <= 1.3e-131) {
tmp = y * (z * ((x / a) * (-2.0 * (z / t))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.1d-107)) then
tmp = y * -x
else if (z <= 1.3d-131) then
tmp = y * (z * ((x / a) * ((-2.0d0) * (z / t))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.1e-107) {
tmp = y * -x;
} else if (z <= 1.3e-131) {
tmp = y * (z * ((x / a) * (-2.0 * (z / t))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4.1e-107: tmp = y * -x elif z <= 1.3e-131: tmp = y * (z * ((x / a) * (-2.0 * (z / t)))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.1e-107) tmp = Float64(y * Float64(-x)); elseif (z <= 1.3e-131) tmp = Float64(y * Float64(z * Float64(Float64(x / a) * Float64(-2.0 * Float64(z / t))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.1e-107)
tmp = y * -x;
elseif (z <= 1.3e-131)
tmp = y * (z * ((x / a) * (-2.0 * (z / t))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.1e-107], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.3e-131], N[(y * N[(z * N[(N[(x / a), $MachinePrecision] * N[(-2.0 * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-131}:\\
\;\;\;\;y \cdot \left(z \cdot \left(\frac{x}{a} \cdot \left(-2 \cdot \frac{z}{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.0999999999999999e-107Initial program 57.9%
associate-/l*60.3%
associate-*l/60.4%
associate-/l*59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in z around -inf 79.6%
mul-1-neg79.6%
Simplified79.6%
if -4.0999999999999999e-107 < z < 1.29999999999999998e-131Initial program 79.2%
associate-/l*74.2%
associate-*l/81.7%
Simplified81.7%
Taylor expanded in z around inf 43.9%
associate-/l*43.8%
Simplified44.0%
associate-/r/44.0%
Applied egg-rr44.0%
Taylor expanded in z around 0 43.4%
associate-*r/43.4%
unpow243.4%
associate-/r*43.8%
associate-*r/43.8%
*-commutative43.8%
associate-*r/43.9%
*-commutative43.9%
associate-/r/44.0%
associate-*l/44.0%
Simplified44.0%
Taylor expanded in x around 0 43.5%
*-commutative43.5%
associate-/r*43.8%
unpow243.8%
associate-*r/43.8%
associate-*r/44.0%
associate-/r/44.0%
associate-*l/43.7%
*-commutative43.7%
associate-/r/43.7%
associate-/r/43.9%
associate-/l*44.0%
associate-/r/44.0%
*-commutative44.0%
*-commutative44.0%
associate-/r/44.0%
associate-/r/43.9%
associate-/r/43.9%
Simplified43.9%
if 1.29999999999999998e-131 < z Initial program 62.3%
associate-/l*65.0%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
Simplified86.2%
Final simplification75.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-107) (* y (- x)) (if (<= z 1.55e-137) (* y (/ x (* -0.5 (* (/ a z) (/ t z))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-107) {
tmp = y * -x;
} else if (z <= 1.55e-137) {
tmp = y * (x / (-0.5 * ((a / z) * (t / z))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.35d-107)) then
tmp = y * -x
else if (z <= 1.55d-137) then
tmp = y * (x / ((-0.5d0) * ((a / z) * (t / z))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-107) {
tmp = y * -x;
} else if (z <= 1.55e-137) {
tmp = y * (x / (-0.5 * ((a / z) * (t / z))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-107: tmp = y * -x elif z <= 1.55e-137: tmp = y * (x / (-0.5 * ((a / z) * (t / z)))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e-107) tmp = Float64(y * Float64(-x)); elseif (z <= 1.55e-137) tmp = Float64(y * Float64(x / Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.35e-107)
tmp = y * -x;
elseif (z <= 1.55e-137)
tmp = y * (x / (-0.5 * ((a / z) * (t / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-107], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.55e-137], N[(y * N[(x / N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-137}:\\
\;\;\;\;y \cdot \frac{x}{-0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.35e-107Initial program 57.9%
associate-/l*60.3%
associate-*l/60.4%
associate-/l*59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in z around -inf 79.6%
mul-1-neg79.6%
Simplified79.6%
if -1.35e-107 < z < 1.54999999999999989e-137Initial program 79.2%
associate-/l*74.2%
associate-*l/81.7%
Simplified81.7%
Taylor expanded in z around inf 43.9%
associate-/l*43.8%
Simplified44.0%
Taylor expanded in z around 0 43.4%
unpow243.4%
*-commutative43.4%
times-frac44.0%
Simplified44.0%
if 1.54999999999999989e-137 < z Initial program 62.3%
associate-/l*65.0%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
Simplified86.2%
Final simplification75.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-105) (* y (- x)) (if (<= z 1.9e-137) (/ x (/ (/ a z) (/ (/ (* z y) 0.5) t))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-105) {
tmp = y * -x;
} else if (z <= 1.9e-137) {
tmp = x / ((a / z) / (((z * y) / 0.5) / t));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.35d-105)) then
tmp = y * -x
else if (z <= 1.9d-137) then
tmp = x / ((a / z) / (((z * y) / 0.5d0) / t))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-105) {
tmp = y * -x;
} else if (z <= 1.9e-137) {
tmp = x / ((a / z) / (((z * y) / 0.5) / t));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-105: tmp = y * -x elif z <= 1.9e-137: tmp = x / ((a / z) / (((z * y) / 0.5) / t)) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e-105) tmp = Float64(y * Float64(-x)); elseif (z <= 1.9e-137) tmp = Float64(x / Float64(Float64(a / z) / Float64(Float64(Float64(z * y) / 0.5) / t))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.35e-105)
tmp = y * -x;
elseif (z <= 1.9e-137)
tmp = x / ((a / z) / (((z * y) / 0.5) / t));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-105], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.9e-137], N[(x / N[(N[(a / z), $MachinePrecision] / N[(N[(N[(z * y), $MachinePrecision] / 0.5), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-105}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-137}:\\
\;\;\;\;\frac{x}{\frac{\frac{a}{z}}{\frac{\frac{z \cdot y}{0.5}}{t}}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.34999999999999996e-105Initial program 57.9%
associate-/l*60.3%
associate-*l/60.4%
associate-/l*59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in z around -inf 79.6%
mul-1-neg79.6%
Simplified79.6%
if -1.34999999999999996e-105 < z < 1.89999999999999999e-137Initial program 79.2%
associate-/l*74.2%
associate-/l*79.9%
Simplified79.9%
Taylor expanded in z around -inf 43.5%
*-commutative43.5%
associate-*r/43.5%
*-commutative43.5%
associate-*r*43.5%
unpow243.5%
Simplified43.5%
times-frac43.3%
associate-*l/43.8%
sub-div43.8%
*-commutative43.8%
Applied egg-rr43.8%
Taylor expanded in a around inf 43.5%
*-commutative43.5%
unpow243.5%
associate-*l/43.5%
associate-*r*43.5%
*-commutative43.5%
associate-*r*47.8%
associate-/r*47.8%
associate-*l/47.9%
associate-/l*47.8%
*-commutative47.8%
associate-/r*47.8%
Simplified47.8%
if 1.89999999999999999e-137 < z Initial program 62.3%
associate-/l*65.0%
associate-/l*64.1%
Simplified64.1%
Taylor expanded in z around inf 86.2%
*-commutative86.2%
Simplified86.2%
Final simplification76.2%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.35e-107) (* y (- x)) (* y (/ x (/ (+ z (* -0.5 (* (/ a z) t))) z)))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-107) {
tmp = y * -x;
} else {
tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.35d-107)) then
tmp = y * -x
else
tmp = y * (x / ((z + ((-0.5d0) * ((a / z) * t))) / z))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.35e-107) {
tmp = y * -x;
} else {
tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.35e-107: tmp = y * -x else: tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.35e-107) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * Float64(x / Float64(Float64(z + Float64(-0.5 * Float64(Float64(a / z) * t))) / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.35e-107)
tmp = y * -x;
else
tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.35e-107], N[(y * (-x)), $MachinePrecision], N[(y * N[(x / N[(N[(z + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-107}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\
\end{array}
\end{array}
if z < -1.35e-107Initial program 57.9%
associate-/l*60.3%
associate-*l/60.4%
associate-/l*59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in z around -inf 79.6%
mul-1-neg79.6%
Simplified79.6%
if -1.35e-107 < z Initial program 67.5%
associate-/l*67.9%
associate-*l/70.2%
Simplified70.2%
Taylor expanded in z around inf 72.1%
associate-/l*75.0%
Simplified75.1%
associate-/r/75.1%
Applied egg-rr75.1%
Final simplification76.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 4.7e-306) (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x) (* y (/ x (/ (+ z (* -0.5 (* (/ a z) t))) z)))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.7e-306) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else {
tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 4.7d-306) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else
tmp = y * (x / ((z + ((-0.5d0) * ((a / z) * t))) / z))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 4.7e-306) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else {
tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= 4.7e-306: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x else: tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 4.7e-306) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); else tmp = Float64(y * Float64(x / Float64(Float64(z + Float64(-0.5 * Float64(Float64(a / z) * t))) / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 4.7e-306)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
else
tmp = y * (x / ((z + (-0.5 * ((a / z) * t))) / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, 4.7e-306], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(y * N[(x / N[(N[(z + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.7 \cdot 10^{-306}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\frac{z + -0.5 \cdot \left(\frac{a}{z} \cdot t\right)}{z}}\\
\end{array}
\end{array}
if z < 4.7000000000000001e-306Initial program 63.1%
associate-/l*64.2%
associate-/l*65.8%
Simplified65.8%
Taylor expanded in z around -inf 68.2%
*-commutative68.2%
associate-*r/68.2%
*-commutative68.2%
associate-*r*68.2%
unpow268.2%
Simplified68.2%
associate-*l*68.2%
*-commutative68.2%
associate-*r*71.0%
times-frac72.2%
*-commutative72.2%
associate-*l/75.6%
associate-/r/75.6%
div-inv75.6%
clear-num75.6%
Applied egg-rr75.6%
Taylor expanded in y around -inf 68.4%
associate-*r/68.4%
mul-1-neg68.4%
distribute-rgt-neg-in68.4%
+-commutative68.4%
associate-/l*73.0%
unpow273.0%
associate-*r/75.6%
Simplified75.6%
div-inv75.6%
associate-*l*75.7%
*-commutative75.7%
div-inv75.7%
Applied egg-rr75.8%
if 4.7000000000000001e-306 < z Initial program 64.9%
associate-/l*66.0%
associate-*l/67.4%
Simplified67.4%
Taylor expanded in z around inf 77.4%
associate-/l*80.9%
Simplified80.9%
associate-/r/81.0%
Applied egg-rr81.0%
Final simplification78.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 8e-304) (* (/ y (- -1.0 (/ (/ a z) (/ z (/ t -2.0))))) x) (/ (* y x) (+ 1.0 (* -0.5 (* (/ a z) (/ t z)))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 8e-304) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 8d-304) then
tmp = (y / ((-1.0d0) - ((a / z) / (z / (t / (-2.0d0)))))) * x
else
tmp = (y * x) / (1.0d0 + ((-0.5d0) * ((a / z) * (t / z))))
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 8e-304) {
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
} else {
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= 8e-304: tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x else: tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z)))) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 8e-304) tmp = Float64(Float64(y / Float64(-1.0 - Float64(Float64(a / z) / Float64(z / Float64(t / -2.0))))) * x); else tmp = Float64(Float64(y * x) / Float64(1.0 + Float64(-0.5 * Float64(Float64(a / z) * Float64(t / z))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 8e-304)
tmp = (y / (-1.0 - ((a / z) / (z / (t / -2.0))))) * x;
else
tmp = (y * x) / (1.0 + (-0.5 * ((a / z) * (t / z))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, 8e-304], N[(N[(y / N[(-1.0 - N[(N[(a / z), $MachinePrecision] / N[(z / N[(t / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(y * x), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 8 \cdot 10^{-304}:\\
\;\;\;\;\frac{y}{-1 - \frac{\frac{a}{z}}{\frac{z}{\frac{t}{-2}}}} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{1 + -0.5 \cdot \left(\frac{a}{z} \cdot \frac{t}{z}\right)}\\
\end{array}
\end{array}
if z < 7.99999999999999977e-304Initial program 62.9%
associate-/l*64.0%
associate-/l*66.4%
Simplified66.4%
Taylor expanded in z around -inf 68.0%
*-commutative68.0%
associate-*r/68.0%
*-commutative68.0%
associate-*r*68.0%
unpow268.0%
Simplified68.0%
associate-*l*68.0%
*-commutative68.0%
associate-*r*70.7%
times-frac71.8%
*-commutative71.8%
associate-*l/75.2%
associate-/r/75.2%
div-inv75.2%
clear-num75.2%
Applied egg-rr75.2%
Taylor expanded in y around -inf 68.1%
associate-*r/68.1%
mul-1-neg68.1%
distribute-rgt-neg-in68.1%
+-commutative68.1%
associate-/l*72.6%
unpow272.6%
associate-*r/75.2%
Simplified75.2%
div-inv75.2%
associate-*l*75.3%
*-commutative75.3%
div-inv75.3%
Applied egg-rr75.4%
if 7.99999999999999977e-304 < z Initial program 65.1%
associate-/l*66.2%
Simplified66.2%
Taylor expanded in z around inf 77.8%
associate-/l*81.4%
Simplified81.4%
Taylor expanded in z around 0 76.7%
unpow276.7%
*-commutative76.7%
times-frac81.4%
Simplified81.4%
Final simplification78.6%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.7e-287) (* y (- x)) (if (<= z 9.5e-97) (/ (* z (* y x)) z) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.7e-287) {
tmp = y * -x;
} else if (z <= 9.5e-97) {
tmp = (z * (y * x)) / z;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.7d-287)) then
tmp = y * -x
else if (z <= 9.5d-97) then
tmp = (z * (y * x)) / z
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.7e-287) {
tmp = y * -x;
} else if (z <= 9.5e-97) {
tmp = (z * (y * x)) / z;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4.7e-287: tmp = y * -x elif z <= 9.5e-97: tmp = (z * (y * x)) / z else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.7e-287) tmp = Float64(y * Float64(-x)); elseif (z <= 9.5e-97) tmp = Float64(Float64(z * Float64(y * x)) / z); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.7e-287)
tmp = y * -x;
elseif (z <= 9.5e-97)
tmp = (z * (y * x)) / z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.7e-287], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 9.5e-97], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{-287}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-97}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.6999999999999999e-287Initial program 62.1%
associate-/l*63.3%
associate-*l/65.8%
associate-/l*64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in z around -inf 71.5%
mul-1-neg71.5%
Simplified71.5%
if -4.6999999999999999e-287 < z < 9.5000000000000001e-97Initial program 80.3%
Taylor expanded in z around inf 41.0%
if 9.5000000000000001e-97 < z Initial program 61.0%
associate-/l*63.9%
associate-/l*63.0%
Simplified63.0%
Taylor expanded in z around inf 88.1%
*-commutative88.1%
Simplified88.1%
Final simplification74.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.3e-297) (* y (- x)) (* y x)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-297) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.3d-297)) then
tmp = y * -x
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-297) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.3e-297: tmp = y * -x else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e-297) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.3e-297)
tmp = y * -x;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e-297], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-297}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.2999999999999999e-297Initial program 62.1%
associate-/l*63.3%
associate-*l/65.8%
associate-/l*64.7%
*-commutative64.7%
Simplified64.7%
Taylor expanded in z around -inf 71.5%
mul-1-neg71.5%
Simplified71.5%
if -2.2999999999999999e-297 < z Initial program 65.7%
associate-/l*66.7%
associate-/l*66.7%
Simplified66.7%
Taylor expanded in z around inf 72.8%
*-commutative72.8%
Simplified72.8%
Final simplification72.2%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y x))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
return y * x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y * x
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): return y * x
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) return Float64(y * x) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = y * x;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
y \cdot x
\end{array}
Initial program 64.1%
associate-/l*65.2%
associate-/l*65.9%
Simplified65.9%
Taylor expanded in z around inf 47.6%
*-commutative47.6%
Simplified47.6%
Final simplification47.6%
(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 2023297
(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)))))