
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt(((z * z) - (t * a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((x * y) * z) / sqrt(((z * z) - (t * a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / Math.sqrt(((z * z) - (t * a)));
}
def code(x, y, z, t, a): return ((x * y) * z) / math.sqrt(((z * z) - (t * a)))
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) * z) / sqrt(Float64(Float64(z * z) - Float64(t * a)))) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) * z) / sqrt(((z * z) - (t * a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function.
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 (* (/ z (sqrt (- (* z z) (* a t)))) (* y x))))
(if (<= z -1e+140)
(* y (- x))
(if (<= z -3.9e-187)
t_1
(if (<= z 1.45e-79)
(* y (* (exp (* -0.5 (- (log (- t)) (log (/ 1.0 a))))) (* z x)))
(if (<= z 1.55e+122) t_1 (* y x)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (z / sqrt(((z * z) - (a * t)))) * (y * x);
double tmp;
if (z <= -1e+140) {
tmp = y * -x;
} else if (z <= -3.9e-187) {
tmp = t_1;
} else if (z <= 1.45e-79) {
tmp = y * (exp((-0.5 * (log(-t) - log((1.0 / a))))) * (z * x));
} else if (z <= 1.55e+122) {
tmp = t_1;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (z / sqrt(((z * z) - (a * t)))) * (y * x)
if (z <= (-1d+140)) then
tmp = y * -x
else if (z <= (-3.9d-187)) then
tmp = t_1
else if (z <= 1.45d-79) then
tmp = y * (exp(((-0.5d0) * (log(-t) - log((1.0d0 / a))))) * (z * x))
else if (z <= 1.55d+122) then
tmp = t_1
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z / Math.sqrt(((z * z) - (a * t)))) * (y * x);
double tmp;
if (z <= -1e+140) {
tmp = y * -x;
} else if (z <= -3.9e-187) {
tmp = t_1;
} else if (z <= 1.45e-79) {
tmp = y * (Math.exp((-0.5 * (Math.log(-t) - Math.log((1.0 / a))))) * (z * x));
} else if (z <= 1.55e+122) {
tmp = t_1;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): t_1 = (z / math.sqrt(((z * z) - (a * t)))) * (y * x) tmp = 0 if z <= -1e+140: tmp = y * -x elif z <= -3.9e-187: tmp = t_1 elif z <= 1.45e-79: tmp = y * (math.exp((-0.5 * (math.log(-t) - math.log((1.0 / a))))) * (z * x)) elif z <= 1.55e+122: tmp = t_1 else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(z / sqrt(Float64(Float64(z * z) - Float64(a * t)))) * Float64(y * x)) tmp = 0.0 if (z <= -1e+140) tmp = Float64(y * Float64(-x)); elseif (z <= -3.9e-187) tmp = t_1; elseif (z <= 1.45e-79) tmp = Float64(y * Float64(exp(Float64(-0.5 * Float64(log(Float64(-t)) - log(Float64(1.0 / a))))) * Float64(z * x))); elseif (z <= 1.55e+122) tmp = t_1; else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (z / sqrt(((z * z) - (a * t)))) * (y * x);
tmp = 0.0;
if (z <= -1e+140)
tmp = y * -x;
elseif (z <= -3.9e-187)
tmp = t_1;
elseif (z <= 1.45e-79)
tmp = y * (exp((-0.5 * (log(-t) - log((1.0 / a))))) * (z * x));
elseif (z <= 1.55e+122)
tmp = t_1;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+140], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, -3.9e-187], t$95$1, If[LessEqual[z, 1.45e-79], N[(y * N[(N[Exp[N[(-0.5 * N[(N[Log[(-t)], $MachinePrecision] - N[Log[N[(1.0 / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+122], t$95$1, N[(y * x), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{z}{\sqrt{z \cdot z - a \cdot t}} \cdot \left(y \cdot x\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+140}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-79}:\\
\;\;\;\;y \cdot \left(e^{-0.5 \cdot \left(\log \left(-t\right) - \log \left(\frac{1}{a}\right)\right)} \cdot \left(z \cdot x\right)\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+122}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.00000000000000006e140Initial program 17.4%
*-commutative17.4%
associate-*l*16.9%
associate-*r/17.0%
Simplified17.0%
Taylor expanded in z around -inf 98.5%
neg-mul-198.5%
Simplified98.5%
if -1.00000000000000006e140 < z < -3.8999999999999999e-187 or 1.45e-79 < z < 1.54999999999999999e122Initial program 90.7%
*-commutative90.7%
associate-*l*86.4%
associate-*r/86.0%
Simplified86.0%
associate-*r/86.4%
associate-*r*90.7%
*-commutative90.7%
expm1-log1p-u71.9%
associate-*l/67.3%
expm1-udef36.7%
*-commutative36.7%
clear-num36.7%
un-div-inv36.7%
Applied egg-rr36.7%
expm1-def67.2%
expm1-log1p86.0%
associate-/r/93.9%
*-commutative93.9%
Simplified93.9%
if -3.8999999999999999e-187 < z < 1.45e-79Initial program 66.7%
*-commutative66.7%
associate-*l*74.1%
associate-*r/70.5%
Simplified70.5%
clear-num70.5%
associate-/r/70.5%
pow1/270.5%
pow-flip70.6%
metadata-eval70.6%
*-commutative70.6%
Applied egg-rr70.6%
Taylor expanded in a around inf 36.5%
if 1.54999999999999999e122 < z Initial program 33.5%
*-commutative33.5%
associate-*l*32.9%
associate-*r/33.1%
Simplified33.1%
Taylor expanded in z around inf 100.0%
Final simplification84.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -4e+71) (* y (- x)) (if (<= z 5.1e+115) (* y (/ (* z x) (sqrt (- (* z z) (* a t))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+71) {
tmp = y * -x;
} else if (z <= 5.1e+115) {
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4d+71)) then
tmp = y * -x
else if (z <= 5.1d+115) then
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e+71) {
tmp = y * -x;
} else if (z <= 5.1e+115) {
tmp = y * ((z * x) / Math.sqrt(((z * z) - (a * t))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -4e+71: tmp = y * -x elif z <= 5.1e+115: tmp = y * ((z * x) / math.sqrt(((z * z) - (a * t)))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e+71) tmp = Float64(y * Float64(-x)); elseif (z <= 5.1e+115) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(Float64(z * z) - Float64(a * t))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -4e+71)
tmp = y * -x;
elseif (z <= 5.1e+115)
tmp = y * ((z * x) / sqrt(((z * z) - (a * t))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e+71], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 5.1e+115], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+71}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{+115}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -4.0000000000000002e71Initial program 29.8%
*-commutative29.8%
associate-*l*29.4%
associate-*r/29.4%
Simplified29.4%
Taylor expanded in z around -inf 98.7%
neg-mul-198.7%
Simplified98.7%
if -4.0000000000000002e71 < z < 5.0999999999999996e115Initial program 81.5%
*-commutative81.5%
associate-*l*81.2%
associate-*r/79.6%
Simplified79.6%
if 5.0999999999999996e115 < z Initial program 33.5%
*-commutative33.5%
associate-*l*32.9%
associate-*r/33.1%
Simplified33.1%
Taylor expanded in z around inf 100.0%
Final simplification89.0%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.3e+51) (* y (- x)) (if (<= z 9.4e+117) (/ (* z (* y x)) (sqrt (- (* z z) (* a t)))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+51) {
tmp = y * -x;
} else if (z <= 9.4e+117) {
tmp = (z * (y * x)) / sqrt(((z * z) - (a * t)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.3d+51)) then
tmp = y * -x
else if (z <= 9.4d+117) then
tmp = (z * (y * x)) / sqrt(((z * z) - (a * t)))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e+51) {
tmp = y * -x;
} else if (z <= 9.4e+117) {
tmp = (z * (y * x)) / Math.sqrt(((z * z) - (a * t)));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.3e+51: tmp = y * -x elif z <= 9.4e+117: tmp = (z * (y * x)) / math.sqrt(((z * z) - (a * t))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e+51) tmp = Float64(y * Float64(-x)); elseif (z <= 9.4e+117) tmp = Float64(Float64(z * Float64(y * x)) / sqrt(Float64(Float64(z * z) - Float64(a * t)))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.3e+51)
tmp = y * -x;
elseif (z <= 9.4e+117)
tmp = (z * (y * x)) / sqrt(((z * z) - (a * t)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e+51], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 9.4e+117], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(N[(z * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+51}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{+117}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.30000000000000005e51Initial program 33.2%
*-commutative33.2%
associate-*l*32.7%
associate-*r/32.8%
Simplified32.8%
Taylor expanded in z around -inf 98.8%
neg-mul-198.8%
Simplified98.8%
if -2.30000000000000005e51 < z < 9.40000000000000011e117Initial program 81.5%
if 9.40000000000000011e117 < z Initial program 33.5%
*-commutative33.5%
associate-*l*32.9%
associate-*r/33.1%
Simplified33.1%
Taylor expanded in z around inf 100.0%
Final simplification90.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -23000000000.0) (* y (* x (/ z (- (* -0.5 (/ t (/ z a))) z)))) (if (<= z 9e-77) (* y (/ (* z x) (sqrt (* t (- a))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -23000000000.0) {
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
} else if (z <= 9e-77) {
tmp = y * ((z * x) / sqrt((t * -a)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-23000000000.0d0)) then
tmp = y * (x * (z / (((-0.5d0) * (t / (z / a))) - z)))
else if (z <= 9d-77) then
tmp = y * ((z * x) / sqrt((t * -a)))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -23000000000.0) {
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
} else if (z <= 9e-77) {
tmp = y * ((z * x) / Math.sqrt((t * -a)));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -23000000000.0: tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z))) elif z <= 9e-77: tmp = y * ((z * x) / math.sqrt((t * -a))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -23000000000.0) tmp = Float64(y * Float64(x * Float64(z / Float64(Float64(-0.5 * Float64(t / Float64(z / a))) - z)))); elseif (z <= 9e-77) tmp = Float64(y * Float64(Float64(z * x) / sqrt(Float64(t * Float64(-a))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -23000000000.0)
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
elseif (z <= 9e-77)
tmp = y * ((z * x) / sqrt((t * -a)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -23000000000.0], N[(y * N[(x * N[(z / N[(N[(-0.5 * N[(t / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e-77], N[(y * N[(N[(z * x), $MachinePrecision] / N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -23000000000:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{-0.5 \cdot \frac{t}{\frac{z}{a}} - z}\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-77}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{\sqrt{t \cdot \left(-a\right)}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.3e10Initial program 39.3%
*-commutative39.3%
associate-*l*38.9%
associate-*r/39.0%
Simplified39.0%
Taylor expanded in z around -inf 74.3%
associate-*r/74.3%
frac-2neg74.3%
*-commutative74.3%
mul-1-neg74.3%
add-sqr-sqrt74.3%
sqrt-unprod73.1%
mul-1-neg73.1%
mul-1-neg73.1%
sqr-neg73.1%
sqrt-prod0.0%
add-sqr-sqrt74.3%
Applied egg-rr74.3%
distribute-frac-neg74.3%
*-commutative74.3%
associate-*r/74.3%
associate-/l*78.7%
distribute-lft-neg-in78.7%
metadata-eval78.7%
Simplified78.7%
Taylor expanded in x around 0 74.3%
*-commutative74.3%
neg-mul-174.3%
+-commutative74.3%
associate-*l/78.7%
fma-udef78.7%
*-lft-identity78.7%
times-frac95.1%
/-rgt-identity95.1%
fma-neg95.1%
associate-*l/90.7%
*-commutative90.7%
associate-/l*95.1%
Simplified95.1%
if -2.3e10 < z < 9.0000000000000001e-77Initial program 72.7%
*-commutative72.7%
associate-*l*75.3%
associate-*r/72.9%
Simplified72.9%
Taylor expanded in z around 0 65.3%
mul-1-neg65.3%
distribute-rgt-neg-out65.3%
Simplified65.3%
if 9.0000000000000001e-77 < z Initial program 62.8%
*-commutative62.8%
associate-*l*60.3%
associate-*r/59.9%
Simplified59.9%
Taylor expanded in z around inf 95.9%
Final simplification86.9%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -23000000000.0) (* y (* x (/ z (- (* -0.5 (/ t (/ z a))) z)))) (if (<= z 1.4e-77) (/ (* z x) (/ (sqrt (* t (- a))) y)) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -23000000000.0) {
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
} else if (z <= 1.4e-77) {
tmp = (z * x) / (sqrt((t * -a)) / y);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-23000000000.0d0)) then
tmp = y * (x * (z / (((-0.5d0) * (t / (z / a))) - z)))
else if (z <= 1.4d-77) then
tmp = (z * x) / (sqrt((t * -a)) / y)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -23000000000.0) {
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
} else if (z <= 1.4e-77) {
tmp = (z * x) / (Math.sqrt((t * -a)) / y);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -23000000000.0: tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z))) elif z <= 1.4e-77: tmp = (z * x) / (math.sqrt((t * -a)) / y) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -23000000000.0) tmp = Float64(y * Float64(x * Float64(z / Float64(Float64(-0.5 * Float64(t / Float64(z / a))) - z)))); elseif (z <= 1.4e-77) tmp = Float64(Float64(z * x) / Float64(sqrt(Float64(t * Float64(-a))) / y)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -23000000000.0)
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
elseif (z <= 1.4e-77)
tmp = (z * x) / (sqrt((t * -a)) / y);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -23000000000.0], N[(y * N[(x * N[(z / N[(N[(-0.5 * N[(t / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-77], N[(N[(z * x), $MachinePrecision] / N[(N[Sqrt[N[(t * (-a)), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -23000000000:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{-0.5 \cdot \frac{t}{\frac{z}{a}} - z}\right)\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-77}:\\
\;\;\;\;\frac{z \cdot x}{\frac{\sqrt{t \cdot \left(-a\right)}}{y}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.3e10Initial program 39.3%
*-commutative39.3%
associate-*l*38.9%
associate-*r/39.0%
Simplified39.0%
Taylor expanded in z around -inf 74.3%
associate-*r/74.3%
frac-2neg74.3%
*-commutative74.3%
mul-1-neg74.3%
add-sqr-sqrt74.3%
sqrt-unprod73.1%
mul-1-neg73.1%
mul-1-neg73.1%
sqr-neg73.1%
sqrt-prod0.0%
add-sqr-sqrt74.3%
Applied egg-rr74.3%
distribute-frac-neg74.3%
*-commutative74.3%
associate-*r/74.3%
associate-/l*78.7%
distribute-lft-neg-in78.7%
metadata-eval78.7%
Simplified78.7%
Taylor expanded in x around 0 74.3%
*-commutative74.3%
neg-mul-174.3%
+-commutative74.3%
associate-*l/78.7%
fma-udef78.7%
*-lft-identity78.7%
times-frac95.1%
/-rgt-identity95.1%
fma-neg95.1%
associate-*l/90.7%
*-commutative90.7%
associate-/l*95.1%
Simplified95.1%
if -2.3e10 < z < 1.4e-77Initial program 72.7%
*-commutative72.7%
associate-*l*75.3%
associate-*r/72.9%
Simplified72.9%
associate-*r/75.3%
associate-*r*72.7%
*-commutative72.7%
associate-*l/68.1%
*-commutative68.1%
associate-/l*72.0%
associate-*r/73.3%
Applied egg-rr73.3%
Taylor expanded in z around 0 66.9%
mul-1-neg65.3%
distribute-rgt-neg-out65.3%
Simplified66.9%
if 1.4e-77 < z Initial program 62.8%
*-commutative62.8%
associate-*l*60.3%
associate-*r/59.9%
Simplified59.9%
Taylor expanded in z around inf 95.9%
Final simplification87.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.4e-288) (* y (- x)) (if (<= z 1.45e-170) (* -2.0 (* (/ y a) (* z (/ (* z x) t)))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-288) {
tmp = y * -x;
} else if (z <= 1.45e-170) {
tmp = -2.0 * ((y / a) * (z * ((z * x) / t)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.4d-288)) then
tmp = y * -x
else if (z <= 1.45d-170) then
tmp = (-2.0d0) * ((y / a) * (z * ((z * x) / t)))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-288) {
tmp = y * -x;
} else if (z <= 1.45e-170) {
tmp = -2.0 * ((y / a) * (z * ((z * x) / t)));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.4e-288: tmp = y * -x elif z <= 1.45e-170: tmp = -2.0 * ((y / a) * (z * ((z * x) / t))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e-288) tmp = Float64(y * Float64(-x)); elseif (z <= 1.45e-170) tmp = Float64(-2.0 * Float64(Float64(y / a) * Float64(z * Float64(Float64(z * x) / t)))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.4e-288)
tmp = y * -x;
elseif (z <= 1.45e-170)
tmp = -2.0 * ((y / a) * (z * ((z * x) / t)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e-288], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.45e-170], N[(-2.0 * N[(N[(y / a), $MachinePrecision] * N[(z * N[(N[(z * x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-288}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-170}:\\
\;\;\;\;-2 \cdot \left(\frac{y}{a} \cdot \left(z \cdot \frac{z \cdot x}{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.3999999999999998e-288Initial program 47.8%
*-commutative47.8%
associate-*l*47.5%
associate-*r/46.9%
Simplified46.9%
Taylor expanded in z around -inf 79.7%
neg-mul-179.7%
Simplified79.7%
if -2.3999999999999998e-288 < z < 1.45e-170Initial program 80.8%
associate-*l/80.7%
Simplified80.7%
Taylor expanded in z around inf 57.7%
associate-/l*58.8%
Simplified58.8%
Taylor expanded in z around 0 55.7%
times-frac55.8%
unpow255.8%
Simplified55.8%
Taylor expanded in z around 0 55.8%
unpow255.8%
associate-*r*55.8%
*-rgt-identity55.8%
associate-*r/55.8%
associate-*l*56.4%
associate-*r/56.4%
*-rgt-identity56.4%
Simplified56.4%
if 1.45e-170 < z Initial program 62.4%
*-commutative62.4%
associate-*l*61.1%
associate-*r/60.8%
Simplified60.8%
Taylor expanded in z around inf 85.6%
Final simplification79.8%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.4e-288) (* y (- x)) (if (<= z 1.28e-169) (* -2.0 (/ (* y (* z (/ z (/ t x)))) a)) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-288) {
tmp = y * -x;
} else if (z <= 1.28e-169) {
tmp = -2.0 * ((y * (z * (z / (t / x)))) / a);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.4d-288)) then
tmp = y * -x
else if (z <= 1.28d-169) then
tmp = (-2.0d0) * ((y * (z * (z / (t / x)))) / a)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-288) {
tmp = y * -x;
} else if (z <= 1.28e-169) {
tmp = -2.0 * ((y * (z * (z / (t / x)))) / a);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.4e-288: tmp = y * -x elif z <= 1.28e-169: tmp = -2.0 * ((y * (z * (z / (t / x)))) / a) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e-288) tmp = Float64(y * Float64(-x)); elseif (z <= 1.28e-169) tmp = Float64(-2.0 * Float64(Float64(y * Float64(z * Float64(z / Float64(t / x)))) / a)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.4e-288)
tmp = y * -x;
elseif (z <= 1.28e-169)
tmp = -2.0 * ((y * (z * (z / (t / x)))) / a);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e-288], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.28e-169], N[(-2.0 * N[(N[(y * N[(z * N[(z / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-288}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{-169}:\\
\;\;\;\;-2 \cdot \frac{y \cdot \left(z \cdot \frac{z}{\frac{t}{x}}\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.3999999999999998e-288Initial program 47.8%
*-commutative47.8%
associate-*l*47.5%
associate-*r/46.9%
Simplified46.9%
Taylor expanded in z around -inf 79.7%
neg-mul-179.7%
Simplified79.7%
if -2.3999999999999998e-288 < z < 1.28e-169Initial program 80.8%
associate-*l/80.7%
Simplified80.7%
Taylor expanded in z around inf 57.7%
associate-/l*58.8%
Simplified58.8%
Taylor expanded in z around 0 55.7%
times-frac55.8%
unpow255.8%
Simplified55.8%
Taylor expanded in z around 0 55.8%
unpow255.8%
associate-*r*55.8%
*-rgt-identity55.8%
associate-*r/55.8%
associate-*l*56.4%
associate-*r/56.4%
*-rgt-identity56.4%
Simplified56.4%
associate-*l/56.4%
associate-/l*52.4%
Applied egg-rr52.4%
if 1.28e-169 < z Initial program 62.4%
*-commutative62.4%
associate-*l*61.1%
associate-*r/60.8%
Simplified60.8%
Taylor expanded in z around inf 85.6%
Final simplification79.3%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.4e-288) (* y (- x)) (if (<= z 3.5e-169) (* y (/ (* z x) (* -0.5 (* t (/ a z))))) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-288) {
tmp = y * -x;
} else if (z <= 3.5e-169) {
tmp = y * ((z * x) / (-0.5 * (t * (a / z))));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.4d-288)) then
tmp = y * -x
else if (z <= 3.5d-169) then
tmp = y * ((z * x) / ((-0.5d0) * (t * (a / z))))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-288) {
tmp = y * -x;
} else if (z <= 3.5e-169) {
tmp = y * ((z * x) / (-0.5 * (t * (a / z))));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.4e-288: tmp = y * -x elif z <= 3.5e-169: tmp = y * ((z * x) / (-0.5 * (t * (a / z)))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e-288) tmp = Float64(y * Float64(-x)); elseif (z <= 3.5e-169) tmp = Float64(y * Float64(Float64(z * x) / Float64(-0.5 * Float64(t * Float64(a / z))))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.4e-288)
tmp = y * -x;
elseif (z <= 3.5e-169)
tmp = y * ((z * x) / (-0.5 * (t * (a / z))));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e-288], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.5e-169], N[(y * N[(N[(z * x), $MachinePrecision] / N[(-0.5 * N[(t * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-288}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-169}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{-0.5 \cdot \left(t \cdot \frac{a}{z}\right)}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.3999999999999998e-288Initial program 47.8%
*-commutative47.8%
associate-*l*47.5%
associate-*r/46.9%
Simplified46.9%
Taylor expanded in z around -inf 79.7%
neg-mul-179.7%
Simplified79.7%
if -2.3999999999999998e-288 < z < 3.5000000000000003e-169Initial program 80.8%
*-commutative80.8%
associate-*l*84.2%
associate-*r/80.6%
Simplified80.6%
Taylor expanded in z around -inf 55.7%
associate-*r/55.7%
frac-2neg55.7%
*-commutative55.7%
mul-1-neg55.7%
add-sqr-sqrt9.6%
sqrt-unprod55.7%
mul-1-neg55.7%
mul-1-neg55.7%
sqr-neg55.7%
sqrt-prod46.3%
add-sqr-sqrt55.9%
Applied egg-rr55.9%
distribute-frac-neg55.9%
*-commutative55.9%
associate-*r/55.9%
associate-/l*56.4%
distribute-lft-neg-in56.4%
metadata-eval56.4%
Simplified56.4%
Taylor expanded in a around inf 56.0%
associate-*l/56.4%
*-commutative56.4%
Simplified56.4%
if 3.5000000000000003e-169 < z Initial program 62.4%
*-commutative62.4%
associate-*l*61.1%
associate-*r/60.8%
Simplified60.8%
Taylor expanded in z around inf 85.6%
Final simplification79.8%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z 1.7e-170) (* y (* x (/ z (- (* -0.5 (/ t (/ z a))) z)))) (* y x)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.7e-170) {
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 1.7d-170) then
tmp = y * (x * (z / (((-0.5d0) * (t / (z / a))) - z)))
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.7e-170) {
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= 1.7e-170: tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z))) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.7e-170) tmp = Float64(y * Float64(x * Float64(z / Float64(Float64(-0.5 * Float64(t / Float64(z / a))) - z)))); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= 1.7e-170)
tmp = y * (x * (z / ((-0.5 * (t / (z / a))) - z)));
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1.7e-170], N[(y * N[(x * N[(z / N[(N[(-0.5 * N[(t / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.7 \cdot 10^{-170}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{-0.5 \cdot \frac{t}{\frac{z}{a}} - z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < 1.70000000000000006e-170Initial program 53.9%
*-commutative53.9%
associate-*l*54.3%
associate-*r/53.1%
Simplified53.1%
Taylor expanded in z around -inf 64.1%
associate-*r/64.1%
frac-2neg64.1%
*-commutative64.1%
mul-1-neg64.1%
add-sqr-sqrt55.6%
sqrt-unprod61.9%
mul-1-neg61.9%
mul-1-neg61.9%
sqr-neg61.9%
sqrt-prod8.6%
add-sqr-sqrt63.3%
Applied egg-rr63.3%
distribute-frac-neg63.3%
*-commutative63.3%
associate-*r/63.3%
associate-/l*66.0%
distribute-lft-neg-in66.0%
metadata-eval66.0%
Simplified66.0%
Taylor expanded in x around 0 63.3%
*-commutative63.3%
neg-mul-163.3%
+-commutative63.3%
associate-*l/66.0%
fma-udef66.0%
*-lft-identity66.0%
times-frac76.5%
/-rgt-identity76.5%
fma-neg76.5%
associate-*l/73.9%
*-commutative73.9%
associate-/l*76.5%
Simplified76.5%
if 1.70000000000000006e-170 < z Initial program 62.4%
*-commutative62.4%
associate-*l*61.1%
associate-*r/60.8%
Simplified60.8%
Taylor expanded in z around inf 85.6%
Final simplification80.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2e-47) (* y (- x)) (if (<= z 1.48e-192) (/ (* z (* y x)) (- z)) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-47) {
tmp = y * -x;
} else if (z <= 1.48e-192) {
tmp = (z * (y * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2d-47)) then
tmp = y * -x
else if (z <= 1.48d-192) then
tmp = (z * (y * x)) / -z
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e-47) {
tmp = y * -x;
} else if (z <= 1.48e-192) {
tmp = (z * (y * x)) / -z;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2e-47: tmp = y * -x elif z <= 1.48e-192: tmp = (z * (y * x)) / -z else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e-47) tmp = Float64(y * Float64(-x)); elseif (z <= 1.48e-192) tmp = Float64(Float64(z * Float64(y * x)) / Float64(-z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2e-47)
tmp = y * -x;
elseif (z <= 1.48e-192)
tmp = (z * (y * x)) / -z;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e-47], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 1.48e-192], N[(N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-47}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 1.48 \cdot 10^{-192}:\\
\;\;\;\;\frac{z \cdot \left(y \cdot x\right)}{-z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -1.9999999999999999e-47Initial program 44.3%
*-commutative44.3%
associate-*l*43.0%
associate-*r/43.1%
Simplified43.1%
Taylor expanded in z around -inf 92.3%
neg-mul-192.3%
Simplified92.3%
if -1.9999999999999999e-47 < z < 1.4800000000000001e-192Initial program 73.1%
Taylor expanded in z around -inf 32.2%
mul-1-neg32.2%
Simplified32.2%
if 1.4800000000000001e-192 < z Initial program 62.3%
*-commutative62.3%
associate-*l*60.9%
associate-*r/60.7%
Simplified60.7%
Taylor expanded in z around inf 84.1%
Final simplification77.5%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -2.4e-288) (* y (- x)) (if (<= z 3.7e-236) (* y (/ (* z x) z)) (* y x))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-288) {
tmp = y * -x;
} else if (z <= 3.7e-236) {
tmp = y * ((z * x) / z);
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.4d-288)) then
tmp = y * -x
else if (z <= 3.7d-236) then
tmp = y * ((z * x) / z)
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-288) {
tmp = y * -x;
} else if (z <= 3.7e-236) {
tmp = y * ((z * x) / z);
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -2.4e-288: tmp = y * -x elif z <= 3.7e-236: tmp = y * ((z * x) / z) else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e-288) tmp = Float64(y * Float64(-x)); elseif (z <= 3.7e-236) tmp = Float64(y * Float64(Float64(z * x) / z)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -2.4e-288)
tmp = y * -x;
elseif (z <= 3.7e-236)
tmp = y * ((z * x) / z);
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e-288], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 3.7e-236], N[(y * N[(N[(z * x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-288}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-236}:\\
\;\;\;\;y \cdot \frac{z \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.3999999999999998e-288Initial program 47.8%
*-commutative47.8%
associate-*l*47.5%
associate-*r/46.9%
Simplified46.9%
Taylor expanded in z around -inf 79.7%
neg-mul-179.7%
Simplified79.7%
if -2.3999999999999998e-288 < z < 3.70000000000000021e-236Initial program 91.9%
*-commutative91.9%
associate-*l*91.9%
associate-*r/86.3%
Simplified86.3%
Taylor expanded in z around inf 43.4%
if 3.70000000000000021e-236 < z Initial program 62.4%
*-commutative62.4%
associate-*l*61.9%
associate-*r/61.7%
Simplified61.7%
Taylor expanded in z around inf 79.9%
Final simplification77.4%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= z -6.2e-306) (* y (- x)) (* y x)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-306) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-6.2d-306)) then
tmp = y * -x
else
tmp = y * x
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.2e-306) {
tmp = y * -x;
} else {
tmp = y * x;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): tmp = 0 if z <= -6.2e-306: tmp = y * -x else: tmp = y * x return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.2e-306) tmp = Float64(y * Float64(-x)); else tmp = Float64(y * x); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (z <= -6.2e-306)
tmp = y * -x;
else
tmp = y * x;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.2e-306], N[(y * (-x)), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-306}:\\
\;\;\;\;y \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -6.19999999999999995e-306Initial program 48.3%
*-commutative48.3%
associate-*l*48.1%
associate-*r/47.4%
Simplified47.4%
Taylor expanded in z around -inf 78.4%
neg-mul-178.4%
Simplified78.4%
if -6.19999999999999995e-306 < z Initial program 65.8%
*-commutative65.8%
associate-*l*65.4%
associate-*r/64.5%
Simplified64.5%
Taylor expanded in z around inf 72.2%
Final simplification75.2%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* y x))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a) {
return y * x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = y * x
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a) {
return y * x;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a): return y * x
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a) return Float64(y * x) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = y * x;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(y * x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
y \cdot x
\end{array}
Initial program 57.6%
*-commutative57.6%
associate-*l*57.2%
associate-*r/56.4%
Simplified56.4%
Taylor expanded in z around inf 43.3%
Final simplification43.3%
(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 2023238
(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)))))