
(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 17 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 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* z (+ x y)) t_1) (* y b)) t_2)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 5e+241)))
(+ (/ a (/ t_2 (+ y t))) (/ z (/ t_2 (+ x y))))
(/ (- (fma (+ x y) z t_1) (* y b)) (+ x (+ y t))))))
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)) + t_1) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 5e+241)) {
tmp = (a / (t_2 / (y + t))) + (z / (t_2 / (x + y)));
} else {
tmp = (fma((x + y), z, t_1) - (y * b)) / (x + (y + t));
}
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(Float64(Float64(Float64(z * Float64(x + y)) + t_1) - Float64(y * b)) / t_2) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 5e+241)) tmp = Float64(Float64(a / Float64(t_2 / Float64(y + t))) + Float64(z / Float64(t_2 / Float64(x + y)))); else tmp = Float64(Float64(fma(Float64(x + y), z, t_1) - Float64(y * b)) / Float64(x + Float64(y + t))); end return 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[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 5e+241]], $MachinePrecision]], N[(N[(a / N[(t$95$2 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / N[(t$95$2 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $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 := \frac{\left(z \cdot \left(x + y\right) + t\_1\right) - y \cdot b}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty \lor \neg \left(t\_3 \leq 5 \cdot 10^{+241}\right):\\
\;\;\;\;\frac{a}{\frac{t\_2}{y + t}} + \frac{z}{\frac{t\_2}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_1\right) - y \cdot b}{x + \left(y + t\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.0 or 5.00000000000000025e241 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.0%
Taylor expanded in z around inf 7.0%
associate--l+7.0%
associate-/l*36.9%
associate-+r+36.9%
div-sub36.9%
Simplified36.7%
Taylor expanded in z around inf 39.3%
associate-/l*81.3%
+-commutative81.3%
associate-+r+81.3%
associate-+r+81.3%
+-commutative81.3%
associate-+r+81.3%
+-commutative81.3%
Simplified81.3%
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.00000000000000025e241Initial program 99.8%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification91.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+241)))
(+ (/ a (/ t_1 (+ y t))) (/ z (/ t_1 (+ x y))))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+241)) {
tmp = (a / (t_1 / (y + t))) + (z / (t_1 / (x + y)));
} else {
tmp = t_2;
}
return tmp;
}
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 * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+241)) {
tmp = (a / (t_1 / (y + t))) + (z / (t_1 / (x + y)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+241): tmp = (a / (t_1 / (y + t))) + (z / (t_1 / (x + y))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+241)) tmp = Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(z / Float64(t_1 / Float64(x + y)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+241))) tmp = (a / (t_1 / (y + t))) + (z / (t_1 / (x + y))); else tmp = t_2; 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[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+241]], $MachinePrecision]], N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z / N[(t$95$1 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 5 \cdot 10^{+241}\right):\\
\;\;\;\;\frac{a}{\frac{t\_1}{y + t}} + \frac{z}{\frac{t\_1}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;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.00000000000000025e241 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.0%
Taylor expanded in z around inf 7.0%
associate--l+7.0%
associate-/l*36.9%
associate-+r+36.9%
div-sub36.9%
Simplified36.7%
Taylor expanded in z around inf 39.3%
associate-/l*81.3%
+-commutative81.3%
associate-+r+81.3%
associate-+r+81.3%
+-commutative81.3%
associate-+r+81.3%
+-commutative81.3%
Simplified81.3%
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.00000000000000025e241Initial program 99.8%
Final simplification91.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+301)))
(+ (/ a (/ t_1 (+ y t))) (- z b))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+301)) {
tmp = (a / (t_1 / (y + t))) + (z - b);
} else {
tmp = t_2;
}
return tmp;
}
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 * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+301)) {
tmp = (a / (t_1 / (y + t))) + (z - b);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 1e+301): tmp = (a / (t_1 / (y + t))) + (z - b) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 1e+301)) tmp = Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(z - b)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+301))) tmp = (a / (t_1 / (y + t))) + (z - b); else tmp = t_2; 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[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 1e+301]], $MachinePrecision]], N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z - b), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+301}\right):\\
\;\;\;\;\frac{a}{\frac{t\_1}{y + t}} + \left(z - b\right)\\
\mathbf{else}:\\
\;\;\;\;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.00000000000000005e301 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.4%
Taylor expanded in z around inf 5.4%
associate--l+5.4%
associate-/l*35.8%
associate-+r+35.8%
div-sub35.8%
Simplified35.5%
Taylor expanded in y around inf 79.9%
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.00000000000000005e301Initial program 99.8%
Final simplification91.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (/ z (/ (+ y t) y)))) (t_2 (- (+ z a) b)))
(if (<= x -2.45e+206)
z
(if (<= x -4.1e-116)
t_2
(if (<= x 5.3e-20)
t_1
(if (<= x 1.05e+54)
t_2
(if (<= x 1.2e+133) t_1 (* z (/ x (+ x t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (z / ((y + t) / y));
double t_2 = (z + a) - b;
double tmp;
if (x <= -2.45e+206) {
tmp = z;
} else if (x <= -4.1e-116) {
tmp = t_2;
} else if (x <= 5.3e-20) {
tmp = t_1;
} else if (x <= 1.05e+54) {
tmp = t_2;
} else if (x <= 1.2e+133) {
tmp = t_1;
} else {
tmp = z * (x / (x + t));
}
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 + (z / ((y + t) / y))
t_2 = (z + a) - b
if (x <= (-2.45d+206)) then
tmp = z
else if (x <= (-4.1d-116)) then
tmp = t_2
else if (x <= 5.3d-20) then
tmp = t_1
else if (x <= 1.05d+54) then
tmp = t_2
else if (x <= 1.2d+133) then
tmp = t_1
else
tmp = z * (x / (x + t))
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 + (z / ((y + t) / y));
double t_2 = (z + a) - b;
double tmp;
if (x <= -2.45e+206) {
tmp = z;
} else if (x <= -4.1e-116) {
tmp = t_2;
} else if (x <= 5.3e-20) {
tmp = t_1;
} else if (x <= 1.05e+54) {
tmp = t_2;
} else if (x <= 1.2e+133) {
tmp = t_1;
} else {
tmp = z * (x / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (z / ((y + t) / y)) t_2 = (z + a) - b tmp = 0 if x <= -2.45e+206: tmp = z elif x <= -4.1e-116: tmp = t_2 elif x <= 5.3e-20: tmp = t_1 elif x <= 1.05e+54: tmp = t_2 elif x <= 1.2e+133: tmp = t_1 else: tmp = z * (x / (x + t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(z / Float64(Float64(y + t) / y))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (x <= -2.45e+206) tmp = z; elseif (x <= -4.1e-116) tmp = t_2; elseif (x <= 5.3e-20) tmp = t_1; elseif (x <= 1.05e+54) tmp = t_2; elseif (x <= 1.2e+133) tmp = t_1; else tmp = Float64(z * Float64(x / Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (z / ((y + t) / y)); t_2 = (z + a) - b; tmp = 0.0; if (x <= -2.45e+206) tmp = z; elseif (x <= -4.1e-116) tmp = t_2; elseif (x <= 5.3e-20) tmp = t_1; elseif (x <= 1.05e+54) tmp = t_2; elseif (x <= 1.2e+133) tmp = t_1; else tmp = z * (x / (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(z / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[x, -2.45e+206], z, If[LessEqual[x, -4.1e-116], t$95$2, If[LessEqual[x, 5.3e-20], t$95$1, If[LessEqual[x, 1.05e+54], t$95$2, If[LessEqual[x, 1.2e+133], t$95$1, N[(z * N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \frac{z}{\frac{y + t}{y}}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;x \leq -2.45 \cdot 10^{+206}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-116}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x}{x + t}\\
\end{array}
\end{array}
if x < -2.45e206Initial program 50.4%
Taylor expanded in x around inf 80.7%
if -2.45e206 < x < -4.0999999999999999e-116 or 5.3000000000000002e-20 < x < 1.04999999999999993e54Initial program 57.2%
Taylor expanded in y around inf 65.6%
if -4.0999999999999999e-116 < x < 5.3000000000000002e-20 or 1.04999999999999993e54 < x < 1.1999999999999999e133Initial program 69.1%
Taylor expanded in z around inf 69.1%
associate--l+69.1%
associate-/l*79.0%
associate-+r+79.0%
div-sub79.0%
Simplified79.1%
Taylor expanded in z around inf 67.8%
associate-/l*79.4%
+-commutative79.4%
associate-+r+79.4%
associate-+r+79.4%
+-commutative79.4%
associate-+r+79.4%
+-commutative79.4%
Simplified79.4%
Taylor expanded in t around inf 76.1%
Taylor expanded in x around 0 73.3%
+-commutative73.3%
Simplified73.3%
if 1.1999999999999999e133 < x Initial program 33.6%
Taylor expanded in y around 0 30.8%
Taylor expanded in a around 0 23.1%
associate-/l*52.8%
associate-/r/63.5%
+-commutative63.5%
Simplified63.5%
Final simplification70.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ z (/ t_1 (+ x y)))))
(if (<= z -7e+136)
t_2
(if (<= z -1350000000000.0)
(- (+ z a) b)
(if (<= z -2e-144)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= z 8.5e+29) (/ a (/ t_1 (+ y t))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = z / (t_1 / (x + y));
double tmp;
if (z <= -7e+136) {
tmp = t_2;
} else if (z <= -1350000000000.0) {
tmp = (z + a) - b;
} else if (z <= -2e-144) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (z <= 8.5e+29) {
tmp = a / (t_1 / (y + t));
} 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 = y + (x + t)
t_2 = z / (t_1 / (x + y))
if (z <= (-7d+136)) then
tmp = t_2
else if (z <= (-1350000000000.0d0)) then
tmp = (z + a) - b
else if (z <= (-2d-144)) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (z <= 8.5d+29) then
tmp = a / (t_1 / (y + t))
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 = y + (x + t);
double t_2 = z / (t_1 / (x + y));
double tmp;
if (z <= -7e+136) {
tmp = t_2;
} else if (z <= -1350000000000.0) {
tmp = (z + a) - b;
} else if (z <= -2e-144) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (z <= 8.5e+29) {
tmp = a / (t_1 / (y + t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = z / (t_1 / (x + y)) tmp = 0 if z <= -7e+136: tmp = t_2 elif z <= -1350000000000.0: tmp = (z + a) - b elif z <= -2e-144: tmp = ((t * a) + (x * z)) / (x + t) elif z <= 8.5e+29: tmp = a / (t_1 / (y + t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(z / Float64(t_1 / Float64(x + y))) tmp = 0.0 if (z <= -7e+136) tmp = t_2; elseif (z <= -1350000000000.0) tmp = Float64(Float64(z + a) - b); elseif (z <= -2e-144) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (z <= 8.5e+29) tmp = Float64(a / Float64(t_1 / Float64(y + t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = z / (t_1 / (x + y)); tmp = 0.0; if (z <= -7e+136) tmp = t_2; elseif (z <= -1350000000000.0) tmp = (z + a) - b; elseif (z <= -2e-144) tmp = ((t * a) + (x * z)) / (x + t); elseif (z <= 8.5e+29) tmp = a / (t_1 / (y + t)); else tmp = t_2; 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[(z / N[(t$95$1 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+136], t$95$2, If[LessEqual[z, -1350000000000.0], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, -2e-144], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+29], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{z}{\frac{t\_1}{x + y}}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+136}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1350000000000:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-144}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+29}:\\
\;\;\;\;\frac{a}{\frac{t\_1}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -7.00000000000000002e136 or 8.5000000000000006e29 < z Initial program 45.7%
Taylor expanded in z around inf 36.6%
associate-/l*75.1%
associate-+r+75.1%
+-commutative75.1%
Simplified75.1%
if -7.00000000000000002e136 < z < -1.35e12Initial program 51.3%
Taylor expanded in y around inf 80.3%
if -1.35e12 < z < -1.9999999999999999e-144Initial program 79.1%
Taylor expanded in y around 0 60.5%
if -1.9999999999999999e-144 < z < 8.5000000000000006e29Initial program 63.7%
Taylor expanded in a around inf 41.2%
associate-/l*66.3%
associate-+r+66.3%
Simplified66.3%
Final simplification70.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ a (/ (+ y (+ x t)) (+ y t)))))
(if (or (<= x -4.8e+205) (not (<= x 6.2e+55)))
(+ z t_1)
(+ t_1 (/ y (/ (+ y t) (- z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / ((y + (x + t)) / (y + t));
double tmp;
if ((x <= -4.8e+205) || !(x <= 6.2e+55)) {
tmp = z + t_1;
} else {
tmp = t_1 + (y / ((y + t) / (z - 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) :: tmp
t_1 = a / ((y + (x + t)) / (y + t))
if ((x <= (-4.8d+205)) .or. (.not. (x <= 6.2d+55))) then
tmp = z + t_1
else
tmp = t_1 + (y / ((y + t) / (z - 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 + (x + t)) / (y + t));
double tmp;
if ((x <= -4.8e+205) || !(x <= 6.2e+55)) {
tmp = z + t_1;
} else {
tmp = t_1 + (y / ((y + t) / (z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / ((y + (x + t)) / (y + t)) tmp = 0 if (x <= -4.8e+205) or not (x <= 6.2e+55): tmp = z + t_1 else: tmp = t_1 + (y / ((y + t) / (z - b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(Float64(y + Float64(x + t)) / Float64(y + t))) tmp = 0.0 if ((x <= -4.8e+205) || !(x <= 6.2e+55)) tmp = Float64(z + t_1); else tmp = Float64(t_1 + Float64(y / Float64(Float64(y + t) / Float64(z - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / ((y + (x + t)) / (y + t)); tmp = 0.0; if ((x <= -4.8e+205) || ~((x <= 6.2e+55))) tmp = z + t_1; else tmp = t_1 + (y / ((y + t) / (z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -4.8e+205], N[Not[LessEqual[x, 6.2e+55]], $MachinePrecision]], N[(z + t$95$1), $MachinePrecision], N[(t$95$1 + N[(y / N[(N[(y + t), $MachinePrecision] / N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{y + \left(x + t\right)}{y + t}}\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+205} \lor \neg \left(x \leq 6.2 \cdot 10^{+55}\right):\\
\;\;\;\;z + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{y}{\frac{y + t}{z - b}}\\
\end{array}
\end{array}
if x < -4.79999999999999972e205 or 6.19999999999999987e55 < x Initial program 45.7%
Taylor expanded in z around inf 45.8%
associate--l+45.8%
associate-/l*54.7%
associate-+r+54.7%
div-sub54.7%
Simplified54.1%
Taylor expanded in z around inf 50.1%
associate-/l*91.4%
+-commutative91.4%
associate-+r+91.4%
associate-+r+91.4%
+-commutative91.4%
associate-+r+91.4%
+-commutative91.4%
Simplified91.4%
Taylor expanded in t around 0 86.4%
if -4.79999999999999972e205 < x < 6.19999999999999987e55Initial program 64.0%
Taylor expanded in z around inf 64.0%
associate--l+64.0%
associate-/l*78.6%
associate-+r+78.6%
div-sub78.6%
Simplified78.7%
Taylor expanded in x around 0 70.1%
associate-/l*83.3%
+-commutative83.3%
Simplified83.3%
Final simplification84.3%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= t -1.1e+161)
(not (or (<= t -5.2e+97) (and (not (<= t -6.5e+59)) (<= t 9.5e+38)))))
(+ a (/ z (/ t (+ x y))))
(- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.1e+161) || !((t <= -5.2e+97) || (!(t <= -6.5e+59) && (t <= 9.5e+38)))) {
tmp = a + (z / (t / (x + y)));
} 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 ((t <= (-1.1d+161)) .or. (.not. (t <= (-5.2d+97)) .or. (.not. (t <= (-6.5d+59))) .and. (t <= 9.5d+38))) then
tmp = a + (z / (t / (x + y)))
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 ((t <= -1.1e+161) || !((t <= -5.2e+97) || (!(t <= -6.5e+59) && (t <= 9.5e+38)))) {
tmp = a + (z / (t / (x + y)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.1e+161) or not ((t <= -5.2e+97) or (not (t <= -6.5e+59) and (t <= 9.5e+38))): tmp = a + (z / (t / (x + y))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.1e+161) || !((t <= -5.2e+97) || (!(t <= -6.5e+59) && (t <= 9.5e+38)))) tmp = Float64(a + Float64(z / Float64(t / Float64(x + y)))); 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 ((t <= -1.1e+161) || ~(((t <= -5.2e+97) || (~((t <= -6.5e+59)) && (t <= 9.5e+38))))) tmp = a + (z / (t / (x + y))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.1e+161], N[Not[Or[LessEqual[t, -5.2e+97], And[N[Not[LessEqual[t, -6.5e+59]], $MachinePrecision], LessEqual[t, 9.5e+38]]]], $MachinePrecision]], N[(a + N[(z / N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+161} \lor \neg \left(t \leq -5.2 \cdot 10^{+97} \lor \neg \left(t \leq -6.5 \cdot 10^{+59}\right) \land t \leq 9.5 \cdot 10^{+38}\right):\\
\;\;\;\;a + \frac{z}{\frac{t}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -1.1e161 or -5.2e97 < t < -6.50000000000000021e59 or 9.4999999999999995e38 < t Initial program 55.8%
Taylor expanded in z around inf 55.8%
associate--l+55.8%
associate-/l*78.8%
associate-+r+78.8%
div-sub78.8%
Simplified78.7%
Taylor expanded in z around inf 73.2%
associate-/l*89.0%
+-commutative89.0%
associate-+r+89.0%
associate-+r+89.0%
+-commutative89.0%
associate-+r+89.0%
+-commutative89.0%
Simplified89.0%
Taylor expanded in t around inf 81.1%
Taylor expanded in t around inf 69.3%
if -1.1e161 < t < -5.2e97 or -6.50000000000000021e59 < t < 9.4999999999999995e38Initial program 60.1%
Taylor expanded in y around inf 64.3%
Final simplification66.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ a (/ (+ y (+ x t)) (+ y t))))))
(if (<= x -9.6e-120)
t_1
(if (<= x 1.95e-27)
(+ a (/ z (/ (+ y t) y)))
(if (<= x 1.9e+22) (- (+ z a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (a / ((y + (x + t)) / (y + t)));
double tmp;
if (x <= -9.6e-120) {
tmp = t_1;
} else if (x <= 1.95e-27) {
tmp = a + (z / ((y + t) / y));
} else if (x <= 1.9e+22) {
tmp = (z + a) - b;
} 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 / ((y + (x + t)) / (y + t)))
if (x <= (-9.6d-120)) then
tmp = t_1
else if (x <= 1.95d-27) then
tmp = a + (z / ((y + t) / y))
else if (x <= 1.9d+22) then
tmp = (z + a) - b
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 / ((y + (x + t)) / (y + t)));
double tmp;
if (x <= -9.6e-120) {
tmp = t_1;
} else if (x <= 1.95e-27) {
tmp = a + (z / ((y + t) / y));
} else if (x <= 1.9e+22) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (a / ((y + (x + t)) / (y + t))) tmp = 0 if x <= -9.6e-120: tmp = t_1 elif x <= 1.95e-27: tmp = a + (z / ((y + t) / y)) elif x <= 1.9e+22: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(a / Float64(Float64(y + Float64(x + t)) / Float64(y + t)))) tmp = 0.0 if (x <= -9.6e-120) tmp = t_1; elseif (x <= 1.95e-27) tmp = Float64(a + Float64(z / Float64(Float64(y + t) / y))); elseif (x <= 1.9e+22) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (a / ((y + (x + t)) / (y + t))); tmp = 0.0; if (x <= -9.6e-120) tmp = t_1; elseif (x <= 1.95e-27) tmp = a + (z / ((y + t) / y)); elseif (x <= 1.9e+22) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(a / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.6e-120], t$95$1, If[LessEqual[x, 1.95e-27], N[(a + N[(z / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e+22], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{a}{\frac{y + \left(x + t\right)}{y + t}}\\
\mathbf{if}\;x \leq -9.6 \cdot 10^{-120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-27}:\\
\;\;\;\;a + \frac{z}{\frac{y + t}{y}}\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+22}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.5999999999999998e-120 or 1.9000000000000002e22 < x Initial program 52.2%
Taylor expanded in z around inf 52.2%
associate--l+52.2%
associate-/l*66.9%
associate-+r+66.9%
div-sub66.9%
Simplified66.6%
Taylor expanded in z around inf 62.0%
associate-/l*86.4%
+-commutative86.4%
associate-+r+86.4%
associate-+r+86.4%
+-commutative86.4%
associate-+r+86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in t around 0 76.9%
if -9.5999999999999998e-120 < x < 1.94999999999999986e-27Initial program 69.0%
Taylor expanded in z around inf 69.0%
associate--l+69.0%
associate-/l*79.9%
associate-+r+79.9%
div-sub79.9%
Simplified79.9%
Taylor expanded in z around inf 68.4%
associate-/l*78.4%
+-commutative78.4%
associate-+r+78.4%
associate-+r+78.4%
+-commutative78.4%
associate-+r+78.4%
+-commutative78.4%
Simplified78.4%
Taylor expanded in t around inf 76.5%
Taylor expanded in x around 0 74.1%
+-commutative74.1%
Simplified74.1%
if 1.94999999999999986e-27 < x < 1.9000000000000002e22Initial program 53.2%
Taylor expanded in y around inf 92.1%
Final simplification76.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= x -4.8e+205)
z
(if (<= x -2.5e-195)
t_1
(if (<= x -9e-219)
(+ a (/ (* x (- z a)) t))
(if (<= x 2.8e+138) t_1 (* z (/ x (+ x t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (x <= -4.8e+205) {
tmp = z;
} else if (x <= -2.5e-195) {
tmp = t_1;
} else if (x <= -9e-219) {
tmp = a + ((x * (z - a)) / t);
} else if (x <= 2.8e+138) {
tmp = t_1;
} else {
tmp = z * (x / (x + t));
}
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 (x <= (-4.8d+205)) then
tmp = z
else if (x <= (-2.5d-195)) then
tmp = t_1
else if (x <= (-9d-219)) then
tmp = a + ((x * (z - a)) / t)
else if (x <= 2.8d+138) then
tmp = t_1
else
tmp = z * (x / (x + t))
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 (x <= -4.8e+205) {
tmp = z;
} else if (x <= -2.5e-195) {
tmp = t_1;
} else if (x <= -9e-219) {
tmp = a + ((x * (z - a)) / t);
} else if (x <= 2.8e+138) {
tmp = t_1;
} else {
tmp = z * (x / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if x <= -4.8e+205: tmp = z elif x <= -2.5e-195: tmp = t_1 elif x <= -9e-219: tmp = a + ((x * (z - a)) / t) elif x <= 2.8e+138: tmp = t_1 else: tmp = z * (x / (x + t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (x <= -4.8e+205) tmp = z; elseif (x <= -2.5e-195) tmp = t_1; elseif (x <= -9e-219) tmp = Float64(a + Float64(Float64(x * Float64(z - a)) / t)); elseif (x <= 2.8e+138) tmp = t_1; else tmp = Float64(z * Float64(x / Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (x <= -4.8e+205) tmp = z; elseif (x <= -2.5e-195) tmp = t_1; elseif (x <= -9e-219) tmp = a + ((x * (z - a)) / t); elseif (x <= 2.8e+138) tmp = t_1; else tmp = z * (x / (x + t)); 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[x, -4.8e+205], z, If[LessEqual[x, -2.5e-195], t$95$1, If[LessEqual[x, -9e-219], N[(a + N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e+138], t$95$1, N[(z * N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+205}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-195}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-219}:\\
\;\;\;\;a + \frac{x \cdot \left(z - a\right)}{t}\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x}{x + t}\\
\end{array}
\end{array}
if x < -4.79999999999999972e205Initial program 50.4%
Taylor expanded in x around inf 80.7%
if -4.79999999999999972e205 < x < -2.50000000000000004e-195 or -9.00000000000000029e-219 < x < 2.8000000000000001e138Initial program 62.8%
Taylor expanded in y around inf 60.9%
if -2.50000000000000004e-195 < x < -9.00000000000000029e-219Initial program 75.1%
Taylor expanded in y around 0 77.7%
Taylor expanded in t around -inf 89.7%
mul-1-neg89.7%
unsub-neg89.7%
distribute-lft-out--89.7%
mul-1-neg89.7%
*-commutative89.7%
distribute-lft-out--89.7%
Simplified89.7%
if 2.8000000000000001e138 < x Initial program 35.8%
Taylor expanded in y around 0 32.8%
Taylor expanded in a around 0 24.4%
associate-/l*51.5%
associate-/r/63.2%
+-commutative63.2%
Simplified63.2%
Final simplification63.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.65e+58)
z
(if (<= z -4e-86)
a
(if (<= z -1.2e-154)
z
(if (<= z -2.35e-164) (- b) (if (<= z 21.0) a z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.65e+58) {
tmp = z;
} else if (z <= -4e-86) {
tmp = a;
} else if (z <= -1.2e-154) {
tmp = z;
} else if (z <= -2.35e-164) {
tmp = -b;
} else if (z <= 21.0) {
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 (z <= (-1.65d+58)) then
tmp = z
else if (z <= (-4d-86)) then
tmp = a
else if (z <= (-1.2d-154)) then
tmp = z
else if (z <= (-2.35d-164)) then
tmp = -b
else if (z <= 21.0d0) 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 (z <= -1.65e+58) {
tmp = z;
} else if (z <= -4e-86) {
tmp = a;
} else if (z <= -1.2e-154) {
tmp = z;
} else if (z <= -2.35e-164) {
tmp = -b;
} else if (z <= 21.0) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.65e+58: tmp = z elif z <= -4e-86: tmp = a elif z <= -1.2e-154: tmp = z elif z <= -2.35e-164: tmp = -b elif z <= 21.0: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.65e+58) tmp = z; elseif (z <= -4e-86) tmp = a; elseif (z <= -1.2e-154) tmp = z; elseif (z <= -2.35e-164) tmp = Float64(-b); elseif (z <= 21.0) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.65e+58) tmp = z; elseif (z <= -4e-86) tmp = a; elseif (z <= -1.2e-154) tmp = z; elseif (z <= -2.35e-164) tmp = -b; elseif (z <= 21.0) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.65e+58], z, If[LessEqual[z, -4e-86], a, If[LessEqual[z, -1.2e-154], z, If[LessEqual[z, -2.35e-164], (-b), If[LessEqual[z, 21.0], a, z]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+58}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-86}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-154}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-164}:\\
\;\;\;\;-b\\
\mathbf{elif}\;z \leq 21:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.64999999999999991e58 or -4.00000000000000034e-86 < z < -1.19999999999999993e-154 or 21 < z Initial program 50.0%
Taylor expanded in x around inf 53.1%
if -1.64999999999999991e58 < z < -4.00000000000000034e-86 or -2.3499999999999998e-164 < z < 21Initial program 68.7%
Taylor expanded in t around inf 53.0%
if -1.19999999999999993e-154 < z < -2.3499999999999998e-164Initial program 42.7%
Taylor expanded in x around inf 42.3%
*-commutative42.3%
Simplified42.3%
Taylor expanded in y around inf 61.2%
neg-mul-161.2%
Simplified61.2%
Final simplification53.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (or (<= a -8.8e+42) (not (<= a 480000000000.0)))
(+ z (/ a (/ t_1 (+ y t))))
(+ a (/ z (/ t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((a <= -8.8e+42) || !(a <= 480000000000.0)) {
tmp = z + (a / (t_1 / (y + t)));
} else {
tmp = a + (z / (t_1 / (x + y)));
}
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 = y + (x + t)
if ((a <= (-8.8d+42)) .or. (.not. (a <= 480000000000.0d0))) then
tmp = z + (a / (t_1 / (y + t)))
else
tmp = a + (z / (t_1 / (x + y)))
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 tmp;
if ((a <= -8.8e+42) || !(a <= 480000000000.0)) {
tmp = z + (a / (t_1 / (y + t)));
} else {
tmp = a + (z / (t_1 / (x + y)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if (a <= -8.8e+42) or not (a <= 480000000000.0): tmp = z + (a / (t_1 / (y + t))) else: tmp = a + (z / (t_1 / (x + y))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if ((a <= -8.8e+42) || !(a <= 480000000000.0)) tmp = Float64(z + Float64(a / Float64(t_1 / Float64(y + t)))); else tmp = Float64(a + Float64(z / Float64(t_1 / Float64(x + y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if ((a <= -8.8e+42) || ~((a <= 480000000000.0))) tmp = z + (a / (t_1 / (y + t))); else tmp = a + (z / (t_1 / (x + y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -8.8e+42], N[Not[LessEqual[a, 480000000000.0]], $MachinePrecision]], N[(z + N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(z / N[(t$95$1 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;a \leq -8.8 \cdot 10^{+42} \lor \neg \left(a \leq 480000000000\right):\\
\;\;\;\;z + \frac{a}{\frac{t\_1}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;a + \frac{z}{\frac{t\_1}{x + y}}\\
\end{array}
\end{array}
if a < -8.8000000000000005e42 or 4.8e11 < a Initial program 43.9%
Taylor expanded in z around inf 43.9%
associate--l+43.9%
associate-/l*72.2%
associate-+r+72.2%
div-sub72.2%
Simplified72.0%
Taylor expanded in z around inf 70.3%
associate-/l*88.0%
+-commutative88.0%
associate-+r+88.0%
associate-+r+88.0%
+-commutative88.0%
associate-+r+88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in t around 0 83.9%
if -8.8000000000000005e42 < a < 4.8e11Initial program 70.8%
Taylor expanded in z around inf 70.8%
associate--l+70.8%
associate-/l*70.8%
associate-+r+70.8%
div-sub70.8%
Simplified70.7%
Taylor expanded in z around inf 58.1%
associate-/l*77.6%
+-commutative77.6%
associate-+r+77.6%
associate-+r+77.6%
+-commutative77.6%
associate-+r+77.6%
+-commutative77.6%
Simplified77.6%
Taylor expanded in t around inf 73.6%
Final simplification78.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ a (/ t_1 (+ y t)))))
(if (<= a -5e+41)
(+ t_2 (- z b))
(if (<= a 120000000000.0) (+ a (/ z (/ t_1 (+ x y)))) (+ z t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a / (t_1 / (y + t));
double tmp;
if (a <= -5e+41) {
tmp = t_2 + (z - b);
} else if (a <= 120000000000.0) {
tmp = a + (z / (t_1 / (x + y)));
} else {
tmp = z + 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 = y + (x + t)
t_2 = a / (t_1 / (y + t))
if (a <= (-5d+41)) then
tmp = t_2 + (z - b)
else if (a <= 120000000000.0d0) then
tmp = a + (z / (t_1 / (x + y)))
else
tmp = z + 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 = y + (x + t);
double t_2 = a / (t_1 / (y + t));
double tmp;
if (a <= -5e+41) {
tmp = t_2 + (z - b);
} else if (a <= 120000000000.0) {
tmp = a + (z / (t_1 / (x + y)));
} else {
tmp = z + t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = a / (t_1 / (y + t)) tmp = 0 if a <= -5e+41: tmp = t_2 + (z - b) elif a <= 120000000000.0: tmp = a + (z / (t_1 / (x + y))) else: tmp = z + t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(a / Float64(t_1 / Float64(y + t))) tmp = 0.0 if (a <= -5e+41) tmp = Float64(t_2 + Float64(z - b)); elseif (a <= 120000000000.0) tmp = Float64(a + Float64(z / Float64(t_1 / Float64(x + y)))); else tmp = Float64(z + t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = a / (t_1 / (y + t)); tmp = 0.0; if (a <= -5e+41) tmp = t_2 + (z - b); elseif (a <= 120000000000.0) tmp = a + (z / (t_1 / (x + y))); else tmp = z + t_2; 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[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5e+41], N[(t$95$2 + N[(z - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 120000000000.0], N[(a + N[(z / N[(t$95$1 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{a}{\frac{t\_1}{y + t}}\\
\mathbf{if}\;a \leq -5 \cdot 10^{+41}:\\
\;\;\;\;t\_2 + \left(z - b\right)\\
\mathbf{elif}\;a \leq 120000000000:\\
\;\;\;\;a + \frac{z}{\frac{t\_1}{x + y}}\\
\mathbf{else}:\\
\;\;\;\;z + t\_2\\
\end{array}
\end{array}
if a < -5.00000000000000022e41Initial program 43.3%
Taylor expanded in z around inf 43.3%
associate--l+43.3%
associate-/l*69.7%
associate-+r+69.7%
div-sub69.7%
Simplified69.6%
Taylor expanded in y around inf 85.8%
if -5.00000000000000022e41 < a < 1.2e11Initial program 70.8%
Taylor expanded in z around inf 70.8%
associate--l+70.8%
associate-/l*70.8%
associate-+r+70.8%
div-sub70.8%
Simplified70.7%
Taylor expanded in z around inf 58.1%
associate-/l*77.6%
+-commutative77.6%
associate-+r+77.6%
associate-+r+77.6%
+-commutative77.6%
associate-+r+77.6%
+-commutative77.6%
Simplified77.6%
Taylor expanded in t around inf 73.6%
if 1.2e11 < a Initial program 44.4%
Taylor expanded in z around inf 44.4%
associate--l+44.4%
associate-/l*74.5%
associate-+r+74.5%
div-sub74.5%
Simplified74.3%
Taylor expanded in z around inf 68.7%
associate-/l*87.5%
+-commutative87.5%
associate-+r+87.5%
associate-+r+87.5%
+-commutative87.5%
associate-+r+87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in t around 0 84.2%
Final simplification78.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.1e+206) z (if (<= x 6.2e+139) (- (+ z a) b) (* z (/ x (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.1e+206) {
tmp = z;
} else if (x <= 6.2e+139) {
tmp = (z + a) - b;
} else {
tmp = z * (x / (x + t));
}
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 <= (-1.1d+206)) then
tmp = z
else if (x <= 6.2d+139) then
tmp = (z + a) - b
else
tmp = z * (x / (x + t))
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 <= -1.1e+206) {
tmp = z;
} else if (x <= 6.2e+139) {
tmp = (z + a) - b;
} else {
tmp = z * (x / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.1e+206: tmp = z elif x <= 6.2e+139: tmp = (z + a) - b else: tmp = z * (x / (x + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.1e+206) tmp = z; elseif (x <= 6.2e+139) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z * Float64(x / Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.1e+206) tmp = z; elseif (x <= 6.2e+139) tmp = (z + a) - b; else tmp = z * (x / (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.1e+206], z, If[LessEqual[x, 6.2e+139], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z * N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{+206}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+139}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x}{x + t}\\
\end{array}
\end{array}
if x < -1.10000000000000001e206Initial program 50.4%
Taylor expanded in x around inf 80.7%
if -1.10000000000000001e206 < x < 6.2e139Initial program 63.3%
Taylor expanded in y around inf 59.6%
if 6.2e139 < x Initial program 35.8%
Taylor expanded in y around 0 32.8%
Taylor expanded in a around 0 24.4%
associate-/l*51.5%
associate-/r/63.2%
+-commutative63.2%
Simplified63.2%
Final simplification61.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.45e+206) z (if (<= x 4e+197) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.45e+206) {
tmp = z;
} else if (x <= 4e+197) {
tmp = (z + a) - b;
} 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 <= (-2.45d+206)) then
tmp = z
else if (x <= 4d+197) then
tmp = (z + a) - b
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 <= -2.45e+206) {
tmp = z;
} else if (x <= 4e+197) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.45e+206: tmp = z elif x <= 4e+197: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.45e+206) tmp = z; elseif (x <= 4e+197) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.45e+206) tmp = z; elseif (x <= 4e+197) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.45e+206], z, If[LessEqual[x, 4e+197], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+206}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+197}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.45e206 or 3.9999999999999998e197 < x Initial program 43.0%
Taylor expanded in x around inf 75.0%
if -2.45e206 < x < 3.9999999999999998e197Initial program 61.8%
Taylor expanded in y around inf 58.7%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.25e+58) z (if (<= z 13.5) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.25e+58) {
tmp = z;
} else if (z <= 13.5) {
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 (z <= (-2.25d+58)) then
tmp = z
else if (z <= 13.5d0) 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 (z <= -2.25e+58) {
tmp = z;
} else if (z <= 13.5) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.25e+58: tmp = z elif z <= 13.5: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.25e+58) tmp = z; elseif (z <= 13.5) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.25e+58) tmp = z; elseif (z <= 13.5) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.25e+58], z, If[LessEqual[z, 13.5], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+58}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 13.5:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -2.2499999999999999e58 or 13.5 < z Initial program 47.9%
Taylor expanded in x around inf 54.9%
if -2.2499999999999999e58 < z < 13.5Initial program 67.1%
Taylor expanded in t around inf 48.5%
Final simplification51.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1350000.0) (- z b) (if (<= z 0.21) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1350000.0) {
tmp = z - b;
} else if (z <= 0.21) {
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 (z <= (-1350000.0d0)) then
tmp = z - b
else if (z <= 0.21d0) 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 (z <= -1350000.0) {
tmp = z - b;
} else if (z <= 0.21) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1350000.0: tmp = z - b elif z <= 0.21: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1350000.0) tmp = Float64(z - b); elseif (z <= 0.21) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1350000.0) tmp = z - b; elseif (z <= 0.21) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1350000.0], N[(z - b), $MachinePrecision], If[LessEqual[z, 0.21], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1350000:\\
\;\;\;\;z - b\\
\mathbf{elif}\;z \leq 0.21:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.35e6Initial program 42.8%
Taylor expanded in z around inf 33.0%
+-commutative33.0%
Simplified33.0%
Taylor expanded in y around inf 56.6%
if -1.35e6 < z < 0.209999999999999992Initial program 67.8%
Taylor expanded in t around inf 49.3%
if 0.209999999999999992 < z Initial program 53.9%
Taylor expanded in x around inf 51.0%
Final simplification51.4%
(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 58.5%
Taylor expanded in t around inf 34.5%
Final simplification34.5%
(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 2024040
(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)))