
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (* x (/ z (sqrt (- (* z z) (* a t))))))))
(if (<= z -1e+154)
(* x (- y))
(if (<= z -2.9e-289)
t_1
(if (<= z 9.5e-86)
(* (* z y) (/ x (sqrt (* a (- t)))))
(if (<= z 4.4e+55) t_1 (* x y)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x * (z / sqrt(((z * z) - (a * t)))));
double tmp;
if (z <= -1e+154) {
tmp = x * -y;
} else if (z <= -2.9e-289) {
tmp = t_1;
} else if (z <= 9.5e-86) {
tmp = (z * y) * (x / sqrt((a * -t)));
} else if (z <= 4.4e+55) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * (x * (z / sqrt(((z * z) - (a * t)))))
if (z <= (-1d+154)) then
tmp = x * -y
else if (z <= (-2.9d-289)) then
tmp = t_1
else if (z <= 9.5d-86) then
tmp = (z * y) * (x / sqrt((a * -t)))
else if (z <= 4.4d+55) then
tmp = t_1
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (x * (z / Math.sqrt(((z * z) - (a * t)))));
double tmp;
if (z <= -1e+154) {
tmp = x * -y;
} else if (z <= -2.9e-289) {
tmp = t_1;
} else if (z <= 9.5e-86) {
tmp = (z * y) * (x / Math.sqrt((a * -t)));
} else if (z <= 4.4e+55) {
tmp = t_1;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = y * (x * (z / math.sqrt(((z * z) - (a * t))))) tmp = 0 if z <= -1e+154: tmp = x * -y elif z <= -2.9e-289: tmp = t_1 elif z <= 9.5e-86: tmp = (z * y) * (x / math.sqrt((a * -t))) elif z <= 4.4e+55: tmp = t_1 else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(y * Float64(x * Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))))) tmp = 0.0 if (z <= -1e+154) tmp = Float64(x * Float64(-y)); elseif (z <= -2.9e-289) tmp = t_1; elseif (z <= 9.5e-86) tmp = Float64(Float64(z * y) * Float64(x / sqrt(Float64(a * Float64(-t))))); elseif (z <= 4.4e+55) tmp = t_1; else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = y * (x * (z / sqrt(((z * z) - (a * t)))));
tmp = 0.0;
if (z <= -1e+154)
tmp = x * -y;
elseif (z <= -2.9e-289)
tmp = t_1;
elseif (z <= 9.5e-86)
tmp = (z * y) * (x / sqrt((a * -t)));
elseif (z <= 4.4e+55)
tmp = t_1;
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(x * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+154], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -2.9e-289], t$95$1, If[LessEqual[z, 9.5e-86], N[(N[(z * y), $MachinePrecision] * N[(x / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.4e+55], t$95$1, N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-289}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-86}:\\
\;\;\;\;\left(z \cdot y\right) \cdot \frac{x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.00000000000000004e154Initial program 13.6%
*-commutative13.6%
associate-*l*13.0%
associate-*r/13.3%
Simplified13.3%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.00000000000000004e154 < z < -2.90000000000000006e-289 or 9.4999999999999996e-86 < z < 4.40000000000000021e55Initial program 83.3%
associate-/l*84.3%
Simplified84.3%
associate-*l/88.0%
associate-/l*86.2%
div-inv86.1%
associate-*l*88.6%
div-inv88.8%
Applied egg-rr88.8%
if -2.90000000000000006e-289 < z < 9.4999999999999996e-86Initial program 66.8%
*-commutative66.8%
associate-*l*75.2%
associate-*r/72.7%
Simplified72.7%
*-commutative72.7%
associate-/l*64.3%
associate-/r/77.4%
associate-/l/86.0%
*-commutative86.0%
Applied egg-rr86.0%
associate-/r/85.9%
Applied egg-rr85.9%
Taylor expanded in z around 0 85.9%
associate-*r*85.9%
neg-mul-185.9%
Simplified85.9%
if 4.40000000000000021e55 < z Initial program 45.4%
*-commutative45.4%
associate-*l*43.8%
associate-*r/47.8%
Simplified47.8%
Taylor expanded in z around inf 100.0%
Final simplification94.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.6e+110) (* x (- y)) (if (<= z 3.6e+55) (* y (/ (* z x) (sqrt (- (* z z) (* a t))))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e+110) {
tmp = x * -y;
} else if (z <= 3.6e+55) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.6d+110)) then
tmp = x * -y
else if (z <= 3.6d+55) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e+110) {
tmp = x * -y;
} else if (z <= 3.6e+55) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.6e+110: tmp = x * -y elif z <= 3.6e+55: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e+110) tmp = Float64(x * Float64(-y)); elseif (z <= 3.6e+55) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.6e+110)
tmp = x * -y;
elseif (z <= 3.6e+55)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e+110], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.6e+55], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+110}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+55}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.6e110Initial program 29.7%
*-commutative29.7%
associate-*l*29.1%
associate-*r/29.4%
Simplified29.4%
Taylor expanded in z around -inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -2.6e110 < z < 3.59999999999999987e55Initial program 79.0%
*-commutative79.0%
associate-*l*81.0%
associate-*r/82.9%
Simplified82.9%
if 3.59999999999999987e55 < z Initial program 45.4%
*-commutative45.4%
associate-*l*43.8%
associate-*r/47.8%
Simplified47.8%
Taylor expanded in z around inf 100.0%
Final simplification92.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.05e+61) (* (/ x (fma 0.5 (* (/ a z) (/ t z)) -1.0)) y) (if (<= z 8.4e+54) (* (/ x (sqrt (- (* z z) (* a t)))) (* z y)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.05e+61) {
tmp = (x / fma(0.5, ((a / z) * (t / z)), -1.0)) * y;
} else if (z <= 8.4e+54) {
tmp = (x / sqrt(((z * z) - (a * t)))) * (z * y);
} else {
tmp = x * y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.05e+61) tmp = Float64(Float64(x / fma(0.5, Float64(Float64(a / z) * Float64(t / z)), -1.0)) * y); elseif (z <= 8.4e+54) tmp = Float64(Float64(x / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(z * y)); else tmp = Float64(x * y); end return tmp end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.05e+61], N[(N[(x / N[(0.5 * N[(N[(a / z), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 8.4e+54], N[(N[(x / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.05 \cdot 10^{+61}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(0.5, \frac{a}{z} \cdot \frac{t}{z}, -1\right)} \cdot y\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{+54}:\\
\;\;\;\;\frac{x}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.0499999999999998e61Initial program 37.9%
associate-/l*39.7%
Simplified39.7%
Taylor expanded in z around -inf 93.4%
associate-*r/93.4%
*-commutative93.4%
Applied egg-rr93.4%
div-inv93.4%
+-commutative93.4%
*-commutative93.4%
fma-def93.4%
associate-/l*93.4%
Applied egg-rr93.4%
associate-*r/93.4%
*-commutative93.4%
*-rgt-identity93.4%
*-commutative93.4%
rem-log-exp14.9%
fma-udef14.9%
*-commutative14.9%
neg-mul-114.9%
prod-exp14.9%
*-commutative14.9%
prod-exp14.9%
rem-log-exp93.4%
unsub-neg93.4%
associate-/r/93.4%
*-commutative93.4%
Simplified93.4%
expm1-log1p-u64.3%
expm1-udef37.4%
associate-/l*37.5%
div-sub37.5%
*-commutative37.5%
*-commutative37.5%
pow137.5%
pow137.5%
pow-div37.5%
metadata-eval37.5%
metadata-eval37.5%
Applied egg-rr37.5%
expm1-def64.2%
expm1-log1p93.2%
associate-/r/93.5%
associate-*r/93.5%
*-commutative93.5%
*-commutative93.5%
associate-/r*93.3%
unpow293.3%
associate-*r/93.3%
fma-neg93.3%
unpow293.3%
times-frac98.7%
metadata-eval98.7%
Simplified98.7%
if -4.0499999999999998e61 < z < 8.39999999999999943e54Initial program 77.9%
*-commutative77.9%
associate-*l*80.2%
associate-*r/82.2%
Simplified82.2%
*-commutative82.2%
associate-/l*81.2%
associate-/r/83.0%
associate-/l/83.0%
*-commutative83.0%
Applied egg-rr83.0%
associate-/r/83.7%
Applied egg-rr83.7%
if 8.39999999999999943e54 < z Initial program 45.4%
*-commutative45.4%
associate-*l*43.8%
associate-*r/47.8%
Simplified47.8%
Taylor expanded in z around inf 100.0%
Final simplification92.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4e+81) (* x (- y)) (if (<= z 1.32e+54) (* (/ x (sqrt (- (* z z) (* a t)))) (* z y)) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+81) {
tmp = x * -y;
} else if (z <= 1.32e+54) {
tmp = (x / sqrt(((z * z) - (a * t)))) * (z * y);
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4d+81)) then
tmp = x * -y
else if (z <= 1.32d+54) then
tmp = (x / sqrt(((z * z) - (a * t)))) * (z * y)
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+81) {
tmp = x * -y;
} else if (z <= 1.32e+54) {
tmp = (x / Math.sqrt(((z * z) - (a * t)))) * (z * y);
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4e+81: tmp = x * -y elif z <= 1.32e+54: tmp = (x / math.sqrt(((z * z) - (a * t)))) * (z * y) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+81) tmp = Float64(x * Float64(-y)); elseif (z <= 1.32e+54) tmp = Float64(Float64(x / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(z * y)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4e+81)
tmp = x * -y;
elseif (z <= 1.32e+54)
tmp = (x / sqrt(((z * z) - (a * t)))) * (z * y);
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+81], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.32e+54], N[(N[(x / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+81}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+54}:\\
\;\;\;\;\frac{x}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.99999999999999969e81Initial program 36.6%
*-commutative36.6%
associate-*l*36.1%
associate-*r/36.3%
Simplified36.3%
Taylor expanded in z around -inf 99.6%
neg-mul-199.6%
Simplified99.6%
if -3.99999999999999969e81 < z < 1.3200000000000001e54Initial program 77.6%
*-commutative77.6%
associate-*l*79.8%
associate-*r/81.8%
Simplified81.8%
*-commutative81.8%
associate-/l*80.9%
associate-/r/82.6%
associate-/l/82.6%
*-commutative82.6%
Applied egg-rr82.6%
associate-/r/83.3%
Applied egg-rr83.3%
if 1.3200000000000001e54 < z Initial program 45.4%
*-commutative45.4%
associate-*l*43.8%
associate-*r/47.8%
Simplified47.8%
Taylor expanded in z around inf 100.0%
Final simplification92.7%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.25e-125)
(/ (* x y) (/ (- (* -0.5 (* (/ a z) t)) z) z))
(if (<= z 240000.0)
(* y (/ (* z x) (sqrt (* a (- t)))))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.25e-125) {
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
} else if (z <= 240000.0) {
tmp = y * ((z * x) / sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.25d-125)) then
tmp = (x * y) / ((((-0.5d0) * ((a / z) * t)) - z) / z)
else if (z <= 240000.0d0) then
tmp = y * ((z * x) / sqrt((a * -t)))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.25e-125) {
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
} else if (z <= 240000.0) {
tmp = y * ((z * x) / Math.sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.25e-125: tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z) elif z <= 240000.0: tmp = y * ((z * x) / math.sqrt((a * -t))) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.25e-125) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(-0.5 * Float64(Float64(a / z) * t)) - z) / z)); elseif (z <= 240000.0) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.25e-125)
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
elseif (z <= 240000.0)
tmp = y * ((z * x) / sqrt((a * -t)));
else
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.25e-125], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 240000.0], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-125}:\\
\;\;\;\;\frac{x \cdot y}{\frac{-0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}{z}}\\
\mathbf{elif}\;z \leq 240000:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -1.24999999999999992e-125Initial program 52.5%
associate-/l*53.8%
Simplified53.8%
Taylor expanded in z around -inf 90.3%
associate-*r/90.3%
frac-2neg90.3%
*-commutative90.3%
mul-1-neg90.3%
add-sqr-sqrt90.3%
sqrt-unprod90.2%
mul-1-neg90.2%
mul-1-neg90.2%
sqr-neg90.2%
sqrt-prod0.0%
add-sqr-sqrt89.8%
Applied egg-rr89.8%
distribute-frac-neg89.8%
*-commutative89.8%
associate-*r/89.8%
associate-/l*93.5%
distribute-lft-neg-in93.5%
metadata-eval93.5%
associate-/r/93.5%
*-commutative93.5%
Simplified93.5%
if -1.24999999999999992e-125 < z < 2.4e5Initial program 72.9%
*-commutative72.9%
associate-*l*79.5%
associate-*r/78.3%
Simplified78.3%
Taylor expanded in z around 0 67.2%
associate-*r*70.1%
neg-mul-170.1%
Simplified67.2%
if 2.4e5 < z Initial program 49.6%
associate-/l*55.5%
Simplified55.5%
Taylor expanded in z around inf 94.8%
unpow294.8%
associate-/l*98.4%
Simplified98.4%
Final simplification88.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.45e-121)
(/ (* x y) (/ (- (* -0.5 (* (/ a z) t)) z) z))
(if (<= z 240000.0)
(* (* z y) (/ x (sqrt (* a (- t)))))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-121) {
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
} else if (z <= 240000.0) {
tmp = (z * y) * (x / sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.45d-121)) then
tmp = (x * y) / ((((-0.5d0) * ((a / z) * t)) - z) / z)
else if (z <= 240000.0d0) then
tmp = (z * y) * (x / sqrt((a * -t)))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-121) {
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
} else if (z <= 240000.0) {
tmp = (z * y) * (x / Math.sqrt((a * -t)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.45e-121: tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z) elif z <= 240000.0: tmp = (z * y) * (x / math.sqrt((a * -t))) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e-121) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(-0.5 * Float64(Float64(a / z) * t)) - z) / z)); elseif (z <= 240000.0) tmp = Float64(Float64(z * y) * Float64(x / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.45e-121)
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
elseif (z <= 240000.0)
tmp = (z * y) * (x / sqrt((a * -t)));
else
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e-121], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 240000.0], N[(N[(z * y), $MachinePrecision] * N[(x / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-121}:\\
\;\;\;\;\frac{x \cdot y}{\frac{-0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}{z}}\\
\mathbf{elif}\;z \leq 240000:\\
\;\;\;\;\left(z \cdot y\right) \cdot \frac{x}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -1.45e-121Initial program 52.5%
associate-/l*53.8%
Simplified53.8%
Taylor expanded in z around -inf 90.3%
associate-*r/90.3%
frac-2neg90.3%
*-commutative90.3%
mul-1-neg90.3%
add-sqr-sqrt90.3%
sqrt-unprod90.2%
mul-1-neg90.2%
mul-1-neg90.2%
sqr-neg90.2%
sqrt-prod0.0%
add-sqr-sqrt89.8%
Applied egg-rr89.8%
distribute-frac-neg89.8%
*-commutative89.8%
associate-*r/89.8%
associate-/l*93.5%
distribute-lft-neg-in93.5%
metadata-eval93.5%
associate-/r/93.5%
*-commutative93.5%
Simplified93.5%
if -1.45e-121 < z < 2.4e5Initial program 72.9%
*-commutative72.9%
associate-*l*79.5%
associate-*r/78.3%
Simplified78.3%
*-commutative78.3%
associate-/l*74.0%
associate-/r/77.0%
associate-/l/79.9%
*-commutative79.9%
Applied egg-rr79.9%
associate-/r/81.3%
Applied egg-rr81.3%
Taylor expanded in z around 0 70.1%
associate-*r*70.1%
neg-mul-170.1%
Simplified70.1%
if 2.4e5 < z Initial program 49.6%
associate-/l*55.5%
Simplified55.5%
Taylor expanded in z around inf 94.8%
unpow294.8%
associate-/l*98.4%
Simplified98.4%
Final simplification89.1%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.55e-121)
(/ (* x y) (/ (- (* -0.5 (* (/ a z) t)) z) z))
(if (<= z 9.5e-88)
(/ x (/ (sqrt (* a (- t))) (* z y)))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-121) {
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
} else if (z <= 9.5e-88) {
tmp = x / (sqrt((a * -t)) / (z * y));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.55d-121)) then
tmp = (x * y) / ((((-0.5d0) * ((a / z) * t)) - z) / z)
else if (z <= 9.5d-88) then
tmp = x / (sqrt((a * -t)) / (z * y))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-121) {
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
} else if (z <= 9.5e-88) {
tmp = x / (Math.sqrt((a * -t)) / (z * y));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.55e-121: tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z) elif z <= 9.5e-88: tmp = x / (math.sqrt((a * -t)) / (z * y)) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e-121) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(-0.5 * Float64(Float64(a / z) * t)) - z) / z)); elseif (z <= 9.5e-88) tmp = Float64(x / Float64(sqrt(Float64(a * Float64(-t))) / Float64(z * y))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.55e-121)
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
elseif (z <= 9.5e-88)
tmp = x / (sqrt((a * -t)) / (z * y));
else
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e-121], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-88], N[(x / N[(N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-121}:\\
\;\;\;\;\frac{x \cdot y}{\frac{-0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}{z}}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{a \cdot \left(-t\right)}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -1.5499999999999999e-121Initial program 52.5%
associate-/l*53.8%
Simplified53.8%
Taylor expanded in z around -inf 90.3%
associate-*r/90.3%
frac-2neg90.3%
*-commutative90.3%
mul-1-neg90.3%
add-sqr-sqrt90.3%
sqrt-unprod90.2%
mul-1-neg90.2%
mul-1-neg90.2%
sqr-neg90.2%
sqrt-prod0.0%
add-sqr-sqrt89.8%
Applied egg-rr89.8%
distribute-frac-neg89.8%
*-commutative89.8%
associate-*r/89.8%
associate-/l*93.5%
distribute-lft-neg-in93.5%
metadata-eval93.5%
associate-/r/93.5%
*-commutative93.5%
Simplified93.5%
if -1.5499999999999999e-121 < z < 9.5e-88Initial program 69.1%
*-commutative69.1%
associate-*l*76.2%
associate-*r/74.2%
Simplified74.2%
*-commutative74.2%
associate-/l*68.4%
associate-/r/74.4%
associate-/l/78.4%
*-commutative78.4%
Applied egg-rr78.4%
Taylor expanded in z around 0 76.3%
associate-*r*76.3%
neg-mul-176.3%
Simplified76.3%
if 9.5e-88 < z Initial program 55.5%
associate-/l*60.5%
Simplified60.5%
Taylor expanded in z around inf 87.6%
unpow287.6%
associate-/l*90.5%
Simplified90.5%
Final simplification89.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.7e+81) (* x (- y)) (if (<= z 9.5e-86) (* z (/ (* x y) (- (* (/ 0.5 z) (* a t)) z))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+81) {
tmp = x * -y;
} else if (z <= 9.5e-86) {
tmp = z * ((x * y) / (((0.5 / z) * (a * t)) - z));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.7d+81)) then
tmp = x * -y
else if (z <= 9.5d-86) then
tmp = z * ((x * y) / (((0.5d0 / z) * (a * t)) - z))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.7e+81) {
tmp = x * -y;
} else if (z <= 9.5e-86) {
tmp = z * ((x * y) / (((0.5 / z) * (a * t)) - z));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -3.7e+81: tmp = x * -y elif z <= 9.5e-86: tmp = z * ((x * y) / (((0.5 / z) * (a * t)) - z)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.7e+81) tmp = Float64(x * Float64(-y)); elseif (z <= 9.5e-86) tmp = Float64(z * Float64(Float64(x * y) / Float64(Float64(Float64(0.5 / z) * Float64(a * t)) - z))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.7e+81)
tmp = x * -y;
elseif (z <= 9.5e-86)
tmp = z * ((x * y) / (((0.5 / z) * (a * t)) - z));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.7e+81], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 9.5e-86], N[(z * N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 / z), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+81}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-86}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{\frac{0.5}{z} \cdot \left(a \cdot t\right) - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -3.7000000000000001e81Initial program 36.6%
*-commutative36.6%
associate-*l*36.1%
associate-*r/36.3%
Simplified36.3%
Taylor expanded in z around -inf 99.6%
neg-mul-199.6%
Simplified99.6%
if -3.7000000000000001e81 < z < 9.4999999999999996e-86Initial program 75.1%
associate-/l*76.2%
Simplified76.2%
Taylor expanded in z around -inf 56.2%
associate-*r/56.2%
*-commutative56.2%
Applied egg-rr56.2%
expm1-log1p-u51.1%
expm1-udef36.8%
associate-/r/36.8%
+-commutative36.8%
*-commutative36.8%
fma-def36.8%
associate-/l*36.8%
Applied egg-rr36.8%
expm1-def51.0%
expm1-log1p56.3%
*-commutative56.3%
rem-log-exp30.7%
fma-udef30.7%
*-commutative30.7%
neg-mul-130.7%
prod-exp30.0%
*-commutative30.0%
prod-exp30.7%
rem-log-exp56.3%
unsub-neg56.3%
associate-/r/56.3%
*-commutative56.3%
Simplified56.3%
if 9.4999999999999996e-86 < z Initial program 56.0%
*-commutative56.0%
associate-*l*55.7%
associate-*r/59.7%
Simplified59.7%
Taylor expanded in z around inf 91.1%
Final simplification82.2%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -4e+81)
(* x (- y))
(if (<= z -8.2e-232)
(* z (/ (* x y) (- (* (/ 0.5 z) (* a t)) z)))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+81) {
tmp = x * -y;
} else if (z <= -8.2e-232) {
tmp = z * ((x * y) / (((0.5 / z) * (a * t)) - z));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4d+81)) then
tmp = x * -y
else if (z <= (-8.2d-232)) then
tmp = z * ((x * y) / (((0.5d0 / z) * (a * t)) - z))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+81) {
tmp = x * -y;
} else if (z <= -8.2e-232) {
tmp = z * ((x * y) / (((0.5 / z) * (a * t)) - z));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -4e+81: tmp = x * -y elif z <= -8.2e-232: tmp = z * ((x * y) / (((0.5 / z) * (a * t)) - z)) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+81) tmp = Float64(x * Float64(-y)); elseif (z <= -8.2e-232) tmp = Float64(z * Float64(Float64(x * y) / Float64(Float64(Float64(0.5 / z) * Float64(a * t)) - z))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4e+81)
tmp = x * -y;
elseif (z <= -8.2e-232)
tmp = z * ((x * y) / (((0.5 / z) * (a * t)) - z));
else
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+81], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -8.2e-232], N[(z * N[(N[(x * y), $MachinePrecision] / N[(N[(N[(0.5 / z), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+81}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-232}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{\frac{0.5}{z} \cdot \left(a \cdot t\right) - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -3.99999999999999969e81Initial program 36.6%
*-commutative36.6%
associate-*l*36.1%
associate-*r/36.3%
Simplified36.3%
Taylor expanded in z around -inf 99.6%
neg-mul-199.6%
Simplified99.6%
if -3.99999999999999969e81 < z < -8.19999999999999945e-232Initial program 83.8%
associate-/l*82.2%
Simplified82.2%
Taylor expanded in z around -inf 69.2%
associate-*r/69.2%
*-commutative69.2%
Applied egg-rr69.2%
expm1-log1p-u61.4%
expm1-udef38.5%
associate-/r/38.4%
+-commutative38.4%
*-commutative38.4%
fma-def38.4%
associate-/l*38.4%
Applied egg-rr38.4%
expm1-def61.3%
expm1-log1p69.1%
*-commutative69.1%
rem-log-exp30.1%
fma-udef30.1%
*-commutative30.1%
neg-mul-130.1%
prod-exp29.1%
*-commutative29.1%
prod-exp30.1%
rem-log-exp69.1%
unsub-neg69.1%
associate-/r/69.1%
*-commutative69.1%
Simplified69.1%
if -8.19999999999999945e-232 < z Initial program 56.7%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around inf 75.9%
unpow275.9%
associate-/l*78.6%
Simplified78.6%
Final simplification82.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.3e-254) (* x (- y)) (if (<= z 9.5e-86) (* -2.0 (/ (* x (* y (* z z))) (* a t))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-254) {
tmp = x * -y;
} else if (z <= 9.5e-86) {
tmp = -2.0 * ((x * (y * (z * z))) / (a * t));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.3d-254)) then
tmp = x * -y
else if (z <= 9.5d-86) then
tmp = (-2.0d0) * ((x * (y * (z * z))) / (a * t))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-254) {
tmp = x * -y;
} else if (z <= 9.5e-86) {
tmp = -2.0 * ((x * (y * (z * z))) / (a * t));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.3e-254: tmp = x * -y elif z <= 9.5e-86: tmp = -2.0 * ((x * (y * (z * z))) / (a * t)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e-254) tmp = Float64(x * Float64(-y)); elseif (z <= 9.5e-86) tmp = Float64(-2.0 * Float64(Float64(x * Float64(y * Float64(z * z))) / Float64(a * t))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.3e-254)
tmp = x * -y;
elseif (z <= 9.5e-86)
tmp = -2.0 * ((x * (y * (z * z))) / (a * t));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e-254], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 9.5e-86], N[(-2.0 * N[(N[(x * N[(y * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-254}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-86}:\\
\;\;\;\;-2 \cdot \frac{x \cdot \left(y \cdot \left(z \cdot z\right)\right)}{a \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.2999999999999999e-254Initial program 55.8%
*-commutative55.8%
associate-*l*54.5%
associate-*r/55.8%
Simplified55.8%
Taylor expanded in z around -inf 80.7%
neg-mul-180.7%
Simplified80.7%
if -2.2999999999999999e-254 < z < 9.4999999999999996e-86Initial program 65.6%
associate-*l/73.1%
Simplified73.1%
Taylor expanded in z around inf 37.6%
Taylor expanded in z around 0 37.2%
associate-*r*37.4%
*-commutative37.4%
unpow237.4%
Simplified37.4%
if 9.4999999999999996e-86 < z Initial program 56.0%
*-commutative56.0%
associate-*l*55.7%
associate-*r/59.7%
Simplified59.7%
Taylor expanded in z around inf 91.1%
Final simplification80.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.75e-124) (* x (- y)) (if (<= z 9.5e-86) (* 2.0 (* (/ y a) (/ (* z (* z x)) t))) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-124) {
tmp = x * -y;
} else if (z <= 9.5e-86) {
tmp = 2.0 * ((y / a) * ((z * (z * x)) / t));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.75d-124)) then
tmp = x * -y
else if (z <= 9.5d-86) then
tmp = 2.0d0 * ((y / a) * ((z * (z * x)) / t))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-124) {
tmp = x * -y;
} else if (z <= 9.5e-86) {
tmp = 2.0 * ((y / a) * ((z * (z * x)) / t));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.75e-124: tmp = x * -y elif z <= 9.5e-86: tmp = 2.0 * ((y / a) * ((z * (z * x)) / t)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e-124) tmp = Float64(x * Float64(-y)); elseif (z <= 9.5e-86) tmp = Float64(2.0 * Float64(Float64(y / a) * Float64(Float64(z * Float64(z * x)) / t))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.75e-124)
tmp = x * -y;
elseif (z <= 9.5e-86)
tmp = 2.0 * ((y / a) * ((z * (z * x)) / t));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e-124], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 9.5e-86], N[(2.0 * N[(N[(y / a), $MachinePrecision] * N[(N[(z * N[(z * x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-124}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-86}:\\
\;\;\;\;2 \cdot \left(\frac{y}{a} \cdot \frac{z \cdot \left(z \cdot x\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.7499999999999999e-124Initial program 52.5%
*-commutative52.5%
associate-*l*50.4%
associate-*r/52.4%
Simplified52.4%
Taylor expanded in z around -inf 92.8%
neg-mul-192.8%
Simplified92.8%
if -1.7499999999999999e-124 < z < 9.4999999999999996e-86Initial program 67.7%
associate-/l*69.5%
Simplified69.5%
Taylor expanded in z around -inf 38.6%
Taylor expanded in a around inf 30.1%
times-frac31.2%
unpow231.2%
associate-*l*33.6%
Simplified33.6%
if 9.4999999999999996e-86 < z Initial program 56.0%
*-commutative56.0%
associate-*l*55.7%
associate-*r/59.7%
Simplified59.7%
Taylor expanded in z around inf 91.1%
Final simplification80.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -8.2e-232) (/ (* x y) (/ (- (* (/ 0.5 z) (* a t)) z) z)) (/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t)))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e-232) {
tmp = (x * y) / ((((0.5 / z) * (a * t)) - z) / z);
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8.2d-232)) then
tmp = (x * y) / ((((0.5d0 / z) * (a * t)) - z) / z)
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8.2e-232) {
tmp = (x * y) / ((((0.5 / z) * (a * t)) - z) / z);
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -8.2e-232: tmp = (x * y) / ((((0.5 / z) * (a * t)) - z) / z) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -8.2e-232) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(Float64(0.5 / z) * Float64(a * t)) - z) / z)); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -8.2e-232)
tmp = (x * y) / ((((0.5 / z) * (a * t)) - z) / z);
else
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.2e-232], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(N[(0.5 / z), $MachinePrecision] * N[(a * t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{-232}:\\
\;\;\;\;\frac{x \cdot y}{\frac{\frac{0.5}{z} \cdot \left(a \cdot t\right) - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < -8.19999999999999945e-232Initial program 57.0%
associate-/l*57.4%
Simplified57.4%
Taylor expanded in z around -inf 83.5%
associate-*r/83.5%
*-commutative83.5%
Applied egg-rr83.5%
div-inv83.5%
+-commutative83.5%
*-commutative83.5%
fma-def83.5%
associate-/l*83.5%
Applied egg-rr83.5%
associate-*r/83.5%
*-commutative83.5%
*-rgt-identity83.5%
*-commutative83.5%
rem-log-exp20.9%
fma-udef20.9%
*-commutative20.9%
neg-mul-120.9%
prod-exp20.5%
*-commutative20.5%
prod-exp20.9%
rem-log-exp83.5%
unsub-neg83.5%
associate-/r/83.5%
*-commutative83.5%
Simplified83.5%
if -8.19999999999999945e-232 < z Initial program 56.7%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in z around inf 75.9%
unpow275.9%
associate-/l*78.6%
Simplified78.6%
Final simplification81.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 3e-107) (/ (* x y) (/ (- (* -0.5 (* (/ a z) t)) z) z)) (/ (* x y) (+ 1.0 (* -0.5 (/ a (/ (* z z) t)))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 3e-107) {
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 3d-107) then
tmp = (x * y) / ((((-0.5d0) * ((a / z) * t)) - z) / z)
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / ((z * z) / t))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 3e-107) {
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= 3e-107: tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z) else: tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 3e-107) tmp = Float64(Float64(x * y) / Float64(Float64(Float64(-0.5 * Float64(Float64(a / z) * t)) - z) / z)); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 3e-107)
tmp = (x * y) / (((-0.5 * ((a / z) * t)) - z) / z);
else
tmp = (x * y) / (1.0 + (-0.5 * (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, 3e-107], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(-0.5 * N[(N[(a / z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3 \cdot 10^{-107}:\\
\;\;\;\;\frac{x \cdot y}{\frac{-0.5 \cdot \left(\frac{a}{z} \cdot t\right) - z}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{\frac{z \cdot z}{t}}}\\
\end{array}
\end{array}
if z < 2.9999999999999997e-107Initial program 57.4%
associate-/l*58.9%
Simplified58.9%
Taylor expanded in z around -inf 74.3%
associate-*r/74.3%
frac-2neg74.3%
*-commutative74.3%
mul-1-neg74.3%
add-sqr-sqrt69.5%
sqrt-unprod72.2%
mul-1-neg72.2%
mul-1-neg72.2%
sqr-neg72.2%
sqrt-prod5.0%
add-sqr-sqrt73.8%
Applied egg-rr73.8%
distribute-frac-neg73.8%
*-commutative73.8%
associate-*r/73.8%
associate-/l*76.7%
distribute-lft-neg-in76.7%
metadata-eval76.7%
associate-/r/76.7%
*-commutative76.7%
Simplified76.7%
if 2.9999999999999997e-107 < z Initial program 55.9%
associate-/l*60.8%
Simplified60.8%
Taylor expanded in z around inf 87.4%
unpow287.4%
associate-/l*90.3%
Simplified90.3%
Final simplification82.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2e-310) (* x (- y)) (* x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-310) {
tmp = x * -y;
} else {
tmp = x * y;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2d-310)) then
tmp = x * -y
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-310) {
tmp = x * -y;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2e-310: tmp = x * -y else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-310) tmp = Float64(x * Float64(-y)); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2e-310)
tmp = x * -y;
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-310], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.999999999999994e-310Initial program 55.3%
*-commutative55.3%
associate-*l*55.5%
associate-*r/56.8%
Simplified56.8%
Taylor expanded in z around -inf 78.9%
neg-mul-178.9%
Simplified78.9%
if -1.999999999999994e-310 < z Initial program 58.4%
*-commutative58.4%
associate-*l*58.9%
associate-*r/61.8%
Simplified61.8%
Taylor expanded in z around inf 78.9%
Final simplification78.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x y))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return x * y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x * y
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return x * y;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return x * y
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(x * y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = x * y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot y
\end{array}
Initial program 56.8%
*-commutative56.8%
associate-*l*57.2%
associate-*r/59.2%
Simplified59.2%
Taylor expanded in z around inf 45.4%
Final simplification45.4%
(FPCore (x y z t a)
:precision binary64
(if (< z -3.1921305903852764e+46)
(- (* y x))
(if (< z 5.976268120920894e+90)
(/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
(* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z < (-3.1921305903852764d+46)) then
tmp = -(y * x)
else if (z < 5.976268120920894d+90) then
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z < -3.1921305903852764e+46: tmp = -(y * x) elif z < 5.976268120920894e+90: tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y) else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z < -3.1921305903852764e+46) tmp = Float64(-Float64(y * x)); elseif (z < 5.976268120920894e+90) tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z < -3.1921305903852764e+46) tmp = -(y * x); elseif (z < 5.976268120920894e+90) tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
herbie shell --seed 2023221
(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)))))