
(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 17 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: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (/ (* z z) t))))
(if (<= z -2e+145)
(/ (* x y) (fma 0.5 t_1 -1.0))
(if (<= z -2.6e-207)
(/ (* x y) (/ (sqrt (- (* z z) (* a t))) z))
(if (<= z 1.7e-99)
(/
x
(/ (pow (exp (* 0.25 (- (log (- t)) (log (/ 1.0 a))))) 2.0) (* z y)))
(/ (* x y) (sqrt (- 1.0 t_1))))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = a / ((z * z) / t);
double tmp;
if (z <= -2e+145) {
tmp = (x * y) / fma(0.5, t_1, -1.0);
} else if (z <= -2.6e-207) {
tmp = (x * y) / (sqrt(((z * z) - (a * t))) / z);
} else if (z <= 1.7e-99) {
tmp = x / (pow(exp((0.25 * (log(-t) - log((1.0 / a))))), 2.0) / (z * y));
} else {
tmp = (x * y) / sqrt((1.0 - t_1));
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(a / Float64(Float64(z * z) / t)) tmp = 0.0 if (z <= -2e+145) tmp = Float64(Float64(x * y) / fma(0.5, t_1, -1.0)); elseif (z <= -2.6e-207) tmp = Float64(Float64(x * y) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / z)); elseif (z <= 1.7e-99) tmp = Float64(x / Float64((exp(Float64(0.25 * Float64(log(Float64(-t)) - log(Float64(1.0 / a))))) ^ 2.0) / Float64(z * y))); else tmp = Float64(Float64(x * y) / sqrt(Float64(1.0 - t_1))); end return tmp end
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+145], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-207], N[(N[(x * y), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-99], N[(x / N[(N[Power[N[Exp[N[(0.25 * N[(N[Log[(-t)], $MachinePrecision] - N[Log[N[(1.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z \cdot z}{t}}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+145}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-207}:\\
\;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-99}:\\
\;\;\;\;\frac{x}{\frac{{\left(e^{0.25 \cdot \left(\log \left(-t\right) - \log \left(\frac{1}{a}\right)\right)}\right)}^{2}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1 - t_1}}\\
\end{array}
\end{array}
if z < -2e145Initial program 15.0%
associate-/l*15.6%
Simplified15.6%
Taylor expanded in z around -inf 96.2%
fma-neg96.2%
unpow296.2%
associate-/l*98.2%
metadata-eval98.2%
Simplified98.2%
if -2e145 < z < -2.5999999999999999e-207Initial program 91.9%
associate-/l*95.3%
Simplified95.3%
if -2.5999999999999999e-207 < z < 1.70000000000000003e-99Initial program 65.5%
*-commutative65.5%
associate-*l*67.4%
associate-*r/73.3%
Simplified73.3%
*-commutative73.3%
associate-/l*73.1%
associate-/r/71.5%
associate-/l/73.7%
*-commutative73.7%
Applied egg-rr73.7%
add-sqr-sqrt73.5%
pow273.5%
pow1/273.5%
sqrt-pow173.5%
metadata-eval73.5%
Applied egg-rr73.5%
Taylor expanded in a around inf 43.7%
if 1.70000000000000003e-99 < z Initial program 66.1%
associate-/l*66.2%
Simplified66.2%
add-sqr-sqrt66.2%
sqrt-unprod66.2%
frac-times60.1%
add-sqr-sqrt60.1%
Applied egg-rr60.1%
div-sub60.1%
*-inverses86.9%
*-commutative86.9%
associate-/l*92.1%
Simplified92.1%
Final simplification85.2%
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.8e+84)
(* x (- y))
(if (<= z 6.6e+74)
(* y (/ (* z x) (sqrt (- (* z z) (* a t)))))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (* z (/ z t)))))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e+84) {
tmp = x * -y;
} else if (z <= 6.6e+74) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.8d+84)) then
tmp = x * -y
else if (z <= 6.6d+74) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / (z * (z / t)))))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.8e+84) {
tmp = x * -y;
} else if (z <= 6.6e+74) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -7.8e+84: tmp = x * -y elif z <= 6.6e+74: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) else: tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t))))) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.8e+84) tmp = Float64(x * Float64(-y)); elseif (z <= 6.6e+74) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(z * Float64(z / t)))))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -7.8e+84)
tmp = x * -y;
elseif (z <= 6.6e+74)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
else
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.8e+84], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 6.6e+74], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+84}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{z \cdot \frac{z}{t}}}\\
\end{array}
\end{array}
if z < -7.80000000000000032e84Initial program 27.2%
*-commutative27.2%
associate-*l*25.2%
associate-*r/27.0%
Simplified27.0%
Taylor expanded in z around -inf 98.5%
neg-mul-198.5%
Simplified98.5%
if -7.80000000000000032e84 < z < 6.6000000000000004e74Initial program 82.8%
*-commutative82.8%
associate-*l*81.4%
associate-*r/84.7%
Simplified84.7%
if 6.6000000000000004e74 < z Initial program 42.5%
associate-/l*42.7%
Simplified42.7%
Taylor expanded in z around inf 81.8%
unpow281.8%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in z around 0 90.2%
unpow290.2%
associate-*r/92.7%
Simplified92.7%
Final simplification89.6%
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.8e+79)
(* x (- y))
(if (<= z 6e+75)
(/ x (/ (sqrt (- (* z z) (* a t))) (* z y)))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (* z (/ z t)))))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+79) {
tmp = x * -y;
} else if (z <= 6e+75) {
tmp = x / (sqrt(((z * z) - (a * t))) / (z * y));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5.8d+79)) then
tmp = x * -y
else if (z <= 6d+75) then
tmp = x / (sqrt(((z * z) - (a * t))) / (z * y))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / (z * (z / t)))))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+79) {
tmp = x * -y;
} else if (z <= 6e+75) {
tmp = x / (Math.sqrt(((z * z) - (a * t))) / (z * y));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -5.8e+79: tmp = x * -y elif z <= 6e+75: tmp = x / (math.sqrt(((z * z) - (a * t))) / (z * y)) else: tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t))))) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e+79) tmp = Float64(x * Float64(-y)); elseif (z <= 6e+75) tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / Float64(z * y))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(z * Float64(z / t)))))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -5.8e+79)
tmp = x * -y;
elseif (z <= 6e+75)
tmp = x / (sqrt(((z * z) - (a * t))) / (z * y));
else
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+79], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 6e+75], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+79}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+75}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{z \cdot \frac{z}{t}}}\\
\end{array}
\end{array}
if z < -5.79999999999999984e79Initial program 28.3%
*-commutative28.3%
associate-*l*26.4%
associate-*r/28.1%
Simplified28.1%
Taylor expanded in z around -inf 98.5%
neg-mul-198.5%
Simplified98.5%
if -5.79999999999999984e79 < z < 6e75Initial program 82.7%
*-commutative82.7%
associate-*l*81.3%
associate-*r/84.6%
Simplified84.6%
*-commutative84.6%
associate-/l*86.3%
associate-/r/85.9%
associate-/l/85.9%
*-commutative85.9%
Applied egg-rr85.9%
if 6e75 < z Initial program 42.5%
associate-/l*42.7%
Simplified42.7%
Taylor expanded in z around inf 81.8%
unpow281.8%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in z around 0 90.2%
unpow290.2%
associate-*r/92.7%
Simplified92.7%
Final simplification90.3%
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.2e+81)
(* x (- y))
(if (<= z 8.5e-142)
(/ x (/ (sqrt (- (* z z) (* a t))) (* z y)))
(/ (* x y) (sqrt (- 1.0 (/ a (/ (* z z) t))))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e+81) {
tmp = x * -y;
} else if (z <= 8.5e-142) {
tmp = x / (sqrt(((z * z) - (a * t))) / (z * y));
} else {
tmp = (x * y) / sqrt((1.0 - (a / ((z * z) / t))));
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7.2d+81)) then
tmp = x * -y
else if (z <= 8.5d-142) then
tmp = x / (sqrt(((z * z) - (a * t))) / (z * y))
else
tmp = (x * y) / sqrt((1.0d0 - (a / ((z * z) / t))))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e+81) {
tmp = x * -y;
} else if (z <= 8.5e-142) {
tmp = x / (Math.sqrt(((z * z) - (a * t))) / (z * y));
} else {
tmp = (x * y) / Math.sqrt((1.0 - (a / ((z * z) / t))));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -7.2e+81: tmp = x * -y elif z <= 8.5e-142: tmp = x / (math.sqrt(((z * z) - (a * t))) / (z * y)) else: tmp = (x * y) / math.sqrt((1.0 - (a / ((z * z) / t)))) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e+81) tmp = Float64(x * Float64(-y)); elseif (z <= 8.5e-142) tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / Float64(z * y))); else tmp = Float64(Float64(x * y) / sqrt(Float64(1.0 - Float64(a / Float64(Float64(z * z) / t))))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -7.2e+81)
tmp = x * -y;
elseif (z <= 8.5e-142)
tmp = x / (sqrt(((z * z) - (a * t))) / (z * y));
else
tmp = (x * y) / sqrt((1.0 - (a / ((z * z) / t))));
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.2e+81], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 8.5e-142], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[Sqrt[N[(1.0 - N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+81}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-142}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1 - \frac{a}{\frac{z \cdot z}{t}}}}\\
\end{array}
\end{array}
if z < -7.20000000000000011e81Initial program 28.3%
*-commutative28.3%
associate-*l*26.4%
associate-*r/28.1%
Simplified28.1%
Taylor expanded in z around -inf 98.5%
neg-mul-198.5%
Simplified98.5%
if -7.20000000000000011e81 < z < 8.4999999999999996e-142Initial program 81.9%
*-commutative81.9%
associate-*l*81.7%
associate-*r/83.9%
Simplified83.9%
*-commutative83.9%
associate-/l*85.0%
associate-/r/84.1%
associate-/l/84.7%
*-commutative84.7%
Applied egg-rr84.7%
if 8.4999999999999996e-142 < z Initial program 64.3%
associate-/l*66.2%
Simplified66.2%
add-sqr-sqrt66.2%
sqrt-unprod66.2%
frac-times60.5%
add-sqr-sqrt60.5%
Applied egg-rr60.5%
div-sub60.5%
*-inverses85.8%
*-commutative85.8%
associate-/l*90.7%
Simplified90.7%
Final simplification90.5%
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (/ (* z z) t))))
(if (<= z -4.9e+79)
(/ (* x y) (fma 0.5 t_1 -1.0))
(if (<= z 8.5e-142)
(/ x (/ (sqrt (- (* z z) (* a t))) (* z y)))
(/ (* x y) (sqrt (- 1.0 t_1)))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = a / ((z * z) / t);
double tmp;
if (z <= -4.9e+79) {
tmp = (x * y) / fma(0.5, t_1, -1.0);
} else if (z <= 8.5e-142) {
tmp = x / (sqrt(((z * z) - (a * t))) / (z * y));
} else {
tmp = (x * y) / sqrt((1.0 - t_1));
}
return tmp;
}
t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(a / Float64(Float64(z * z) / t)) tmp = 0.0 if (z <= -4.9e+79) tmp = Float64(Float64(x * y) / fma(0.5, t_1, -1.0)); elseif (z <= 8.5e-142) tmp = Float64(x / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / Float64(z * y))); else tmp = Float64(Float64(x * y) / sqrt(Float64(1.0 - t_1))); end return tmp end
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(N[(z * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.9e+79], N[(N[(x * y), $MachinePrecision] / N[(0.5 * t$95$1 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-142], N[(x / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[Sqrt[N[(1.0 - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{z \cdot z}{t}}\\
\mathbf{if}\;z \leq -4.9 \cdot 10^{+79}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, t_1, -1\right)}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-142}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{z \cdot z - a \cdot t}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{\sqrt{1 - t_1}}\\
\end{array}
\end{array}
if z < -4.8999999999999999e79Initial program 28.3%
associate-/l*30.3%
Simplified30.3%
Taylor expanded in z around -inf 96.9%
fma-neg96.9%
unpow296.9%
associate-/l*98.5%
metadata-eval98.5%
Simplified98.5%
if -4.8999999999999999e79 < z < 8.4999999999999996e-142Initial program 81.9%
*-commutative81.9%
associate-*l*81.7%
associate-*r/83.9%
Simplified83.9%
*-commutative83.9%
associate-/l*85.0%
associate-/r/84.1%
associate-/l/84.7%
*-commutative84.7%
Applied egg-rr84.7%
if 8.4999999999999996e-142 < z Initial program 64.3%
associate-/l*66.2%
Simplified66.2%
add-sqr-sqrt66.2%
sqrt-unprod66.2%
frac-times60.5%
add-sqr-sqrt60.5%
Applied egg-rr60.5%
div-sub60.5%
*-inverses85.8%
*-commutative85.8%
associate-/l*90.7%
Simplified90.7%
Final simplification90.5%
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.45e-136)
(* x (- y))
(if (<= z 7.8e-66)
(* y (/ (* z x) (sqrt (* t (- a)))))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (* z (/ z t)))))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-136) {
tmp = x * -y;
} else if (z <= 7.8e-66) {
tmp = y * ((z * x) / sqrt((t * -a)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.45d-136)) then
tmp = x * -y
else if (z <= 7.8d-66) then
tmp = y * ((z * x) / sqrt((t * -a)))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / (z * (z / t)))))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e-136) {
tmp = x * -y;
} else if (z <= 7.8e-66) {
tmp = y * ((z * x) / Math.sqrt((t * -a)));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.45e-136: tmp = x * -y elif z <= 7.8e-66: tmp = y * ((z * x) / math.sqrt((t * -a))) else: tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t))))) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e-136) tmp = Float64(x * Float64(-y)); elseif (z <= 7.8e-66) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(t * Float64(-a))))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(z * Float64(z / t)))))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.45e-136)
tmp = x * -y;
elseif (z <= 7.8e-66)
tmp = y * ((z * x) / sqrt((t * -a)));
else
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e-136], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 7.8e-66], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-136}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-66}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{z \cdot \frac{z}{t}}}\\
\end{array}
\end{array}
if z < -1.44999999999999997e-136Initial program 51.5%
*-commutative51.5%
associate-*l*49.3%
associate-*r/52.3%
Simplified52.3%
Taylor expanded in z around -inf 88.8%
neg-mul-188.8%
Simplified88.8%
if -1.44999999999999997e-136 < z < 7.79999999999999965e-66Initial program 73.9%
*-commutative73.9%
associate-*l*72.4%
associate-*r/75.3%
Simplified75.3%
Taylor expanded in z around 0 70.6%
associate-*r*70.6%
neg-mul-170.6%
Simplified70.6%
if 7.79999999999999965e-66 < z Initial program 64.1%
associate-/l*64.2%
Simplified64.2%
Taylor expanded in z around inf 79.4%
unpow279.4%
associate-/l*84.0%
Simplified84.0%
Taylor expanded in z around 0 84.0%
unpow284.0%
associate-*r/85.4%
Simplified85.4%
Final simplification82.9%
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= z -9.5e-137)
(* x (- y))
(if (<= z 7.6e-61)
(/ x (/ (sqrt (* t (- a))) (* z y)))
(/ (* x y) (+ 1.0 (* -0.5 (/ a (* z (/ z t)))))))))assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-137) {
tmp = x * -y;
} else if (z <= 7.6e-61) {
tmp = x / (sqrt((t * -a)) / (z * y));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-9.5d-137)) then
tmp = x * -y
else if (z <= 7.6d-61) then
tmp = x / (sqrt((t * -a)) / (z * y))
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / (z * (z / t)))))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -9.5e-137) {
tmp = x * -y;
} else if (z <= 7.6e-61) {
tmp = x / (Math.sqrt((t * -a)) / (z * y));
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -9.5e-137: tmp = x * -y elif z <= 7.6e-61: tmp = x / (math.sqrt((t * -a)) / (z * y)) else: tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t))))) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -9.5e-137) tmp = Float64(x * Float64(-y)); elseif (z <= 7.6e-61) tmp = Float64(x / Float64(sqrt(Float64(t * Float64(-a))) / Float64(z * y))); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(z * Float64(z / t)))))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -9.5e-137)
tmp = x * -y;
elseif (z <= 7.6e-61)
tmp = x / (sqrt((t * -a)) / (z * y));
else
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-137], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 7.6e-61], N[(x / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-137}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-61}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{t \cdot \left(-a\right)}}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{z \cdot \frac{z}{t}}}\\
\end{array}
\end{array}
if z < -9.5000000000000007e-137Initial program 51.5%
*-commutative51.5%
associate-*l*49.3%
associate-*r/52.3%
Simplified52.3%
Taylor expanded in z around -inf 88.8%
neg-mul-188.8%
Simplified88.8%
if -9.5000000000000007e-137 < z < 7.59999999999999961e-61Initial program 73.9%
*-commutative73.9%
associate-*l*72.4%
associate-*r/75.3%
Simplified75.3%
*-commutative75.3%
associate-/l*77.3%
associate-/r/75.5%
associate-/l/78.3%
*-commutative78.3%
Applied egg-rr78.3%
Taylor expanded in z around 0 72.2%
associate-*r*70.6%
neg-mul-170.6%
Simplified72.2%
if 7.59999999999999961e-61 < z Initial program 64.1%
associate-/l*64.2%
Simplified64.2%
Taylor expanded in z around inf 79.4%
unpow279.4%
associate-/l*84.0%
Simplified84.0%
Taylor expanded in z around 0 84.0%
unpow284.0%
associate-*r/85.4%
Simplified85.4%
Final simplification83.3%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -7e-151) (* x (- y)) (if (<= z 2.6e+75) (* y (/ (* z x) (+ z (* -0.5 (/ (* a t) z))))) (* x y))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e-151) {
tmp = x * -y;
} else if (z <= 2.6e+75) {
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7d-151)) then
tmp = x * -y
else if (z <= 2.6d+75) then
tmp = y * ((z * x) / (z + ((-0.5d0) * ((a * t) / z))))
else
tmp = x * y
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e-151) {
tmp = x * -y;
} else if (z <= 2.6e+75) {
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
} else {
tmp = x * y;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -7e-151: tmp = x * -y elif z <= 2.6e+75: tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z)))) else: tmp = x * y return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e-151) tmp = Float64(x * Float64(-y)); elseif (z <= 2.6e+75) tmp = Float64(y * Float64(Float64(z * x) / Float64(z + Float64(-0.5 * Float64(Float64(a * t) / z))))); else tmp = Float64(x * y); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -7e-151)
tmp = x * -y;
elseif (z <= 2.6e+75)
tmp = y * ((z * x) / (z + (-0.5 * ((a * t) / z))));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e-151], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.6e+75], N[(y * N[(N[(z * x), $MachinePrecision] / N[(z + N[(-0.5 * N[(N[(a * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-151}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+75}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z + -0.5 \cdot \frac{a \cdot t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -6.99999999999999991e-151Initial program 52.8%
*-commutative52.8%
associate-*l*49.8%
associate-*r/52.7%
Simplified52.7%
Taylor expanded in z around -inf 87.3%
neg-mul-187.3%
Simplified87.3%
if -6.99999999999999991e-151 < z < 2.59999999999999985e75Initial program 79.6%
*-commutative79.6%
associate-*l*79.5%
associate-*r/82.3%
Simplified82.3%
Taylor expanded in z around inf 62.4%
if 2.59999999999999985e75 < z Initial program 42.5%
*-commutative42.5%
associate-*l*34.3%
associate-*r/34.5%
Simplified34.5%
Taylor expanded in z around inf 90.2%
Final simplification77.8%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.6e-151) (* x (- y)) (if (<= z 4.2e-177) (* -2.0 (* (/ y a) (/ (* x (* z z)) t))) (* x y))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-151) {
tmp = x * -y;
} else if (z <= 4.2e-177) {
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.6d-151)) then
tmp = x * -y
else if (z <= 4.2d-177) then
tmp = (-2.0d0) * ((y / a) * ((x * (z * z)) / t))
else
tmp = x * y
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.6e-151) {
tmp = x * -y;
} else if (z <= 4.2e-177) {
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
} else {
tmp = x * y;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.6e-151: tmp = x * -y elif z <= 4.2e-177: tmp = -2.0 * ((y / a) * ((x * (z * z)) / t)) else: tmp = x * y return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.6e-151) tmp = Float64(x * Float64(-y)); elseif (z <= 4.2e-177) tmp = Float64(-2.0 * Float64(Float64(y / a) * Float64(Float64(x * Float64(z * z)) / t))); else tmp = Float64(x * y); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.6e-151)
tmp = x * -y;
elseif (z <= 4.2e-177)
tmp = -2.0 * ((y / a) * ((x * (z * z)) / t));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.6e-151], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 4.2e-177], N[(-2.0 * N[(N[(y / a), $MachinePrecision] * N[(N[(x * N[(z * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-151}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-177}:\\
\;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \frac{x \cdot \left(z \cdot z\right)}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.60000000000000011e-151Initial program 52.8%
*-commutative52.8%
associate-*l*49.8%
associate-*r/52.7%
Simplified52.7%
Taylor expanded in z around -inf 87.3%
neg-mul-187.3%
Simplified87.3%
if -1.60000000000000011e-151 < z < 4.20000000000000002e-177Initial program 76.0%
associate-/l*74.0%
Simplified74.0%
Taylor expanded in z around inf 53.6%
unpow253.6%
associate-/l*60.7%
Simplified60.7%
Taylor expanded in a around inf 53.8%
times-frac60.7%
unpow260.7%
Simplified60.7%
if 4.20000000000000002e-177 < z Initial program 64.2%
*-commutative64.2%
associate-*l*58.7%
associate-*r/62.2%
Simplified62.2%
Taylor expanded in z around inf 73.9%
Final simplification77.1%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.7e-142) (* x (- y)) (if (<= z 1.9e-179) (* z (* 2.0 (* (/ z t) (/ (* x y) a)))) (* x y))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-142) {
tmp = x * -y;
} else if (z <= 1.9e-179) {
tmp = z * (2.0 * ((z / t) * ((x * y) / a)));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.7d-142)) then
tmp = x * -y
else if (z <= 1.9d-179) then
tmp = z * (2.0d0 * ((z / t) * ((x * y) / a)))
else
tmp = x * y
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e-142) {
tmp = x * -y;
} else if (z <= 1.9e-179) {
tmp = z * (2.0 * ((z / t) * ((x * y) / a)));
} else {
tmp = x * y;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.7e-142: tmp = x * -y elif z <= 1.9e-179: tmp = z * (2.0 * ((z / t) * ((x * y) / a))) else: tmp = x * y return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e-142) tmp = Float64(x * Float64(-y)); elseif (z <= 1.9e-179) tmp = Float64(z * Float64(2.0 * Float64(Float64(z / t) * Float64(Float64(x * y) / a)))); else tmp = Float64(x * y); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.7e-142)
tmp = x * -y;
elseif (z <= 1.9e-179)
tmp = z * (2.0 * ((z / t) * ((x * y) / a)));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e-142], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.9e-179], N[(z * N[(2.0 * N[(N[(z / t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-142}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-179}:\\
\;\;\;\;z \cdot \left(2 \cdot \left(\frac{z}{t} \cdot \frac{x \cdot y}{a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2.6999999999999998e-142Initial program 51.5%
*-commutative51.5%
associate-*l*49.3%
associate-*r/52.3%
Simplified52.3%
Taylor expanded in z around -inf 88.8%
neg-mul-188.8%
Simplified88.8%
if -2.6999999999999998e-142 < z < 1.89999999999999987e-179Initial program 77.5%
associate-*l/73.6%
Simplified73.6%
Taylor expanded in z around -inf 57.3%
Taylor expanded in a around inf 52.8%
*-commutative52.8%
associate-*l*52.8%
*-commutative52.8%
*-commutative52.8%
times-frac59.3%
Simplified59.3%
if 1.89999999999999987e-179 < z Initial program 64.2%
*-commutative64.2%
associate-*l*58.7%
associate-*r/62.2%
Simplified62.2%
Taylor expanded in z around inf 73.9%
Final simplification77.1%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.8e-150) (* x (- y)) (if (<= z 3.3e-177) (/ x (/ (* -0.5 (* t (/ a z))) (* z y))) (* x y))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-150) {
tmp = x * -y;
} else if (z <= 3.3e-177) {
tmp = x / ((-0.5 * (t * (a / z))) / (z * y));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.8d-150)) then
tmp = x * -y
else if (z <= 3.3d-177) then
tmp = x / (((-0.5d0) * (t * (a / z))) / (z * y))
else
tmp = x * y
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e-150) {
tmp = x * -y;
} else if (z <= 3.3e-177) {
tmp = x / ((-0.5 * (t * (a / z))) / (z * y));
} else {
tmp = x * y;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4.8e-150: tmp = x * -y elif z <= 3.3e-177: tmp = x / ((-0.5 * (t * (a / z))) / (z * y)) else: tmp = x * y return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e-150) tmp = Float64(x * Float64(-y)); elseif (z <= 3.3e-177) tmp = Float64(x / Float64(Float64(-0.5 * Float64(t * Float64(a / z))) / Float64(z * y))); else tmp = Float64(x * y); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.8e-150)
tmp = x * -y;
elseif (z <= 3.3e-177)
tmp = x / ((-0.5 * (t * (a / z))) / (z * y));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e-150], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 3.3e-177], N[(x / N[(N[(-0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{-150}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-177}:\\
\;\;\;\;\frac{x}{\frac{-0.5 \cdot \left(t \cdot \frac{a}{z}\right)}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.8e-150Initial program 52.8%
*-commutative52.8%
associate-*l*49.8%
associate-*r/52.7%
Simplified52.7%
Taylor expanded in z around -inf 87.3%
neg-mul-187.3%
Simplified87.3%
if -4.8e-150 < z < 3.3e-177Initial program 76.0%
*-commutative76.0%
associate-*l*80.2%
associate-*r/78.3%
Simplified78.3%
*-commutative78.3%
associate-/l*75.9%
associate-/r/72.1%
associate-/l/77.8%
*-commutative77.8%
Applied egg-rr77.8%
Taylor expanded in z around inf 59.6%
Taylor expanded in z around 0 54.1%
associate-*l/61.0%
Simplified61.0%
if 3.3e-177 < z Initial program 64.2%
*-commutative64.2%
associate-*l*58.7%
associate-*r/62.2%
Simplified62.2%
Taylor expanded in z around inf 73.9%
Final simplification77.1%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -3.5e-151) (* x (- y)) (/ (* x y) (+ 1.0 (* -0.5 (/ a (* z (/ z t))))))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e-151) {
tmp = x * -y;
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.5d-151)) then
tmp = x * -y
else
tmp = (x * y) / (1.0d0 + ((-0.5d0) * (a / (z * (z / t)))))
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.5e-151) {
tmp = x * -y;
} else {
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -3.5e-151: tmp = x * -y else: tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t))))) return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.5e-151) tmp = Float64(x * Float64(-y)); else tmp = Float64(Float64(x * y) / Float64(1.0 + Float64(-0.5 * Float64(a / Float64(z * Float64(z / t)))))); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -3.5e-151)
tmp = x * -y;
else
tmp = (x * y) / (1.0 + (-0.5 * (a / (z * (z / t)))));
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e-151], N[(x * (-y)), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(1.0 + N[(-0.5 * N[(a / N[(z * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-151}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{1 + -0.5 \cdot \frac{a}{z \cdot \frac{z}{t}}}\\
\end{array}
\end{array}
if z < -3.49999999999999995e-151Initial program 52.8%
*-commutative52.8%
associate-*l*49.8%
associate-*r/52.7%
Simplified52.7%
Taylor expanded in z around -inf 87.3%
neg-mul-187.3%
Simplified87.3%
if -3.49999999999999995e-151 < z Initial program 67.7%
associate-/l*68.4%
Simplified68.4%
Taylor expanded in z around inf 65.8%
unpow265.8%
associate-/l*70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
unpow270.6%
associate-*r/72.7%
Simplified72.7%
Final simplification78.6%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.85e-218) (* x (- y)) (if (<= z 2.9e-177) (* y (/ (* z x) z)) (* x y))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e-218) {
tmp = x * -y;
} else if (z <= 2.9e-177) {
tmp = y * ((z * x) / z);
} else {
tmp = x * y;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.85d-218)) then
tmp = x * -y
else if (z <= 2.9d-177) then
tmp = y * ((z * x) / z)
else
tmp = x * y
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e-218) {
tmp = x * -y;
} else if (z <= 2.9e-177) {
tmp = y * ((z * x) / z);
} else {
tmp = x * y;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.85e-218: tmp = x * -y elif z <= 2.9e-177: tmp = y * ((z * x) / z) else: tmp = x * y return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e-218) tmp = Float64(x * Float64(-y)); elseif (z <= 2.9e-177) tmp = Float64(y * Float64(Float64(z * x) / z)); else tmp = Float64(x * y); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.85e-218)
tmp = x * -y;
elseif (z <= 2.9e-177)
tmp = y * ((z * x) / z);
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e-218], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.9e-177], N[(y * N[(N[(z * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-218}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-177}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.8500000000000001e-218Initial program 56.0%
*-commutative56.0%
associate-*l*53.3%
associate-*r/55.1%
Simplified55.1%
Taylor expanded in z around -inf 80.4%
neg-mul-180.4%
Simplified80.4%
if -1.8500000000000001e-218 < z < 2.89999999999999997e-177Initial program 73.1%
*-commutative73.1%
associate-*l*78.9%
associate-*r/79.0%
Simplified79.0%
Taylor expanded in z around inf 43.0%
if 2.89999999999999997e-177 < z Initial program 64.2%
*-commutative64.2%
associate-*l*58.7%
associate-*r/62.2%
Simplified62.2%
Taylor expanded in z around inf 73.9%
Final simplification73.0%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -1.2e-150) (* x (- y)) (if (<= z 1.5e-201) (/ x (/ z (* z y))) (* x y))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e-150) {
tmp = x * -y;
} else if (z <= 1.5e-201) {
tmp = x / (z / (z * y));
} else {
tmp = x * y;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.2d-150)) then
tmp = x * -y
else if (z <= 1.5d-201) then
tmp = x / (z / (z * y))
else
tmp = x * y
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e-150) {
tmp = x * -y;
} else if (z <= 1.5e-201) {
tmp = x / (z / (z * y));
} else {
tmp = x * y;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -1.2e-150: tmp = x * -y elif z <= 1.5e-201: tmp = x / (z / (z * y)) else: tmp = x * y return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e-150) tmp = Float64(x * Float64(-y)); elseif (z <= 1.5e-201) tmp = Float64(x / Float64(z / Float64(z * y))); else tmp = Float64(x * y); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -1.2e-150)
tmp = x * -y;
elseif (z <= 1.5e-201)
tmp = x / (z / (z * y));
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e-150], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 1.5e-201], N[(x / N[(z / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-150}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-201}:\\
\;\;\;\;\frac{x}{\frac{z}{z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -1.2e-150Initial program 52.8%
*-commutative52.8%
associate-*l*49.8%
associate-*r/52.7%
Simplified52.7%
Taylor expanded in z around -inf 87.3%
neg-mul-187.3%
Simplified87.3%
if -1.2e-150 < z < 1.50000000000000001e-201Initial program 74.9%
*-commutative74.9%
associate-*l*79.2%
associate-*r/77.2%
Simplified77.2%
*-commutative77.2%
associate-/l*74.8%
associate-/r/70.8%
associate-/l/76.7%
*-commutative76.7%
Applied egg-rr76.7%
Taylor expanded in z around inf 36.6%
if 1.50000000000000001e-201 < z Initial program 64.9%
*-commutative64.9%
associate-*l*59.5%
associate-*r/62.9%
Simplified62.9%
Taylor expanded in z around inf 72.6%
Final simplification72.7%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4.3e-181) (* x (- y)) (if (<= z 2.5e-138) (/ (* z (* x y)) z) (* x y))))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.3e-181) {
tmp = x * -y;
} else if (z <= 2.5e-138) {
tmp = (z * (x * y)) / z;
} else {
tmp = x * y;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.3d-181)) then
tmp = x * -y
else if (z <= 2.5d-138) then
tmp = (z * (x * y)) / z
else
tmp = x * y
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.3e-181) {
tmp = x * -y;
} else if (z <= 2.5e-138) {
tmp = (z * (x * y)) / z;
} else {
tmp = x * y;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4.3e-181: tmp = x * -y elif z <= 2.5e-138: tmp = (z * (x * y)) / z else: tmp = x * y return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.3e-181) tmp = Float64(x * Float64(-y)); elseif (z <= 2.5e-138) tmp = Float64(Float64(z * Float64(x * y)) / z); else tmp = Float64(x * y); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4.3e-181)
tmp = x * -y;
elseif (z <= 2.5e-138)
tmp = (z * (x * y)) / z;
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.3e-181], N[(x * (-y)), $MachinePrecision], If[LessEqual[z, 2.5e-138], N[(N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-181}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-138}:\\
\;\;\;\;\frac{z \cdot \left(x \cdot y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -4.3e-181Initial program 54.6%
*-commutative54.6%
associate-*l*51.6%
associate-*r/54.4%
Simplified54.4%
Taylor expanded in z around -inf 85.1%
neg-mul-185.1%
Simplified85.1%
if -4.3e-181 < z < 2.49999999999999994e-138Initial program 73.5%
Taylor expanded in z around inf 44.8%
if 2.49999999999999994e-138 < z Initial program 63.6%
*-commutative63.6%
associate-*l*58.7%
associate-*r/61.5%
Simplified61.5%
Taylor expanded in z around inf 75.8%
Final simplification74.0%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2e-237) (* x (- y)) (* x y)))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-237) {
tmp = x * -y;
} else {
tmp = x * y;
}
return tmp;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2d-237)) then
tmp = x * -y
else
tmp = x * y
end if
code = tmp
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-237) {
tmp = x * -y;
} else {
tmp = x * y;
}
return tmp;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2e-237: tmp = x * -y else: tmp = x * y return tmp
t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-237) tmp = Float64(x * Float64(-y)); else tmp = Float64(x * y); end return tmp end
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2e-237)
tmp = x * -y;
else
tmp = x * y;
end
tmp_2 = tmp;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-237], N[(x * (-y)), $MachinePrecision], N[(x * y), $MachinePrecision]]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-237}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if z < -2e-237Initial program 57.1%
*-commutative57.1%
associate-*l*54.5%
associate-*r/56.3%
Simplified56.3%
Taylor expanded in z around -inf 78.5%
neg-mul-178.5%
Simplified78.5%
if -2e-237 < z Initial program 65.5%
*-commutative65.5%
associate-*l*62.6%
associate-*r/65.3%
Simplified65.3%
Taylor expanded in z around inf 62.0%
Final simplification69.7%
NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* x y))
assert(t < a);
double code(double x, double y, double z, double t, double a) {
return x * y;
}
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x * y
end function
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
return x * y;
}
[t, a] = sort([t, a]) def code(x, y, z, t, a): return x * y
t, a = sort([t, a]) function code(x, y, z, t, a) return Float64(x * y) end
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = x * y;
end
NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(x * y), $MachinePrecision]
\begin{array}{l}
[t, a] = \mathsf{sort}([t, a])\\
\\
x \cdot y
\end{array}
Initial program 61.6%
*-commutative61.6%
associate-*l*58.8%
associate-*r/61.1%
Simplified61.1%
Taylor expanded in z around inf 39.7%
Final simplification39.7%
(FPCore (x y z t a)
:precision binary64
(if (< z -3.1921305903852764e+46)
(- (* y x))
(if (< z 5.976268120920894e+90)
(/ (* x z) (/ (sqrt (- (* z z) (* a t))) y))
(* y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z < (-3.1921305903852764d+46)) then
tmp = -(y * x)
else if (z < 5.976268120920894d+90) then
tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y)
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z < -3.1921305903852764e+46) {
tmp = -(y * x);
} else if (z < 5.976268120920894e+90) {
tmp = (x * z) / (Math.sqrt(((z * z) - (a * t))) / y);
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z < -3.1921305903852764e+46: tmp = -(y * x) elif z < 5.976268120920894e+90: tmp = (x * z) / (math.sqrt(((z * z) - (a * t))) / y) else: tmp = y * x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z < -3.1921305903852764e+46) tmp = Float64(-Float64(y * x)); elseif (z < 5.976268120920894e+90) tmp = Float64(Float64(x * z) / Float64(sqrt(Float64(Float64(z * z) - Float64(a * t))) / y)); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z < -3.1921305903852764e+46) tmp = -(y * x); elseif (z < 5.976268120920894e+90) tmp = (x * z) / (sqrt(((z * z) - (a * t))) / y); else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[z, -3.1921305903852764e+46], (-N[(y * x), $MachinePrecision]), If[Less[z, 5.976268120920894e+90], N[(N[(x * z), $MachinePrecision] / N[(N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
herbie shell --seed 2023214
(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)))))