
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* a t)))))
(if (<= z -1.25e+104)
(* (* (/ z (fma 0.5 (/ a (/ z t)) (- z))) x) y)
(if (<= z 1e-302)
(/ z (/ t_1 (* x y)))
(if (<= z 1.1e-127)
(/ (* x (* z y)) (sqrt (* a (- t))))
(if (<= z 2e+118) (* y (* x (/ z t_1))) (* x y)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -1.25e+104) {
tmp = ((z / fma(0.5, (a / (z / t)), -z)) * x) * y;
} else if (z <= 1e-302) {
tmp = z / (t_1 / (x * y));
} else if (z <= 1.1e-127) {
tmp = (x * (z * y)) / sqrt((a * -t));
} else if (z <= 2e+118) {
tmp = y * (x * (z / t_1));
} else {
tmp = x * y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) tmp = 0.0 if (z <= -1.25e+104) tmp = Float64(Float64(Float64(z / fma(0.5, Float64(a / Float64(z / t)), Float64(-z))) * x) * y); elseif (z <= 1e-302) tmp = Float64(z / Float64(t_1 / Float64(x * y))); elseif (z <= 1.1e-127) tmp = Float64(Float64(x * Float64(z * y)) / sqrt(Float64(a * Float64(-t)))); elseif (z <= 2e+118) tmp = Float64(y * Float64(x * Float64(z / t_1))); 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_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.25e+104], N[(N[(N[(z / N[(0.5 * N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] + (-z)), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 1e-302], N[(z / N[(t$95$1 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-127], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+118], N[(y * N[(x * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+104}:\\
\;\;\;\;\left(\frac{z}{\mathsf{fma}\left(0.5, \frac{a}{\frac{z}{t}}, -z\right)} \cdot x\right) \cdot y\\
\mathbf{elif}\;z \leq 10^{-302}:\\
\;\;\;\;\frac{z}{\frac{t_1}{x \cdot y}}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-127}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+118}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.2499999999999999e104Initial program 32.1%
*-commutative32.1%
associate-/l*28.3%
Simplified28.3%
associate-/r/32.5%
associate-*r*32.6%
Applied egg-rr32.6%
Taylor expanded in z around -inf 93.5%
fma-def93.5%
associate-/l*98.3%
neg-mul-198.3%
Simplified98.3%
if -1.2499999999999999e104 < z < 9.9999999999999996e-303Initial program 82.0%
*-commutative82.0%
associate-/l*86.1%
Simplified86.1%
if 9.9999999999999996e-303 < z < 1.1000000000000001e-127Initial program 69.9%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in z around 0 83.5%
associate-*r*83.5%
neg-mul-183.5%
*-commutative83.5%
Simplified83.5%
if 1.1000000000000001e-127 < z < 1.99999999999999993e118Initial program 94.3%
*-commutative94.3%
associate-/l*91.3%
Simplified91.3%
associate-/r/96.3%
associate-*r*96.3%
Applied egg-rr96.3%
if 1.99999999999999993e118 < z Initial program 17.4%
associate-*l*17.0%
associate-*r/17.3%
Simplified17.3%
Taylor expanded in z around inf 100.0%
Final simplification93.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* x (/ z (/ (sqrt (- (* z z) (* a t))) y)))))
(if (<= z -1.05e+117)
(* x (- y))
(if (<= z -1.18e-116)
t_1
(if (<= z 1.35e-305)
(/ z (/ (sqrt (* a (- t))) (* x y)))
(if (<= z 2e+71)
t_1
(* y (* x (/ z (+ z (* (/ a (/ z t)) -0.5)))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = x * (z / (sqrt(((z * z) - (a * t))) / y));
double tmp;
if (z <= -1.05e+117) {
tmp = x * -y;
} else if (z <= -1.18e-116) {
tmp = t_1;
} else if (z <= 1.35e-305) {
tmp = z / (sqrt((a * -t)) / (x * y));
} else if (z <= 2e+71) {
tmp = t_1;
} else {
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z / (sqrt(((z * z) - (a * t))) / y))
if (z <= (-1.05d+117)) then
tmp = x * -y
else if (z <= (-1.18d-116)) then
tmp = t_1
else if (z <= 1.35d-305) then
tmp = z / (sqrt((a * -t)) / (x * y))
else if (z <= 2d+71) then
tmp = t_1
else
tmp = y * (x * (z / (z + ((a / (z / t)) * (-0.5d0)))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * (z / (Math.sqrt(((z * z) - (a * t))) / y));
double tmp;
if (z <= -1.05e+117) {
tmp = x * -y;
} else if (z <= -1.18e-116) {
tmp = t_1;
} else if (z <= 1.35e-305) {
tmp = z / (Math.sqrt((a * -t)) / (x * y));
} else if (z <= 2e+71) {
tmp = t_1;
} else {
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = x * (z / (math.sqrt(((z * z) - (a * t))) / y)) tmp = 0 if z <= -1.05e+117: tmp = x * -y elif z <= -1.18e-116: tmp = t_1 elif z <= 1.35e-305: tmp = z / (math.sqrt((a * -t)) / (x * y)) elif z <= 2e+71: tmp = t_1 else: tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(x * Float64(z / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y))) tmp = 0.0 if (z <= -1.05e+117) tmp = Float64(x * Float64(-y)); elseif (z <= -1.18e-116) tmp = t_1; elseif (z <= 1.35e-305) tmp = Float64(z / Float64(sqrt(Float64(a * Float64(-t))) / Float64(x * y))); elseif (z <= 2e+71) tmp = t_1; else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = x * (z / (sqrt(((z * z) - (a * t))) / y));
tmp = 0.0;
if (z <= -1.05e+117)
tmp = x * -y;
elseif (z <= -1.18e-116)
tmp = t_1;
elseif (z <= 1.35e-305)
tmp = z / (sqrt((a * -t)) / (x * y));
elseif (z <= 2e+71)
tmp = t_1;
else
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(z / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+117], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -1.18e-116], t$95$1, If[LessEqual[z, 1.35e-305], N[(z / N[(N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision] / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+71], t$95$1, N[(y * N[(x * N[(z / N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+117}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -1.18 \cdot 10^{-116}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-305}:\\
\;\;\;\;\frac{z}{\frac{\sqrt{a \cdot \left(-t\right)}}{x \cdot y}}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + \frac{a}{\frac{z}{t}} \cdot -0.5}\right)\\
\end{array}
\end{array}
if z < -1.0500000000000001e117Initial program 26.9%
associate-*l*24.9%
associate-*r/25.0%
Simplified25.0%
Taylor expanded in z around -inf 97.9%
mul-1-neg97.9%
distribute-rgt-neg-out97.9%
Simplified97.9%
if -1.0500000000000001e117 < z < -1.1800000000000001e-116 or 1.35e-305 < z < 2.0000000000000001e71Initial program 85.6%
associate-*l*89.3%
associate-*r/91.9%
*-commutative91.9%
associate-/l*91.1%
Simplified91.1%
if -1.1800000000000001e-116 < z < 1.35e-305Initial program 77.7%
*-commutative77.7%
associate-/l*78.1%
Simplified78.1%
Taylor expanded in z around 0 78.0%
associate-*r*59.3%
neg-mul-159.3%
*-commutative59.3%
Simplified78.0%
if 2.0000000000000001e71 < z Initial program 33.7%
*-commutative33.7%
associate-/l*31.1%
Simplified31.1%
associate-/r/35.8%
associate-*r*36.0%
Applied egg-rr36.0%
Taylor expanded in z around inf 90.4%
associate-/l*96.8%
Simplified96.8%
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
(let* ((t_1 (* x (/ (* z y) (sqrt (- (* z z) (* a t)))))))
(if (<= z -2.05e+123)
(* x (- y))
(if (<= z -2.4e-125)
t_1
(if (<= z 4e-305)
(/ z (/ (sqrt (* a (- t))) (* x y)))
(if (<= z 4e+71)
t_1
(* y (* x (/ z (+ z (* (/ a (/ z t)) -0.5)))))))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = x * ((z * y) / sqrt(((z * z) - (a * t))));
double tmp;
if (z <= -2.05e+123) {
tmp = x * -y;
} else if (z <= -2.4e-125) {
tmp = t_1;
} else if (z <= 4e-305) {
tmp = z / (sqrt((a * -t)) / (x * y));
} else if (z <= 4e+71) {
tmp = t_1;
} else {
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((z * y) / sqrt(((z * z) - (a * t))))
if (z <= (-2.05d+123)) then
tmp = x * -y
else if (z <= (-2.4d-125)) then
tmp = t_1
else if (z <= 4d-305) then
tmp = z / (sqrt((a * -t)) / (x * y))
else if (z <= 4d+71) then
tmp = t_1
else
tmp = y * (x * (z / (z + ((a / (z / t)) * (-0.5d0)))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x * ((z * y) / Math.sqrt(((z * z) - (a * t))));
double tmp;
if (z <= -2.05e+123) {
tmp = x * -y;
} else if (z <= -2.4e-125) {
tmp = t_1;
} else if (z <= 4e-305) {
tmp = z / (Math.sqrt((a * -t)) / (x * y));
} else if (z <= 4e+71) {
tmp = t_1;
} else {
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = x * ((z * y) / math.sqrt(((z * z) - (a * t)))) tmp = 0 if z <= -2.05e+123: tmp = x * -y elif z <= -2.4e-125: tmp = t_1 elif z <= 4e-305: tmp = z / (math.sqrt((a * -t)) / (x * y)) elif z <= 4e+71: tmp = t_1 else: tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(x * Float64(Float64(z * y) / sqrt(Float64(Float64(z * z) - Float64(a * t))))) tmp = 0.0 if (z <= -2.05e+123) tmp = Float64(x * Float64(-y)); elseif (z <= -2.4e-125) tmp = t_1; elseif (z <= 4e-305) tmp = Float64(z / Float64(sqrt(Float64(a * Float64(-t))) / Float64(x * y))); elseif (z <= 4e+71) tmp = t_1; else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = x * ((z * y) / sqrt(((z * z) - (a * t))));
tmp = 0.0;
if (z <= -2.05e+123)
tmp = x * -y;
elseif (z <= -2.4e-125)
tmp = t_1;
elseif (z <= 4e-305)
tmp = z / (sqrt((a * -t)) / (x * y));
elseif (z <= 4e+71)
tmp = t_1;
else
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(N[(z * y), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+123], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, -2.4e-125], t$95$1, If[LessEqual[z, 4e-305], N[(z / N[(N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision] / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+71], t$95$1, N[(y * N[(x * N[(z / N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x \cdot \frac{z \cdot y}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{if}\;z \leq -2.05 \cdot 10^{+123}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-305}:\\
\;\;\;\;\frac{z}{\frac{\sqrt{a \cdot \left(-t\right)}}{x \cdot y}}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + \frac{a}{\frac{z}{t}} \cdot -0.5}\right)\\
\end{array}
\end{array}
if z < -2.04999999999999995e123Initial program 25.5%
associate-*l*25.4%
associate-*r/25.5%
Simplified25.5%
Taylor expanded in z around -inf 97.9%
mul-1-neg97.9%
distribute-rgt-neg-out97.9%
Simplified97.9%
if -2.04999999999999995e123 < z < -2.4000000000000001e-125 or 3.99999999999999999e-305 < z < 4.0000000000000002e71Initial program 85.8%
associate-*l*88.7%
associate-*r/91.2%
Simplified91.2%
if -2.4000000000000001e-125 < z < 3.99999999999999999e-305Initial program 77.0%
*-commutative77.0%
associate-/l*80.5%
Simplified80.5%
Taylor expanded in z around 0 80.4%
associate-*r*61.0%
neg-mul-161.0%
*-commutative61.0%
Simplified80.4%
if 4.0000000000000002e71 < z Initial program 33.7%
*-commutative33.7%
associate-/l*31.1%
Simplified31.1%
associate-/r/35.8%
associate-*r*36.0%
Applied egg-rr36.0%
Taylor expanded in z around inf 90.4%
associate-/l*96.8%
Simplified96.8%
Final simplification92.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* a t)))))
(if (<= z -4.5e+104)
(* x (- y))
(if (<= z 2.7e-306)
(* z (/ (* x y) t_1))
(if (<= z 1.1e-127)
(/ (* x (* z y)) (sqrt (* a (- t))))
(if (<= z 2e+118) (* y (* x (/ z t_1))) (* x y)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -4.5e+104) {
tmp = x * -y;
} else if (z <= 2.7e-306) {
tmp = z * ((x * y) / t_1);
} else if (z <= 1.1e-127) {
tmp = (x * (z * y)) / sqrt((a * -t));
} else if (z <= 2e+118) {
tmp = y * (x * (z / 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 = sqrt(((z * z) - (a * t)))
if (z <= (-4.5d+104)) then
tmp = x * -y
else if (z <= 2.7d-306) then
tmp = z * ((x * y) / t_1)
else if (z <= 1.1d-127) then
tmp = (x * (z * y)) / sqrt((a * -t))
else if (z <= 2d+118) then
tmp = y * (x * (z / t_1))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -4.5e+104) {
tmp = x * -y;
} else if (z <= 2.7e-306) {
tmp = z * ((x * y) / t_1);
} else if (z <= 1.1e-127) {
tmp = (x * (z * y)) / Math.sqrt((a * -t));
} else if (z <= 2e+118) {
tmp = y * (x * (z / t_1));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (a * t))) tmp = 0 if z <= -4.5e+104: tmp = x * -y elif z <= 2.7e-306: tmp = z * ((x * y) / t_1) elif z <= 1.1e-127: tmp = (x * (z * y)) / math.sqrt((a * -t)) elif z <= 2e+118: tmp = y * (x * (z / t_1)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) tmp = 0.0 if (z <= -4.5e+104) tmp = Float64(x * Float64(-y)); elseif (z <= 2.7e-306) tmp = Float64(z * Float64(Float64(x * y) / t_1)); elseif (z <= 1.1e-127) tmp = Float64(Float64(x * Float64(z * y)) / sqrt(Float64(a * Float64(-t)))); elseif (z <= 2e+118) tmp = Float64(y * Float64(x * Float64(z / t_1))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (a * t)));
tmp = 0.0;
if (z <= -4.5e+104)
tmp = x * -y;
elseif (z <= 2.7e-306)
tmp = z * ((x * y) / t_1);
elseif (z <= 1.1e-127)
tmp = (x * (z * y)) / sqrt((a * -t));
elseif (z <= 2e+118)
tmp = y * (x * (z / t_1));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -4.5e+104], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.7e-306], N[(z * N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-127], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+118], N[(y * N[(x * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+104}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-306}:\\
\;\;\;\;z \cdot \frac{x \cdot y}{t_1}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-127}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+118}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.4999999999999998e104Initial program 32.1%
associate-*l*30.3%
associate-*r/30.4%
Simplified30.4%
Taylor expanded in z around -inf 98.1%
mul-1-neg98.1%
distribute-rgt-neg-out98.1%
Simplified98.1%
if -4.4999999999999998e104 < z < 2.70000000000000009e-306Initial program 82.0%
associate-*l/84.8%
Simplified84.8%
if 2.70000000000000009e-306 < z < 1.1000000000000001e-127Initial program 69.9%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in z around 0 83.5%
associate-*r*83.5%
neg-mul-183.5%
*-commutative83.5%
Simplified83.5%
if 1.1000000000000001e-127 < z < 1.99999999999999993e118Initial program 94.3%
*-commutative94.3%
associate-/l*91.3%
Simplified91.3%
associate-/r/96.3%
associate-*r*96.3%
Applied egg-rr96.3%
if 1.99999999999999993e118 < z Initial program 17.4%
associate-*l*17.0%
associate-*r/17.3%
Simplified17.3%
Taylor expanded in z around inf 100.0%
Final simplification92.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* a t)))))
(if (<= z -1.25e+104)
(* x (- y))
(if (<= z 9e-307)
(/ z (/ t_1 (* x y)))
(if (<= z 1.1e-127)
(/ (* x (* z y)) (sqrt (* a (- t))))
(if (<= z 2e+118) (* y (* x (/ z t_1))) (* x y)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -1.25e+104) {
tmp = x * -y;
} else if (z <= 9e-307) {
tmp = z / (t_1 / (x * y));
} else if (z <= 1.1e-127) {
tmp = (x * (z * y)) / sqrt((a * -t));
} else if (z <= 2e+118) {
tmp = y * (x * (z / 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 = sqrt(((z * z) - (a * t)))
if (z <= (-1.25d+104)) then
tmp = x * -y
else if (z <= 9d-307) then
tmp = z / (t_1 / (x * y))
else if (z <= 1.1d-127) then
tmp = (x * (z * y)) / sqrt((a * -t))
else if (z <= 2d+118) then
tmp = y * (x * (z / t_1))
else
tmp = x * y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -1.25e+104) {
tmp = x * -y;
} else if (z <= 9e-307) {
tmp = z / (t_1 / (x * y));
} else if (z <= 1.1e-127) {
tmp = (x * (z * y)) / Math.sqrt((a * -t));
} else if (z <= 2e+118) {
tmp = y * (x * (z / t_1));
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt(((z * z) - (a * t))) tmp = 0 if z <= -1.25e+104: tmp = x * -y elif z <= 9e-307: tmp = z / (t_1 / (x * y)) elif z <= 1.1e-127: tmp = (x * (z * y)) / math.sqrt((a * -t)) elif z <= 2e+118: tmp = y * (x * (z / t_1)) else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) tmp = 0.0 if (z <= -1.25e+104) tmp = Float64(x * Float64(-y)); elseif (z <= 9e-307) tmp = Float64(z / Float64(t_1 / Float64(x * y))); elseif (z <= 1.1e-127) tmp = Float64(Float64(x * Float64(z * y)) / sqrt(Float64(a * Float64(-t)))); elseif (z <= 2e+118) tmp = Float64(y * Float64(x * Float64(z / t_1))); else tmp = Float64(x * y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt(((z * z) - (a * t)));
tmp = 0.0;
if (z <= -1.25e+104)
tmp = x * -y;
elseif (z <= 9e-307)
tmp = z / (t_1 / (x * y));
elseif (z <= 1.1e-127)
tmp = (x * (z * y)) / sqrt((a * -t));
elseif (z <= 2e+118)
tmp = y * (x * (z / t_1));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.25e+104], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 9e-307], N[(z / N[(t$95$1 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-127], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e+118], N[(y * N[(x * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+104}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-307}:\\
\;\;\;\;\frac{z}{\frac{t_1}{x \cdot y}}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-127}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+118}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.2499999999999999e104Initial program 32.1%
associate-*l*30.3%
associate-*r/30.4%
Simplified30.4%
Taylor expanded in z around -inf 98.1%
mul-1-neg98.1%
distribute-rgt-neg-out98.1%
Simplified98.1%
if -1.2499999999999999e104 < z < 8.99999999999999978e-307Initial program 82.0%
*-commutative82.0%
associate-/l*86.1%
Simplified86.1%
if 8.99999999999999978e-307 < z < 1.1000000000000001e-127Initial program 69.9%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in z around 0 83.5%
associate-*r*83.5%
neg-mul-183.5%
*-commutative83.5%
Simplified83.5%
if 1.1000000000000001e-127 < z < 1.99999999999999993e118Initial program 94.3%
*-commutative94.3%
associate-/l*91.3%
Simplified91.3%
associate-/r/96.3%
associate-*r*96.3%
Applied egg-rr96.3%
if 1.99999999999999993e118 < z Initial program 17.4%
associate-*l*17.0%
associate-*r/17.3%
Simplified17.3%
Taylor expanded in z around inf 100.0%
Final simplification93.0%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (- (* z z) (* a t)))))
(if (<= z -6e+104)
(/ (* x y) (fma 0.5 (/ a (/ (* z z) t)) -1.0))
(if (<= z 2.9e-305)
(/ z (/ t_1 (* x y)))
(if (<= z 1.1e-127)
(/ (* x (* z y)) (sqrt (* a (- t))))
(if (<= z 1e+123) (* y (* x (/ z t_1))) (* x y)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt(((z * z) - (a * t)));
double tmp;
if (z <= -6e+104) {
tmp = (x * y) / fma(0.5, (a / ((z * z) / t)), -1.0);
} else if (z <= 2.9e-305) {
tmp = z / (t_1 / (x * y));
} else if (z <= 1.1e-127) {
tmp = (x * (z * y)) / sqrt((a * -t));
} else if (z <= 1e+123) {
tmp = y * (x * (z / t_1));
} else {
tmp = x * y;
}
return tmp;
}
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(Float64(z * z) - Float64(a * t))) tmp = 0.0 if (z <= -6e+104) tmp = Float64(Float64(x * y) / fma(0.5, Float64(a / Float64(Float64(z * z) / t)), -1.0)); elseif (z <= 2.9e-305) tmp = Float64(z / Float64(t_1 / Float64(x * y))); elseif (z <= 1.1e-127) tmp = Float64(Float64(x * Float64(z * y)) / sqrt(Float64(a * Float64(-t)))); elseif (z <= 1e+123) tmp = Float64(y * Float64(x * Float64(z / t_1))); 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_] := Block[{t$95$1 = N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -6e+104], N[(N[(x * y), $MachinePrecision] / N[(0.5 * N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-305], N[(z / N[(t$95$1 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-127], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+123], N[(y * N[(x * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{z \cdot z - a \cdot t}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+104}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a}{\frac{z \cdot z}{t}}, -1\right)}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-305}:\\
\;\;\;\;\frac{z}{\frac{t_1}{x \cdot y}}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-127}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{elif}\;z \leq 10^{+123}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -5.99999999999999937e104Initial program 32.1%
associate-*l*30.3%
associate-*r/30.4%
Simplified30.4%
associate-/l*32.6%
associate-*r/32.5%
*-commutative32.5%
Applied egg-rr32.5%
Taylor expanded in z around -inf 89.4%
fma-neg89.4%
associate-/l*98.1%
unpow298.1%
metadata-eval98.1%
Simplified98.1%
if -5.99999999999999937e104 < z < 2.89999999999999988e-305Initial program 82.0%
*-commutative82.0%
associate-/l*86.1%
Simplified86.1%
if 2.89999999999999988e-305 < z < 1.1000000000000001e-127Initial program 69.9%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in z around 0 83.5%
associate-*r*83.5%
neg-mul-183.5%
*-commutative83.5%
Simplified83.5%
if 1.1000000000000001e-127 < z < 9.99999999999999978e122Initial program 94.3%
*-commutative94.3%
associate-/l*91.3%
Simplified91.3%
associate-/r/96.3%
associate-*r*96.3%
Applied egg-rr96.3%
if 9.99999999999999978e122 < z Initial program 17.4%
associate-*l*17.0%
associate-*r/17.3%
Simplified17.3%
Taylor expanded in z around inf 100.0%
Final simplification93.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 -4e+129) (* x (- y)) (if (<= z 2e+118) (* y (* x (/ z (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 <= -4e+129) {
tmp = x * -y;
} else if (z <= 2e+118) {
tmp = y * (x * (z / 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 <= (-4d+129)) then
tmp = x * -y
else if (z <= 2d+118) then
tmp = y * (x * (z / 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 <= -4e+129) {
tmp = x * -y;
} else if (z <= 2e+118) {
tmp = y * (x * (z / 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 <= -4e+129: tmp = x * -y elif z <= 2e+118: tmp = y * (x * (z / 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 <= -4e+129) tmp = Float64(x * Float64(-y)); elseif (z <= 2e+118) tmp = Float64(y * Float64(x * Float64(z / 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 <= -4e+129)
tmp = x * -y;
elseif (z <= 2e+118)
tmp = y * (x * (z / 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, -4e+129], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2e+118], N[(y * N[(x * N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $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 -4 \cdot 10^{+129}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+118}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4e129Initial program 25.5%
associate-*l*25.4%
associate-*r/25.5%
Simplified25.5%
Taylor expanded in z around -inf 97.9%
mul-1-neg97.9%
distribute-rgt-neg-out97.9%
Simplified97.9%
if -4e129 < z < 1.99999999999999993e118Initial program 84.2%
*-commutative84.2%
associate-/l*84.0%
Simplified84.0%
associate-/r/86.0%
associate-*r*87.2%
Applied egg-rr87.2%
if 1.99999999999999993e118 < z Initial program 17.4%
associate-*l*17.0%
associate-*r/17.3%
Simplified17.3%
Taylor expanded in z around inf 100.0%
Final simplification91.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (* a (- t)))))
(if (<= z -1.3e-28)
(* x (- y))
(if (<= z 3.35e-304)
(/ z (/ t_1 (* x y)))
(if (<= z 2.8e-123)
(* x (/ (* z y) t_1))
(/ (* x y) (/ (+ z (* (/ a (/ z t)) -0.5)) z)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt((a * -t));
double tmp;
if (z <= -1.3e-28) {
tmp = x * -y;
} else if (z <= 3.35e-304) {
tmp = z / (t_1 / (x * y));
} else if (z <= 2.8e-123) {
tmp = x * ((z * y) / t_1);
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((a * -t))
if (z <= (-1.3d-28)) then
tmp = x * -y
else if (z <= 3.35d-304) then
tmp = z / (t_1 / (x * y))
else if (z <= 2.8d-123) then
tmp = x * ((z * y) / t_1)
else
tmp = (x * y) / ((z + ((a / (z / t)) * (-0.5d0))) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt((a * -t));
double tmp;
if (z <= -1.3e-28) {
tmp = x * -y;
} else if (z <= 3.35e-304) {
tmp = z / (t_1 / (x * y));
} else if (z <= 2.8e-123) {
tmp = x * ((z * y) / t_1);
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt((a * -t)) tmp = 0 if z <= -1.3e-28: tmp = x * -y elif z <= 3.35e-304: tmp = z / (t_1 / (x * y)) elif z <= 2.8e-123: tmp = x * ((z * y) / t_1) else: tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(a * Float64(-t))) tmp = 0.0 if (z <= -1.3e-28) tmp = Float64(x * Float64(-y)); elseif (z <= 3.35e-304) tmp = Float64(z / Float64(t_1 / Float64(x * y))); elseif (z <= 2.8e-123) tmp = Float64(x * Float64(Float64(z * y) / t_1)); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5)) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt((a * -t));
tmp = 0.0;
if (z <= -1.3e-28)
tmp = x * -y;
elseif (z <= 3.35e-304)
tmp = z / (t_1 / (x * y));
elseif (z <= 2.8e-123)
tmp = x * ((z * y) / t_1);
else
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.3e-28], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.35e-304], N[(z / N[(t$95$1 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e-123], N[(x * N[(N[(z * y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{a \cdot \left(-t\right)}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.35 \cdot 10^{-304}:\\
\;\;\;\;\frac{z}{\frac{t_1}{x \cdot y}}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-123}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + \frac{a}{\frac{z}{t}} \cdot -0.5}{z}}\\
\end{array}
\end{array}
if z < -1.3e-28Initial program 50.7%
associate-*l*48.3%
associate-*r/50.7%
Simplified50.7%
Taylor expanded in z around -inf 94.2%
mul-1-neg94.2%
distribute-rgt-neg-out94.2%
Simplified94.2%
if -1.3e-28 < z < 3.3500000000000002e-304Initial program 77.5%
*-commutative77.5%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in z around 0 72.9%
associate-*r*61.9%
neg-mul-161.9%
*-commutative61.9%
Simplified72.9%
if 3.3500000000000002e-304 < z < 2.7999999999999999e-123Initial program 69.9%
associate-*l*83.5%
associate-*r/80.6%
Simplified80.6%
Taylor expanded in z around 0 80.6%
associate-*r*83.5%
neg-mul-183.5%
*-commutative83.5%
Simplified80.6%
if 2.7999999999999999e-123 < z Initial program 59.0%
associate-*l*57.7%
associate-*r/59.9%
Simplified59.9%
associate-/l*61.3%
associate-*r/60.4%
*-commutative60.4%
Applied egg-rr60.4%
Taylor expanded in z around inf 81.1%
associate-/l*85.0%
Simplified85.0%
Final simplification85.4%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (sqrt (* a (- t)))))
(if (<= z -7e-31)
(* x (- y))
(if (<= z 3.3e-302)
(/ z (/ t_1 (* x y)))
(if (<= z 1.1e-122)
(/ (* x (* z y)) t_1)
(/ (* x y) (/ (+ z (* (/ a (/ z t)) -0.5)) z)))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = sqrt((a * -t));
double tmp;
if (z <= -7e-31) {
tmp = x * -y;
} else if (z <= 3.3e-302) {
tmp = z / (t_1 / (x * y));
} else if (z <= 1.1e-122) {
tmp = (x * (z * y)) / t_1;
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((a * -t))
if (z <= (-7d-31)) then
tmp = x * -y
else if (z <= 3.3d-302) then
tmp = z / (t_1 / (x * y))
else if (z <= 1.1d-122) then
tmp = (x * (z * y)) / t_1
else
tmp = (x * y) / ((z + ((a / (z / t)) * (-0.5d0))) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.sqrt((a * -t));
double tmp;
if (z <= -7e-31) {
tmp = x * -y;
} else if (z <= 3.3e-302) {
tmp = z / (t_1 / (x * y));
} else if (z <= 1.1e-122) {
tmp = (x * (z * y)) / t_1;
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = math.sqrt((a * -t)) tmp = 0 if z <= -7e-31: tmp = x * -y elif z <= 3.3e-302: tmp = z / (t_1 / (x * y)) elif z <= 1.1e-122: tmp = (x * (z * y)) / t_1 else: tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = sqrt(Float64(a * Float64(-t))) tmp = 0.0 if (z <= -7e-31) tmp = Float64(x * Float64(-y)); elseif (z <= 3.3e-302) tmp = Float64(z / Float64(t_1 / Float64(x * y))); elseif (z <= 1.1e-122) tmp = Float64(Float64(x * Float64(z * y)) / t_1); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5)) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = sqrt((a * -t));
tmp = 0.0;
if (z <= -7e-31)
tmp = x * -y;
elseif (z <= 3.3e-302)
tmp = z / (t_1 / (x * y));
elseif (z <= 1.1e-122)
tmp = (x * (z * y)) / t_1;
else
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -7e-31], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.3e-302], N[(z / N[(t$95$1 / N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-122], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \sqrt{a \cdot \left(-t\right)}\\
\mathbf{if}\;z \leq -7 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-302}:\\
\;\;\;\;\frac{z}{\frac{t_1}{x \cdot y}}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-122}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + \frac{a}{\frac{z}{t}} \cdot -0.5}{z}}\\
\end{array}
\end{array}
if z < -6.99999999999999971e-31Initial program 50.7%
associate-*l*48.3%
associate-*r/50.7%
Simplified50.7%
Taylor expanded in z around -inf 94.2%
mul-1-neg94.2%
distribute-rgt-neg-out94.2%
Simplified94.2%
if -6.99999999999999971e-31 < z < 3.3000000000000002e-302Initial program 77.5%
*-commutative77.5%
associate-/l*79.6%
Simplified79.6%
Taylor expanded in z around 0 72.9%
associate-*r*61.9%
neg-mul-161.9%
*-commutative61.9%
Simplified72.9%
if 3.3000000000000002e-302 < z < 1.1e-122Initial program 69.9%
associate-*l*83.5%
Simplified83.5%
Taylor expanded in z around 0 83.5%
associate-*r*83.5%
neg-mul-183.5%
*-commutative83.5%
Simplified83.5%
if 1.1e-122 < z Initial program 59.0%
associate-*l*57.7%
associate-*r/59.9%
Simplified59.9%
associate-/l*61.3%
associate-*r/60.4%
*-commutative60.4%
Applied egg-rr60.4%
Taylor expanded in z around inf 81.1%
associate-/l*85.0%
Simplified85.0%
Final simplification85.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 -7.5e-31)
(* x (- y))
(if (<= z 6.4e-123)
(* x (/ z (/ (sqrt (* a (- t))) y)))
(/ (* x y) (/ (+ z (* (/ a (/ z t)) -0.5)) z)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e-31) {
tmp = x * -y;
} else if (z <= 6.4e-123) {
tmp = x * (z / (sqrt((a * -t)) / y));
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.5d-31)) then
tmp = x * -y
else if (z <= 6.4d-123) then
tmp = x * (z / (sqrt((a * -t)) / y))
else
tmp = (x * y) / ((z + ((a / (z / t)) * (-0.5d0))) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e-31) {
tmp = x * -y;
} else if (z <= 6.4e-123) {
tmp = x * (z / (Math.sqrt((a * -t)) / y));
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -7.5e-31: tmp = x * -y elif z <= 6.4e-123: tmp = x * (z / (math.sqrt((a * -t)) / y)) else: tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e-31) tmp = Float64(x * Float64(-y)); elseif (z <= 6.4e-123) tmp = Float64(x * Float64(z / Float64(sqrt(Float64(a * Float64(-t))) / y))); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5)) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -7.5e-31)
tmp = x * -y;
elseif (z <= 6.4e-123)
tmp = x * (z / (sqrt((a * -t)) / y));
else
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e-31], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 6.4e-123], N[(x * N[(z / N[(N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-123}:\\
\;\;\;\;x \cdot \frac{z}{\frac{\sqrt{a \cdot \left(-t\right)}}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + \frac{a}{\frac{z}{t}} \cdot -0.5}{z}}\\
\end{array}
\end{array}
if z < -7.49999999999999975e-31Initial program 50.7%
associate-*l*48.3%
associate-*r/50.7%
Simplified50.7%
Taylor expanded in z around -inf 94.2%
mul-1-neg94.2%
distribute-rgt-neg-out94.2%
Simplified94.2%
if -7.49999999999999975e-31 < z < 6.39999999999999957e-123Initial program 74.2%
associate-*l*74.9%
associate-*r/76.3%
*-commutative76.3%
associate-/l*73.8%
Simplified73.8%
Taylor expanded in z around 0 70.0%
associate-*r*71.1%
neg-mul-171.1%
*-commutative71.1%
Simplified70.0%
if 6.39999999999999957e-123 < z Initial program 59.0%
associate-*l*57.7%
associate-*r/59.9%
Simplified59.9%
associate-/l*61.3%
associate-*r/60.4%
*-commutative60.4%
Applied egg-rr60.4%
Taylor expanded in z around inf 81.1%
associate-/l*85.0%
Simplified85.0%
Final simplification83.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.02e-27)
(* x (- y))
(if (<= z 2.9e-123)
(* x (/ (* z y) (sqrt (* a (- t)))))
(/ (* x y) (/ (+ z (* (/ a (/ z t)) -0.5)) z)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.02e-27) {
tmp = x * -y;
} else if (z <= 2.9e-123) {
tmp = x * ((z * y) / sqrt((a * -t)));
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.02d-27)) then
tmp = x * -y
else if (z <= 2.9d-123) then
tmp = x * ((z * y) / sqrt((a * -t)))
else
tmp = (x * y) / ((z + ((a / (z / t)) * (-0.5d0))) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.02e-27) {
tmp = x * -y;
} else if (z <= 2.9e-123) {
tmp = x * ((z * y) / Math.sqrt((a * -t)));
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.02e-27: tmp = x * -y elif z <= 2.9e-123: tmp = x * ((z * y) / math.sqrt((a * -t))) else: tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.02e-27) tmp = Float64(x * Float64(-y)); elseif (z <= 2.9e-123) tmp = Float64(x * Float64(Float64(z * y) / sqrt(Float64(a * Float64(-t))))); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5)) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.02e-27)
tmp = x * -y;
elseif (z <= 2.9e-123)
tmp = x * ((z * y) / sqrt((a * -t)));
else
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.02e-27], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.9e-123], N[(x * N[(N[(z * y), $MachinePrecision] / N[Sqrt[N[(a * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-27}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-123}:\\
\;\;\;\;x \cdot \frac{z \cdot y}{\sqrt{a \cdot \left(-t\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + \frac{a}{\frac{z}{t}} \cdot -0.5}{z}}\\
\end{array}
\end{array}
if z < -1.02000000000000002e-27Initial program 50.7%
associate-*l*48.3%
associate-*r/50.7%
Simplified50.7%
Taylor expanded in z around -inf 94.2%
mul-1-neg94.2%
distribute-rgt-neg-out94.2%
Simplified94.2%
if -1.02000000000000002e-27 < z < 2.90000000000000004e-123Initial program 74.2%
associate-*l*74.9%
associate-*r/76.3%
Simplified76.3%
Taylor expanded in z around 0 71.2%
associate-*r*71.1%
neg-mul-171.1%
*-commutative71.1%
Simplified71.2%
if 2.90000000000000004e-123 < z Initial program 59.0%
associate-*l*57.7%
associate-*r/59.9%
Simplified59.9%
associate-/l*61.3%
associate-*r/60.4%
*-commutative60.4%
Applied egg-rr60.4%
Taylor expanded in z around inf 81.1%
associate-/l*85.0%
Simplified85.0%
Final simplification84.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 -6.7e-158) (* x (- y)) (* y (* x (/ z (+ z (* (/ a (/ z t)) -0.5)))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.7e-158) {
tmp = x * -y;
} else {
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-6.7d-158)) then
tmp = x * -y
else
tmp = y * (x * (z / (z + ((a / (z / t)) * (-0.5d0)))))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.7e-158) {
tmp = x * -y;
} else {
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -6.7e-158: tmp = x * -y else: tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5)))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.7e-158) tmp = Float64(x * Float64(-y)); else tmp = Float64(y * Float64(x * Float64(z / Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5))))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -6.7e-158)
tmp = x * -y;
else
tmp = y * (x * (z / (z + ((a / (z / t)) * -0.5))));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.7e-158], N[(x * (-y)), $MachinePrecision], N[(y * N[(x * N[(z / N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.7 \cdot 10^{-158}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + \frac{a}{\frac{z}{t}} \cdot -0.5}\right)\\
\end{array}
\end{array}
if z < -6.7000000000000001e-158Initial program 56.7%
associate-*l*53.8%
associate-*r/56.6%
Simplified56.6%
Taylor expanded in z around -inf 83.4%
mul-1-neg83.4%
distribute-rgt-neg-out83.4%
Simplified83.4%
if -6.7000000000000001e-158 < z Initial program 63.4%
*-commutative63.4%
associate-/l*61.6%
Simplified61.6%
associate-/r/63.6%
associate-*r*64.5%
Applied egg-rr64.5%
Taylor expanded in z around inf 65.6%
associate-/l*68.0%
Simplified68.0%
Final simplification74.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.14e-157) (* x (- y)) (/ (* x y) (/ (+ z (* (/ a (/ z t)) -0.5)) z))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.14e-157) {
tmp = x * -y;
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.14d-157)) then
tmp = x * -y
else
tmp = (x * y) / ((z + ((a / (z / t)) * (-0.5d0))) / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.14e-157) {
tmp = x * -y;
} else {
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -1.14e-157: tmp = x * -y else: tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.14e-157) tmp = Float64(x * Float64(-y)); else tmp = Float64(Float64(x * y) / Float64(Float64(z + Float64(Float64(a / Float64(z / t)) * -0.5)) / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.14e-157)
tmp = x * -y;
else
tmp = (x * y) / ((z + ((a / (z / t)) * -0.5)) / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.14e-157], N[(x * (-y)), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(N[(z + N[(N[(a / N[(z / t), $MachinePrecision]), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.14 \cdot 10^{-157}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\frac{z + \frac{a}{\frac{z}{t}} \cdot -0.5}{z}}\\
\end{array}
\end{array}
if z < -1.13999999999999996e-157Initial program 56.7%
associate-*l*53.8%
associate-*r/56.6%
Simplified56.6%
Taylor expanded in z around -inf 83.4%
mul-1-neg83.4%
distribute-rgt-neg-out83.4%
Simplified83.4%
if -1.13999999999999996e-157 < z Initial program 63.4%
associate-*l*63.6%
associate-*r/65.0%
Simplified65.0%
associate-/l*64.1%
associate-*r/63.0%
*-commutative63.0%
Applied egg-rr63.0%
Taylor expanded in z around inf 66.1%
associate-/l*68.0%
Simplified68.6%
Final simplification74.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.9e-158) (* x (- y)) (if (<= z 3.6e-68) (/ (* x (* z y)) z) (* x y))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e-158) {
tmp = x * -y;
} else if (z <= 3.6e-68) {
tmp = (x * (z * y)) / 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 <= (-2.9d-158)) then
tmp = x * -y
else if (z <= 3.6d-68) then
tmp = (x * (z * y)) / 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 <= -2.9e-158) {
tmp = x * -y;
} else if (z <= 3.6e-68) {
tmp = (x * (z * y)) / z;
} else {
tmp = x * y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if z <= -2.9e-158: tmp = x * -y elif z <= 3.6e-68: tmp = (x * (z * y)) / z else: tmp = x * y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e-158) tmp = Float64(x * Float64(-y)); elseif (z <= 3.6e-68) tmp = Float64(Float64(x * Float64(z * y)) / 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 <= -2.9e-158)
tmp = x * -y;
elseif (z <= 3.6e-68)
tmp = (x * (z * y)) / 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, -2.9e-158], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.6e-68], N[(N[(x * N[(z * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-158}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot \left(z \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.8999999999999998e-158Initial program 56.7%
associate-*l*53.8%
associate-*r/56.6%
Simplified56.6%
Taylor expanded in z around -inf 83.4%
mul-1-neg83.4%
distribute-rgt-neg-out83.4%
Simplified83.4%
if -2.8999999999999998e-158 < z < 3.60000000000000007e-68Initial program 74.4%
associate-*l*76.8%
Simplified76.8%
Taylor expanded in z around inf 43.3%
if 3.60000000000000007e-68 < z Initial program 55.5%
associate-*l*54.0%
associate-*r/56.4%
Simplified56.4%
Taylor expanded in z around inf 85.8%
Final simplification74.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 -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 59.5%
associate-*l*55.6%
associate-*r/58.7%
Simplified58.7%
Taylor expanded in z around -inf 74.4%
mul-1-neg74.4%
distribute-rgt-neg-out74.4%
Simplified74.4%
if -1.999999999999994e-310 < z Initial program 61.9%
associate-*l*63.6%
associate-*r/64.5%
Simplified64.5%
Taylor expanded in z around inf 68.2%
Final simplification71.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x y))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return x * y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x * y
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return x * y;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return x * y
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(x * y) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = x * y;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot y
\end{array}
Initial program 60.8%
associate-*l*59.7%
associate-*r/61.7%
Simplified61.7%
Taylor expanded in z around inf 43.5%
Final simplification43.5%
(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 2023268
(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)))))