
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
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
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ (- z b) (/ t_1 y))))
(if (or (<= x -3.65e+127) (not (<= x 3.8e+167)))
(+ t_2 (+ z (* (/ a t_1) (+ y t))))
(+ t_2 (+ (/ a (/ t_1 (+ y t))) (/ (* x z) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z - b) / (t_1 / y);
double tmp;
if ((x <= -3.65e+127) || !(x <= 3.8e+167)) {
tmp = t_2 + (z + ((a / t_1) * (y + t)));
} else {
tmp = t_2 + ((a / (t_1 / (y + t))) + ((x * z) / t_1));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (z - b) / (t_1 / y)
if ((x <= (-3.65d+127)) .or. (.not. (x <= 3.8d+167))) then
tmp = t_2 + (z + ((a / t_1) * (y + t)))
else
tmp = t_2 + ((a / (t_1 / (y + t))) + ((x * z) / t_1))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z - b) / (t_1 / y);
double tmp;
if ((x <= -3.65e+127) || !(x <= 3.8e+167)) {
tmp = t_2 + (z + ((a / t_1) * (y + t)));
} else {
tmp = t_2 + ((a / (t_1 / (y + t))) + ((x * z) / t_1));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z - b) / (t_1 / y) tmp = 0 if (x <= -3.65e+127) or not (x <= 3.8e+167): tmp = t_2 + (z + ((a / t_1) * (y + t))) else: tmp = t_2 + ((a / (t_1 / (y + t))) + ((x * z) / t_1)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(z - b) / Float64(t_1 / y)) tmp = 0.0 if ((x <= -3.65e+127) || !(x <= 3.8e+167)) tmp = Float64(t_2 + Float64(z + Float64(Float64(a / t_1) * Float64(y + t)))); else tmp = Float64(t_2 + Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(Float64(x * z) / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (z - b) / (t_1 / y); tmp = 0.0; if ((x <= -3.65e+127) || ~((x <= 3.8e+167))) tmp = t_2 + (z + ((a / t_1) * (y + t))); else tmp = t_2 + ((a / (t_1 / (y + t))) + ((x * z) / t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -3.65e+127], N[Not[LessEqual[x, 3.8e+167]], $MachinePrecision]], N[(t$95$2 + N[(z + N[(N[(a / t$95$1), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{z - b}{\frac{t_1}{y}}\\
\mathbf{if}\;x \leq -3.65 \cdot 10^{+127} \lor \neg \left(x \leq 3.8 \cdot 10^{+167}\right):\\
\;\;\;\;t_2 + \left(z + \frac{a}{t_1} \cdot \left(y + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 + \left(\frac{a}{\frac{t_1}{y + t}} + \frac{x \cdot z}{t_1}\right)\\
\end{array}
\end{array}
if x < -3.6499999999999998e127 or 3.79999999999999994e167 < x Initial program 43.2%
Simplified43.5%
Taylor expanded in a around inf 43.2%
associate-/l*46.1%
+-commutative46.1%
associate-/l*58.2%
Simplified58.2%
associate-/r/58.2%
+-commutative58.2%
Applied egg-rr58.2%
Taylor expanded in x around inf 86.0%
if -3.6499999999999998e127 < x < 3.79999999999999994e167Initial program 68.2%
Simplified68.4%
Taylor expanded in a around inf 68.3%
associate-/l*79.0%
+-commutative79.0%
associate-/l*97.5%
Simplified97.5%
Final simplification94.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (* z (+ x y)))
(t_4 (/ (- (+ t_3 t_1) (* b y)) t_2)))
(if (or (<= t_4 (- INFINITY)) (not (<= t_4 5e+278)))
(+ (/ (- z b) (/ t_2 y)) (+ z (* (/ a t_2) (+ y t))))
(/ (+ t_3 (- t_1 (* b y))) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = z * (x + y);
double t_4 = ((t_3 + t_1) - (b * y)) / t_2;
double tmp;
if ((t_4 <= -((double) INFINITY)) || !(t_4 <= 5e+278)) {
tmp = ((z - b) / (t_2 / y)) + (z + ((a / t_2) * (y + t)));
} else {
tmp = (t_3 + (t_1 - (b * y))) / t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = z * (x + y);
double t_4 = ((t_3 + t_1) - (b * y)) / t_2;
double tmp;
if ((t_4 <= -Double.POSITIVE_INFINITY) || !(t_4 <= 5e+278)) {
tmp = ((z - b) / (t_2 / y)) + (z + ((a / t_2) * (y + t)));
} else {
tmp = (t_3 + (t_1 - (b * y))) / t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) t_3 = z * (x + y) t_4 = ((t_3 + t_1) - (b * y)) / t_2 tmp = 0 if (t_4 <= -math.inf) or not (t_4 <= 5e+278): tmp = ((z - b) / (t_2 / y)) + (z + ((a / t_2) * (y + t))) else: tmp = (t_3 + (t_1 - (b * y))) / t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(z * Float64(x + y)) t_4 = Float64(Float64(Float64(t_3 + t_1) - Float64(b * y)) / t_2) tmp = 0.0 if ((t_4 <= Float64(-Inf)) || !(t_4 <= 5e+278)) tmp = Float64(Float64(Float64(z - b) / Float64(t_2 / y)) + Float64(z + Float64(Float64(a / t_2) * Float64(y + t)))); else tmp = Float64(Float64(t_3 + Float64(t_1 - Float64(b * y))) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); t_3 = z * (x + y); t_4 = ((t_3 + t_1) - (b * y)) / t_2; tmp = 0.0; if ((t_4 <= -Inf) || ~((t_4 <= 5e+278))) tmp = ((z - b) / (t_2 / y)) + (z + ((a / t_2) * (y + t))); else tmp = (t_3 + (t_1 - (b * y))) / t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[t$95$4, (-Infinity)], N[Not[LessEqual[t$95$4, 5e+278]], $MachinePrecision]], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$2 / y), $MachinePrecision]), $MachinePrecision] + N[(z + N[(N[(a / t$95$2), $MachinePrecision] * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 + N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := z \cdot \left(x + y\right)\\
t_4 := \frac{\left(t_3 + t_1\right) - b \cdot y}{t_2}\\
\mathbf{if}\;t_4 \leq -\infty \lor \neg \left(t_4 \leq 5 \cdot 10^{+278}\right):\\
\;\;\;\;\frac{z - b}{\frac{t_2}{y}} + \left(z + \frac{a}{t_2} \cdot \left(y + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t_3 + \left(t_1 - b \cdot y\right)}{t_2}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5.00000000000000029e278 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Simplified6.8%
Taylor expanded in a around inf 6.5%
associate-/l*31.3%
+-commutative31.3%
associate-/l*73.3%
Simplified73.3%
associate-/r/73.2%
+-commutative73.2%
Applied egg-rr73.2%
Taylor expanded in x around inf 80.5%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000029e278Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
*-commutative99.7%
Applied egg-rr99.7%
Final simplification92.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (* z (+ x y)))
(t_4 (/ (- (+ t_3 t_1) (* b y)) t_2)))
(if (<= t_4 (- INFINITY))
(- (+ z a) b)
(if (<= t_4 1e+265)
(/ (+ t_3 (- t_1 (* b y))) t_2)
(+ (/ (- z b) (* (+ x (+ y t)) (/ 1.0 y))) (+ a (/ (* x z) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = z * (x + y);
double t_4 = ((t_3 + t_1) - (b * y)) / t_2;
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = (z + a) - b;
} else if (t_4 <= 1e+265) {
tmp = (t_3 + (t_1 - (b * y))) / t_2;
} else {
tmp = ((z - b) / ((x + (y + t)) * (1.0 / y))) + (a + ((x * z) / t_2));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = z * (x + y);
double t_4 = ((t_3 + t_1) - (b * y)) / t_2;
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = (z + a) - b;
} else if (t_4 <= 1e+265) {
tmp = (t_3 + (t_1 - (b * y))) / t_2;
} else {
tmp = ((z - b) / ((x + (y + t)) * (1.0 / y))) + (a + ((x * z) / t_2));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) t_3 = z * (x + y) t_4 = ((t_3 + t_1) - (b * y)) / t_2 tmp = 0 if t_4 <= -math.inf: tmp = (z + a) - b elif t_4 <= 1e+265: tmp = (t_3 + (t_1 - (b * y))) / t_2 else: tmp = ((z - b) / ((x + (y + t)) * (1.0 / y))) + (a + ((x * z) / t_2)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(z * Float64(x + y)) t_4 = Float64(Float64(Float64(t_3 + t_1) - Float64(b * y)) / t_2) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(Float64(z + a) - b); elseif (t_4 <= 1e+265) tmp = Float64(Float64(t_3 + Float64(t_1 - Float64(b * y))) / t_2); else tmp = Float64(Float64(Float64(z - b) / Float64(Float64(x + Float64(y + t)) * Float64(1.0 / y))) + Float64(a + Float64(Float64(x * z) / t_2))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); t_3 = z * (x + y); t_4 = ((t_3 + t_1) - (b * y)) / t_2; tmp = 0.0; if (t_4 <= -Inf) tmp = (z + a) - b; elseif (t_4 <= 1e+265) tmp = (t_3 + (t_1 - (b * y))) / t_2; else tmp = ((z - b) / ((x + (y + t)) * (1.0 / y))) + (a + ((x * z) / t_2)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$4, 1e+265], N[(N[(t$95$3 + N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[(z - b), $MachinePrecision] / N[(N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a + N[(N[(x * z), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := z \cdot \left(x + y\right)\\
t_4 := \frac{\left(t_3 + t_1\right) - b \cdot y}{t_2}\\
\mathbf{if}\;t_4 \leq -\infty:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t_4 \leq 10^{+265}:\\
\;\;\;\;\frac{t_3 + \left(t_1 - b \cdot y\right)}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{z - b}{\left(x + \left(y + t\right)\right) \cdot \frac{1}{y}} + \left(a + \frac{x \cdot z}{t_2}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.6%
Taylor expanded in y around inf 71.4%
+-commutative71.4%
Simplified71.4%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000007e265Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
*-commutative99.7%
Applied egg-rr99.7%
if 1.00000000000000007e265 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.2%
Simplified10.3%
Taylor expanded in a around inf 9.7%
associate-/l*36.6%
+-commutative36.6%
associate-/l*74.5%
Simplified74.5%
div-inv74.2%
+-commutative74.2%
Applied egg-rr74.2%
+-commutative74.2%
associate-+r+74.2%
Simplified74.2%
Taylor expanded in y around inf 69.0%
Final simplification87.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (* z (+ x y)))
(t_4 (/ (- (+ t_3 t_1) (* b y)) t_2)))
(if (or (<= t_4 (- INFINITY)) (not (<= t_4 1e+265)))
(- (+ z a) b)
(/ (+ t_3 (- t_1 (* b y))) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = z * (x + y);
double t_4 = ((t_3 + t_1) - (b * y)) / t_2;
double tmp;
if ((t_4 <= -((double) INFINITY)) || !(t_4 <= 1e+265)) {
tmp = (z + a) - b;
} else {
tmp = (t_3 + (t_1 - (b * y))) / t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = z * (x + y);
double t_4 = ((t_3 + t_1) - (b * y)) / t_2;
double tmp;
if ((t_4 <= -Double.POSITIVE_INFINITY) || !(t_4 <= 1e+265)) {
tmp = (z + a) - b;
} else {
tmp = (t_3 + (t_1 - (b * y))) / t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) t_3 = z * (x + y) t_4 = ((t_3 + t_1) - (b * y)) / t_2 tmp = 0 if (t_4 <= -math.inf) or not (t_4 <= 1e+265): tmp = (z + a) - b else: tmp = (t_3 + (t_1 - (b * y))) / t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(z * Float64(x + y)) t_4 = Float64(Float64(Float64(t_3 + t_1) - Float64(b * y)) / t_2) tmp = 0.0 if ((t_4 <= Float64(-Inf)) || !(t_4 <= 1e+265)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(t_3 + Float64(t_1 - Float64(b * y))) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); t_3 = z * (x + y); t_4 = ((t_3 + t_1) - (b * y)) / t_2; tmp = 0.0; if ((t_4 <= -Inf) || ~((t_4 <= 1e+265))) tmp = (z + a) - b; else tmp = (t_3 + (t_1 - (b * y))) / t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + t$95$1), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[t$95$4, (-Infinity)], N[Not[LessEqual[t$95$4, 1e+265]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(t$95$3 + N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := z \cdot \left(x + y\right)\\
t_4 := \frac{\left(t_3 + t_1\right) - b \cdot y}{t_2}\\
\mathbf{if}\;t_4 \leq -\infty \lor \neg \left(t_4 \leq 10^{+265}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t_3 + \left(t_1 - b \cdot y\right)}{t_2}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.00000000000000007e265 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.1%
Taylor expanded in y around inf 67.4%
+-commutative67.4%
Simplified67.4%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000007e265Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
*-commutative99.7%
Applied egg-rr99.7%
Final simplification86.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ (* y (- a b)) (+ x y))))
(t_2 (- (+ z a) b))
(t_3 (+ y (+ x t))))
(if (<= y -5.1e+51)
t_2
(if (<= y -1.5e-191)
t_1
(if (<= y -1.4e-236)
(/ a (/ t_3 (+ y t)))
(if (<= y -3.9e-266)
(+ z (* y (- (/ a x) (/ b x))))
(if (<= y 4.1e-272)
(/ (* x z) t_3)
(if (<= y 3.7e-263)
(/ t (/ (+ x t) a))
(if (<= y 2.3e+36) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double t_3 = y + (x + t);
double tmp;
if (y <= -5.1e+51) {
tmp = t_2;
} else if (y <= -1.5e-191) {
tmp = t_1;
} else if (y <= -1.4e-236) {
tmp = a / (t_3 / (y + t));
} else if (y <= -3.9e-266) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (y <= 4.1e-272) {
tmp = (x * z) / t_3;
} else if (y <= 3.7e-263) {
tmp = t / ((x + t) / a);
} else if (y <= 2.3e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z + ((y * (a - b)) / (x + y))
t_2 = (z + a) - b
t_3 = y + (x + t)
if (y <= (-5.1d+51)) then
tmp = t_2
else if (y <= (-1.5d-191)) then
tmp = t_1
else if (y <= (-1.4d-236)) then
tmp = a / (t_3 / (y + t))
else if (y <= (-3.9d-266)) then
tmp = z + (y * ((a / x) - (b / x)))
else if (y <= 4.1d-272) then
tmp = (x * z) / t_3
else if (y <= 3.7d-263) then
tmp = t / ((x + t) / a)
else if (y <= 2.3d+36) then
tmp = t_1
else
tmp = 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 t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double t_3 = y + (x + t);
double tmp;
if (y <= -5.1e+51) {
tmp = t_2;
} else if (y <= -1.5e-191) {
tmp = t_1;
} else if (y <= -1.4e-236) {
tmp = a / (t_3 / (y + t));
} else if (y <= -3.9e-266) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (y <= 4.1e-272) {
tmp = (x * z) / t_3;
} else if (y <= 3.7e-263) {
tmp = t / ((x + t) / a);
} else if (y <= 2.3e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + ((y * (a - b)) / (x + y)) t_2 = (z + a) - b t_3 = y + (x + t) tmp = 0 if y <= -5.1e+51: tmp = t_2 elif y <= -1.5e-191: tmp = t_1 elif y <= -1.4e-236: tmp = a / (t_3 / (y + t)) elif y <= -3.9e-266: tmp = z + (y * ((a / x) - (b / x))) elif y <= 4.1e-272: tmp = (x * z) / t_3 elif y <= 3.7e-263: tmp = t / ((x + t) / a) elif y <= 2.3e+36: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))) t_2 = Float64(Float64(z + a) - b) t_3 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -5.1e+51) tmp = t_2; elseif (y <= -1.5e-191) tmp = t_1; elseif (y <= -1.4e-236) tmp = Float64(a / Float64(t_3 / Float64(y + t))); elseif (y <= -3.9e-266) tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); elseif (y <= 4.1e-272) tmp = Float64(Float64(x * z) / t_3); elseif (y <= 3.7e-263) tmp = Float64(t / Float64(Float64(x + t) / a)); elseif (y <= 2.3e+36) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + ((y * (a - b)) / (x + y)); t_2 = (z + a) - b; t_3 = y + (x + t); tmp = 0.0; if (y <= -5.1e+51) tmp = t_2; elseif (y <= -1.5e-191) tmp = t_1; elseif (y <= -1.4e-236) tmp = a / (t_3 / (y + t)); elseif (y <= -3.9e-266) tmp = z + (y * ((a / x) - (b / x))); elseif (y <= 4.1e-272) tmp = (x * z) / t_3; elseif (y <= 3.7e-263) tmp = t / ((x + t) / a); elseif (y <= 2.3e+36) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.1e+51], t$95$2, If[LessEqual[y, -1.5e-191], t$95$1, If[LessEqual[y, -1.4e-236], N[(a / N[(t$95$3 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.9e-266], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e-272], N[(N[(x * z), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[y, 3.7e-263], N[(t / N[(N[(x + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+36], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{y \cdot \left(a - b\right)}{x + y}\\
t_2 := \left(z + a\right) - b\\
t_3 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -5.1 \cdot 10^{+51}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-191}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-236}:\\
\;\;\;\;\frac{a}{\frac{t_3}{y + t}}\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-266}:\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-272}:\\
\;\;\;\;\frac{x \cdot z}{t_3}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-263}:\\
\;\;\;\;\frac{t}{\frac{x + t}{a}}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -5.1000000000000001e51 or 2.29999999999999996e36 < y Initial program 36.2%
Taylor expanded in y around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -5.1000000000000001e51 < y < -1.5e-191 or 3.6999999999999997e-263 < y < 2.29999999999999996e36Initial program 80.2%
Simplified80.2%
Taylor expanded in t around 0 53.2%
Taylor expanded in z around 0 64.6%
if -1.5e-191 < y < -1.39999999999999993e-236Initial program 76.6%
Taylor expanded in a around inf 47.2%
associate-/l*70.2%
Simplified70.2%
if -1.39999999999999993e-236 < y < -3.90000000000000028e-266Initial program 59.5%
Simplified59.7%
Taylor expanded in t around 0 45.1%
Taylor expanded in y around 0 72.5%
if -3.90000000000000028e-266 < y < 4.0999999999999997e-272Initial program 91.0%
Taylor expanded in x around inf 60.7%
if 4.0999999999999997e-272 < y < 3.6999999999999997e-263Initial program 76.5%
Taylor expanded in z around 0 76.5%
Taylor expanded in y around 0 76.5%
*-commutative76.5%
associate-/l*100.0%
Simplified100.0%
Final simplification69.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ (* y (- a b)) (+ x y))))
(t_2 (- (+ z a) b))
(t_3 (+ y (+ x t))))
(if (<= y -5.5e+51)
t_2
(if (<= y -4.2e-192)
t_1
(if (<= y -6.5e-236)
(/ a (/ t_3 (+ y t)))
(if (<= y -3.7e-266)
(+ z (* y (- (/ a x) (/ b x))))
(if (<= y 1.9e-272)
(/ (* z (+ x y)) t_3)
(if (<= y 5e-264)
(/ t (/ (+ x t) a))
(if (<= y 1.95e+31) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double t_3 = y + (x + t);
double tmp;
if (y <= -5.5e+51) {
tmp = t_2;
} else if (y <= -4.2e-192) {
tmp = t_1;
} else if (y <= -6.5e-236) {
tmp = a / (t_3 / (y + t));
} else if (y <= -3.7e-266) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (y <= 1.9e-272) {
tmp = (z * (x + y)) / t_3;
} else if (y <= 5e-264) {
tmp = t / ((x + t) / a);
} else if (y <= 1.95e+31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z + ((y * (a - b)) / (x + y))
t_2 = (z + a) - b
t_3 = y + (x + t)
if (y <= (-5.5d+51)) then
tmp = t_2
else if (y <= (-4.2d-192)) then
tmp = t_1
else if (y <= (-6.5d-236)) then
tmp = a / (t_3 / (y + t))
else if (y <= (-3.7d-266)) then
tmp = z + (y * ((a / x) - (b / x)))
else if (y <= 1.9d-272) then
tmp = (z * (x + y)) / t_3
else if (y <= 5d-264) then
tmp = t / ((x + t) / a)
else if (y <= 1.95d+31) then
tmp = t_1
else
tmp = 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 t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double t_3 = y + (x + t);
double tmp;
if (y <= -5.5e+51) {
tmp = t_2;
} else if (y <= -4.2e-192) {
tmp = t_1;
} else if (y <= -6.5e-236) {
tmp = a / (t_3 / (y + t));
} else if (y <= -3.7e-266) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (y <= 1.9e-272) {
tmp = (z * (x + y)) / t_3;
} else if (y <= 5e-264) {
tmp = t / ((x + t) / a);
} else if (y <= 1.95e+31) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + ((y * (a - b)) / (x + y)) t_2 = (z + a) - b t_3 = y + (x + t) tmp = 0 if y <= -5.5e+51: tmp = t_2 elif y <= -4.2e-192: tmp = t_1 elif y <= -6.5e-236: tmp = a / (t_3 / (y + t)) elif y <= -3.7e-266: tmp = z + (y * ((a / x) - (b / x))) elif y <= 1.9e-272: tmp = (z * (x + y)) / t_3 elif y <= 5e-264: tmp = t / ((x + t) / a) elif y <= 1.95e+31: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))) t_2 = Float64(Float64(z + a) - b) t_3 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -5.5e+51) tmp = t_2; elseif (y <= -4.2e-192) tmp = t_1; elseif (y <= -6.5e-236) tmp = Float64(a / Float64(t_3 / Float64(y + t))); elseif (y <= -3.7e-266) tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); elseif (y <= 1.9e-272) tmp = Float64(Float64(z * Float64(x + y)) / t_3); elseif (y <= 5e-264) tmp = Float64(t / Float64(Float64(x + t) / a)); elseif (y <= 1.95e+31) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + ((y * (a - b)) / (x + y)); t_2 = (z + a) - b; t_3 = y + (x + t); tmp = 0.0; if (y <= -5.5e+51) tmp = t_2; elseif (y <= -4.2e-192) tmp = t_1; elseif (y <= -6.5e-236) tmp = a / (t_3 / (y + t)); elseif (y <= -3.7e-266) tmp = z + (y * ((a / x) - (b / x))); elseif (y <= 1.9e-272) tmp = (z * (x + y)) / t_3; elseif (y <= 5e-264) tmp = t / ((x + t) / a); elseif (y <= 1.95e+31) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+51], t$95$2, If[LessEqual[y, -4.2e-192], t$95$1, If[LessEqual[y, -6.5e-236], N[(a / N[(t$95$3 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.7e-266], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-272], N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[y, 5e-264], N[(t / N[(N[(x + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e+31], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{y \cdot \left(a - b\right)}{x + y}\\
t_2 := \left(z + a\right) - b\\
t_3 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+51}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-236}:\\
\;\;\;\;\frac{a}{\frac{t_3}{y + t}}\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-266}:\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-272}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right)}{t_3}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-264}:\\
\;\;\;\;\frac{t}{\frac{x + t}{a}}\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -5.5e51 or 1.95e31 < y Initial program 36.2%
Taylor expanded in y around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -5.5e51 < y < -4.19999999999999986e-192 or 5.0000000000000001e-264 < y < 1.95e31Initial program 80.2%
Simplified80.2%
Taylor expanded in t around 0 53.2%
Taylor expanded in z around 0 64.6%
if -4.19999999999999986e-192 < y < -6.5000000000000001e-236Initial program 76.6%
Taylor expanded in a around inf 47.2%
associate-/l*70.2%
Simplified70.2%
if -6.5000000000000001e-236 < y < -3.7000000000000003e-266Initial program 59.5%
Simplified59.7%
Taylor expanded in t around 0 45.1%
Taylor expanded in y around 0 72.5%
if -3.7000000000000003e-266 < y < 1.89999999999999985e-272Initial program 91.0%
Taylor expanded in z around inf 62.0%
if 1.89999999999999985e-272 < y < 5.0000000000000001e-264Initial program 76.5%
Taylor expanded in z around 0 76.5%
Taylor expanded in y around 0 76.5%
*-commutative76.5%
associate-/l*100.0%
Simplified100.0%
Final simplification69.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ (* y (- a b)) (+ x y))))
(t_2 (- (+ z a) b))
(t_3 (+ y (+ x t))))
(if (<= y -4.8e+51)
t_2
(if (<= y -2.8e-192)
t_1
(if (<= y -4.8e-237)
(/ a (/ t_3 (+ y t)))
(if (<= y -4.4e-265)
(+ z (* y (- (/ a x) (/ b x))))
(if (<= y 6.5e-273)
(/ (+ x y) (/ t_3 z))
(if (<= y 3.2e-262)
(/ t (/ (+ x t) a))
(if (<= y 1.6e+36) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double t_3 = y + (x + t);
double tmp;
if (y <= -4.8e+51) {
tmp = t_2;
} else if (y <= -2.8e-192) {
tmp = t_1;
} else if (y <= -4.8e-237) {
tmp = a / (t_3 / (y + t));
} else if (y <= -4.4e-265) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (y <= 6.5e-273) {
tmp = (x + y) / (t_3 / z);
} else if (y <= 3.2e-262) {
tmp = t / ((x + t) / a);
} else if (y <= 1.6e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = z + ((y * (a - b)) / (x + y))
t_2 = (z + a) - b
t_3 = y + (x + t)
if (y <= (-4.8d+51)) then
tmp = t_2
else if (y <= (-2.8d-192)) then
tmp = t_1
else if (y <= (-4.8d-237)) then
tmp = a / (t_3 / (y + t))
else if (y <= (-4.4d-265)) then
tmp = z + (y * ((a / x) - (b / x)))
else if (y <= 6.5d-273) then
tmp = (x + y) / (t_3 / z)
else if (y <= 3.2d-262) then
tmp = t / ((x + t) / a)
else if (y <= 1.6d+36) then
tmp = t_1
else
tmp = 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 t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double t_3 = y + (x + t);
double tmp;
if (y <= -4.8e+51) {
tmp = t_2;
} else if (y <= -2.8e-192) {
tmp = t_1;
} else if (y <= -4.8e-237) {
tmp = a / (t_3 / (y + t));
} else if (y <= -4.4e-265) {
tmp = z + (y * ((a / x) - (b / x)));
} else if (y <= 6.5e-273) {
tmp = (x + y) / (t_3 / z);
} else if (y <= 3.2e-262) {
tmp = t / ((x + t) / a);
} else if (y <= 1.6e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + ((y * (a - b)) / (x + y)) t_2 = (z + a) - b t_3 = y + (x + t) tmp = 0 if y <= -4.8e+51: tmp = t_2 elif y <= -2.8e-192: tmp = t_1 elif y <= -4.8e-237: tmp = a / (t_3 / (y + t)) elif y <= -4.4e-265: tmp = z + (y * ((a / x) - (b / x))) elif y <= 6.5e-273: tmp = (x + y) / (t_3 / z) elif y <= 3.2e-262: tmp = t / ((x + t) / a) elif y <= 1.6e+36: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))) t_2 = Float64(Float64(z + a) - b) t_3 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -4.8e+51) tmp = t_2; elseif (y <= -2.8e-192) tmp = t_1; elseif (y <= -4.8e-237) tmp = Float64(a / Float64(t_3 / Float64(y + t))); elseif (y <= -4.4e-265) tmp = Float64(z + Float64(y * Float64(Float64(a / x) - Float64(b / x)))); elseif (y <= 6.5e-273) tmp = Float64(Float64(x + y) / Float64(t_3 / z)); elseif (y <= 3.2e-262) tmp = Float64(t / Float64(Float64(x + t) / a)); elseif (y <= 1.6e+36) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + ((y * (a - b)) / (x + y)); t_2 = (z + a) - b; t_3 = y + (x + t); tmp = 0.0; if (y <= -4.8e+51) tmp = t_2; elseif (y <= -2.8e-192) tmp = t_1; elseif (y <= -4.8e-237) tmp = a / (t_3 / (y + t)); elseif (y <= -4.4e-265) tmp = z + (y * ((a / x) - (b / x))); elseif (y <= 6.5e-273) tmp = (x + y) / (t_3 / z); elseif (y <= 3.2e-262) tmp = t / ((x + t) / a); elseif (y <= 1.6e+36) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.8e+51], t$95$2, If[LessEqual[y, -2.8e-192], t$95$1, If[LessEqual[y, -4.8e-237], N[(a / N[(t$95$3 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.4e-265], N[(z + N[(y * N[(N[(a / x), $MachinePrecision] - N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-273], N[(N[(x + y), $MachinePrecision] / N[(t$95$3 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-262], N[(t / N[(N[(x + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+36], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{y \cdot \left(a - b\right)}{x + y}\\
t_2 := \left(z + a\right) - b\\
t_3 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{+51}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-237}:\\
\;\;\;\;\frac{a}{\frac{t_3}{y + t}}\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-265}:\\
\;\;\;\;z + y \cdot \left(\frac{a}{x} - \frac{b}{x}\right)\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-273}:\\
\;\;\;\;\frac{x + y}{\frac{t_3}{z}}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-262}:\\
\;\;\;\;\frac{t}{\frac{x + t}{a}}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -4.7999999999999997e51 or 1.5999999999999999e36 < y Initial program 36.2%
Taylor expanded in y around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -4.7999999999999997e51 < y < -2.80000000000000004e-192 or 3.2e-262 < y < 1.5999999999999999e36Initial program 80.2%
Simplified80.2%
Taylor expanded in t around 0 53.2%
Taylor expanded in z around 0 64.6%
if -2.80000000000000004e-192 < y < -4.8e-237Initial program 76.6%
Taylor expanded in a around inf 47.2%
associate-/l*70.2%
Simplified70.2%
if -4.8e-237 < y < -4.40000000000000021e-265Initial program 68.6%
Simplified68.8%
Taylor expanded in t around 0 51.8%
Taylor expanded in y around 0 67.9%
if -4.40000000000000021e-265 < y < 6.49999999999999979e-273Initial program 83.8%
Taylor expanded in z around inf 57.2%
associate-/l*68.3%
Simplified68.3%
if 6.49999999999999979e-273 < y < 3.2e-262Initial program 76.5%
Taylor expanded in z around 0 76.5%
Taylor expanded in y around 0 76.5%
*-commutative76.5%
associate-/l*100.0%
Simplified100.0%
Final simplification69.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ (* y (- a b)) (+ x y)))) (t_2 (- (+ z a) b)))
(if (<= y -9.6e+44)
t_2
(if (<= y -6.8e-203)
t_1
(if (<= y -1.1e-236)
(/ t (/ (+ x t) a))
(if (<= y -1e-308)
(/ (* x z) (+ y (+ x t)))
(if (<= y 6.1e-264) (+ z a) (if (<= y 2.2e+36) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (y <= -9.6e+44) {
tmp = t_2;
} else if (y <= -6.8e-203) {
tmp = t_1;
} else if (y <= -1.1e-236) {
tmp = t / ((x + t) / a);
} else if (y <= -1e-308) {
tmp = (x * z) / (y + (x + t));
} else if (y <= 6.1e-264) {
tmp = z + a;
} else if (y <= 2.2e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z + ((y * (a - b)) / (x + y))
t_2 = (z + a) - b
if (y <= (-9.6d+44)) then
tmp = t_2
else if (y <= (-6.8d-203)) then
tmp = t_1
else if (y <= (-1.1d-236)) then
tmp = t / ((x + t) / a)
else if (y <= (-1d-308)) then
tmp = (x * z) / (y + (x + t))
else if (y <= 6.1d-264) then
tmp = z + a
else if (y <= 2.2d+36) then
tmp = t_1
else
tmp = 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 t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (y <= -9.6e+44) {
tmp = t_2;
} else if (y <= -6.8e-203) {
tmp = t_1;
} else if (y <= -1.1e-236) {
tmp = t / ((x + t) / a);
} else if (y <= -1e-308) {
tmp = (x * z) / (y + (x + t));
} else if (y <= 6.1e-264) {
tmp = z + a;
} else if (y <= 2.2e+36) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + ((y * (a - b)) / (x + y)) t_2 = (z + a) - b tmp = 0 if y <= -9.6e+44: tmp = t_2 elif y <= -6.8e-203: tmp = t_1 elif y <= -1.1e-236: tmp = t / ((x + t) / a) elif y <= -1e-308: tmp = (x * z) / (y + (x + t)) elif y <= 6.1e-264: tmp = z + a elif y <= 2.2e+36: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -9.6e+44) tmp = t_2; elseif (y <= -6.8e-203) tmp = t_1; elseif (y <= -1.1e-236) tmp = Float64(t / Float64(Float64(x + t) / a)); elseif (y <= -1e-308) tmp = Float64(Float64(x * z) / Float64(y + Float64(x + t))); elseif (y <= 6.1e-264) tmp = Float64(z + a); elseif (y <= 2.2e+36) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + ((y * (a - b)) / (x + y)); t_2 = (z + a) - b; tmp = 0.0; if (y <= -9.6e+44) tmp = t_2; elseif (y <= -6.8e-203) tmp = t_1; elseif (y <= -1.1e-236) tmp = t / ((x + t) / a); elseif (y <= -1e-308) tmp = (x * z) / (y + (x + t)); elseif (y <= 6.1e-264) tmp = z + a; elseif (y <= 2.2e+36) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -9.6e+44], t$95$2, If[LessEqual[y, -6.8e-203], t$95$1, If[LessEqual[y, -1.1e-236], N[(t / N[(N[(x + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1e-308], N[(N[(x * z), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.1e-264], N[(z + a), $MachinePrecision], If[LessEqual[y, 2.2e+36], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{y \cdot \left(a - b\right)}{x + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -9.6 \cdot 10^{+44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-236}:\\
\;\;\;\;\frac{t}{\frac{x + t}{a}}\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-308}:\\
\;\;\;\;\frac{x \cdot z}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-264}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -9.60000000000000053e44 or 2.2e36 < y Initial program 38.0%
Taylor expanded in y around inf 73.9%
+-commutative73.9%
Simplified73.9%
if -9.60000000000000053e44 < y < -6.7999999999999998e-203 or 6.10000000000000025e-264 < y < 2.2e36Initial program 80.0%
Simplified80.0%
Taylor expanded in t around 0 52.0%
Taylor expanded in z around 0 63.5%
if -6.7999999999999998e-203 < y < -1.09999999999999996e-236Initial program 73.4%
Taylor expanded in z around 0 39.8%
Taylor expanded in y around 0 39.7%
*-commutative39.7%
associate-/l*65.6%
Simplified65.6%
if -1.09999999999999996e-236 < y < -9.9999999999999991e-309Initial program 78.0%
Taylor expanded in x around inf 53.7%
if -9.9999999999999991e-309 < y < 6.10000000000000025e-264Initial program 78.8%
Taylor expanded in y around inf 55.5%
+-commutative55.5%
Simplified55.5%
Taylor expanded in b around 0 66.2%
+-commutative66.2%
Simplified66.2%
Final simplification67.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -5.6e+86)
(- (+ a (+ z (* x (- (/ b y) (/ a y))))) b)
(if (<= y -2.55e-110)
(+ z (/ (* y (- a b)) (+ x y)))
(if (<= y 2.3e-160)
(/ (+ (* x z) (* t a)) (+ x t))
(if (<= y 2.2e-14) (/ (+ (* t a) (* y t_1)) (+ y t)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -5.6e+86) {
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b;
} else if (y <= -2.55e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 2.3e-160) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 2.2e-14) {
tmp = ((t * a) + (y * t_1)) / (y + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-5.6d+86)) then
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b
else if (y <= (-2.55d-110)) then
tmp = z + ((y * (a - b)) / (x + y))
else if (y <= 2.3d-160) then
tmp = ((x * z) + (t * a)) / (x + t)
else if (y <= 2.2d-14) then
tmp = ((t * a) + (y * t_1)) / (y + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -5.6e+86) {
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b;
} else if (y <= -2.55e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 2.3e-160) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 2.2e-14) {
tmp = ((t * a) + (y * t_1)) / (y + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -5.6e+86: tmp = (a + (z + (x * ((b / y) - (a / y))))) - b elif y <= -2.55e-110: tmp = z + ((y * (a - b)) / (x + y)) elif y <= 2.3e-160: tmp = ((x * z) + (t * a)) / (x + t) elif y <= 2.2e-14: tmp = ((t * a) + (y * t_1)) / (y + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -5.6e+86) tmp = Float64(Float64(a + Float64(z + Float64(x * Float64(Float64(b / y) - Float64(a / y))))) - b); elseif (y <= -2.55e-110) tmp = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))); elseif (y <= 2.3e-160) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); elseif (y <= 2.2e-14) tmp = Float64(Float64(Float64(t * a) + Float64(y * t_1)) / Float64(y + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -5.6e+86) tmp = (a + (z + (x * ((b / y) - (a / y))))) - b; elseif (y <= -2.55e-110) tmp = z + ((y * (a - b)) / (x + y)); elseif (y <= 2.3e-160) tmp = ((x * z) + (t * a)) / (x + t); elseif (y <= 2.2e-14) tmp = ((t * a) + (y * t_1)) / (y + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -5.6e+86], N[(N[(a + N[(z + N[(x * N[(N[(b / y), $MachinePrecision] - N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[y, -2.55e-110], N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e-160], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-14], N[(N[(N[(t * a), $MachinePrecision] + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{+86}:\\
\;\;\;\;\left(a + \left(z + x \cdot \left(\frac{b}{y} - \frac{a}{y}\right)\right)\right) - b\\
\mathbf{elif}\;y \leq -2.55 \cdot 10^{-110}:\\
\;\;\;\;z + \frac{y \cdot \left(a - b\right)}{x + y}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-160}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-14}:\\
\;\;\;\;\frac{t \cdot a + y \cdot t_1}{y + t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.60000000000000008e86Initial program 26.6%
Simplified27.1%
Taylor expanded in t around 0 24.8%
Taylor expanded in x around 0 73.4%
if -5.60000000000000008e86 < y < -2.5500000000000001e-110Initial program 73.8%
Simplified73.8%
Taylor expanded in t around 0 62.7%
Taylor expanded in z around 0 69.2%
if -2.5500000000000001e-110 < y < 2.29999999999999985e-160Initial program 81.0%
Taylor expanded in y around 0 71.3%
if 2.29999999999999985e-160 < y < 2.2000000000000001e-14Initial program 77.7%
Simplified77.7%
Taylor expanded in x around 0 64.8%
if 2.2000000000000001e-14 < y Initial program 50.9%
Taylor expanded in y around inf 76.2%
+-commutative76.2%
Simplified76.2%
Final simplification71.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -5.6e+84)
(- (+ a (+ z (* x (- (/ b y) (/ a y))))) b)
(if (<= y -2.35e-110)
(+ z (/ (* y (- a b)) (+ x y)))
(if (<= y 5.8e-170)
(/ (+ (* x z) (* t a)) (+ x t))
(if (<= y 3.1e-15)
(/ (- (* a (+ y t)) (* b y)) (+ y (+ x t)))
(- (+ z a) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.6e+84) {
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b;
} else if (y <= -2.35e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 5.8e-170) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 3.1e-15) {
tmp = ((a * (y + t)) - (b * y)) / (y + (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (y <= (-5.6d+84)) then
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b
else if (y <= (-2.35d-110)) then
tmp = z + ((y * (a - b)) / (x + y))
else if (y <= 5.8d-170) then
tmp = ((x * z) + (t * a)) / (x + t)
else if (y <= 3.1d-15) then
tmp = ((a * (y + t)) - (b * y)) / (y + (x + t))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.6e+84) {
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b;
} else if (y <= -2.35e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 5.8e-170) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 3.1e-15) {
tmp = ((a * (y + t)) - (b * y)) / (y + (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -5.6e+84: tmp = (a + (z + (x * ((b / y) - (a / y))))) - b elif y <= -2.35e-110: tmp = z + ((y * (a - b)) / (x + y)) elif y <= 5.8e-170: tmp = ((x * z) + (t * a)) / (x + t) elif y <= 3.1e-15: tmp = ((a * (y + t)) - (b * y)) / (y + (x + t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.6e+84) tmp = Float64(Float64(a + Float64(z + Float64(x * Float64(Float64(b / y) - Float64(a / y))))) - b); elseif (y <= -2.35e-110) tmp = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))); elseif (y <= 5.8e-170) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); elseif (y <= 3.1e-15) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(b * y)) / Float64(y + Float64(x + t))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -5.6e+84) tmp = (a + (z + (x * ((b / y) - (a / y))))) - b; elseif (y <= -2.35e-110) tmp = z + ((y * (a - b)) / (x + y)); elseif (y <= 5.8e-170) tmp = ((x * z) + (t * a)) / (x + t); elseif (y <= 3.1e-15) tmp = ((a * (y + t)) - (b * y)) / (y + (x + t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.6e+84], N[(N[(a + N[(z + N[(x * N[(N[(b / y), $MachinePrecision] - N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[y, -2.35e-110], N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-170], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e-15], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+84}:\\
\;\;\;\;\left(a + \left(z + x \cdot \left(\frac{b}{y} - \frac{a}{y}\right)\right)\right) - b\\
\mathbf{elif}\;y \leq -2.35 \cdot 10^{-110}:\\
\;\;\;\;z + \frac{y \cdot \left(a - b\right)}{x + y}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-170}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-15}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - b \cdot y}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if y < -5.59999999999999963e84Initial program 26.6%
Simplified27.1%
Taylor expanded in t around 0 24.8%
Taylor expanded in x around 0 73.4%
if -5.59999999999999963e84 < y < -2.34999999999999996e-110Initial program 73.8%
Simplified73.8%
Taylor expanded in t around 0 62.7%
Taylor expanded in z around 0 69.2%
if -2.34999999999999996e-110 < y < 5.8000000000000001e-170Initial program 80.5%
Taylor expanded in y around 0 71.9%
if 5.8000000000000001e-170 < y < 3.0999999999999999e-15Initial program 79.0%
Taylor expanded in z around 0 66.9%
if 3.0999999999999999e-15 < y Initial program 50.9%
Taylor expanded in y around inf 76.2%
+-commutative76.2%
Simplified76.2%
Final simplification72.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t))) (t_2 (+ y (+ x t))))
(if (<= y -1.25e+86)
(- (+ a (+ z (* x (- (/ b y) (/ a y))))) b)
(if (<= y -3.1e-110)
(+ z (/ (* y (- a b)) (+ x y)))
(if (<= y 4.1e-131)
(/ (+ (* z (+ x y)) t_1) t_2)
(if (<= y 1.9e-14) (/ (- t_1 (* b y)) t_2) (- (+ z a) b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double tmp;
if (y <= -1.25e+86) {
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b;
} else if (y <= -3.1e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 4.1e-131) {
tmp = ((z * (x + y)) + t_1) / t_2;
} else if (y <= 1.9e-14) {
tmp = (t_1 - (b * y)) / t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * (y + t)
t_2 = y + (x + t)
if (y <= (-1.25d+86)) then
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b
else if (y <= (-3.1d-110)) then
tmp = z + ((y * (a - b)) / (x + y))
else if (y <= 4.1d-131) then
tmp = ((z * (x + y)) + t_1) / t_2
else if (y <= 1.9d-14) then
tmp = (t_1 - (b * y)) / t_2
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double tmp;
if (y <= -1.25e+86) {
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b;
} else if (y <= -3.1e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 4.1e-131) {
tmp = ((z * (x + y)) + t_1) / t_2;
} else if (y <= 1.9e-14) {
tmp = (t_1 - (b * y)) / t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) tmp = 0 if y <= -1.25e+86: tmp = (a + (z + (x * ((b / y) - (a / y))))) - b elif y <= -3.1e-110: tmp = z + ((y * (a - b)) / (x + y)) elif y <= 4.1e-131: tmp = ((z * (x + y)) + t_1) / t_2 elif y <= 1.9e-14: tmp = (t_1 - (b * y)) / t_2 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -1.25e+86) tmp = Float64(Float64(a + Float64(z + Float64(x * Float64(Float64(b / y) - Float64(a / y))))) - b); elseif (y <= -3.1e-110) tmp = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))); elseif (y <= 4.1e-131) tmp = Float64(Float64(Float64(z * Float64(x + y)) + t_1) / t_2); elseif (y <= 1.9e-14) tmp = Float64(Float64(t_1 - Float64(b * y)) / t_2); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); tmp = 0.0; if (y <= -1.25e+86) tmp = (a + (z + (x * ((b / y) - (a / y))))) - b; elseif (y <= -3.1e-110) tmp = z + ((y * (a - b)) / (x + y)); elseif (y <= 4.1e-131) tmp = ((z * (x + y)) + t_1) / t_2; elseif (y <= 1.9e-14) tmp = (t_1 - (b * y)) / t_2; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+86], N[(N[(a + N[(z + N[(x * N[(N[(b / y), $MachinePrecision] - N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[y, -3.1e-110], N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e-131], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[y, 1.9e-14], N[(N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+86}:\\
\;\;\;\;\left(a + \left(z + x \cdot \left(\frac{b}{y} - \frac{a}{y}\right)\right)\right) - b\\
\mathbf{elif}\;y \leq -3.1 \cdot 10^{-110}:\\
\;\;\;\;z + \frac{y \cdot \left(a - b\right)}{x + y}\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-131}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) + t_1}{t_2}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-14}:\\
\;\;\;\;\frac{t_1 - b \cdot y}{t_2}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if y < -1.2499999999999999e86Initial program 26.6%
Simplified27.1%
Taylor expanded in t around 0 24.8%
Taylor expanded in x around 0 73.4%
if -1.2499999999999999e86 < y < -3.10000000000000007e-110Initial program 73.8%
Simplified73.8%
Taylor expanded in t around 0 62.7%
Taylor expanded in z around 0 69.2%
if -3.10000000000000007e-110 < y < 4.1000000000000002e-131Initial program 78.8%
Taylor expanded in b around 0 73.2%
if 4.1000000000000002e-131 < y < 1.9000000000000001e-14Initial program 84.0%
Taylor expanded in z around 0 75.3%
if 1.9000000000000001e-14 < y Initial program 50.9%
Taylor expanded in y around inf 76.2%
+-commutative76.2%
Simplified76.2%
Final simplification73.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -5.6e+42)
t_1
(if (<= y -2.9e-110)
(+ z (/ (* y (- a b)) (+ x y)))
(if (<= y 2e-164)
(/ (+ (* x z) (* t a)) (+ x t))
(if (<= y 3.6e-32)
(/ (* y t_1) (+ y (+ x t)))
(if (<= y 3.8e-32) a t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -5.6e+42) {
tmp = t_1;
} else if (y <= -2.9e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 2e-164) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 3.6e-32) {
tmp = (y * t_1) / (y + (x + t));
} else if (y <= 3.8e-32) {
tmp = a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-5.6d+42)) then
tmp = t_1
else if (y <= (-2.9d-110)) then
tmp = z + ((y * (a - b)) / (x + y))
else if (y <= 2d-164) then
tmp = ((x * z) + (t * a)) / (x + t)
else if (y <= 3.6d-32) then
tmp = (y * t_1) / (y + (x + t))
else if (y <= 3.8d-32) then
tmp = a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -5.6e+42) {
tmp = t_1;
} else if (y <= -2.9e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 2e-164) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 3.6e-32) {
tmp = (y * t_1) / (y + (x + t));
} else if (y <= 3.8e-32) {
tmp = a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -5.6e+42: tmp = t_1 elif y <= -2.9e-110: tmp = z + ((y * (a - b)) / (x + y)) elif y <= 2e-164: tmp = ((x * z) + (t * a)) / (x + t) elif y <= 3.6e-32: tmp = (y * t_1) / (y + (x + t)) elif y <= 3.8e-32: tmp = a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -5.6e+42) tmp = t_1; elseif (y <= -2.9e-110) tmp = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))); elseif (y <= 2e-164) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); elseif (y <= 3.6e-32) tmp = Float64(Float64(y * t_1) / Float64(y + Float64(x + t))); elseif (y <= 3.8e-32) tmp = a; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -5.6e+42) tmp = t_1; elseif (y <= -2.9e-110) tmp = z + ((y * (a - b)) / (x + y)); elseif (y <= 2e-164) tmp = ((x * z) + (t * a)) / (x + t); elseif (y <= 3.6e-32) tmp = (y * t_1) / (y + (x + t)); elseif (y <= 3.8e-32) tmp = a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -5.6e+42], t$95$1, If[LessEqual[y, -2.9e-110], N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-164], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e-32], N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-32], a, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -5.6 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-110}:\\
\;\;\;\;z + \frac{y \cdot \left(a - b\right)}{x + y}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-164}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-32}:\\
\;\;\;\;\frac{y \cdot t_1}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-32}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.5999999999999999e42 or 3.80000000000000008e-32 < y Initial program 45.7%
Taylor expanded in y around inf 74.2%
+-commutative74.2%
Simplified74.2%
if -5.5999999999999999e42 < y < -2.9000000000000002e-110Initial program 74.4%
Simplified74.4%
Taylor expanded in t around 0 62.1%
Taylor expanded in z around 0 70.4%
if -2.9000000000000002e-110 < y < 1.99999999999999992e-164Initial program 80.5%
Taylor expanded in y around 0 71.9%
if 1.99999999999999992e-164 < y < 3.59999999999999993e-32Initial program 75.0%
Taylor expanded in y around inf 49.4%
+-commutative49.4%
Simplified49.4%
if 3.59999999999999993e-32 < y < 3.80000000000000008e-32Initial program 98.4%
Taylor expanded in t around inf 96.4%
Final simplification70.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.4e+84)
(- (+ a (+ z (* x (- (/ b y) (/ a y))))) b)
(if (<= y -3e-110)
(+ z (/ (* y (- a b)) (+ x y)))
(if (<= y 1.55e-164)
(/ (+ (* x z) (* t a)) (+ x t))
(if (<= y 3.2e-32)
(/ (* y t_1) (+ y (+ x t)))
(if (<= y 3.8e-32) a t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2.4e+84) {
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b;
} else if (y <= -3e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 1.55e-164) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 3.2e-32) {
tmp = (y * t_1) / (y + (x + t));
} else if (y <= 3.8e-32) {
tmp = a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-2.4d+84)) then
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b
else if (y <= (-3d-110)) then
tmp = z + ((y * (a - b)) / (x + y))
else if (y <= 1.55d-164) then
tmp = ((x * z) + (t * a)) / (x + t)
else if (y <= 3.2d-32) then
tmp = (y * t_1) / (y + (x + t))
else if (y <= 3.8d-32) then
tmp = a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2.4e+84) {
tmp = (a + (z + (x * ((b / y) - (a / y))))) - b;
} else if (y <= -3e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 1.55e-164) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 3.2e-32) {
tmp = (y * t_1) / (y + (x + t));
} else if (y <= 3.8e-32) {
tmp = a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.4e+84: tmp = (a + (z + (x * ((b / y) - (a / y))))) - b elif y <= -3e-110: tmp = z + ((y * (a - b)) / (x + y)) elif y <= 1.55e-164: tmp = ((x * z) + (t * a)) / (x + t) elif y <= 3.2e-32: tmp = (y * t_1) / (y + (x + t)) elif y <= 3.8e-32: tmp = a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.4e+84) tmp = Float64(Float64(a + Float64(z + Float64(x * Float64(Float64(b / y) - Float64(a / y))))) - b); elseif (y <= -3e-110) tmp = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))); elseif (y <= 1.55e-164) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); elseif (y <= 3.2e-32) tmp = Float64(Float64(y * t_1) / Float64(y + Float64(x + t))); elseif (y <= 3.8e-32) tmp = a; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -2.4e+84) tmp = (a + (z + (x * ((b / y) - (a / y))))) - b; elseif (y <= -3e-110) tmp = z + ((y * (a - b)) / (x + y)); elseif (y <= 1.55e-164) tmp = ((x * z) + (t * a)) / (x + t); elseif (y <= 3.2e-32) tmp = (y * t_1) / (y + (x + t)); elseif (y <= 3.8e-32) tmp = a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.4e+84], N[(N[(a + N[(z + N[(x * N[(N[(b / y), $MachinePrecision] - N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[y, -3e-110], N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e-164], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-32], N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-32], a, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+84}:\\
\;\;\;\;\left(a + \left(z + x \cdot \left(\frac{b}{y} - \frac{a}{y}\right)\right)\right) - b\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-110}:\\
\;\;\;\;z + \frac{y \cdot \left(a - b\right)}{x + y}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-164}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-32}:\\
\;\;\;\;\frac{y \cdot t_1}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-32}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.4e84Initial program 26.6%
Simplified27.1%
Taylor expanded in t around 0 24.8%
Taylor expanded in x around 0 73.4%
if -2.4e84 < y < -2.99999999999999986e-110Initial program 73.8%
Simplified73.8%
Taylor expanded in t around 0 62.7%
Taylor expanded in z around 0 69.2%
if -2.99999999999999986e-110 < y < 1.55e-164Initial program 80.5%
Taylor expanded in y around 0 71.9%
if 1.55e-164 < y < 3.2000000000000002e-32Initial program 75.0%
Taylor expanded in y around inf 49.4%
+-commutative49.4%
Simplified49.4%
if 3.2000000000000002e-32 < y < 3.80000000000000008e-32Initial program 98.4%
Taylor expanded in t around inf 96.4%
if 3.80000000000000008e-32 < y Initial program 55.3%
Taylor expanded in y around inf 76.1%
+-commutative76.1%
Simplified76.1%
Final simplification70.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2e+45)
t_1
(if (<= y -2.35e-110)
(+ z (/ (* y (- a b)) (+ x y)))
(if (<= y 7.4e-32) (/ (+ (* x z) (* t a)) (+ x t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2e+45) {
tmp = t_1;
} else if (y <= -2.35e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 7.4e-32) {
tmp = ((x * z) + (t * a)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-2d+45)) then
tmp = t_1
else if (y <= (-2.35d-110)) then
tmp = z + ((y * (a - b)) / (x + y))
else if (y <= 7.4d-32) then
tmp = ((x * z) + (t * a)) / (x + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -2e+45) {
tmp = t_1;
} else if (y <= -2.35e-110) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (y <= 7.4e-32) {
tmp = ((x * z) + (t * a)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2e+45: tmp = t_1 elif y <= -2.35e-110: tmp = z + ((y * (a - b)) / (x + y)) elif y <= 7.4e-32: tmp = ((x * z) + (t * a)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2e+45) tmp = t_1; elseif (y <= -2.35e-110) tmp = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))); elseif (y <= 7.4e-32) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -2e+45) tmp = t_1; elseif (y <= -2.35e-110) tmp = z + ((y * (a - b)) / (x + y)); elseif (y <= 7.4e-32) tmp = ((x * z) + (t * a)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2e+45], t$95$1, If[LessEqual[y, -2.35e-110], N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-32], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2 \cdot 10^{+45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.35 \cdot 10^{-110}:\\
\;\;\;\;z + \frac{y \cdot \left(a - b\right)}{x + y}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.9999999999999999e45 or 7.4e-32 < y Initial program 45.7%
Taylor expanded in y around inf 74.2%
+-commutative74.2%
Simplified74.2%
if -1.9999999999999999e45 < y < -2.34999999999999996e-110Initial program 74.4%
Simplified74.4%
Taylor expanded in t around 0 62.1%
Taylor expanded in z around 0 70.4%
if -2.34999999999999996e-110 < y < 7.4e-32Initial program 79.4%
Taylor expanded in y around 0 61.9%
Final simplification69.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9e-105) (not (<= y 8.6e-32))) (- (+ z a) b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9e-105) || !(y <= 8.6e-32)) {
tmp = (z + a) - b;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if ((y <= (-9d-105)) .or. (.not. (y <= 8.6d-32))) then
tmp = (z + a) - b
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9e-105) || !(y <= 8.6e-32)) {
tmp = (z + a) - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9e-105) or not (y <= 8.6e-32): tmp = (z + a) - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9e-105) || !(y <= 8.6e-32)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -9e-105) || ~((y <= 8.6e-32))) tmp = (z + a) - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9e-105], N[Not[LessEqual[y, 8.6e-32]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-105} \lor \neg \left(y \leq 8.6 \cdot 10^{-32}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if y < -8.9999999999999995e-105 or 8.5999999999999998e-32 < y Initial program 51.6%
Taylor expanded in y around inf 69.2%
+-commutative69.2%
Simplified69.2%
if -8.9999999999999995e-105 < y < 8.5999999999999998e-32Initial program 78.8%
Taylor expanded in y around inf 37.0%
+-commutative37.0%
Simplified37.0%
Taylor expanded in b around 0 46.5%
+-commutative46.5%
Simplified46.5%
Final simplification60.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2e+133) z (if (<= x 1.65e-77) (- a b) (+ z a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2e+133) {
tmp = z;
} else if (x <= 1.65e-77) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-2d+133)) then
tmp = z
else if (x <= 1.65d-77) then
tmp = a - b
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2e+133) {
tmp = z;
} else if (x <= 1.65e-77) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2e+133: tmp = z elif x <= 1.65e-77: tmp = a - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2e+133) tmp = z; elseif (x <= 1.65e-77) tmp = Float64(a - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2e+133) tmp = z; elseif (x <= 1.65e-77) tmp = a - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2e+133], z, If[LessEqual[x, 1.65e-77], N[(a - b), $MachinePrecision], N[(z + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+133}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-77}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if x < -2e133Initial program 43.3%
Taylor expanded in x around inf 51.7%
if -2e133 < x < 1.64999999999999996e-77Initial program 66.7%
Taylor expanded in y around inf 65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in z around 0 58.5%
if 1.64999999999999996e-77 < x Initial program 61.6%
Taylor expanded in y around inf 47.8%
+-commutative47.8%
Simplified47.8%
Taylor expanded in b around 0 48.2%
+-commutative48.2%
Simplified48.2%
Final simplification54.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6e+118) z (if (<= x 6.5e-61) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6e+118) {
tmp = z;
} else if (x <= 6.5e-61) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (x <= (-6d+118)) then
tmp = z
else if (x <= 6.5d-61) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6e+118) {
tmp = z;
} else if (x <= 6.5e-61) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6e+118: tmp = z elif x <= 6.5e-61: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6e+118) tmp = z; elseif (x <= 6.5e-61) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6e+118) tmp = z; elseif (x <= 6.5e-61) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6e+118], z, If[LessEqual[x, 6.5e-61], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+118}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-61}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -6e118 or 6.4999999999999994e-61 < x Initial program 55.6%
Taylor expanded in x around inf 43.4%
if -6e118 < x < 6.4999999999999994e-61Initial program 67.7%
Taylor expanded in t around inf 45.0%
Final simplification44.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b 2.4e+209) (+ z a) (- b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 2.4e+209) {
tmp = z + a;
} else {
tmp = -b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (b <= 2.4d+209) then
tmp = z + a
else
tmp = -b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 2.4e+209) {
tmp = z + a;
} else {
tmp = -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 2.4e+209: tmp = z + a else: tmp = -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 2.4e+209) tmp = Float64(z + a); else tmp = Float64(-b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 2.4e+209) tmp = z + a; else tmp = -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 2.4e+209], N[(z + a), $MachinePrecision], (-b)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.4 \cdot 10^{+209}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;-b\\
\end{array}
\end{array}
if b < 2.39999999999999996e209Initial program 62.6%
Taylor expanded in y around inf 57.9%
+-commutative57.9%
Simplified57.9%
Taylor expanded in b around 0 50.4%
+-commutative50.4%
Simplified50.4%
if 2.39999999999999996e209 < b Initial program 57.7%
Taylor expanded in y around inf 45.7%
+-commutative45.7%
Simplified45.7%
Taylor expanded in b around inf 41.6%
neg-mul-141.6%
Simplified41.6%
Final simplification49.6%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
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
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 62.1%
Taylor expanded in t around inf 30.9%
Final simplification30.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t_2}{t_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t_1}{t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
herbie shell --seed 2023195
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))