
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c) :precision binary64 (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = ((((x * 9.0d0) * y) - (((z * 4.0d0) * t) * a)) + b) / (z * c)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c);
}
def code(x, y, z, t, a, b, c): return ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c)
function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(Float64(Float64(x * 9.0) * y) - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) / Float64(z * c)) end
function tmp = code(x, y, z, t, a, b, c) tmp = ((((x * 9.0) * y) - (((z * 4.0) * t) * a)) + b) / (z * c); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision] - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x \cdot 9\right) \cdot y - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b}{z \cdot c}
\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 b c)
:precision binary64
(let* ((t_1 (/ (fma x (* 9.0 y) b) z)))
(if (<= z -9e-55)
(/ (+ t_1 (* t (* a -4.0))) c)
(if (<= z 2.4e-16)
(/ (+ b (- (* x (* 9.0 y)) (* 4.0 (* t (* z a))))) (* z c))
(/ (fma t (* a -4.0) t_1) c)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = fma(x, (9.0 * y), b) / z;
double tmp;
if (z <= -9e-55) {
tmp = (t_1 + (t * (a * -4.0))) / c;
} else if (z <= 2.4e-16) {
tmp = (b + ((x * (9.0 * y)) - (4.0 * (t * (z * a))))) / (z * c);
} else {
tmp = fma(t, (a * -4.0), t_1) / c;
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(fma(x, Float64(9.0 * y), b) / z) tmp = 0.0 if (z <= -9e-55) tmp = Float64(Float64(t_1 + Float64(t * Float64(a * -4.0))) / c); elseif (z <= 2.4e-16) tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(4.0 * Float64(t * Float64(z * a))))) / Float64(z * c)); else tmp = Float64(fma(t, Float64(a * -4.0), t_1) / c); end return 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_, b_, c_] := Block[{t$95$1 = N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -9e-55], N[(N[(t$95$1 + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 2.4e-16], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a * -4.0), $MachinePrecision] + t$95$1), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\\
\mathbf{if}\;z \leq -9 \cdot 10^{-55}:\\
\;\;\;\;\frac{t_1 + t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-16}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - 4 \cdot \left(t \cdot \left(z \cdot a\right)\right)\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, t_1\right)}{c}\\
\end{array}
\end{array}
if z < -8.99999999999999941e-55Initial program 62.6%
associate-/r*71.9%
Simplified91.1%
if -8.99999999999999941e-55 < z < 2.40000000000000005e-16Initial program 91.2%
associate-*l*91.2%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in z around 0 91.2%
associate-*r*86.3%
*-commutative86.3%
associate-*l*90.5%
Simplified90.5%
if 2.40000000000000005e-16 < z Initial program 61.8%
associate-/r*69.4%
Simplified90.6%
Final simplification90.7%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -7.6e-55) (not (<= z 2.2e-16))) (/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* a -4.0))) c) (/ (+ b (- (* x (* 9.0 y)) (* 4.0 (* t (* z a))))) (* z c))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -7.6e-55) || !(z <= 2.2e-16)) {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (a * -4.0))) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - (4.0 * (t * (z * a))))) / (z * c);
}
return tmp;
}
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -7.6e-55) || !(z <= 2.2e-16)) tmp = Float64(Float64(Float64(fma(x, Float64(9.0 * y), b) / z) + Float64(t * Float64(a * -4.0))) / c); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(4.0 * Float64(t * Float64(z * a))))) / Float64(z * c)); end return 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_, b_, c_] := If[Or[LessEqual[z, -7.6e-55], N[Not[LessEqual[z, 2.2e-16]], $MachinePrecision]], N[(N[(N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{-55} \lor \neg \left(z \leq 2.2 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z} + t \cdot \left(a \cdot -4\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - 4 \cdot \left(t \cdot \left(z \cdot a\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -7.5999999999999993e-55 or 2.2e-16 < z Initial program 62.2%
associate-/r*70.7%
Simplified90.1%
if -7.5999999999999993e-55 < z < 2.2e-16Initial program 91.2%
associate-*l*91.2%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in z around 0 91.2%
associate-*r*86.3%
*-commutative86.3%
associate-*l*90.5%
Simplified90.5%
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 b c)
:precision binary64
(let* ((t_1 (* 9.0 (/ y (/ z (/ x c))))) (t_2 (* -4.0 (/ a (/ c t)))))
(if (<= t -1e+194)
t_2
(if (<= t -3.35e+167)
(* (/ y z) (/ (* x 9.0) c))
(if (<= t -4.6e+17)
t_2
(if (<= t -2.4e-94)
t_1
(if (<= t -8e-114)
(/ (/ b z) c)
(if (<= t -1e-128)
t_1
(if (<= t 1.45e-230)
(* (/ b c) (/ 1.0 z))
(if (<= t 4.2e-42)
(* 9.0 (* (/ y c) (/ x z)))
(* -4.0 (/ t (/ c a)))))))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * (y / (z / (x / c)));
double t_2 = -4.0 * (a / (c / t));
double tmp;
if (t <= -1e+194) {
tmp = t_2;
} else if (t <= -3.35e+167) {
tmp = (y / z) * ((x * 9.0) / c);
} else if (t <= -4.6e+17) {
tmp = t_2;
} else if (t <= -2.4e-94) {
tmp = t_1;
} else if (t <= -8e-114) {
tmp = (b / z) / c;
} else if (t <= -1e-128) {
tmp = t_1;
} else if (t <= 1.45e-230) {
tmp = (b / c) * (1.0 / z);
} else if (t <= 4.2e-42) {
tmp = 9.0 * ((y / c) * (x / z));
} else {
tmp = -4.0 * (t / (c / a));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 9.0d0 * (y / (z / (x / c)))
t_2 = (-4.0d0) * (a / (c / t))
if (t <= (-1d+194)) then
tmp = t_2
else if (t <= (-3.35d+167)) then
tmp = (y / z) * ((x * 9.0d0) / c)
else if (t <= (-4.6d+17)) then
tmp = t_2
else if (t <= (-2.4d-94)) then
tmp = t_1
else if (t <= (-8d-114)) then
tmp = (b / z) / c
else if (t <= (-1d-128)) then
tmp = t_1
else if (t <= 1.45d-230) then
tmp = (b / c) * (1.0d0 / z)
else if (t <= 4.2d-42) then
tmp = 9.0d0 * ((y / c) * (x / z))
else
tmp = (-4.0d0) * (t / (c / a))
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 b, double c) {
double t_1 = 9.0 * (y / (z / (x / c)));
double t_2 = -4.0 * (a / (c / t));
double tmp;
if (t <= -1e+194) {
tmp = t_2;
} else if (t <= -3.35e+167) {
tmp = (y / z) * ((x * 9.0) / c);
} else if (t <= -4.6e+17) {
tmp = t_2;
} else if (t <= -2.4e-94) {
tmp = t_1;
} else if (t <= -8e-114) {
tmp = (b / z) / c;
} else if (t <= -1e-128) {
tmp = t_1;
} else if (t <= 1.45e-230) {
tmp = (b / c) * (1.0 / z);
} else if (t <= 4.2e-42) {
tmp = 9.0 * ((y / c) * (x / z));
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * (y / (z / (x / c))) t_2 = -4.0 * (a / (c / t)) tmp = 0 if t <= -1e+194: tmp = t_2 elif t <= -3.35e+167: tmp = (y / z) * ((x * 9.0) / c) elif t <= -4.6e+17: tmp = t_2 elif t <= -2.4e-94: tmp = t_1 elif t <= -8e-114: tmp = (b / z) / c elif t <= -1e-128: tmp = t_1 elif t <= 1.45e-230: tmp = (b / c) * (1.0 / z) elif t <= 4.2e-42: tmp = 9.0 * ((y / c) * (x / z)) else: tmp = -4.0 * (t / (c / a)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))) t_2 = Float64(-4.0 * Float64(a / Float64(c / t))) tmp = 0.0 if (t <= -1e+194) tmp = t_2; elseif (t <= -3.35e+167) tmp = Float64(Float64(y / z) * Float64(Float64(x * 9.0) / c)); elseif (t <= -4.6e+17) tmp = t_2; elseif (t <= -2.4e-94) tmp = t_1; elseif (t <= -8e-114) tmp = Float64(Float64(b / z) / c); elseif (t <= -1e-128) tmp = t_1; elseif (t <= 1.45e-230) tmp = Float64(Float64(b / c) * Float64(1.0 / z)); elseif (t <= 4.2e-42) tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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, b, c)
t_1 = 9.0 * (y / (z / (x / c)));
t_2 = -4.0 * (a / (c / t));
tmp = 0.0;
if (t <= -1e+194)
tmp = t_2;
elseif (t <= -3.35e+167)
tmp = (y / z) * ((x * 9.0) / c);
elseif (t <= -4.6e+17)
tmp = t_2;
elseif (t <= -2.4e-94)
tmp = t_1;
elseif (t <= -8e-114)
tmp = (b / z) / c;
elseif (t <= -1e-128)
tmp = t_1;
elseif (t <= 1.45e-230)
tmp = (b / c) * (1.0 / z);
elseif (t <= 4.2e-42)
tmp = 9.0 * ((y / c) * (x / z));
else
tmp = -4.0 * (t / (c / a));
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_, b_, c_] := Block[{t$95$1 = N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e+194], t$95$2, If[LessEqual[t, -3.35e+167], N[(N[(y / z), $MachinePrecision] * N[(N[(x * 9.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.6e+17], t$95$2, If[LessEqual[t, -2.4e-94], t$95$1, If[LessEqual[t, -8e-114], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t, -1e-128], t$95$1, If[LessEqual[t, 1.45e-230], N[(N[(b / c), $MachinePrecision] * N[(1.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-42], N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
t_2 := -4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{if}\;t \leq -1 \cdot 10^{+194}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.35 \cdot 10^{+167}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x \cdot 9}{c}\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{+17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-114}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-230}:\\
\;\;\;\;\frac{b}{c} \cdot \frac{1}{z}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-42}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if t < -9.99999999999999945e193 or -3.34999999999999984e167 < t < -4.6e17Initial program 73.1%
associate-*l*73.1%
associate-*l*65.6%
Simplified65.6%
Taylor expanded in z around inf 36.9%
*-commutative36.9%
associate-/l*47.9%
Simplified47.9%
if -9.99999999999999945e193 < t < -3.34999999999999984e167Initial program 75.0%
associate-*l*75.0%
associate-*l*77.5%
Simplified77.5%
*-un-lft-identity77.5%
times-frac100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 52.5%
associate-*r/52.5%
associate-*r*52.5%
*-commutative52.5%
associate-*r*52.5%
times-frac75.0%
*-commutative75.0%
Simplified75.0%
if -4.6e17 < t < -2.4e-94 or -8.0000000000000004e-114 < t < -1.00000000000000005e-128Initial program 76.6%
associate-*l*76.7%
associate-*l*76.6%
Simplified76.6%
*-un-lft-identity76.6%
times-frac72.3%
Applied egg-rr72.3%
Taylor expanded in x around inf 50.3%
associate-/l*59.4%
*-commutative59.4%
associate-/l*59.3%
Simplified59.3%
if -2.4e-94 < t < -8.0000000000000004e-114Initial program 86.4%
associate-/r*100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in z around 0 86.4%
Taylor expanded in y around 0 72.1%
if -1.00000000000000005e-128 < t < 1.45000000000000003e-230Initial program 83.0%
associate-*l*83.0%
associate-*l*83.2%
Simplified83.2%
Taylor expanded in b around inf 50.5%
associate-/r*52.2%
div-inv52.2%
Applied egg-rr52.2%
if 1.45000000000000003e-230 < t < 4.20000000000000013e-42Initial program 92.6%
associate-/r*94.9%
Simplified95.1%
Taylor expanded in z around 0 95.0%
Taylor expanded in y around inf 56.3%
times-frac55.8%
Simplified55.8%
if 4.20000000000000013e-42 < t Initial program 63.0%
associate-*l*63.0%
associate-*l*67.7%
Simplified67.7%
Taylor expanded in z around inf 56.9%
*-commutative56.9%
*-commutative56.9%
associate-/l*60.6%
Simplified60.6%
Final simplification56.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (or (<= z -2e-55) (not (<= z 2e-16))) (/ (+ (* t (* a -4.0)) (/ (+ b (* 9.0 (* x y))) z)) c) (/ (+ b (- (* x (* 9.0 y)) (* 4.0 (* t (* z a))))) (* z c))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -2e-55) || !(z <= 2e-16)) {
tmp = ((t * (a * -4.0)) + ((b + (9.0 * (x * y))) / z)) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - (4.0 * (t * (z * a))))) / (z * c);
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-2d-55)) .or. (.not. (z <= 2d-16))) then
tmp = ((t * (a * (-4.0d0))) + ((b + (9.0d0 * (x * y))) / z)) / c
else
tmp = (b + ((x * (9.0d0 * y)) - (4.0d0 * (t * (z * a))))) / (z * c)
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 b, double c) {
double tmp;
if ((z <= -2e-55) || !(z <= 2e-16)) {
tmp = ((t * (a * -4.0)) + ((b + (9.0 * (x * y))) / z)) / c;
} else {
tmp = (b + ((x * (9.0 * y)) - (4.0 * (t * (z * a))))) / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -2e-55) or not (z <= 2e-16): tmp = ((t * (a * -4.0)) + ((b + (9.0 * (x * y))) / z)) / c else: tmp = (b + ((x * (9.0 * y)) - (4.0 * (t * (z * a))))) / (z * c) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -2e-55) || !(z <= 2e-16)) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(Float64(b + Float64(9.0 * Float64(x * y))) / z)) / c); else tmp = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(4.0 * Float64(t * Float64(z * a))))) / Float64(z * c)); 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, b, c)
tmp = 0.0;
if ((z <= -2e-55) || ~((z <= 2e-16)))
tmp = ((t * (a * -4.0)) + ((b + (9.0 * (x * y))) / z)) / c;
else
tmp = (b + ((x * (9.0 * y)) - (4.0 * (t * (z * a))))) / (z * c);
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_, b_, c_] := If[Or[LessEqual[z, -2e-55], N[Not[LessEqual[z, 2e-16]], $MachinePrecision]], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{-55} \lor \neg \left(z \leq 2 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b + 9 \cdot \left(x \cdot y\right)}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(x \cdot \left(9 \cdot y\right) - 4 \cdot \left(t \cdot \left(z \cdot a\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.99999999999999999e-55 or 2e-16 < z Initial program 62.2%
associate-/r*70.7%
Simplified90.1%
Taylor expanded in z around 0 90.1%
if -1.99999999999999999e-55 < z < 2e-16Initial program 91.2%
associate-*l*91.2%
associate-*l*86.3%
Simplified86.3%
Taylor expanded in z around 0 91.2%
associate-*r*86.3%
*-commutative86.3%
associate-*l*90.5%
Simplified90.5%
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 b c)
:precision binary64
(let* ((t_1 (* 9.0 (* (/ y c) (/ x z)))))
(if (<= a -4.2e-38)
(* -4.0 (* t (/ a c)))
(if (<= a -5e-282)
(* 9.0 (/ y (/ z (/ x c))))
(if (<= a 2.8e-220)
(/ 1.0 (* c (/ z b)))
(if (<= a 5.5e-149)
t_1
(if (<= a 9e-27)
(/ 1.0 (/ (* z c) b))
(if (<= a 3.3e+32)
t_1
(if (<= a 2.85e+59)
(/ b (* z c))
(* -4.0 (/ t (/ c a))))))))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * ((y / c) * (x / z));
double tmp;
if (a <= -4.2e-38) {
tmp = -4.0 * (t * (a / c));
} else if (a <= -5e-282) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (a <= 2.8e-220) {
tmp = 1.0 / (c * (z / b));
} else if (a <= 5.5e-149) {
tmp = t_1;
} else if (a <= 9e-27) {
tmp = 1.0 / ((z * c) / b);
} else if (a <= 3.3e+32) {
tmp = t_1;
} else if (a <= 2.85e+59) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (t / (c / a));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * ((y / c) * (x / z))
if (a <= (-4.2d-38)) then
tmp = (-4.0d0) * (t * (a / c))
else if (a <= (-5d-282)) then
tmp = 9.0d0 * (y / (z / (x / c)))
else if (a <= 2.8d-220) then
tmp = 1.0d0 / (c * (z / b))
else if (a <= 5.5d-149) then
tmp = t_1
else if (a <= 9d-27) then
tmp = 1.0d0 / ((z * c) / b)
else if (a <= 3.3d+32) then
tmp = t_1
else if (a <= 2.85d+59) then
tmp = b / (z * c)
else
tmp = (-4.0d0) * (t / (c / a))
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 b, double c) {
double t_1 = 9.0 * ((y / c) * (x / z));
double tmp;
if (a <= -4.2e-38) {
tmp = -4.0 * (t * (a / c));
} else if (a <= -5e-282) {
tmp = 9.0 * (y / (z / (x / c)));
} else if (a <= 2.8e-220) {
tmp = 1.0 / (c * (z / b));
} else if (a <= 5.5e-149) {
tmp = t_1;
} else if (a <= 9e-27) {
tmp = 1.0 / ((z * c) / b);
} else if (a <= 3.3e+32) {
tmp = t_1;
} else if (a <= 2.85e+59) {
tmp = b / (z * c);
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * ((y / c) * (x / z)) tmp = 0 if a <= -4.2e-38: tmp = -4.0 * (t * (a / c)) elif a <= -5e-282: tmp = 9.0 * (y / (z / (x / c))) elif a <= 2.8e-220: tmp = 1.0 / (c * (z / b)) elif a <= 5.5e-149: tmp = t_1 elif a <= 9e-27: tmp = 1.0 / ((z * c) / b) elif a <= 3.3e+32: tmp = t_1 elif a <= 2.85e+59: tmp = b / (z * c) else: tmp = -4.0 * (t / (c / a)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))) tmp = 0.0 if (a <= -4.2e-38) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (a <= -5e-282) tmp = Float64(9.0 * Float64(y / Float64(z / Float64(x / c)))); elseif (a <= 2.8e-220) tmp = Float64(1.0 / Float64(c * Float64(z / b))); elseif (a <= 5.5e-149) tmp = t_1; elseif (a <= 9e-27) tmp = Float64(1.0 / Float64(Float64(z * c) / b)); elseif (a <= 3.3e+32) tmp = t_1; elseif (a <= 2.85e+59) tmp = Float64(b / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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, b, c)
t_1 = 9.0 * ((y / c) * (x / z));
tmp = 0.0;
if (a <= -4.2e-38)
tmp = -4.0 * (t * (a / c));
elseif (a <= -5e-282)
tmp = 9.0 * (y / (z / (x / c)));
elseif (a <= 2.8e-220)
tmp = 1.0 / (c * (z / b));
elseif (a <= 5.5e-149)
tmp = t_1;
elseif (a <= 9e-27)
tmp = 1.0 / ((z * c) / b);
elseif (a <= 3.3e+32)
tmp = t_1;
elseif (a <= 2.85e+59)
tmp = b / (z * c);
else
tmp = -4.0 * (t / (c / a));
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_, b_, c_] := Block[{t$95$1 = N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.2e-38], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5e-282], N[(9.0 * N[(y / N[(z / N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e-220], N[(1.0 / N[(c * N[(z / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.5e-149], t$95$1, If[LessEqual[a, 9e-27], N[(1.0 / N[(N[(z * c), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e+32], t$95$1, If[LessEqual[a, 2.85e+59], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{-38}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;a \leq -5 \cdot 10^{-282}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z}{\frac{x}{c}}}\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-220}:\\
\;\;\;\;\frac{1}{c \cdot \frac{z}{b}}\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-149}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-27}:\\
\;\;\;\;\frac{1}{\frac{z \cdot c}{b}}\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.85 \cdot 10^{+59}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -4.20000000000000026e-38Initial program 76.2%
associate-*l*76.2%
associate-*l*74.8%
Simplified74.8%
*-un-lft-identity74.8%
times-frac75.0%
Applied egg-rr75.0%
Taylor expanded in z around inf 55.0%
associate-/l*59.8%
associate-/r/63.6%
Simplified63.6%
if -4.20000000000000026e-38 < a < -5.0000000000000001e-282Initial program 74.8%
associate-*l*74.8%
associate-*l*75.0%
Simplified75.0%
*-un-lft-identity75.0%
times-frac81.0%
Applied egg-rr81.0%
Taylor expanded in x around inf 32.6%
associate-/l*39.0%
*-commutative39.0%
associate-/l*41.0%
Simplified41.0%
if -5.0000000000000001e-282 < a < 2.7999999999999999e-220Initial program 74.1%
associate-*l*74.0%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in b around inf 57.9%
clear-num57.9%
inv-pow57.9%
*-commutative57.9%
Applied egg-rr57.9%
unpow-157.9%
associate-/l*70.4%
Simplified70.4%
associate-/r/66.0%
Applied egg-rr66.0%
if 2.7999999999999999e-220 < a < 5.50000000000000043e-149 or 9.0000000000000003e-27 < a < 3.3000000000000002e32Initial program 73.0%
associate-/r*69.1%
Simplified82.5%
Taylor expanded in z around 0 82.5%
Taylor expanded in y around inf 56.5%
times-frac65.4%
Simplified65.4%
if 5.50000000000000043e-149 < a < 9.0000000000000003e-27Initial program 74.1%
associate-*l*74.2%
associate-*l*83.6%
Simplified83.6%
Taylor expanded in b around inf 44.0%
clear-num44.0%
inv-pow44.0%
*-commutative44.0%
Applied egg-rr44.0%
unpow-144.0%
Simplified44.0%
if 3.3000000000000002e32 < a < 2.8500000000000001e59Initial program 100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in b around inf 37.0%
if 2.8500000000000001e59 < a Initial program 74.0%
associate-*l*74.0%
associate-*l*65.0%
Simplified65.0%
Taylor expanded in z around inf 44.2%
*-commutative44.2%
*-commutative44.2%
associate-/l*57.1%
Simplified57.1%
Final simplification55.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 b c) :precision binary64 (if (or (<= z -7.2e+14) (not (<= z 5.6e-26))) (/ (+ (* t (* a -4.0)) (* 9.0 (/ y (/ z x)))) c) (/ (+ b (* 9.0 (* x y))) (* z c))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((z <= -7.2e+14) || !(z <= 5.6e-26)) {
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((z <= (-7.2d+14)) .or. (.not. (z <= 5.6d-26))) then
tmp = ((t * (a * (-4.0d0))) + (9.0d0 * (y / (z / x)))) / c
else
tmp = (b + (9.0d0 * (x * y))) / (z * c)
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 b, double c) {
double tmp;
if ((z <= -7.2e+14) || !(z <= 5.6e-26)) {
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
} else {
tmp = (b + (9.0 * (x * y))) / (z * c);
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (z <= -7.2e+14) or not (z <= 5.6e-26): tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c else: tmp = (b + (9.0 * (x * y))) / (z * c) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((z <= -7.2e+14) || !(z <= 5.6e-26)) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(9.0 * Float64(y / Float64(z / x)))) / c); else tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); 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, b, c)
tmp = 0.0;
if ((z <= -7.2e+14) || ~((z <= 5.6e-26)))
tmp = ((t * (a * -4.0)) + (9.0 * (y / (z / x)))) / c;
else
tmp = (b + (9.0 * (x * y))) / (z * c);
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_, b_, c_] := If[Or[LessEqual[z, -7.2e+14], N[Not[LessEqual[z, 5.6e-26]], $MachinePrecision]], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+14} \lor \neg \left(z \leq 5.6 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -7.2e14 or 5.6000000000000002e-26 < z Initial program 58.2%
associate-/r*67.8%
Simplified88.8%
Taylor expanded in x around inf 73.8%
associate-/l*77.6%
Simplified77.6%
if -7.2e14 < z < 5.6000000000000002e-26Initial program 91.5%
associate-*l*91.5%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in x around inf 77.9%
Final simplification77.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 b c)
:precision binary64
(let* ((t_1 (* t (* a -4.0))))
(if (<= z -7.8e+14)
(* (+ t_1 (* 9.0 (* x (/ y z)))) (/ 1.0 c))
(if (<= z 1.15e-24)
(/ (+ b (* 9.0 (* x y))) (* z c))
(/ (+ t_1 (* 9.0 (/ y (/ z x)))) c)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = t * (a * -4.0);
double tmp;
if (z <= -7.8e+14) {
tmp = (t_1 + (9.0 * (x * (y / z)))) * (1.0 / c);
} else if (z <= 1.15e-24) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
if (z <= (-7.8d+14)) then
tmp = (t_1 + (9.0d0 * (x * (y / z)))) * (1.0d0 / c)
else if (z <= 1.15d-24) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (t_1 + (9.0d0 * (y / (z / x)))) / c
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 b, double c) {
double t_1 = t * (a * -4.0);
double tmp;
if (z <= -7.8e+14) {
tmp = (t_1 + (9.0 * (x * (y / z)))) * (1.0 / c);
} else if (z <= 1.15e-24) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = t * (a * -4.0) tmp = 0 if z <= -7.8e+14: tmp = (t_1 + (9.0 * (x * (y / z)))) * (1.0 / c) elif z <= 1.15e-24: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = (t_1 + (9.0 * (y / (z / x)))) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (z <= -7.8e+14) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(x * Float64(y / z)))) * Float64(1.0 / c)); elseif (z <= 1.15e-24) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(y / Float64(z / x)))) / c); 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, b, c)
t_1 = t * (a * -4.0);
tmp = 0.0;
if (z <= -7.8e+14)
tmp = (t_1 + (9.0 * (x * (y / z)))) * (1.0 / c);
elseif (z <= 1.15e-24)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
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_, b_, c_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+14], N[(N[(t$95$1 + N[(9.0 * N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e-24], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+14}:\\
\;\;\;\;\left(t_1 + 9 \cdot \left(x \cdot \frac{y}{z}\right)\right) \cdot \frac{1}{c}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\end{array}
\end{array}
if z < -7.8e14Initial program 53.6%
associate-/r*65.9%
Simplified91.4%
Taylor expanded in x around inf 78.0%
div-inv78.0%
fma-def78.0%
associate-/l*79.6%
Applied egg-rr79.6%
fma-udef79.6%
associate-/r/78.1%
Applied egg-rr78.1%
if -7.8e14 < z < 1.1500000000000001e-24Initial program 91.5%
associate-*l*91.5%
associate-*l*87.2%
Simplified87.2%
Taylor expanded in x around inf 77.9%
if 1.1500000000000001e-24 < z Initial program 62.1%
associate-/r*69.4%
Simplified86.6%
Taylor expanded in x around inf 70.1%
associate-/l*75.8%
Simplified75.8%
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 b c)
:precision binary64
(let* ((t_1 (* 9.0 (* (/ y c) (/ x z)))))
(if (<= z -1.3e-176)
(* (* a -4.0) (/ t c))
(if (<= z 3.6e-296)
t_1
(if (<= z 1.35e-144)
(/ b (* z c))
(if (<= z 3.6e-9) t_1 (/ (* t (* a -4.0)) c)))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 9.0 * ((y / c) * (x / z));
double tmp;
if (z <= -1.3e-176) {
tmp = (a * -4.0) * (t / c);
} else if (z <= 3.6e-296) {
tmp = t_1;
} else if (z <= 1.35e-144) {
tmp = b / (z * c);
} else if (z <= 3.6e-9) {
tmp = t_1;
} else {
tmp = (t * (a * -4.0)) / c;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = 9.0d0 * ((y / c) * (x / z))
if (z <= (-1.3d-176)) then
tmp = (a * (-4.0d0)) * (t / c)
else if (z <= 3.6d-296) then
tmp = t_1
else if (z <= 1.35d-144) then
tmp = b / (z * c)
else if (z <= 3.6d-9) then
tmp = t_1
else
tmp = (t * (a * (-4.0d0))) / c
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 b, double c) {
double t_1 = 9.0 * ((y / c) * (x / z));
double tmp;
if (z <= -1.3e-176) {
tmp = (a * -4.0) * (t / c);
} else if (z <= 3.6e-296) {
tmp = t_1;
} else if (z <= 1.35e-144) {
tmp = b / (z * c);
} else if (z <= 3.6e-9) {
tmp = t_1;
} else {
tmp = (t * (a * -4.0)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = 9.0 * ((y / c) * (x / z)) tmp = 0 if z <= -1.3e-176: tmp = (a * -4.0) * (t / c) elif z <= 3.6e-296: tmp = t_1 elif z <= 1.35e-144: tmp = b / (z * c) elif z <= 3.6e-9: tmp = t_1 else: tmp = (t * (a * -4.0)) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))) tmp = 0.0 if (z <= -1.3e-176) tmp = Float64(Float64(a * -4.0) * Float64(t / c)); elseif (z <= 3.6e-296) tmp = t_1; elseif (z <= 1.35e-144) tmp = Float64(b / Float64(z * c)); elseif (z <= 3.6e-9) tmp = t_1; else tmp = Float64(Float64(t * Float64(a * -4.0)) / c); 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, b, c)
t_1 = 9.0 * ((y / c) * (x / z));
tmp = 0.0;
if (z <= -1.3e-176)
tmp = (a * -4.0) * (t / c);
elseif (z <= 3.6e-296)
tmp = t_1;
elseif (z <= 1.35e-144)
tmp = b / (z * c);
elseif (z <= 3.6e-9)
tmp = t_1;
else
tmp = (t * (a * -4.0)) / c;
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_, b_, c_] := Block[{t$95$1 = N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e-176], N[(N[(a * -4.0), $MachinePrecision] * N[(t / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-296], t$95$1, If[LessEqual[z, 1.35e-144], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e-9], t$95$1, N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := 9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-176}:\\
\;\;\;\;\left(a \cdot -4\right) \cdot \frac{t}{c}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-296}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-144}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-9}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c}\\
\end{array}
\end{array}
if z < -1.29999999999999996e-176Initial program 65.3%
associate-/r*70.9%
Simplified87.4%
Taylor expanded in z around 0 87.4%
Taylor expanded in z around inf 49.3%
associate-*r/49.3%
associate-*r*49.3%
*-commutative49.3%
associate-*r/55.4%
*-commutative55.4%
Simplified55.4%
if -1.29999999999999996e-176 < z < 3.5999999999999998e-296 or 1.34999999999999988e-144 < z < 3.6e-9Initial program 92.6%
associate-/r*85.0%
Simplified80.4%
Taylor expanded in z around 0 80.4%
Taylor expanded in y around inf 61.2%
times-frac57.6%
Simplified57.6%
if 3.5999999999999998e-296 < z < 1.34999999999999988e-144Initial program 95.4%
associate-*l*95.3%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in b around inf 71.4%
if 3.6e-9 < z Initial program 60.6%
associate-/r*68.4%
Simplified88.7%
Taylor expanded in z around inf 48.5%
associate-*r*48.5%
*-commutative48.5%
*-commutative48.5%
Simplified48.5%
Final simplification56.6%
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c)
:precision binary64
(if (<= z -5.4e-103)
(* -4.0 (* t (/ a c)))
(if (<= z 8.4e-296)
(* 9.0 (/ (* x y) (* z c)))
(if (<= z 9.6e-145)
(/ b (* z c))
(if (<= z 2.9e-7)
(* 9.0 (* (/ y c) (/ x z)))
(/ (* t (* a -4.0)) c))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (z <= -5.4e-103) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 8.4e-296) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (z <= 9.6e-145) {
tmp = b / (z * c);
} else if (z <= 2.9e-7) {
tmp = 9.0 * ((y / c) * (x / z));
} else {
tmp = (t * (a * -4.0)) / c;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (z <= (-5.4d-103)) then
tmp = (-4.0d0) * (t * (a / c))
else if (z <= 8.4d-296) then
tmp = 9.0d0 * ((x * y) / (z * c))
else if (z <= 9.6d-145) then
tmp = b / (z * c)
else if (z <= 2.9d-7) then
tmp = 9.0d0 * ((y / c) * (x / z))
else
tmp = (t * (a * (-4.0d0))) / c
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 b, double c) {
double tmp;
if (z <= -5.4e-103) {
tmp = -4.0 * (t * (a / c));
} else if (z <= 8.4e-296) {
tmp = 9.0 * ((x * y) / (z * c));
} else if (z <= 9.6e-145) {
tmp = b / (z * c);
} else if (z <= 2.9e-7) {
tmp = 9.0 * ((y / c) * (x / z));
} else {
tmp = (t * (a * -4.0)) / c;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if z <= -5.4e-103: tmp = -4.0 * (t * (a / c)) elif z <= 8.4e-296: tmp = 9.0 * ((x * y) / (z * c)) elif z <= 9.6e-145: tmp = b / (z * c) elif z <= 2.9e-7: tmp = 9.0 * ((y / c) * (x / z)) else: tmp = (t * (a * -4.0)) / c return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (z <= -5.4e-103) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (z <= 8.4e-296) tmp = Float64(9.0 * Float64(Float64(x * y) / Float64(z * c))); elseif (z <= 9.6e-145) tmp = Float64(b / Float64(z * c)); elseif (z <= 2.9e-7) tmp = Float64(9.0 * Float64(Float64(y / c) * Float64(x / z))); else tmp = Float64(Float64(t * Float64(a * -4.0)) / c); 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, b, c)
tmp = 0.0;
if (z <= -5.4e-103)
tmp = -4.0 * (t * (a / c));
elseif (z <= 8.4e-296)
tmp = 9.0 * ((x * y) / (z * c));
elseif (z <= 9.6e-145)
tmp = b / (z * c);
elseif (z <= 2.9e-7)
tmp = 9.0 * ((y / c) * (x / z));
else
tmp = (t * (a * -4.0)) / c;
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_, b_, c_] := If[LessEqual[z, -5.4e-103], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.4e-296], N[(9.0 * N[(N[(x * y), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.6e-145], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e-7], N[(9.0 * N[(N[(y / c), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{-103}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{-296}:\\
\;\;\;\;9 \cdot \frac{x \cdot y}{z \cdot c}\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-145}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-7}:\\
\;\;\;\;9 \cdot \left(\frac{y}{c} \cdot \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right)}{c}\\
\end{array}
\end{array}
if z < -5.40000000000000019e-103Initial program 63.5%
associate-*l*63.5%
associate-*l*66.0%
Simplified66.0%
*-un-lft-identity66.0%
times-frac68.7%
Applied egg-rr68.7%
Taylor expanded in z around inf 52.6%
associate-/l*57.1%
associate-/r/57.0%
Simplified57.0%
if -5.40000000000000019e-103 < z < 8.3999999999999997e-296Initial program 93.3%
associate-*l*93.4%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in x around inf 64.0%
if 8.3999999999999997e-296 < z < 9.60000000000000061e-145Initial program 95.4%
associate-*l*95.3%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in b around inf 71.4%
if 9.60000000000000061e-145 < z < 2.8999999999999998e-7Initial program 88.0%
associate-/r*88.0%
Simplified85.0%
Taylor expanded in z around 0 85.0%
Taylor expanded in y around inf 51.3%
times-frac54.2%
Simplified54.2%
if 2.8999999999999998e-7 < z Initial program 60.6%
associate-/r*68.4%
Simplified88.7%
Taylor expanded in z around inf 48.5%
associate-*r*48.5%
*-commutative48.5%
*-commutative48.5%
Simplified48.5%
Final simplification57.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 b c)
:precision binary64
(if (<= y -0.00355)
(* (/ (* x y) c) (/ 9.0 z))
(if (<= y 1.02e-20)
(/ (+ (* t (* a -4.0)) (/ b z)) c)
(if (<= y 9e+191)
(/ (+ b (* 9.0 (* x y))) (* z c))
(/ (* 9.0 (/ x (/ c y))) z)))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -0.00355) {
tmp = ((x * y) / c) * (9.0 / z);
} else if (y <= 1.02e-20) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (y <= 9e+191) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (9.0 * (x / (c / y))) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (y <= (-0.00355d0)) then
tmp = ((x * y) / c) * (9.0d0 / z)
else if (y <= 1.02d-20) then
tmp = ((t * (a * (-4.0d0))) + (b / z)) / c
else if (y <= 9d+191) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (9.0d0 * (x / (c / y))) / z
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (y <= -0.00355) {
tmp = ((x * y) / c) * (9.0 / z);
} else if (y <= 1.02e-20) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (y <= 9e+191) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = (9.0 * (x / (c / y))) / z;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if y <= -0.00355: tmp = ((x * y) / c) * (9.0 / z) elif y <= 1.02e-20: tmp = ((t * (a * -4.0)) + (b / z)) / c elif y <= 9e+191: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = (9.0 * (x / (c / y))) / z return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (y <= -0.00355) tmp = Float64(Float64(Float64(x * y) / c) * Float64(9.0 / z)); elseif (y <= 1.02e-20) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c); elseif (y <= 9e+191) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(Float64(9.0 * Float64(x / Float64(c / y))) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if (y <= -0.00355)
tmp = ((x * y) / c) * (9.0 / z);
elseif (y <= 1.02e-20)
tmp = ((t * (a * -4.0)) + (b / z)) / c;
elseif (y <= 9e+191)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = (9.0 * (x / (c / y))) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[y, -0.00355], N[(N[(N[(x * y), $MachinePrecision] / c), $MachinePrecision] * N[(9.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e-20], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 9e+191], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(9.0 * N[(x / N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00355:\\
\;\;\;\;\frac{x \cdot y}{c} \cdot \frac{9}{z}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-20}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+191}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{9 \cdot \frac{x}{\frac{c}{y}}}{z}\\
\end{array}
\end{array}
if y < -0.0035500000000000002Initial program 65.4%
associate-/r*72.3%
Simplified87.4%
Taylor expanded in z around 0 87.5%
Taylor expanded in y around inf 40.5%
associate-*r/40.5%
*-commutative40.5%
times-frac44.5%
Simplified44.5%
if -0.0035500000000000002 < y < 1.02000000000000001e-20Initial program 78.3%
associate-/r*80.6%
Simplified88.6%
Taylor expanded in x around 0 71.5%
associate-*r*71.5%
*-commutative71.5%
*-commutative71.5%
Simplified71.5%
if 1.02000000000000001e-20 < y < 9.0000000000000005e191Initial program 82.9%
associate-*l*82.9%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in x around inf 73.7%
if 9.0000000000000005e191 < y Initial program 75.3%
associate-*l*75.3%
associate-*l*70.3%
Simplified70.3%
Taylor expanded in x around inf 61.1%
associate-/r*65.9%
associate-*r/65.9%
*-commutative65.9%
associate-/l*70.6%
Simplified70.6%
Final simplification64.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 b c)
:precision binary64
(let* ((t_1 (+ b (* 9.0 (* x y)))))
(if (<= y -3.9e-68)
(/ (/ t_1 z) c)
(if (<= y 3.3e-25)
(/ (+ (* t (* a -4.0)) (/ b z)) c)
(if (<= y 1.22e+192) (/ t_1 (* z c)) (/ (* 9.0 (/ x (/ c y))) z))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b + (9.0 * (x * y));
double tmp;
if (y <= -3.9e-68) {
tmp = (t_1 / z) / c;
} else if (y <= 3.3e-25) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (y <= 1.22e+192) {
tmp = t_1 / (z * c);
} else {
tmp = (9.0 * (x / (c / y))) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: tmp
t_1 = b + (9.0d0 * (x * y))
if (y <= (-3.9d-68)) then
tmp = (t_1 / z) / c
else if (y <= 3.3d-25) then
tmp = ((t * (a * (-4.0d0))) + (b / z)) / c
else if (y <= 1.22d+192) then
tmp = t_1 / (z * c)
else
tmp = (9.0d0 * (x / (c / y))) / z
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b + (9.0 * (x * y));
double tmp;
if (y <= -3.9e-68) {
tmp = (t_1 / z) / c;
} else if (y <= 3.3e-25) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (y <= 1.22e+192) {
tmp = t_1 / (z * c);
} else {
tmp = (9.0 * (x / (c / y))) / z;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = b + (9.0 * (x * y)) tmp = 0 if y <= -3.9e-68: tmp = (t_1 / z) / c elif y <= 3.3e-25: tmp = ((t * (a * -4.0)) + (b / z)) / c elif y <= 1.22e+192: tmp = t_1 / (z * c) else: tmp = (9.0 * (x / (c / y))) / z return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) t_1 = Float64(b + Float64(9.0 * Float64(x * y))) tmp = 0.0 if (y <= -3.9e-68) tmp = Float64(Float64(t_1 / z) / c); elseif (y <= 3.3e-25) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c); elseif (y <= 1.22e+192) tmp = Float64(t_1 / Float64(z * c)); else tmp = Float64(Float64(9.0 * Float64(x / Float64(c / y))) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
t_1 = b + (9.0 * (x * y));
tmp = 0.0;
if (y <= -3.9e-68)
tmp = (t_1 / z) / c;
elseif (y <= 3.3e-25)
tmp = ((t * (a * -4.0)) + (b / z)) / c;
elseif (y <= 1.22e+192)
tmp = t_1 / (z * c);
else
tmp = (9.0 * (x / (c / y))) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.9e-68], N[(N[(t$95$1 / z), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 3.3e-25], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 1.22e+192], N[(t$95$1 / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(9.0 * N[(x / N[(c / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := b + 9 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \leq -3.9 \cdot 10^{-68}:\\
\;\;\;\;\frac{\frac{t_1}{z}}{c}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-25}:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+192}:\\
\;\;\;\;\frac{t_1}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{9 \cdot \frac{x}{\frac{c}{y}}}{z}\\
\end{array}
\end{array}
if y < -3.90000000000000032e-68Initial program 68.0%
associate-/r*74.0%
Simplified88.0%
Taylor expanded in z around 0 88.0%
Taylor expanded in z around 0 66.2%
if -3.90000000000000032e-68 < y < 3.2999999999999998e-25Initial program 77.7%
associate-/r*80.3%
Simplified88.2%
Taylor expanded in x around 0 71.1%
associate-*r*71.1%
*-commutative71.1%
*-commutative71.1%
Simplified71.1%
if 3.2999999999999998e-25 < y < 1.2200000000000001e192Initial program 82.9%
associate-*l*82.9%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in x around inf 73.7%
if 1.2200000000000001e192 < y Initial program 75.3%
associate-*l*75.3%
associate-*l*70.3%
Simplified70.3%
Taylor expanded in x around inf 61.1%
associate-/r*65.9%
associate-*r/65.9%
*-commutative65.9%
associate-/l*70.6%
Simplified70.6%
Final simplification70.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 b c) :precision binary64 (/ (+ (* t (* a -4.0)) (/ (+ b (* 9.0 (* x y))) z)) c))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return ((t * (a * -4.0)) + ((b + (9.0 * (x * y))) / z)) / c;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = ((t * (a * (-4.0d0))) + ((b + (9.0d0 * (x * y))) / z)) / c
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return ((t * (a * -4.0)) + ((b + (9.0 * (x * y))) / z)) / c;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return ((t * (a * -4.0)) + ((b + (9.0 * (x * y))) / z)) / c
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(Float64(b + Float64(9.0 * Float64(x * y))) / z)) / c) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = ((t * (a * -4.0)) + ((b + (9.0 * (x * y))) / z)) / c;
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_, b_, c_] := N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{t \cdot \left(a \cdot -4\right) + \frac{b + 9 \cdot \left(x \cdot y\right)}{z}}{c}
\end{array}
Initial program 75.3%
associate-/r*76.2%
Simplified85.9%
Taylor expanded in z around 0 85.9%
Final simplification85.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 b c)
:precision binary64
(if (<= a -2.7e-38)
(* -4.0 (* t (/ a c)))
(if (<= a 1.06e+95)
(/ (+ b (* 9.0 (* x y))) (* z c))
(* -4.0 (/ t (/ c a))))))assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -2.7e-38) {
tmp = -4.0 * (t * (a / c));
} else if (a <= 1.06e+95) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (t / (c / a));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (a <= (-2.7d-38)) then
tmp = (-4.0d0) * (t * (a / c))
else if (a <= 1.06d+95) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (-4.0d0) * (t / (c / a))
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 b, double c) {
double tmp;
if (a <= -2.7e-38) {
tmp = -4.0 * (t * (a / c));
} else if (a <= 1.06e+95) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -2.7e-38: tmp = -4.0 * (t * (a / c)) elif a <= 1.06e+95: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = -4.0 * (t / (c / a)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -2.7e-38) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (a <= 1.06e+95) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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, b, c)
tmp = 0.0;
if (a <= -2.7e-38)
tmp = -4.0 * (t * (a / c));
elseif (a <= 1.06e+95)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = -4.0 * (t / (c / a));
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_, b_, c_] := If[LessEqual[a, -2.7e-38], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.06e+95], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-38}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;a \leq 1.06 \cdot 10^{+95}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -2.70000000000000005e-38Initial program 76.2%
associate-*l*76.2%
associate-*l*74.8%
Simplified74.8%
*-un-lft-identity74.8%
times-frac75.0%
Applied egg-rr75.0%
Taylor expanded in z around inf 55.0%
associate-/l*59.8%
associate-/r/63.6%
Simplified63.6%
if -2.70000000000000005e-38 < a < 1.06000000000000001e95Initial program 76.3%
associate-*l*76.4%
associate-*l*80.9%
Simplified80.9%
Taylor expanded in x around inf 71.9%
if 1.06000000000000001e95 < a Initial program 71.3%
associate-*l*71.2%
associate-*l*61.3%
Simplified61.3%
Taylor expanded in z around inf 44.4%
*-commutative44.4%
*-commutative44.4%
associate-/l*58.7%
Simplified58.7%
Final simplification67.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 b c) :precision binary64 (if (or (<= t -8e-11) (not (<= t 8.2e-128))) (* -4.0 (* t (/ a c))) (/ (/ b c) z)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -8e-11) || !(t <= 8.2e-128)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b / c) / z;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
NOTE: t and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if ((t <= (-8d-11)) .or. (.not. (t <= 8.2d-128))) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = (b / c) / z
end if
code = tmp
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((t <= -8e-11) || !(t <= 8.2e-128)) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = (b / c) / z;
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if (t <= -8e-11) or not (t <= 8.2e-128): tmp = -4.0 * (t * (a / c)) else: tmp = (b / c) / z return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if ((t <= -8e-11) || !(t <= 8.2e-128)) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(Float64(b / c) / z); end return tmp end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c)
tmp = 0.0;
if ((t <= -8e-11) || ~((t <= 8.2e-128)))
tmp = -4.0 * (t * (a / c));
else
tmp = (b / c) / z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_] := If[Or[LessEqual[t, -8e-11], N[Not[LessEqual[t, 8.2e-128]], $MachinePrecision]], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{-11} \lor \neg \left(t \leq 8.2 \cdot 10^{-128}\right):\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\end{array}
\end{array}
if t < -7.99999999999999952e-11 or 8.1999999999999999e-128 < t Initial program 69.3%
associate-*l*69.3%
associate-*l*69.5%
Simplified69.5%
*-un-lft-identity69.5%
times-frac71.5%
Applied egg-rr71.5%
Taylor expanded in z around inf 47.8%
associate-/l*53.5%
associate-/r/52.4%
Simplified52.4%
if -7.99999999999999952e-11 < t < 8.1999999999999999e-128Initial program 85.2%
associate-*l*85.2%
associate-*l*85.3%
Simplified85.3%
Taylor expanded in b around inf 47.6%
associate-/r*48.4%
Simplified48.4%
Final simplification50.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 b c) :precision binary64 (if (<= a -2.55e-194) (* (* a -4.0) (/ t c)) (if (<= a 3.5e-25) (/ (/ b c) z) (* t (/ -4.0 (/ c a))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -2.55e-194) {
tmp = (a * -4.0) * (t / c);
} else if (a <= 3.5e-25) {
tmp = (b / c) / z;
} else {
tmp = t * (-4.0 / (c / a));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (a <= (-2.55d-194)) then
tmp = (a * (-4.0d0)) * (t / c)
else if (a <= 3.5d-25) then
tmp = (b / c) / z
else
tmp = t * ((-4.0d0) / (c / a))
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 b, double c) {
double tmp;
if (a <= -2.55e-194) {
tmp = (a * -4.0) * (t / c);
} else if (a <= 3.5e-25) {
tmp = (b / c) / z;
} else {
tmp = t * (-4.0 / (c / a));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -2.55e-194: tmp = (a * -4.0) * (t / c) elif a <= 3.5e-25: tmp = (b / c) / z else: tmp = t * (-4.0 / (c / a)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -2.55e-194) tmp = Float64(Float64(a * -4.0) * Float64(t / c)); elseif (a <= 3.5e-25) tmp = Float64(Float64(b / c) / z); else tmp = Float64(t * Float64(-4.0 / Float64(c / a))); 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, b, c)
tmp = 0.0;
if (a <= -2.55e-194)
tmp = (a * -4.0) * (t / c);
elseif (a <= 3.5e-25)
tmp = (b / c) / z;
else
tmp = t * (-4.0 / (c / a));
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_, b_, c_] := If[LessEqual[a, -2.55e-194], N[(N[(a * -4.0), $MachinePrecision] * N[(t / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.5e-25], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(t * N[(-4.0 / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.55 \cdot 10^{-194}:\\
\;\;\;\;\left(a \cdot -4\right) \cdot \frac{t}{c}\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-25}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{-4}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -2.5499999999999999e-194Initial program 73.4%
associate-/r*77.8%
Simplified86.6%
Taylor expanded in z around 0 86.6%
Taylor expanded in z around inf 45.5%
associate-*r/45.5%
associate-*r*45.5%
*-commutative45.5%
associate-*r/48.9%
*-commutative48.9%
Simplified48.9%
if -2.5499999999999999e-194 < a < 3.5000000000000002e-25Initial program 77.9%
associate-*l*78.0%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in b around inf 48.8%
associate-/r*54.6%
Simplified54.6%
if 3.5000000000000002e-25 < a Initial program 75.4%
associate-/r*74.1%
Simplified81.2%
Taylor expanded in x around inf 66.0%
div-inv66.0%
fma-def66.0%
associate-/l*64.4%
Applied egg-rr64.4%
Taylor expanded in y around 0 40.6%
*-commutative40.6%
associate-/l*50.6%
associate-*r/50.6%
*-commutative50.6%
associate-*r/50.4%
Simplified50.4%
Final simplification51.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (if (<= a -2.55e-194) (* (* a -4.0) (/ t c)) (if (<= a 5.2e-25) (/ (/ b c) z) (* -4.0 (/ t (/ c a))))))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (a <= -2.55e-194) {
tmp = (a * -4.0) * (t / c);
} else if (a <= 5.2e-25) {
tmp = (b / c) / z;
} else {
tmp = -4.0 * (t / (c / a));
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: tmp
if (a <= (-2.55d-194)) then
tmp = (a * (-4.0d0)) * (t / c)
else if (a <= 5.2d-25) then
tmp = (b / c) / z
else
tmp = (-4.0d0) * (t / (c / a))
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 b, double c) {
double tmp;
if (a <= -2.55e-194) {
tmp = (a * -4.0) * (t / c);
} else if (a <= 5.2e-25) {
tmp = (b / c) / z;
} else {
tmp = -4.0 * (t / (c / a));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): tmp = 0 if a <= -2.55e-194: tmp = (a * -4.0) * (t / c) elif a <= 5.2e-25: tmp = (b / c) / z else: tmp = -4.0 * (t / (c / a)) return tmp
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) tmp = 0.0 if (a <= -2.55e-194) tmp = Float64(Float64(a * -4.0) * Float64(t / c)); elseif (a <= 5.2e-25) tmp = Float64(Float64(b / c) / z); else tmp = Float64(-4.0 * Float64(t / Float64(c / a))); 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, b, c)
tmp = 0.0;
if (a <= -2.55e-194)
tmp = (a * -4.0) * (t / c);
elseif (a <= 5.2e-25)
tmp = (b / c) / z;
else
tmp = -4.0 * (t / (c / a));
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_, b_, c_] := If[LessEqual[a, -2.55e-194], N[(N[(a * -4.0), $MachinePrecision] * N[(t / c), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.2e-25], N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(t / N[(c / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.55 \cdot 10^{-194}:\\
\;\;\;\;\left(a \cdot -4\right) \cdot \frac{t}{c}\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-25}:\\
\;\;\;\;\frac{\frac{b}{c}}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{t}{\frac{c}{a}}\\
\end{array}
\end{array}
if a < -2.5499999999999999e-194Initial program 73.4%
associate-/r*77.8%
Simplified86.6%
Taylor expanded in z around 0 86.6%
Taylor expanded in z around inf 45.5%
associate-*r/45.5%
associate-*r*45.5%
*-commutative45.5%
associate-*r/48.9%
*-commutative48.9%
Simplified48.9%
if -2.5499999999999999e-194 < a < 5.2e-25Initial program 77.9%
associate-*l*78.0%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in b around inf 48.8%
associate-/r*54.6%
Simplified54.6%
if 5.2e-25 < a Initial program 75.4%
associate-*l*75.4%
associate-*l*68.4%
Simplified68.4%
Taylor expanded in z around inf 40.6%
*-commutative40.6%
*-commutative40.6%
associate-/l*50.6%
Simplified50.6%
Final simplification51.1%
NOTE: x and y should be sorted in increasing order before calling this function. NOTE: t and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c) :precision binary64 (/ b (* z c)))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = b / (z * c)
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return b / (z * c);
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return b / (z * c)
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(b / Float64(z * c)) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = b / (z * c);
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_, b_, c_] := N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{b}{z \cdot c}
\end{array}
Initial program 75.3%
associate-*l*75.4%
associate-*l*75.5%
Simplified75.5%
Taylor expanded in b around inf 32.9%
Final simplification32.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 b c) :precision binary64 (/ (/ b c) z))
assert(x < y);
assert(t < a);
double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
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, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
code = (b / c) / z
end function
assert x < y;
assert t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return (b / c) / z;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): return (b / c) / z
x, y = sort([x, y]) t, a = sort([t, a]) function code(x, y, z, t, a, b, c) return Float64(Float64(b / c) / z) end
x, y = num2cell(sort([x, y])){:}
t, a = num2cell(sort([t, a])){:}
function tmp = code(x, y, z, t, a, b, c)
tmp = (b / c) / z;
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_, b_, c_] := N[(N[(b / c), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\frac{\frac{b}{c}}{z}
\end{array}
Initial program 75.3%
associate-*l*75.4%
associate-*l*75.5%
Simplified75.5%
Taylor expanded in b around inf 32.9%
associate-/r*34.6%
Simplified34.6%
Final simplification34.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (/ b (* c z)))
(t_2 (* 4.0 (/ (* a t) c)))
(t_3 (* (* x 9.0) y))
(t_4 (+ (- t_3 (* (* (* z 4.0) t) a)) b))
(t_5 (/ t_4 (* z c)))
(t_6 (/ (+ (- t_3 (* (* z 4.0) (* t a))) b) (* z c))))
(if (< t_5 -1.100156740804105e-171)
t_6
(if (< t_5 0.0)
(/ (/ t_4 z) c)
(if (< t_5 1.1708877911747488e-53)
t_6
(if (< t_5 2.876823679546137e+130)
(- (+ (* (* 9.0 (/ y c)) (/ x z)) t_1) t_2)
(if (< t_5 1.3838515042456319e+158)
t_6
(- (+ (* 9.0 (* (/ y (* c z)) x)) t_1) t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c)
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), intent (in) :: b
real(8), intent (in) :: c
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = b / (c * z)
t_2 = 4.0d0 * ((a * t) / c)
t_3 = (x * 9.0d0) * y
t_4 = (t_3 - (((z * 4.0d0) * t) * a)) + b
t_5 = t_4 / (z * c)
t_6 = ((t_3 - ((z * 4.0d0) * (t * a))) + b) / (z * c)
if (t_5 < (-1.100156740804105d-171)) then
tmp = t_6
else if (t_5 < 0.0d0) then
tmp = (t_4 / z) / c
else if (t_5 < 1.1708877911747488d-53) then
tmp = t_6
else if (t_5 < 2.876823679546137d+130) then
tmp = (((9.0d0 * (y / c)) * (x / z)) + t_1) - t_2
else if (t_5 < 1.3838515042456319d+158) then
tmp = t_6
else
tmp = ((9.0d0 * ((y / (c * z)) * x)) + t_1) - t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = b / (c * z);
double t_2 = 4.0 * ((a * t) / c);
double t_3 = (x * 9.0) * y;
double t_4 = (t_3 - (((z * 4.0) * t) * a)) + b;
double t_5 = t_4 / (z * c);
double t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c);
double tmp;
if (t_5 < -1.100156740804105e-171) {
tmp = t_6;
} else if (t_5 < 0.0) {
tmp = (t_4 / z) / c;
} else if (t_5 < 1.1708877911747488e-53) {
tmp = t_6;
} else if (t_5 < 2.876823679546137e+130) {
tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2;
} else if (t_5 < 1.3838515042456319e+158) {
tmp = t_6;
} else {
tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = b / (c * z) t_2 = 4.0 * ((a * t) / c) t_3 = (x * 9.0) * y t_4 = (t_3 - (((z * 4.0) * t) * a)) + b t_5 = t_4 / (z * c) t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c) tmp = 0 if t_5 < -1.100156740804105e-171: tmp = t_6 elif t_5 < 0.0: tmp = (t_4 / z) / c elif t_5 < 1.1708877911747488e-53: tmp = t_6 elif t_5 < 2.876823679546137e+130: tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2 elif t_5 < 1.3838515042456319e+158: tmp = t_6 else: tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(b / Float64(c * z)) t_2 = Float64(4.0 * Float64(Float64(a * t) / c)) t_3 = Float64(Float64(x * 9.0) * y) t_4 = Float64(Float64(t_3 - Float64(Float64(Float64(z * 4.0) * t) * a)) + b) t_5 = Float64(t_4 / Float64(z * c)) t_6 = Float64(Float64(Float64(t_3 - Float64(Float64(z * 4.0) * Float64(t * a))) + b) / Float64(z * c)) tmp = 0.0 if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = Float64(Float64(t_4 / z) / c); elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = Float64(Float64(Float64(Float64(9.0 * Float64(y / c)) * Float64(x / z)) + t_1) - t_2); elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = Float64(Float64(Float64(9.0 * Float64(Float64(y / Float64(c * z)) * x)) + t_1) - t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = b / (c * z); t_2 = 4.0 * ((a * t) / c); t_3 = (x * 9.0) * y; t_4 = (t_3 - (((z * 4.0) * t) * a)) + b; t_5 = t_4 / (z * c); t_6 = ((t_3 - ((z * 4.0) * (t * a))) + b) / (z * c); tmp = 0.0; if (t_5 < -1.100156740804105e-171) tmp = t_6; elseif (t_5 < 0.0) tmp = (t_4 / z) / c; elseif (t_5 < 1.1708877911747488e-53) tmp = t_6; elseif (t_5 < 2.876823679546137e+130) tmp = (((9.0 * (y / c)) * (x / z)) + t_1) - t_2; elseif (t_5 < 1.3838515042456319e+158) tmp = t_6; else tmp = ((9.0 * ((y / (c * z)) * x)) + t_1) - t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(b / N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(N[(a * t), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 9.0), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t$95$3 - N[(N[(N[(z * 4.0), $MachinePrecision] * t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(t$95$3 - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$5, -1.100156740804105e-171], t$95$6, If[Less[t$95$5, 0.0], N[(N[(t$95$4 / z), $MachinePrecision] / c), $MachinePrecision], If[Less[t$95$5, 1.1708877911747488e-53], t$95$6, If[Less[t$95$5, 2.876823679546137e+130], N[(N[(N[(N[(9.0 * N[(y / c), $MachinePrecision]), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision], If[Less[t$95$5, 1.3838515042456319e+158], t$95$6, N[(N[(N[(9.0 * N[(N[(y / N[(c * z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{b}{c \cdot z}\\
t_2 := 4 \cdot \frac{a \cdot t}{c}\\
t_3 := \left(x \cdot 9\right) \cdot y\\
t_4 := \left(t_3 - \left(\left(z \cdot 4\right) \cdot t\right) \cdot a\right) + b\\
t_5 := \frac{t_4}{z \cdot c}\\
t_6 := \frac{\left(t_3 - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right) + b}{z \cdot c}\\
\mathbf{if}\;t_5 < -1.100156740804105 \cdot 10^{-171}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 < 0:\\
\;\;\;\;\frac{\frac{t_4}{z}}{c}\\
\mathbf{elif}\;t_5 < 1.1708877911747488 \cdot 10^{-53}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 < 2.876823679546137 \cdot 10^{+130}:\\
\;\;\;\;\left(\left(9 \cdot \frac{y}{c}\right) \cdot \frac{x}{z} + t_1\right) - t_2\\
\mathbf{elif}\;t_5 < 1.3838515042456319 \cdot 10^{+158}:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;\left(9 \cdot \left(\frac{y}{c \cdot z} \cdot x\right) + t_1\right) - t_2\\
\end{array}
\end{array}
herbie shell --seed 2023181
(FPCore (x y z t a b c)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, J"
:precision binary64
:herbie-target
(if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) -1.100156740804105e-171) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 0.0) (/ (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) z) c) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.1708877911747488e-53) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 2.876823679546137e+130) (- (+ (* (* 9.0 (/ y c)) (/ x z)) (/ b (* c z))) (* 4.0 (/ (* a t) c))) (if (< (/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)) 1.3838515042456319e+158) (/ (+ (- (* (* x 9.0) y) (* (* z 4.0) (* t a))) b) (* z c)) (- (+ (* 9.0 (* (/ y (* c z)) x)) (/ b (* c z))) (* 4.0 (/ (* a t) c))))))))
(/ (+ (- (* (* x 9.0) y) (* (* (* z 4.0) t) a)) b) (* z c)))