
(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 (if (or (<= z -3e-66) (not (<= z 2.9e-137))) (/ (fma t (* a -4.0) (/ (fma x (* 9.0 y) b) z)) c) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* 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 <= -3e-66) || !(z <= 2.9e-137)) {
tmp = fma(t, (a * -4.0), (fma(x, (9.0 * y), b) / z)) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (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 <= -3e-66) || !(z <= 2.9e-137)) tmp = Float64(fma(t, Float64(a * -4.0), Float64(fma(x, Float64(9.0 * y), b) / z)) / c); else tmp = Float64(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / 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, -3e-66], N[Not[LessEqual[z, 2.9e-137]], $MachinePrecision]], N[(N[(t * N[(a * -4.0), $MachinePrecision] + N[(N[(x * N[(9.0 * y), $MachinePrecision] + b), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $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 -3 \cdot 10^{-66} \lor \neg \left(z \leq 2.9 \cdot 10^{-137}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(t, a \cdot -4, \frac{\mathsf{fma}\left(x, 9 \cdot y, b\right)}{z}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -3.0000000000000002e-66 or 2.89999999999999985e-137 < z Initial program 69.5%
associate-/r*80.3%
Simplified93.4%
if -3.0000000000000002e-66 < z < 2.89999999999999985e-137Initial program 94.8%
Final simplification93.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 (or (<= z -1.6e-64) (not (<= z 2.9e-137))) (/ (+ (/ (fma x (* 9.0 y) b) z) (* t (* a -4.0))) c) (/ (+ b (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* 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 <= -1.6e-64) || !(z <= 2.9e-137)) {
tmp = ((fma(x, (9.0 * y), b) / z) + (t * (a * -4.0))) / c;
} else {
tmp = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (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 <= -1.6e-64) || !(z <= 2.9e-137)) 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(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / 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, -1.6e-64], N[Not[LessEqual[z, 2.9e-137]], $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[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $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 -1.6 \cdot 10^{-64} \lor \neg \left(z \leq 2.9 \cdot 10^{-137}\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(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -1.59999999999999988e-64 or 2.89999999999999985e-137 < z Initial program 69.5%
associate-/r*80.3%
Simplified92.8%
if -1.59999999999999988e-64 < z < 2.89999999999999985e-137Initial program 94.8%
Final simplification93.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 (- (* y (* x 9.0)) (* a (* t (* z 4.0))))) (* z c)))
(t_2 (/ (+ b (- (* x (* 9.0 y)) (* (* z 4.0) (* t a)))) (* z c))))
(if (<= t_1 -5e-212)
t_2
(if (<= t_1 0.0)
(/ (+ (* t (* a -4.0)) (/ b z)) c)
(if (<= t_1 INFINITY) t_2 (* -4.0 (* t (/ a 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 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
double t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
double tmp;
if (t_1 <= -5e-212) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
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 + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
double t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
double tmp;
if (t_1 <= -5e-212) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = ((t * (a * -4.0)) + (b / z)) / c;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = -4.0 * (t * (a / c));
}
return tmp;
}
[x, y] = sort([x, y]) [t, a] = sort([t, a]) def code(x, y, z, t, a, b, c): t_1 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c) t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c) tmp = 0 if t_1 <= -5e-212: tmp = t_2 elif t_1 <= 0.0: tmp = ((t * (a * -4.0)) + (b / z)) / c elif t_1 <= math.inf: tmp = t_2 else: tmp = -4.0 * (t * (a / 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(Float64(b + Float64(Float64(y * Float64(x * 9.0)) - Float64(a * Float64(t * Float64(z * 4.0))))) / Float64(z * c)) t_2 = Float64(Float64(b + Float64(Float64(x * Float64(9.0 * y)) - Float64(Float64(z * 4.0) * Float64(t * a)))) / Float64(z * c)) tmp = 0.0 if (t_1 <= -5e-212) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / c); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(-4.0 * Float64(t * Float64(a / 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 = (b + ((y * (x * 9.0)) - (a * (t * (z * 4.0))))) / (z * c);
t_2 = (b + ((x * (9.0 * y)) - ((z * 4.0) * (t * a)))) / (z * c);
tmp = 0.0;
if (t_1 <= -5e-212)
tmp = t_2;
elseif (t_1 <= 0.0)
tmp = ((t * (a * -4.0)) + (b / z)) / c;
elseif (t_1 <= Inf)
tmp = t_2;
else
tmp = -4.0 * (t * (a / 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[(N[(b + N[(N[(y * N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * N[(z * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b + N[(N[(x * N[(9.0 * y), $MachinePrecision]), $MachinePrecision] - N[(N[(z * 4.0), $MachinePrecision] * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-212], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
t_1 := \frac{b + \left(y \cdot \left(x \cdot 9\right) - a \cdot \left(t \cdot \left(z \cdot 4\right)\right)\right)}{z \cdot c}\\
t_2 := \frac{b + \left(x \cdot \left(9 \cdot y\right) - \left(z \cdot 4\right) \cdot \left(t \cdot a\right)\right)}{z \cdot c}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-212}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < -5.00000000000000043e-212 or 0.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < +inf.0Initial program 90.6%
associate-*l*90.6%
associate-*l*90.9%
Simplified90.9%
if -5.00000000000000043e-212 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) < 0.0Initial program 30.2%
associate-/r*99.8%
Simplified99.9%
Taylor expanded in x around 0 83.4%
if +inf.0 < (/.f64 (+.f64 (-.f64 (*.f64 (*.f64 x 9) y) (*.f64 (*.f64 (*.f64 z 4) t) a)) b) (*.f64 z c)) Initial program 0.0%
associate-/r*8.2%
Simplified62.5%
Taylor expanded in t around inf 62.5%
associate-/l*83.4%
associate-/r/83.5%
Simplified83.5%
Final simplification89.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
(let* ((t_1 (* t (* a -4.0))))
(if (<= b -3.1e-7)
(/ (+ b (* 9.0 (* x y))) (* z c))
(if (<= b 0.106)
(/ (+ t_1 (* 9.0 (/ y (/ z x)))) c)
(/ (+ t_1 (/ 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) {
double t_1 = t * (a * -4.0);
double tmp;
if (b <= -3.1e-7) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (b <= 0.106) {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
} else {
tmp = (t_1 + (b / 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) :: t_1
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
if (b <= (-3.1d-7)) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else if (b <= 0.106d0) then
tmp = (t_1 + (9.0d0 * (y / (z / x)))) / c
else
tmp = (t_1 + (b / 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 t_1 = t * (a * -4.0);
double tmp;
if (b <= -3.1e-7) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else if (b <= 0.106) {
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
} else {
tmp = (t_1 + (b / z)) / 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 b <= -3.1e-7: tmp = (b + (9.0 * (x * y))) / (z * c) elif b <= 0.106: tmp = (t_1 + (9.0 * (y / (z / x)))) / c else: tmp = (t_1 + (b / z)) / 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 (b <= -3.1e-7) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); elseif (b <= 0.106) tmp = Float64(Float64(t_1 + Float64(9.0 * Float64(y / Float64(z / x)))) / c); else tmp = Float64(Float64(t_1 + Float64(b / 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)
t_1 = t * (a * -4.0);
tmp = 0.0;
if (b <= -3.1e-7)
tmp = (b + (9.0 * (x * y))) / (z * c);
elseif (b <= 0.106)
tmp = (t_1 + (9.0 * (y / (z / x)))) / c;
else
tmp = (t_1 + (b / 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_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.1e-7], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.106], N[(N[(t$95$1 + N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(t$95$1 + N[(b / z), $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}\;b \leq -3.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{elif}\;b \leq 0.106:\\
\;\;\;\;\frac{t_1 + 9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 + \frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < -3.1e-7Initial program 71.7%
associate-/r*70.5%
Simplified81.3%
Taylor expanded in z around 0 65.6%
if -3.1e-7 < b < 0.105999999999999997Initial program 82.9%
associate-/r*83.5%
Simplified92.2%
Taylor expanded in x around inf 89.1%
associate-/l*83.8%
Simplified83.8%
if 0.105999999999999997 < b Initial program 76.0%
associate-/r*87.2%
Simplified94.2%
Taylor expanded in x around 0 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 b c)
:precision binary64
(let* ((t_1 (* 9.0 (* (/ y z) (/ x c)))))
(if (<= x -4800.0)
t_1
(if (<= x -4.75e-175)
(* -4.0 (* a (/ t c)))
(if (<= x 1e-301)
(/ b (* z c))
(if (<= x 1.7e-43) (* -4.0 (* t (/ a c))) t_1))))))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 tmp;
if (x <= -4800.0) {
tmp = t_1;
} else if (x <= -4.75e-175) {
tmp = -4.0 * (a * (t / c));
} else if (x <= 1e-301) {
tmp = b / (z * c);
} else if (x <= 1.7e-43) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = t_1;
}
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 / z) * (x / c))
if (x <= (-4800.0d0)) then
tmp = t_1
else if (x <= (-4.75d-175)) then
tmp = (-4.0d0) * (a * (t / c))
else if (x <= 1d-301) then
tmp = b / (z * c)
else if (x <= 1.7d-43) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = t_1
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 tmp;
if (x <= -4800.0) {
tmp = t_1;
} else if (x <= -4.75e-175) {
tmp = -4.0 * (a * (t / c));
} else if (x <= 1e-301) {
tmp = b / (z * c);
} else if (x <= 1.7e-43) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = t_1;
}
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)) tmp = 0 if x <= -4800.0: tmp = t_1 elif x <= -4.75e-175: tmp = -4.0 * (a * (t / c)) elif x <= 1e-301: tmp = b / (z * c) elif x <= 1.7e-43: tmp = -4.0 * (t * (a / c)) else: tmp = t_1 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 / z) * Float64(x / c))) tmp = 0.0 if (x <= -4800.0) tmp = t_1; elseif (x <= -4.75e-175) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); elseif (x <= 1e-301) tmp = Float64(b / Float64(z * c)); elseif (x <= 1.7e-43) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = t_1; 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));
tmp = 0.0;
if (x <= -4800.0)
tmp = t_1;
elseif (x <= -4.75e-175)
tmp = -4.0 * (a * (t / c));
elseif (x <= 1e-301)
tmp = b / (z * c);
elseif (x <= 1.7e-43)
tmp = -4.0 * (t * (a / c));
else
tmp = t_1;
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 / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4800.0], t$95$1, If[LessEqual[x, -4.75e-175], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e-301], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7e-43], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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}{z} \cdot \frac{x}{c}\right)\\
\mathbf{if}\;x \leq -4800:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.75 \cdot 10^{-175}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;x \leq 10^{-301}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-43}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4800 or 1.7e-43 < x Initial program 77.6%
associate-/r*78.4%
Simplified87.8%
Taylor expanded in x around inf 53.7%
*-commutative53.7%
times-frac54.9%
Simplified54.9%
if -4800 < x < -4.75000000000000026e-175Initial program 81.9%
associate-/r*87.9%
Simplified95.1%
Taylor expanded in x around inf 61.2%
associate-/l*56.7%
Simplified56.7%
clear-num55.6%
inv-pow55.6%
+-commutative55.6%
fma-def55.6%
associate-/r/55.3%
Applied egg-rr55.3%
unpow-155.3%
fma-udef55.3%
*-commutative55.3%
*-commutative55.3%
associate-*r*55.3%
associate-*l/60.1%
+-commutative60.1%
fma-def60.1%
associate-/l*55.6%
associate-*r*55.6%
*-commutative55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in y around 0 40.5%
associate-*r/40.6%
Simplified40.6%
if -4.75000000000000026e-175 < x < 1.00000000000000007e-301Initial program 88.4%
associate-/r*88.8%
Simplified95.7%
Taylor expanded in b around inf 59.4%
*-commutative59.4%
Simplified59.4%
if 1.00000000000000007e-301 < x < 1.7e-43Initial program 72.1%
associate-/r*81.7%
Simplified93.1%
Taylor expanded in t around inf 54.3%
associate-/l*54.2%
associate-/r/47.8%
Simplified47.8%
Final simplification51.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 (<= x -2100.0)
(* 9.0 (* (/ y z) (/ x c)))
(if (<= x -6.4e-176)
(* -4.0 (* a (/ t c)))
(if (<= x 4.4e-301)
(/ b (* z c))
(if (<= x 2e-43) (* -4.0 (* t (/ a c))) (* 9.0 (/ y (/ c (/ x 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 (x <= -2100.0) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (x <= -6.4e-176) {
tmp = -4.0 * (a * (t / c));
} else if (x <= 4.4e-301) {
tmp = b / (z * c);
} else if (x <= 2e-43) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = 9.0 * (y / (c / (x / 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 (x <= (-2100.0d0)) then
tmp = 9.0d0 * ((y / z) * (x / c))
else if (x <= (-6.4d-176)) then
tmp = (-4.0d0) * (a * (t / c))
else if (x <= 4.4d-301) then
tmp = b / (z * c)
else if (x <= 2d-43) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = 9.0d0 * (y / (c / (x / 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 (x <= -2100.0) {
tmp = 9.0 * ((y / z) * (x / c));
} else if (x <= -6.4e-176) {
tmp = -4.0 * (a * (t / c));
} else if (x <= 4.4e-301) {
tmp = b / (z * c);
} else if (x <= 2e-43) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = 9.0 * (y / (c / (x / 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 x <= -2100.0: tmp = 9.0 * ((y / z) * (x / c)) elif x <= -6.4e-176: tmp = -4.0 * (a * (t / c)) elif x <= 4.4e-301: tmp = b / (z * c) elif x <= 2e-43: tmp = -4.0 * (t * (a / c)) else: tmp = 9.0 * (y / (c / (x / 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 (x <= -2100.0) tmp = Float64(9.0 * Float64(Float64(y / z) * Float64(x / c))); elseif (x <= -6.4e-176) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); elseif (x <= 4.4e-301) tmp = Float64(b / Float64(z * c)); elseif (x <= 2e-43) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(9.0 * Float64(y / Float64(c / Float64(x / 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 (x <= -2100.0)
tmp = 9.0 * ((y / z) * (x / c));
elseif (x <= -6.4e-176)
tmp = -4.0 * (a * (t / c));
elseif (x <= 4.4e-301)
tmp = b / (z * c);
elseif (x <= 2e-43)
tmp = -4.0 * (t * (a / c));
else
tmp = 9.0 * (y / (c / (x / 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[x, -2100.0], N[(9.0 * N[(N[(y / z), $MachinePrecision] * N[(x / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.4e-176], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e-301], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e-43], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(9.0 * N[(y / N[(c / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2100:\\
\;\;\;\;9 \cdot \left(\frac{y}{z} \cdot \frac{x}{c}\right)\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-176}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-301}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-43}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{c}{\frac{x}{z}}}\\
\end{array}
\end{array}
if x < -2100Initial program 77.5%
associate-/r*80.3%
Simplified91.3%
Taylor expanded in x around inf 60.2%
*-commutative60.2%
times-frac61.3%
Simplified61.3%
if -2100 < x < -6.39999999999999969e-176Initial program 81.9%
associate-/r*87.9%
Simplified95.1%
Taylor expanded in x around inf 61.2%
associate-/l*56.7%
Simplified56.7%
clear-num55.6%
inv-pow55.6%
+-commutative55.6%
fma-def55.6%
associate-/r/55.3%
Applied egg-rr55.3%
unpow-155.3%
fma-udef55.3%
*-commutative55.3%
*-commutative55.3%
associate-*r*55.3%
associate-*l/60.1%
+-commutative60.1%
fma-def60.1%
associate-/l*55.6%
associate-*r*55.6%
*-commutative55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in y around 0 40.5%
associate-*r/40.6%
Simplified40.6%
if -6.39999999999999969e-176 < x < 4.4e-301Initial program 88.4%
associate-/r*88.8%
Simplified95.7%
Taylor expanded in b around inf 59.4%
*-commutative59.4%
Simplified59.4%
if 4.4e-301 < x < 2.00000000000000015e-43Initial program 72.1%
associate-/r*81.7%
Simplified93.1%
Taylor expanded in t around inf 54.3%
associate-/l*54.2%
associate-/r/47.8%
Simplified47.8%
if 2.00000000000000015e-43 < x Initial program 77.6%
associate-/r*76.9%
Simplified84.8%
Taylor expanded in x around inf 48.4%
associate-/l*48.5%
*-commutative48.5%
Simplified48.5%
Taylor expanded in z around 0 48.5%
associate-/l*46.1%
Simplified46.1%
Final simplification50.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 (<= x -4.4e+73)
(* 9.0 (/ y (/ (* z c) x)))
(if (<= x -3.45e-175)
(* -4.0 (* a (/ t c)))
(if (<= x 7.2e-302)
(/ b (* z c))
(if (<= x 2.3e-42)
(* -4.0 (* t (/ a c)))
(* 9.0 (/ y (/ c (/ x 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 (x <= -4.4e+73) {
tmp = 9.0 * (y / ((z * c) / x));
} else if (x <= -3.45e-175) {
tmp = -4.0 * (a * (t / c));
} else if (x <= 7.2e-302) {
tmp = b / (z * c);
} else if (x <= 2.3e-42) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = 9.0 * (y / (c / (x / 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 (x <= (-4.4d+73)) then
tmp = 9.0d0 * (y / ((z * c) / x))
else if (x <= (-3.45d-175)) then
tmp = (-4.0d0) * (a * (t / c))
else if (x <= 7.2d-302) then
tmp = b / (z * c)
else if (x <= 2.3d-42) then
tmp = (-4.0d0) * (t * (a / c))
else
tmp = 9.0d0 * (y / (c / (x / 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 (x <= -4.4e+73) {
tmp = 9.0 * (y / ((z * c) / x));
} else if (x <= -3.45e-175) {
tmp = -4.0 * (a * (t / c));
} else if (x <= 7.2e-302) {
tmp = b / (z * c);
} else if (x <= 2.3e-42) {
tmp = -4.0 * (t * (a / c));
} else {
tmp = 9.0 * (y / (c / (x / 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 x <= -4.4e+73: tmp = 9.0 * (y / ((z * c) / x)) elif x <= -3.45e-175: tmp = -4.0 * (a * (t / c)) elif x <= 7.2e-302: tmp = b / (z * c) elif x <= 2.3e-42: tmp = -4.0 * (t * (a / c)) else: tmp = 9.0 * (y / (c / (x / 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 (x <= -4.4e+73) tmp = Float64(9.0 * Float64(y / Float64(Float64(z * c) / x))); elseif (x <= -3.45e-175) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); elseif (x <= 7.2e-302) tmp = Float64(b / Float64(z * c)); elseif (x <= 2.3e-42) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); else tmp = Float64(9.0 * Float64(y / Float64(c / Float64(x / 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 (x <= -4.4e+73)
tmp = 9.0 * (y / ((z * c) / x));
elseif (x <= -3.45e-175)
tmp = -4.0 * (a * (t / c));
elseif (x <= 7.2e-302)
tmp = b / (z * c);
elseif (x <= 2.3e-42)
tmp = -4.0 * (t * (a / c));
else
tmp = 9.0 * (y / (c / (x / 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[x, -4.4e+73], N[(9.0 * N[(y / N[(N[(z * c), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.45e-175], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e-302], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e-42], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(9.0 * N[(y / N[(c / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{+73}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z \cdot c}{x}}\\
\mathbf{elif}\;x \leq -3.45 \cdot 10^{-175}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-302}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-42}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{c}{\frac{x}{z}}}\\
\end{array}
\end{array}
if x < -4.4e73Initial program 75.6%
associate-/r*77.4%
Simplified91.1%
Taylor expanded in x around inf 61.2%
associate-/l*64.6%
*-commutative64.6%
Simplified64.6%
if -4.4e73 < x < -3.4500000000000003e-175Initial program 82.8%
associate-/r*89.0%
Simplified94.4%
Taylor expanded in x around inf 65.3%
associate-/l*61.9%
Simplified61.9%
clear-num61.1%
inv-pow61.1%
+-commutative61.1%
fma-def61.1%
associate-/r/60.9%
Applied egg-rr60.9%
unpow-160.9%
fma-udef60.9%
*-commutative60.9%
*-commutative60.9%
associate-*r*60.9%
associate-*l/64.6%
+-commutative64.6%
fma-def64.6%
associate-/l*61.1%
associate-*r*61.1%
*-commutative61.1%
*-commutative61.1%
Simplified61.1%
Taylor expanded in y around 0 37.0%
associate-*r/38.8%
Simplified38.8%
if -3.4500000000000003e-175 < x < 7.2000000000000001e-302Initial program 88.4%
associate-/r*88.8%
Simplified95.7%
Taylor expanded in b around inf 59.4%
*-commutative59.4%
Simplified59.4%
if 7.2000000000000001e-302 < x < 2.30000000000000004e-42Initial program 72.1%
associate-/r*81.7%
Simplified93.1%
Taylor expanded in t around inf 54.3%
associate-/l*54.2%
associate-/r/47.8%
Simplified47.8%
if 2.30000000000000004e-42 < x Initial program 77.6%
associate-/r*76.9%
Simplified84.8%
Taylor expanded in x around inf 48.4%
associate-/l*48.5%
*-commutative48.5%
Simplified48.5%
Taylor expanded in z around 0 48.5%
associate-/l*46.1%
Simplified46.1%
Final simplification50.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 (<= x -1.55e+74)
(* 9.0 (/ y (/ (* z c) x)))
(if (<= x -9.6e-176)
(* -4.0 (* a (/ t c)))
(if (<= x 4.4e-303)
(/ b (* z c))
(if (<= x 6e-43)
(/ 1.0 (* -0.25 (/ (/ c a) t)))
(* 9.0 (/ y (/ c (/ x 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 (x <= -1.55e+74) {
tmp = 9.0 * (y / ((z * c) / x));
} else if (x <= -9.6e-176) {
tmp = -4.0 * (a * (t / c));
} else if (x <= 4.4e-303) {
tmp = b / (z * c);
} else if (x <= 6e-43) {
tmp = 1.0 / (-0.25 * ((c / a) / t));
} else {
tmp = 9.0 * (y / (c / (x / 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 (x <= (-1.55d+74)) then
tmp = 9.0d0 * (y / ((z * c) / x))
else if (x <= (-9.6d-176)) then
tmp = (-4.0d0) * (a * (t / c))
else if (x <= 4.4d-303) then
tmp = b / (z * c)
else if (x <= 6d-43) then
tmp = 1.0d0 / ((-0.25d0) * ((c / a) / t))
else
tmp = 9.0d0 * (y / (c / (x / 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 (x <= -1.55e+74) {
tmp = 9.0 * (y / ((z * c) / x));
} else if (x <= -9.6e-176) {
tmp = -4.0 * (a * (t / c));
} else if (x <= 4.4e-303) {
tmp = b / (z * c);
} else if (x <= 6e-43) {
tmp = 1.0 / (-0.25 * ((c / a) / t));
} else {
tmp = 9.0 * (y / (c / (x / 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 x <= -1.55e+74: tmp = 9.0 * (y / ((z * c) / x)) elif x <= -9.6e-176: tmp = -4.0 * (a * (t / c)) elif x <= 4.4e-303: tmp = b / (z * c) elif x <= 6e-43: tmp = 1.0 / (-0.25 * ((c / a) / t)) else: tmp = 9.0 * (y / (c / (x / 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 (x <= -1.55e+74) tmp = Float64(9.0 * Float64(y / Float64(Float64(z * c) / x))); elseif (x <= -9.6e-176) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); elseif (x <= 4.4e-303) tmp = Float64(b / Float64(z * c)); elseif (x <= 6e-43) tmp = Float64(1.0 / Float64(-0.25 * Float64(Float64(c / a) / t))); else tmp = Float64(9.0 * Float64(y / Float64(c / Float64(x / 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 (x <= -1.55e+74)
tmp = 9.0 * (y / ((z * c) / x));
elseif (x <= -9.6e-176)
tmp = -4.0 * (a * (t / c));
elseif (x <= 4.4e-303)
tmp = b / (z * c);
elseif (x <= 6e-43)
tmp = 1.0 / (-0.25 * ((c / a) / t));
else
tmp = 9.0 * (y / (c / (x / 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[x, -1.55e+74], N[(9.0 * N[(y / N[(N[(z * c), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.6e-176], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e-303], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-43], N[(1.0 / N[(-0.25 * N[(N[(c / a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(9.0 * N[(y / N[(c / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+74}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{z \cdot c}{x}}\\
\mathbf{elif}\;x \leq -9.6 \cdot 10^{-176}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-303}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-43}:\\
\;\;\;\;\frac{1}{-0.25 \cdot \frac{\frac{c}{a}}{t}}\\
\mathbf{else}:\\
\;\;\;\;9 \cdot \frac{y}{\frac{c}{\frac{x}{z}}}\\
\end{array}
\end{array}
if x < -1.55000000000000011e74Initial program 75.6%
associate-/r*77.4%
Simplified91.1%
Taylor expanded in x around inf 61.2%
associate-/l*64.6%
*-commutative64.6%
Simplified64.6%
if -1.55000000000000011e74 < x < -9.60000000000000024e-176Initial program 82.8%
associate-/r*89.0%
Simplified94.4%
Taylor expanded in x around inf 65.3%
associate-/l*61.9%
Simplified61.9%
clear-num61.1%
inv-pow61.1%
+-commutative61.1%
fma-def61.1%
associate-/r/60.9%
Applied egg-rr60.9%
unpow-160.9%
fma-udef60.9%
*-commutative60.9%
*-commutative60.9%
associate-*r*60.9%
associate-*l/64.6%
+-commutative64.6%
fma-def64.6%
associate-/l*61.1%
associate-*r*61.1%
*-commutative61.1%
*-commutative61.1%
Simplified61.1%
Taylor expanded in y around 0 37.0%
associate-*r/38.8%
Simplified38.8%
if -9.60000000000000024e-176 < x < 4.40000000000000028e-303Initial program 88.4%
associate-/r*88.8%
Simplified95.7%
Taylor expanded in b around inf 59.4%
*-commutative59.4%
Simplified59.4%
if 4.40000000000000028e-303 < x < 6.00000000000000007e-43Initial program 72.1%
associate-/r*81.7%
Simplified93.1%
Taylor expanded in x around inf 69.4%
associate-/l*67.1%
Simplified67.1%
clear-num67.2%
inv-pow67.2%
+-commutative67.2%
fma-def67.2%
associate-/r/62.3%
Applied egg-rr62.3%
unpow-162.3%
fma-udef62.3%
*-commutative62.3%
*-commutative62.3%
associate-*r*62.3%
associate-*l/69.5%
+-commutative69.5%
fma-def69.5%
associate-/l*67.2%
associate-*r*67.2%
*-commutative67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y around 0 54.4%
associate-/r*50.2%
Simplified50.2%
if 6.00000000000000007e-43 < x Initial program 77.6%
associate-/r*76.9%
Simplified84.8%
Taylor expanded in x around inf 48.4%
associate-/l*48.5%
*-commutative48.5%
Simplified48.5%
Taylor expanded in z around 0 48.5%
associate-/l*46.1%
Simplified46.1%
Final simplification50.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
(if (<= y -1.85e-91)
(/ (* 9.0 (/ y (/ z x))) c)
(if (<= y 8.5e-218)
(/ 1.0 (/ z (/ b c)))
(if (<= y 7.2e+23)
(* -4.0 (/ a (/ c t)))
(/ 1.0 (* (/ 0.1111111111111111 x) (/ z (/ y 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 (y <= -1.85e-91) {
tmp = (9.0 * (y / (z / x))) / c;
} else if (y <= 8.5e-218) {
tmp = 1.0 / (z / (b / c));
} else if (y <= 7.2e+23) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = 1.0 / ((0.1111111111111111 / x) * (z / (y / 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 (y <= (-1.85d-91)) then
tmp = (9.0d0 * (y / (z / x))) / c
else if (y <= 8.5d-218) then
tmp = 1.0d0 / (z / (b / c))
else if (y <= 7.2d+23) then
tmp = (-4.0d0) * (a / (c / t))
else
tmp = 1.0d0 / ((0.1111111111111111d0 / x) * (z / (y / 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 (y <= -1.85e-91) {
tmp = (9.0 * (y / (z / x))) / c;
} else if (y <= 8.5e-218) {
tmp = 1.0 / (z / (b / c));
} else if (y <= 7.2e+23) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = 1.0 / ((0.1111111111111111 / x) * (z / (y / 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 y <= -1.85e-91: tmp = (9.0 * (y / (z / x))) / c elif y <= 8.5e-218: tmp = 1.0 / (z / (b / c)) elif y <= 7.2e+23: tmp = -4.0 * (a / (c / t)) else: tmp = 1.0 / ((0.1111111111111111 / x) * (z / (y / 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 (y <= -1.85e-91) tmp = Float64(Float64(9.0 * Float64(y / Float64(z / x))) / c); elseif (y <= 8.5e-218) tmp = Float64(1.0 / Float64(z / Float64(b / c))); elseif (y <= 7.2e+23) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); else tmp = Float64(1.0 / Float64(Float64(0.1111111111111111 / x) * Float64(z / Float64(y / 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 (y <= -1.85e-91)
tmp = (9.0 * (y / (z / x))) / c;
elseif (y <= 8.5e-218)
tmp = 1.0 / (z / (b / c));
elseif (y <= 7.2e+23)
tmp = -4.0 * (a / (c / t));
else
tmp = 1.0 / ((0.1111111111111111 / x) * (z / (y / 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[y, -1.85e-91], N[(N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 8.5e-218], N[(1.0 / N[(z / N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+23], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(0.1111111111111111 / x), $MachinePrecision] * N[(z / N[(y / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-91}:\\
\;\;\;\;\frac{9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-218}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{b}{c}}}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+23}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{0.1111111111111111}{x} \cdot \frac{z}{\frac{y}{c}}}\\
\end{array}
\end{array}
if y < -1.8500000000000001e-91Initial program 78.5%
associate-/r*82.9%
Simplified87.6%
Taylor expanded in x around inf 77.7%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in y around inf 62.7%
associate-/l*63.1%
Simplified63.1%
if -1.8500000000000001e-91 < y < 8.5000000000000004e-218Initial program 78.7%
associate-/r*79.1%
Simplified90.8%
Taylor expanded in b around inf 53.7%
*-commutative53.7%
Simplified53.7%
clear-num53.6%
inv-pow53.6%
Applied egg-rr53.6%
unpow-153.6%
associate-/l*56.4%
Simplified56.4%
if 8.5000000000000004e-218 < y < 7.1999999999999997e23Initial program 77.5%
associate-/r*81.1%
Simplified96.4%
Taylor expanded in t around inf 55.3%
associate-/l*53.8%
Simplified53.8%
if 7.1999999999999997e23 < y Initial program 78.5%
associate-/r*81.9%
Simplified85.0%
Taylor expanded in x around inf 72.9%
associate-/l*71.4%
Simplified71.4%
clear-num71.4%
inv-pow71.4%
+-commutative71.4%
fma-def73.1%
associate-/r/68.0%
Applied egg-rr68.0%
unpow-168.0%
fma-udef66.3%
*-commutative66.3%
*-commutative66.3%
associate-*r*66.3%
associate-*l/72.9%
+-commutative72.9%
fma-def72.9%
associate-/l*71.4%
associate-*r*71.4%
*-commutative71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y around inf 53.9%
associate-*r/53.9%
*-commutative53.9%
times-frac57.2%
*-commutative57.2%
associate-/l*62.1%
Simplified62.1%
Final simplification59.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 b c)
:precision binary64
(if (<= y -1e-96)
(/ (* 9.0 (/ y (/ z x))) c)
(if (<= y 1.02e-217)
(/ 1.0 (/ z (/ b c)))
(if (<= y 2.35e+23)
(* -4.0 (/ a (/ c t)))
(/ 1.0 (/ 0.1111111111111111 (* x (/ (/ y 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 (y <= -1e-96) {
tmp = (9.0 * (y / (z / x))) / c;
} else if (y <= 1.02e-217) {
tmp = 1.0 / (z / (b / c));
} else if (y <= 2.35e+23) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = 1.0 / (0.1111111111111111 / (x * ((y / 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 (y <= (-1d-96)) then
tmp = (9.0d0 * (y / (z / x))) / c
else if (y <= 1.02d-217) then
tmp = 1.0d0 / (z / (b / c))
else if (y <= 2.35d+23) then
tmp = (-4.0d0) * (a / (c / t))
else
tmp = 1.0d0 / (0.1111111111111111d0 / (x * ((y / 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 (y <= -1e-96) {
tmp = (9.0 * (y / (z / x))) / c;
} else if (y <= 1.02e-217) {
tmp = 1.0 / (z / (b / c));
} else if (y <= 2.35e+23) {
tmp = -4.0 * (a / (c / t));
} else {
tmp = 1.0 / (0.1111111111111111 / (x * ((y / 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 y <= -1e-96: tmp = (9.0 * (y / (z / x))) / c elif y <= 1.02e-217: tmp = 1.0 / (z / (b / c)) elif y <= 2.35e+23: tmp = -4.0 * (a / (c / t)) else: tmp = 1.0 / (0.1111111111111111 / (x * ((y / 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 (y <= -1e-96) tmp = Float64(Float64(9.0 * Float64(y / Float64(z / x))) / c); elseif (y <= 1.02e-217) tmp = Float64(1.0 / Float64(z / Float64(b / c))); elseif (y <= 2.35e+23) tmp = Float64(-4.0 * Float64(a / Float64(c / t))); else tmp = Float64(1.0 / Float64(0.1111111111111111 / Float64(x * Float64(Float64(y / 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 (y <= -1e-96)
tmp = (9.0 * (y / (z / x))) / c;
elseif (y <= 1.02e-217)
tmp = 1.0 / (z / (b / c));
elseif (y <= 2.35e+23)
tmp = -4.0 * (a / (c / t));
else
tmp = 1.0 / (0.1111111111111111 / (x * ((y / 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[LessEqual[y, -1e-96], N[(N[(9.0 * N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[y, 1.02e-217], N[(1.0 / N[(z / N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.35e+23], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(0.1111111111111111 / N[(x * N[(N[(y / c), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-96}:\\
\;\;\;\;\frac{9 \cdot \frac{y}{\frac{z}{x}}}{c}\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-217}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{b}{c}}}\\
\mathbf{elif}\;y \leq 2.35 \cdot 10^{+23}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{0.1111111111111111}{x \cdot \frac{\frac{y}{c}}{z}}}\\
\end{array}
\end{array}
if y < -9.9999999999999991e-97Initial program 78.5%
associate-/r*82.9%
Simplified87.6%
Taylor expanded in x around inf 77.7%
associate-/l*79.1%
Simplified79.1%
Taylor expanded in y around inf 62.7%
associate-/l*63.1%
Simplified63.1%
if -9.9999999999999991e-97 < y < 1.02e-217Initial program 78.7%
associate-/r*79.1%
Simplified90.8%
Taylor expanded in b around inf 53.7%
*-commutative53.7%
Simplified53.7%
clear-num53.6%
inv-pow53.6%
Applied egg-rr53.6%
unpow-153.6%
associate-/l*56.4%
Simplified56.4%
if 1.02e-217 < y < 2.3499999999999999e23Initial program 77.5%
associate-/r*81.1%
Simplified96.4%
Taylor expanded in t around inf 55.3%
associate-/l*53.8%
Simplified53.8%
if 2.3499999999999999e23 < y Initial program 78.5%
associate-/r*81.9%
Simplified85.0%
Taylor expanded in x around inf 72.9%
associate-/l*71.4%
Simplified71.4%
clear-num71.4%
inv-pow71.4%
+-commutative71.4%
fma-def73.1%
associate-/r/68.0%
Applied egg-rr68.0%
unpow-168.0%
fma-udef66.3%
*-commutative66.3%
*-commutative66.3%
associate-*r*66.3%
associate-*l/72.9%
+-commutative72.9%
fma-def72.9%
associate-/l*71.4%
associate-*r*71.4%
*-commutative71.4%
*-commutative71.4%
Simplified71.4%
Taylor expanded in y around inf 53.9%
associate-*r/53.9%
*-commutative53.9%
times-frac57.2%
*-commutative57.2%
associate-/l*62.1%
Simplified62.1%
*-commutative62.1%
clear-num63.6%
frac-times63.8%
metadata-eval63.8%
Applied egg-rr63.8%
Final simplification59.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 (or (<= z -4.9e+147) (not (<= z 106.0))) (/ (+ (* t (* a -4.0)) (/ b z)) 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 <= -4.9e+147) || !(z <= 106.0)) {
tmp = ((t * (a * -4.0)) + (b / z)) / 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 <= (-4.9d+147)) .or. (.not. (z <= 106.0d0))) then
tmp = ((t * (a * (-4.0d0))) + (b / z)) / 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 <= -4.9e+147) || !(z <= 106.0)) {
tmp = ((t * (a * -4.0)) + (b / z)) / 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 <= -4.9e+147) or not (z <= 106.0): tmp = ((t * (a * -4.0)) + (b / z)) / 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 <= -4.9e+147) || !(z <= 106.0)) tmp = Float64(Float64(Float64(t * Float64(a * -4.0)) + Float64(b / z)) / 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 <= -4.9e+147) || ~((z <= 106.0)))
tmp = ((t * (a * -4.0)) + (b / z)) / 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, -4.9e+147], N[Not[LessEqual[z, 106.0]], $MachinePrecision]], N[(N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b / z), $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 -4.9 \cdot 10^{+147} \lor \neg \left(z \leq 106\right):\\
\;\;\;\;\frac{t \cdot \left(a \cdot -4\right) + \frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\end{array}
\end{array}
if z < -4.8999999999999998e147 or 106 < z Initial program 57.5%
associate-/r*72.3%
Simplified92.1%
Taylor expanded in x around 0 80.5%
if -4.8999999999999998e147 < z < 106Initial program 91.9%
associate-/r*87.2%
Simplified89.4%
Taylor expanded in z around 0 78.9%
Final simplification79.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
(if (<= z -4.1e+152)
(/ (* -4.0 (* t a)) c)
(if (<= z 3.8e+146)
(/ (+ b (* 9.0 (* x y))) (* z c))
(* -4.0 (* a (/ t 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 <= -4.1e+152) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= 3.8e+146) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (a * (t / 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 <= (-4.1d+152)) then
tmp = ((-4.0d0) * (t * a)) / c
else if (z <= 3.8d+146) then
tmp = (b + (9.0d0 * (x * y))) / (z * c)
else
tmp = (-4.0d0) * (a * (t / 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 <= -4.1e+152) {
tmp = (-4.0 * (t * a)) / c;
} else if (z <= 3.8e+146) {
tmp = (b + (9.0 * (x * y))) / (z * c);
} else {
tmp = -4.0 * (a * (t / 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 <= -4.1e+152: tmp = (-4.0 * (t * a)) / c elif z <= 3.8e+146: tmp = (b + (9.0 * (x * y))) / (z * c) else: tmp = -4.0 * (a * (t / 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 <= -4.1e+152) tmp = Float64(Float64(-4.0 * Float64(t * a)) / c); elseif (z <= 3.8e+146) tmp = Float64(Float64(b + Float64(9.0 * Float64(x * y))) / Float64(z * c)); else tmp = Float64(-4.0 * Float64(a * Float64(t / 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 <= -4.1e+152)
tmp = (-4.0 * (t * a)) / c;
elseif (z <= 3.8e+146)
tmp = (b + (9.0 * (x * y))) / (z * c);
else
tmp = -4.0 * (a * (t / 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, -4.1e+152], N[(N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[z, 3.8e+146], N[(N[(b + N[(9.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+152}:\\
\;\;\;\;\frac{-4 \cdot \left(t \cdot a\right)}{c}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+146}:\\
\;\;\;\;\frac{b + 9 \cdot \left(x \cdot y\right)}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\end{array}
\end{array}
if z < -4.0999999999999998e152Initial program 36.9%
associate-/r*58.7%
Simplified94.0%
Taylor expanded in t around inf 65.0%
if -4.0999999999999998e152 < z < 3.79999999999999979e146Initial program 90.1%
associate-/r*87.8%
Simplified90.7%
Taylor expanded in z around 0 74.7%
if 3.79999999999999979e146 < z Initial program 56.0%
associate-/r*69.0%
Simplified85.8%
Taylor expanded in x around inf 72.9%
associate-/l*76.1%
Simplified76.1%
clear-num74.9%
inv-pow74.9%
+-commutative74.9%
fma-def74.9%
associate-/r/76.0%
Applied egg-rr76.0%
unpow-176.0%
fma-udef76.0%
*-commutative76.0%
*-commutative76.0%
associate-*r*76.0%
associate-*l/71.7%
+-commutative71.7%
fma-def71.7%
associate-/l*74.9%
associate-*r*74.9%
*-commutative74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in y around 0 57.8%
associate-*r/66.3%
Simplified66.3%
Final simplification72.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 (if (or (<= t -1.3e+23) (not (<= t 1.06e-69))) (* -4.0 (* a (/ t c))) (/ (/ 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) {
double tmp;
if ((t <= -1.3e+23) || !(t <= 1.06e-69)) {
tmp = -4.0 * (a * (t / c));
} else {
tmp = (b / 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 ((t <= (-1.3d+23)) .or. (.not. (t <= 1.06d-69))) then
tmp = (-4.0d0) * (a * (t / c))
else
tmp = (b / 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 ((t <= -1.3e+23) || !(t <= 1.06e-69)) {
tmp = -4.0 * (a * (t / c));
} else {
tmp = (b / 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 (t <= -1.3e+23) or not (t <= 1.06e-69): tmp = -4.0 * (a * (t / c)) else: tmp = (b / 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 ((t <= -1.3e+23) || !(t <= 1.06e-69)) tmp = Float64(-4.0 * Float64(a * Float64(t / c))); else tmp = Float64(Float64(b / 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 ((t <= -1.3e+23) || ~((t <= 1.06e-69)))
tmp = -4.0 * (a * (t / c));
else
tmp = (b / 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[t, -1.3e+23], N[Not[LessEqual[t, 1.06e-69]], $MachinePrecision]], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+23} \lor \neg \left(t \leq 1.06 \cdot 10^{-69}\right):\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if t < -1.29999999999999996e23 or 1.05999999999999997e-69 < t Initial program 72.5%
associate-/r*73.1%
Simplified86.0%
Taylor expanded in x around inf 72.7%
associate-/l*71.9%
Simplified71.9%
clear-num71.8%
inv-pow71.8%
+-commutative71.8%
fma-def73.3%
associate-/r/73.4%
Applied egg-rr73.4%
unpow-173.4%
fma-udef71.9%
*-commutative71.9%
*-commutative71.9%
associate-*r*71.9%
associate-*l/72.6%
+-commutative72.6%
fma-def72.6%
associate-/l*71.8%
associate-*r*71.8%
*-commutative71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in y around 0 55.6%
associate-*r/59.2%
Simplified59.2%
if -1.29999999999999996e23 < t < 1.05999999999999997e-69Initial program 84.5%
associate-/r*90.1%
Simplified93.6%
Taylor expanded in x around 0 53.8%
Taylor expanded in b around inf 41.2%
Final simplification50.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 (if (<= t -1.55e+102) (* -4.0 (* t (/ a c))) (if (<= t 2.85e-69) (/ (/ b z) c) (* -4.0 (* a (/ t 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 (t <= -1.55e+102) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 2.85e-69) {
tmp = (b / z) / c;
} else {
tmp = -4.0 * (a * (t / 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 (t <= (-1.55d+102)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= 2.85d-69) then
tmp = (b / z) / c
else
tmp = (-4.0d0) * (a * (t / 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 (t <= -1.55e+102) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 2.85e-69) {
tmp = (b / z) / c;
} else {
tmp = -4.0 * (a * (t / 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 t <= -1.55e+102: tmp = -4.0 * (t * (a / c)) elif t <= 2.85e-69: tmp = (b / z) / c else: tmp = -4.0 * (a * (t / 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 (t <= -1.55e+102) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= 2.85e-69) tmp = Float64(Float64(b / z) / c); else tmp = Float64(-4.0 * Float64(a * Float64(t / 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 (t <= -1.55e+102)
tmp = -4.0 * (t * (a / c));
elseif (t <= 2.85e-69)
tmp = (b / z) / c;
else
tmp = -4.0 * (a * (t / 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[t, -1.55e+102], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.85e-69], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], N[(-4.0 * N[(a * N[(t / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+102}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq 2.85 \cdot 10^{-69}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot \frac{t}{c}\right)\\
\end{array}
\end{array}
if t < -1.54999999999999993e102Initial program 70.3%
associate-/r*67.2%
Simplified88.3%
Taylor expanded in t around inf 60.8%
associate-/l*60.8%
associate-/r/62.3%
Simplified62.3%
if -1.54999999999999993e102 < t < 2.85e-69Initial program 84.3%
associate-/r*90.6%
Simplified93.7%
Taylor expanded in x around 0 55.9%
Taylor expanded in b around inf 41.4%
if 2.85e-69 < t Initial program 71.5%
associate-/r*72.1%
Simplified85.2%
Taylor expanded in x around inf 71.7%
associate-/l*68.5%
Simplified68.5%
clear-num68.4%
inv-pow68.5%
+-commutative68.5%
fma-def68.5%
associate-/r/70.0%
Applied egg-rr70.0%
unpow-170.0%
fma-udef70.0%
*-commutative70.0%
*-commutative70.0%
associate-*r*70.0%
associate-*l/71.6%
+-commutative71.6%
fma-def71.6%
associate-/l*68.4%
associate-*r*68.4%
*-commutative68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in y around 0 54.8%
associate-*r/59.2%
Simplified59.2%
Final simplification50.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 (<= t -1.55e+102) (* -4.0 (* t (/ a c))) (if (<= t 2.3e-69) (/ (/ b z) c) (* -4.0 (/ a (/ c t))))))
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 <= -1.55e+102) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 2.3e-69) {
tmp = (b / z) / c;
} else {
tmp = -4.0 * (a / (c / t));
}
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 <= (-1.55d+102)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= 2.3d-69) then
tmp = (b / z) / c
else
tmp = (-4.0d0) * (a / (c / t))
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 <= -1.55e+102) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 2.3e-69) {
tmp = (b / z) / c;
} else {
tmp = -4.0 * (a / (c / t));
}
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 <= -1.55e+102: tmp = -4.0 * (t * (a / c)) elif t <= 2.3e-69: tmp = (b / z) / c else: tmp = -4.0 * (a / (c / t)) 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 <= -1.55e+102) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= 2.3e-69) tmp = Float64(Float64(b / z) / c); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); 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 <= -1.55e+102)
tmp = -4.0 * (t * (a / c));
elseif (t <= 2.3e-69)
tmp = (b / z) / c;
else
tmp = -4.0 * (a / (c / t));
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[t, -1.55e+102], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.3e-69], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+102}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-69}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if t < -1.54999999999999993e102Initial program 70.3%
associate-/r*67.2%
Simplified88.3%
Taylor expanded in t around inf 60.8%
associate-/l*60.8%
associate-/r/62.3%
Simplified62.3%
if -1.54999999999999993e102 < t < 2.3000000000000001e-69Initial program 84.3%
associate-/r*90.6%
Simplified93.7%
Taylor expanded in x around 0 55.9%
Taylor expanded in b around inf 41.4%
if 2.3000000000000001e-69 < t Initial program 71.5%
associate-/r*72.1%
Simplified85.2%
Taylor expanded in t around inf 54.8%
associate-/l*59.2%
Simplified59.2%
Final simplification50.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 (<= t -1.55e+102) (* -4.0 (* t (/ a c))) (if (<= t 1.82e-68) (/ 1.0 (/ z (/ b c))) (* -4.0 (/ a (/ c t))))))
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 <= -1.55e+102) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 1.82e-68) {
tmp = 1.0 / (z / (b / c));
} else {
tmp = -4.0 * (a / (c / t));
}
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 <= (-1.55d+102)) then
tmp = (-4.0d0) * (t * (a / c))
else if (t <= 1.82d-68) then
tmp = 1.0d0 / (z / (b / c))
else
tmp = (-4.0d0) * (a / (c / t))
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 <= -1.55e+102) {
tmp = -4.0 * (t * (a / c));
} else if (t <= 1.82e-68) {
tmp = 1.0 / (z / (b / c));
} else {
tmp = -4.0 * (a / (c / t));
}
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 <= -1.55e+102: tmp = -4.0 * (t * (a / c)) elif t <= 1.82e-68: tmp = 1.0 / (z / (b / c)) else: tmp = -4.0 * (a / (c / t)) 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 <= -1.55e+102) tmp = Float64(-4.0 * Float64(t * Float64(a / c))); elseif (t <= 1.82e-68) tmp = Float64(1.0 / Float64(z / Float64(b / c))); else tmp = Float64(-4.0 * Float64(a / Float64(c / t))); 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 <= -1.55e+102)
tmp = -4.0 * (t * (a / c));
elseif (t <= 1.82e-68)
tmp = 1.0 / (z / (b / c));
else
tmp = -4.0 * (a / (c / t));
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[t, -1.55e+102], N[(-4.0 * N[(t * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.82e-68], N[(1.0 / N[(z / N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(a / N[(c / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+102}:\\
\;\;\;\;-4 \cdot \left(t \cdot \frac{a}{c}\right)\\
\mathbf{elif}\;t \leq 1.82 \cdot 10^{-68}:\\
\;\;\;\;\frac{1}{\frac{z}{\frac{b}{c}}}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \frac{a}{\frac{c}{t}}\\
\end{array}
\end{array}
if t < -1.54999999999999993e102Initial program 70.3%
associate-/r*67.2%
Simplified88.3%
Taylor expanded in t around inf 60.8%
associate-/l*60.8%
associate-/r/62.3%
Simplified62.3%
if -1.54999999999999993e102 < t < 1.81999999999999994e-68Initial program 84.3%
associate-/r*90.6%
Simplified93.7%
Taylor expanded in b around inf 37.4%
*-commutative37.4%
Simplified37.4%
clear-num37.4%
inv-pow37.4%
Applied egg-rr37.4%
unpow-137.4%
associate-/l*42.1%
Simplified42.1%
if 1.81999999999999994e-68 < t Initial program 71.5%
associate-/r*72.1%
Simplified85.2%
Taylor expanded in t around inf 54.8%
associate-/l*59.2%
Simplified59.2%
Final simplification50.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 (if (<= b 4.7e-116) (/ b (* z c)) (/ (/ 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) {
double tmp;
if (b <= 4.7e-116) {
tmp = b / (z * c);
} else {
tmp = (b / 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 (b <= 4.7d-116) then
tmp = b / (z * c)
else
tmp = (b / 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 (b <= 4.7e-116) {
tmp = b / (z * c);
} else {
tmp = (b / 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 b <= 4.7e-116: tmp = b / (z * c) else: tmp = (b / 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 (b <= 4.7e-116) tmp = Float64(b / Float64(z * c)); else tmp = Float64(Float64(b / 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 (b <= 4.7e-116)
tmp = b / (z * c);
else
tmp = (b / 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[LessEqual[b, 4.7e-116], N[(b / N[(z * c), $MachinePrecision]), $MachinePrecision], N[(N[(b / z), $MachinePrecision] / c), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
[t, a] = \mathsf{sort}([t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq 4.7 \cdot 10^{-116}:\\
\;\;\;\;\frac{b}{z \cdot c}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{b}{z}}{c}\\
\end{array}
\end{array}
if b < 4.69999999999999994e-116Initial program 78.1%
associate-/r*78.0%
Simplified87.7%
Taylor expanded in b around inf 24.2%
*-commutative24.2%
Simplified24.2%
if 4.69999999999999994e-116 < b Initial program 78.8%
associate-/r*87.4%
Simplified94.5%
Taylor expanded in x around 0 79.5%
Taylor expanded in b around inf 54.7%
Final simplification34.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 (* 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 78.3%
associate-/r*81.3%
Simplified90.5%
Taylor expanded in b around inf 32.0%
*-commutative32.0%
Simplified32.0%
Final simplification32.0%
(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 2023255
(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)))