
(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 15 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 (+ x (+ y t)))
(t_3 (/ (- (+ (* z (+ x y)) t_1) (* y b)) (+ y (+ x t)))))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 2e+231)))
(- (+ z a) b)
(fma z (+ (/ x t_2) (/ y t_2)) (/ (- t_1 (* y b)) 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 = x + (y + t);
double t_3 = (((z * (x + y)) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 2e+231)) {
tmp = (z + a) - b;
} else {
tmp = fma(z, ((x / t_2) + (y / t_2)), ((t_1 - (y * b)) / t_2));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(x + Float64(y + t)) t_3 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 2e+231)) tmp = Float64(Float64(z + a) - b); else tmp = fma(z, Float64(Float64(x / t_2) + Float64(y / t_2)), Float64(Float64(t_1 - Float64(y * b)) / t_2)); 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[(x + N[(y + 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] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 2e+231]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z * N[(N[(x / t$95$2), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := x + \left(y + t\right)\\
t_3 := \frac{\left(z \cdot \left(x + y\right) + t\_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_3 \leq -\infty \lor \neg \left(t\_3 \leq 2 \cdot 10^{+231}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{x}{t\_2} + \frac{y}{t\_2}, \frac{t\_1 - y \cdot b}{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.0 or 2.0000000000000001e231 < (/.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%
Taylor expanded in y around inf 74.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)) < 2.0000000000000001e231Initial program 99.7%
Taylor expanded in z around 0 99.8%
associate--l+99.8%
fma-define99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
div-sub99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
Final simplification86.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ x (+ y t)))
(t_3 (/ (- (+ (* z (+ x y)) t_1) (* y b)) (+ y (+ x t)))))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 2e+231)))
(- (+ z a) b)
(+ (/ (- t_1 (* y b)) t_2) (* z (+ (/ x t_2) (/ 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 = x + (y + t);
double t_3 = (((z * (x + y)) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 2e+231)) {
tmp = (z + a) - b;
} else {
tmp = ((t_1 - (y * b)) / t_2) + (z * ((x / t_2) + (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 = x + (y + t);
double t_3 = (((z * (x + y)) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 2e+231)) {
tmp = (z + a) - b;
} else {
tmp = ((t_1 - (y * b)) / t_2) + (z * ((x / t_2) + (y / t_2)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = x + (y + t) t_3 = (((z * (x + y)) + t_1) - (y * b)) / (y + (x + t)) tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 2e+231): tmp = (z + a) - b else: tmp = ((t_1 - (y * b)) / t_2) + (z * ((x / t_2) + (y / t_2))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(x + Float64(y + t)) t_3 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 2e+231)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(t_1 - Float64(y * b)) / t_2) + Float64(z * Float64(Float64(x / t_2) + Float64(y / t_2)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = x + (y + t); t_3 = (((z * (x + y)) + t_1) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 2e+231))) tmp = (z + a) - b; else tmp = ((t_1 - (y * b)) / t_2) + (z * ((x / t_2) + (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[(x + N[(y + 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] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 2e+231]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(z * N[(N[(x / t$95$2), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := x + \left(y + t\right)\\
t_3 := \frac{\left(z \cdot \left(x + y\right) + t\_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_3 \leq -\infty \lor \neg \left(t\_3 \leq 2 \cdot 10^{+231}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 - y \cdot b}{t\_2} + z \cdot \left(\frac{x}{t\_2} + \frac{y}{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.0 or 2.0000000000000001e231 < (/.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%
Taylor expanded in y around inf 74.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)) < 2.0000000000000001e231Initial program 99.7%
Taylor expanded in z around 0 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
div-sub99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
Simplified99.8%
Final simplification86.5%
(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))
(t_3 (- (+ z a) b)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 2e+231)))
t_3
(/ (+ (* t a) (+ (* x z) (* y t_3))) 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 * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 2e+231)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1;
}
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 t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 2e+231)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1;
}
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 t_3 = (z + a) - b tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 2e+231): tmp = t_3 else: tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1 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) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 2e+231)) tmp = t_3; else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * t_3))) / t_1); 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; t_3 = (z + a) - b; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 2e+231))) tmp = t_3; else tmp = ((t * a) + ((x * z) + (y * t_3))) / 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[(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]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 2e+231]], $MachinePrecision]], t$95$3, N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\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}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 2 \cdot 10^{+231}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot t\_3\right)}{t\_1}\\
\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 2.0000000000000001e231 < (/.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%
Taylor expanded in y around inf 74.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)) < 2.0000000000000001e231Initial program 99.7%
Taylor expanded in y around 0 99.7%
Final simplification86.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -7.5e+142)
t_1
(if (<= y -1e-198)
(+ z a)
(if (<= y 2.9e-159)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 4.8e-37) (/ (- (* x z) (* y b)) (+ y (+ 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 <= -7.5e+142) {
tmp = t_1;
} else if (y <= -1e-198) {
tmp = z + a;
} else if (y <= 2.9e-159) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 4.8e-37) {
tmp = ((x * z) - (y * b)) / (y + (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 <= (-7.5d+142)) then
tmp = t_1
else if (y <= (-1d-198)) then
tmp = z + a
else if (y <= 2.9d-159) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 4.8d-37) then
tmp = ((x * z) - (y * b)) / (y + (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 <= -7.5e+142) {
tmp = t_1;
} else if (y <= -1e-198) {
tmp = z + a;
} else if (y <= 2.9e-159) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 4.8e-37) {
tmp = ((x * z) - (y * b)) / (y + (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 <= -7.5e+142: tmp = t_1 elif y <= -1e-198: tmp = z + a elif y <= 2.9e-159: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 4.8e-37: tmp = ((x * z) - (y * b)) / (y + (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 <= -7.5e+142) tmp = t_1; elseif (y <= -1e-198) tmp = Float64(z + a); elseif (y <= 2.9e-159) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 4.8e-37) tmp = Float64(Float64(Float64(x * z) - Float64(y * b)) / Float64(y + 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 <= -7.5e+142) tmp = t_1; elseif (y <= -1e-198) tmp = z + a; elseif (y <= 2.9e-159) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 4.8e-37) tmp = ((x * z) - (y * b)) / (y + (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, -7.5e+142], t$95$1, If[LessEqual[y, -1e-198], N[(z + a), $MachinePrecision], If[LessEqual[y, 2.9e-159], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-37], N[(N[(N[(x * z), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-198}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-159}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-37}:\\
\;\;\;\;\frac{x \cdot z - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.5000000000000002e142 or 4.79999999999999982e-37 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -7.5000000000000002e142 < y < -9.9999999999999991e-199Initial program 54.2%
Taylor expanded in b around 0 47.1%
Taylor expanded in y around inf 62.6%
if -9.9999999999999991e-199 < y < 2.8999999999999999e-159Initial program 71.3%
Taylor expanded in y around 0 61.5%
if 2.8999999999999999e-159 < y < 4.79999999999999982e-37Initial program 80.1%
Taylor expanded in a around 0 64.9%
+-commutative64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in y around 0 60.9%
*-commutative60.9%
Simplified60.9%
Final simplification72.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -5.6e+145)
t_1
(if (<= y -3.7e-198)
(+ z a)
(if (<= y 4e-95)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 7e-31) (* z (/ (+ x y) (+ x (+ 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+145) {
tmp = t_1;
} else if (y <= -3.7e-198) {
tmp = z + a;
} else if (y <= 4e-95) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 7e-31) {
tmp = z * ((x + y) / (x + (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+145)) then
tmp = t_1
else if (y <= (-3.7d-198)) then
tmp = z + a
else if (y <= 4d-95) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 7d-31) then
tmp = z * ((x + y) / (x + (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+145) {
tmp = t_1;
} else if (y <= -3.7e-198) {
tmp = z + a;
} else if (y <= 4e-95) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 7e-31) {
tmp = z * ((x + y) / (x + (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+145: tmp = t_1 elif y <= -3.7e-198: tmp = z + a elif y <= 4e-95: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 7e-31: tmp = z * ((x + y) / (x + (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+145) tmp = t_1; elseif (y <= -3.7e-198) tmp = Float64(z + a); elseif (y <= 4e-95) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 7e-31) tmp = Float64(z * Float64(Float64(x + y) / Float64(x + 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+145) tmp = t_1; elseif (y <= -3.7e-198) tmp = z + a; elseif (y <= 4e-95) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 7e-31) tmp = z * ((x + y) / (x + (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+145], t$95$1, If[LessEqual[y, -3.7e-198], N[(z + a), $MachinePrecision], If[LessEqual[y, 4e-95], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-31], N[(z * N[(N[(x + y), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $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^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.7 \cdot 10^{-198}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-95}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-31}:\\
\;\;\;\;z \cdot \frac{x + y}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.5999999999999997e145 or 6.99999999999999971e-31 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -5.5999999999999997e145 < y < -3.69999999999999971e-198Initial program 54.2%
Taylor expanded in b around 0 47.1%
Taylor expanded in y around inf 62.6%
if -3.69999999999999971e-198 < y < 3.99999999999999996e-95Initial program 74.7%
Taylor expanded in y around 0 59.4%
if 3.99999999999999996e-95 < y < 6.99999999999999971e-31Initial program 71.8%
Taylor expanded in z around inf 38.3%
associate-/l*60.5%
+-commutative60.5%
+-commutative60.5%
associate-+r+60.4%
Simplified60.4%
Final simplification72.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))) (t_2 (- (+ z a) b)))
(if (<= y -9.6e+142)
t_2
(if (<= y -2.06e-116)
(+ z a)
(if (<= y 3.7e-268)
(* a (/ (+ y t) t_1))
(if (<= y 1.3e-38) (* z (/ (+ x y) t_1)) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -9.6e+142) {
tmp = t_2;
} else if (y <= -2.06e-116) {
tmp = z + a;
} else if (y <= 3.7e-268) {
tmp = a * ((y + t) / t_1);
} else if (y <= 1.3e-38) {
tmp = z * ((x + y) / 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 = x + (y + t)
t_2 = (z + a) - b
if (y <= (-9.6d+142)) then
tmp = t_2
else if (y <= (-2.06d-116)) then
tmp = z + a
else if (y <= 3.7d-268) then
tmp = a * ((y + t) / t_1)
else if (y <= 1.3d-38) then
tmp = z * ((x + y) / 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 = x + (y + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -9.6e+142) {
tmp = t_2;
} else if (y <= -2.06e-116) {
tmp = z + a;
} else if (y <= 3.7e-268) {
tmp = a * ((y + t) / t_1);
} else if (y <= 1.3e-38) {
tmp = z * ((x + y) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = (z + a) - b tmp = 0 if y <= -9.6e+142: tmp = t_2 elif y <= -2.06e-116: tmp = z + a elif y <= 3.7e-268: tmp = a * ((y + t) / t_1) elif y <= 1.3e-38: tmp = z * ((x + y) / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -9.6e+142) tmp = t_2; elseif (y <= -2.06e-116) tmp = Float64(z + a); elseif (y <= 3.7e-268) tmp = Float64(a * Float64(Float64(y + t) / t_1)); elseif (y <= 1.3e-38) tmp = Float64(z * Float64(Float64(x + y) / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = (z + a) - b; tmp = 0.0; if (y <= -9.6e+142) tmp = t_2; elseif (y <= -2.06e-116) tmp = z + a; elseif (y <= 3.7e-268) tmp = a * ((y + t) / t_1); elseif (y <= 1.3e-38) tmp = z * ((x + y) / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -9.6e+142], t$95$2, If[LessEqual[y, -2.06e-116], N[(z + a), $MachinePrecision], If[LessEqual[y, 3.7e-268], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-38], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -9.6 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.06 \cdot 10^{-116}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-268}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-38}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -9.5999999999999996e142 or 1.30000000000000005e-38 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -9.5999999999999996e142 < y < -2.06000000000000011e-116Initial program 47.8%
Taylor expanded in b around 0 42.8%
Taylor expanded in y around inf 68.5%
if -2.06000000000000011e-116 < y < 3.70000000000000018e-268Initial program 77.4%
Taylor expanded in a around inf 51.2%
associate-/l*63.5%
+-commutative63.5%
+-commutative63.5%
associate-+r+63.5%
Simplified63.5%
if 3.70000000000000018e-268 < y < 1.30000000000000005e-38Initial program 70.6%
Taylor expanded in z around inf 33.7%
associate-/l*50.1%
+-commutative50.1%
+-commutative50.1%
associate-+r+50.0%
Simplified50.0%
Final simplification72.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -6.4e+154)
t_1
(if (<= y -2.85e-117)
(+ z a)
(if (<= y 6e-269)
(* a (/ (+ y t) (+ x (+ y t))))
(if (<= y 1.7e-64) (* z (/ (+ x y) (+ 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 <= -6.4e+154) {
tmp = t_1;
} else if (y <= -2.85e-117) {
tmp = z + a;
} else if (y <= 6e-269) {
tmp = a * ((y + t) / (x + (y + t)));
} else if (y <= 1.7e-64) {
tmp = z * ((x + y) / (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 <= (-6.4d+154)) then
tmp = t_1
else if (y <= (-2.85d-117)) then
tmp = z + a
else if (y <= 6d-269) then
tmp = a * ((y + t) / (x + (y + t)))
else if (y <= 1.7d-64) then
tmp = z * ((x + y) / (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 <= -6.4e+154) {
tmp = t_1;
} else if (y <= -2.85e-117) {
tmp = z + a;
} else if (y <= 6e-269) {
tmp = a * ((y + t) / (x + (y + t)));
} else if (y <= 1.7e-64) {
tmp = z * ((x + y) / (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 <= -6.4e+154: tmp = t_1 elif y <= -2.85e-117: tmp = z + a elif y <= 6e-269: tmp = a * ((y + t) / (x + (y + t))) elif y <= 1.7e-64: tmp = z * ((x + y) / (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 <= -6.4e+154) tmp = t_1; elseif (y <= -2.85e-117) tmp = Float64(z + a); elseif (y <= 6e-269) tmp = Float64(a * Float64(Float64(y + t) / Float64(x + Float64(y + t)))); elseif (y <= 1.7e-64) tmp = Float64(z * Float64(Float64(x + y) / 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 <= -6.4e+154) tmp = t_1; elseif (y <= -2.85e-117) tmp = z + a; elseif (y <= 6e-269) tmp = a * ((y + t) / (x + (y + t))); elseif (y <= 1.7e-64) tmp = z * ((x + y) / (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, -6.4e+154], t$95$1, If[LessEqual[y, -2.85e-117], N[(z + a), $MachinePrecision], If[LessEqual[y, 6e-269], N[(a * N[(N[(y + t), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-64], N[(z * N[(N[(x + y), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -6.4 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.85 \cdot 10^{-117}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-269}:\\
\;\;\;\;a \cdot \frac{y + t}{x + \left(y + t\right)}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-64}:\\
\;\;\;\;z \cdot \frac{x + y}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.4e154 or 1.70000000000000006e-64 < y Initial program 33.9%
Taylor expanded in y around inf 85.8%
if -6.4e154 < y < -2.85e-117Initial program 47.8%
Taylor expanded in b around 0 42.8%
Taylor expanded in y around inf 68.5%
if -2.85e-117 < y < 5.9999999999999997e-269Initial program 77.4%
Taylor expanded in a around inf 51.2%
associate-/l*63.5%
+-commutative63.5%
+-commutative63.5%
associate-+r+63.5%
Simplified63.5%
if 5.9999999999999997e-269 < y < 1.70000000000000006e-64Initial program 68.1%
Taylor expanded in z around inf 32.2%
associate-/l*49.9%
+-commutative49.9%
+-commutative49.9%
associate-+r+49.9%
Simplified49.9%
Taylor expanded in y around 0 49.4%
Final simplification71.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.35e+109) (not (<= y 4.5e-29))) (- (+ z a) b) (+ (/ (* t a) (+ x t)) (* z (/ x (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.35e+109) || !(y <= 4.5e-29)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) / (x + t)) + (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 ((y <= (-1.35d+109)) .or. (.not. (y <= 4.5d-29))) then
tmp = (z + a) - b
else
tmp = ((t * a) / (x + t)) + (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 ((y <= -1.35e+109) || !(y <= 4.5e-29)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) / (x + t)) + (z * (x / (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.35e+109) or not (y <= 4.5e-29): tmp = (z + a) - b else: tmp = ((t * a) / (x + t)) + (z * (x / (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.35e+109) || !(y <= 4.5e-29)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(t * a) / Float64(x + t)) + 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 ((y <= -1.35e+109) || ~((y <= 4.5e-29))) tmp = (z + a) - b; else tmp = ((t * a) / (x + t)) + (z * (x / (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.35e+109], N[Not[LessEqual[y, 4.5e-29]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+109} \lor \neg \left(y \leq 4.5 \cdot 10^{-29}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a}{x + t} + z \cdot \frac{x}{x + t}\\
\end{array}
\end{array}
if y < -1.35000000000000001e109 or 4.4999999999999998e-29 < y Initial program 31.7%
Taylor expanded in y around inf 85.8%
if -1.35000000000000001e109 < y < 4.4999999999999998e-29Initial program 69.1%
Taylor expanded in z around inf 75.8%
associate--l+75.8%
+-commutative75.8%
associate-+r+75.8%
Simplified82.4%
Taylor expanded in y around 0 59.0%
associate-/l*63.5%
associate-/r*61.5%
Simplified61.5%
Taylor expanded in z around 0 48.9%
+-commutative48.9%
+-commutative48.9%
*-commutative48.9%
associate-*r/64.5%
Simplified64.5%
Final simplification74.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -4.5e+148)
t_1
(if (<= y 1.22e-279)
(+ z a)
(if (<= y 8.5e-64) (* z (/ (+ x y) (+ 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 <= -4.5e+148) {
tmp = t_1;
} else if (y <= 1.22e-279) {
tmp = z + a;
} else if (y <= 8.5e-64) {
tmp = z * ((x + y) / (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 <= (-4.5d+148)) then
tmp = t_1
else if (y <= 1.22d-279) then
tmp = z + a
else if (y <= 8.5d-64) then
tmp = z * ((x + y) / (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 <= -4.5e+148) {
tmp = t_1;
} else if (y <= 1.22e-279) {
tmp = z + a;
} else if (y <= 8.5e-64) {
tmp = z * ((x + y) / (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 <= -4.5e+148: tmp = t_1 elif y <= 1.22e-279: tmp = z + a elif y <= 8.5e-64: tmp = z * ((x + y) / (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 <= -4.5e+148) tmp = t_1; elseif (y <= 1.22e-279) tmp = Float64(z + a); elseif (y <= 8.5e-64) tmp = Float64(z * Float64(Float64(x + y) / 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 <= -4.5e+148) tmp = t_1; elseif (y <= 1.22e-279) tmp = z + a; elseif (y <= 8.5e-64) tmp = z * ((x + y) / (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, -4.5e+148], t$95$1, If[LessEqual[y, 1.22e-279], N[(z + a), $MachinePrecision], If[LessEqual[y, 8.5e-64], N[(z * N[(N[(x + y), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-279}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-64}:\\
\;\;\;\;z \cdot \frac{x + y}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.49999999999999994e148 or 8.49999999999999996e-64 < y Initial program 33.9%
Taylor expanded in y around inf 85.8%
if -4.49999999999999994e148 < y < 1.22000000000000002e-279Initial program 62.8%
Taylor expanded in b around 0 57.2%
Taylor expanded in y around inf 62.5%
if 1.22000000000000002e-279 < y < 8.49999999999999996e-64Initial program 70.6%
Taylor expanded in z around inf 32.0%
associate-/l*48.4%
+-commutative48.4%
+-commutative48.4%
associate-+r+48.3%
Simplified48.3%
Taylor expanded in y around 0 47.9%
Final simplification70.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -7.5e+142)
t_1
(if (<= y 3.25e-142)
(+ z a)
(if (<= y 1.25e-38) (* z (/ x (+ 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 <= -7.5e+142) {
tmp = t_1;
} else if (y <= 3.25e-142) {
tmp = z + a;
} else if (y <= 1.25e-38) {
tmp = z * (x / (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 <= (-7.5d+142)) then
tmp = t_1
else if (y <= 3.25d-142) then
tmp = z + a
else if (y <= 1.25d-38) then
tmp = z * (x / (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 <= -7.5e+142) {
tmp = t_1;
} else if (y <= 3.25e-142) {
tmp = z + a;
} else if (y <= 1.25e-38) {
tmp = z * (x / (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 <= -7.5e+142: tmp = t_1 elif y <= 3.25e-142: tmp = z + a elif y <= 1.25e-38: tmp = z * (x / (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 <= -7.5e+142) tmp = t_1; elseif (y <= 3.25e-142) tmp = Float64(z + a); elseif (y <= 1.25e-38) tmp = Float64(z * Float64(x / 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 <= -7.5e+142) tmp = t_1; elseif (y <= 3.25e-142) tmp = z + a; elseif (y <= 1.25e-38) tmp = z * (x / (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, -7.5e+142], t$95$1, If[LessEqual[y, 3.25e-142], N[(z + a), $MachinePrecision], If[LessEqual[y, 1.25e-38], N[(z * N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.25 \cdot 10^{-142}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-38}:\\
\;\;\;\;z \cdot \frac{x}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.5000000000000002e142 or 1.25000000000000008e-38 < y Initial program 31.6%
Taylor expanded in y around inf 87.1%
if -7.5000000000000002e142 < y < 3.25000000000000013e-142Initial program 64.5%
Taylor expanded in b around 0 57.5%
Taylor expanded in y around inf 55.9%
if 3.25000000000000013e-142 < y < 1.25000000000000008e-38Initial program 76.9%
Taylor expanded in a around 0 63.1%
+-commutative63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in y around 0 36.4%
associate-/l*47.8%
+-commutative47.8%
Simplified47.8%
Taylor expanded in z around 0 36.4%
+-commutative36.4%
*-commutative36.4%
associate-*r/55.4%
Simplified55.4%
Final simplification69.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -7.5e+142)
t_1
(if (<= y 5.3e-143)
(+ z a)
(if (<= y 3.5e-62) (* x (/ z (+ 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 <= -7.5e+142) {
tmp = t_1;
} else if (y <= 5.3e-143) {
tmp = z + a;
} else if (y <= 3.5e-62) {
tmp = x * (z / (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 <= (-7.5d+142)) then
tmp = t_1
else if (y <= 5.3d-143) then
tmp = z + a
else if (y <= 3.5d-62) then
tmp = x * (z / (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 <= -7.5e+142) {
tmp = t_1;
} else if (y <= 5.3e-143) {
tmp = z + a;
} else if (y <= 3.5e-62) {
tmp = x * (z / (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 <= -7.5e+142: tmp = t_1 elif y <= 5.3e-143: tmp = z + a elif y <= 3.5e-62: tmp = x * (z / (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 <= -7.5e+142) tmp = t_1; elseif (y <= 5.3e-143) tmp = Float64(z + a); elseif (y <= 3.5e-62) tmp = Float64(x * Float64(z / 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 <= -7.5e+142) tmp = t_1; elseif (y <= 5.3e-143) tmp = z + a; elseif (y <= 3.5e-62) tmp = x * (z / (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, -7.5e+142], t$95$1, If[LessEqual[y, 5.3e-143], N[(z + a), $MachinePrecision], If[LessEqual[y, 3.5e-62], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-143}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \frac{z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.5000000000000002e142 or 3.5000000000000001e-62 < y Initial program 33.9%
Taylor expanded in y around inf 85.8%
if -7.5000000000000002e142 < y < 5.29999999999999997e-143Initial program 64.5%
Taylor expanded in b around 0 57.5%
Taylor expanded in y around inf 55.9%
if 5.29999999999999997e-143 < y < 3.5000000000000001e-62Initial program 72.5%
Taylor expanded in z around inf 34.7%
associate-/l*57.2%
+-commutative57.2%
+-commutative57.2%
associate-+r+57.1%
Simplified57.1%
Taylor expanded in y around 0 33.5%
associate-/l*51.6%
Simplified51.6%
Final simplification69.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.8e+142) (not (<= y 1.45e-64))) (- (+ z a) b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.8e+142) || !(y <= 1.45e-64)) {
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 <= (-7.8d+142)) .or. (.not. (y <= 1.45d-64))) 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 <= -7.8e+142) || !(y <= 1.45e-64)) {
tmp = (z + a) - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.8e+142) or not (y <= 1.45e-64): tmp = (z + a) - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.8e+142) || !(y <= 1.45e-64)) 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 <= -7.8e+142) || ~((y <= 1.45e-64))) tmp = (z + a) - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.8e+142], N[Not[LessEqual[y, 1.45e-64]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+142} \lor \neg \left(y \leq 1.45 \cdot 10^{-64}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if y < -7.8000000000000001e142 or 1.4499999999999999e-64 < y Initial program 34.5%
Taylor expanded in y around inf 85.1%
if -7.8000000000000001e142 < y < 1.4499999999999999e-64Initial program 65.4%
Taylor expanded in b around 0 55.9%
Taylor expanded in y around inf 52.5%
Final simplification67.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.2e-47) z (if (<= z 1.7e-24) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.2e-47) {
tmp = z;
} else if (z <= 1.7e-24) {
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 <= (-5.2d-47)) then
tmp = z
else if (z <= 1.7d-24) 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 <= -5.2e-47) {
tmp = z;
} else if (z <= 1.7e-24) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5.2e-47: tmp = z elif z <= 1.7e-24: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.2e-47) tmp = z; elseif (z <= 1.7e-24) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5.2e-47) tmp = z; elseif (z <= 1.7e-24) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.2e-47], z, If[LessEqual[z, 1.7e-24], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-47}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-24}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -5.2e-47 or 1.69999999999999996e-24 < z Initial program 46.0%
Taylor expanded in x around inf 52.1%
if -5.2e-47 < z < 1.69999999999999996e-24Initial program 58.7%
Taylor expanded in t around inf 50.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -8.5e+168) a (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -8.5e+168) {
tmp = a;
} 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 (t <= (-8.5d+168)) then
tmp = a
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 (t <= -8.5e+168) {
tmp = a;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -8.5e+168: tmp = a else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -8.5e+168) tmp = a; else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -8.5e+168) tmp = a; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -8.5e+168], a, N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+168}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if t < -8.50000000000000069e168Initial program 29.4%
Taylor expanded in t around inf 48.6%
if -8.50000000000000069e168 < t Initial program 54.4%
Taylor expanded in b around 0 45.7%
Taylor expanded in y around inf 63.0%
Final simplification61.1%
(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 51.2%
Taylor expanded in t around inf 35.0%
(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 2024132
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ 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)))