
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (* a (+ y t)))
(t_3 (/ (- (+ t_2 (* z (+ x y))) (* y b)) t_1)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 1e+61)))
(+
(/ (+ x y) (/ t_1 z))
(+ (* t (/ a (+ x (+ y t)))) (/ y (/ t_1 (- a b)))))
(/ (- (fma (+ x y) z t_2) (* y b)) 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 = a * (y + t);
double t_3 = ((t_2 + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 1e+61)) {
tmp = ((x + y) / (t_1 / z)) + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - b))));
} else {
tmp = (fma((x + y), z, t_2) - (y * b)) / t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(a * Float64(y + t)) t_3 = Float64(Float64(Float64(t_2 + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 1e+61)) tmp = Float64(Float64(Float64(x + y) / Float64(t_1 / z)) + Float64(Float64(t * Float64(a / Float64(x + Float64(y + t)))) + Float64(y / Float64(t_1 / Float64(a - b))))); else tmp = Float64(Float64(fma(Float64(x + y), z, t_2) - Float64(y * b)) / t_1); end return 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[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 1e+61]], $MachinePrecision]], N[(N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$2), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a \cdot \left(y + t\right)\\
t_3 := \frac{\left(t_2 + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_3 \leq -\infty \lor \neg \left(t_3 \leq 10^{+61}\right):\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}} + \left(t \cdot \frac{a}{x + \left(y + t\right)} + \frac{y}{\frac{t_1}{a - b}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t_2\right) - y \cdot b}{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 9.99999999999999949e60 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 19.9%
*-commutative19.9%
distribute-rgt-in19.8%
associate-+r+19.8%
associate--l+19.8%
+-commutative19.8%
+-commutative19.8%
distribute-lft-out--19.8%
fma-def20.2%
+-commutative20.2%
fma-def20.3%
associate-+l+20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in z around inf 19.8%
associate-/l*45.8%
+-commutative45.8%
associate-/l*76.5%
Simplified76.5%
*-un-lft-identity76.5%
associate-/l*99.8%
associate-+r+99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
associate-+r+99.8%
associate-/r/99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999949e60Initial program 99.8%
fma-def99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 1e+61)))
(+
(/ (+ x y) (/ t_1 z))
(+ (* t (/ a (+ x (+ y t)))) (/ y (/ t_1 (- a 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 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 1e+61)) {
tmp = ((x + y) / (t_1 / z)) + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - 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 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 1e+61)) {
tmp = ((x + y) / (t_1 / z)) + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - b))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 1e+61): tmp = ((x + y) / (t_1 / z)) + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - 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(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 1e+61)) tmp = Float64(Float64(Float64(x + y) / Float64(t_1 / z)) + Float64(Float64(t * Float64(a / Float64(x + Float64(y + t)))) + Float64(y / Float64(t_1 / Float64(a - 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 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 1e+61))) tmp = ((x + y) / (t_1 / z)) + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - 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[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $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+61]], $MachinePrecision]], N[(N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(N[(t * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 10^{+61}\right):\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}} + \left(t \cdot \frac{a}{x + \left(y + t\right)} + \frac{y}{\frac{t_1}{a - 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 9.99999999999999949e60 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 19.9%
*-commutative19.9%
distribute-rgt-in19.8%
associate-+r+19.8%
associate--l+19.8%
+-commutative19.8%
+-commutative19.8%
distribute-lft-out--19.8%
fma-def20.2%
+-commutative20.2%
fma-def20.3%
associate-+l+20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in z around inf 19.8%
associate-/l*45.8%
+-commutative45.8%
associate-/l*76.5%
Simplified76.5%
*-un-lft-identity76.5%
associate-/l*99.8%
associate-+r+99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
associate-+r+99.8%
associate-/r/99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999949e60Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 2e+130)))
(+ z (+ (* t (/ a (+ x (+ y t)))) (/ y (/ t_1 (- a 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 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 2e+130)) {
tmp = z + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - 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 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 2e+130)) {
tmp = z + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - b))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 2e+130): tmp = z + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - 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(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 2e+130)) tmp = Float64(z + Float64(Float64(t * Float64(a / Float64(x + Float64(y + t)))) + Float64(y / Float64(t_1 / Float64(a - 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 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 2e+130))) tmp = z + ((t * (a / (x + (y + t)))) + (y / (t_1 / (a - 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[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $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, 2e+130]], $MachinePrecision]], N[(z + N[(N[(t * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 2 \cdot 10^{+130}\right):\\
\;\;\;\;z + \left(t \cdot \frac{a}{x + \left(y + t\right)} + \frac{y}{\frac{t_1}{a - 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 2.0000000000000001e130 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 14.5%
*-commutative14.5%
distribute-rgt-in14.3%
associate-+r+14.3%
associate--l+14.3%
+-commutative14.3%
+-commutative14.3%
distribute-lft-out--14.4%
fma-def14.8%
+-commutative14.8%
fma-def14.9%
associate-+l+14.9%
+-commutative14.9%
Simplified14.9%
Taylor expanded in z around inf 14.4%
associate-/l*42.1%
+-commutative42.1%
associate-/l*74.9%
Simplified74.9%
*-un-lft-identity74.9%
associate-/l*99.8%
associate-+r+99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
associate-+r+99.8%
associate-/r/99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 89.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)) < 2.0000000000000001e130Initial program 99.8%
Final simplification94.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+231))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+231)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+231)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+231): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+231)) 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 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+231))) 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[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+231]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+231}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;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 5.3%
Taylor expanded in y around inf 73.7%
+-commutative73.7%
Simplified73.7%
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.8%
Final simplification87.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* y (- a b)) (* z (+ x y))) (+ x y)))
(t_2 (+ y (+ x t)))
(t_3 (- (+ z a) b)))
(if (<= y -44000000.0)
t_3
(if (<= y -1.28e-135)
(/ (* y t_3) t_2)
(if (<= y 1.05e-99)
(/ (+ (* x z) (* t a)) (+ x t))
(if (<= y 6.2e-55)
t_1
(if (<= y 4.3e-6)
(/ (+ x y) (/ t_2 z))
(if (<= y 2.65e+35) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * (a - b)) + (z * (x + y))) / (x + y);
double t_2 = y + (x + t);
double t_3 = (z + a) - b;
double tmp;
if (y <= -44000000.0) {
tmp = t_3;
} else if (y <= -1.28e-135) {
tmp = (y * t_3) / t_2;
} else if (y <= 1.05e-99) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 6.2e-55) {
tmp = t_1;
} else if (y <= 4.3e-6) {
tmp = (x + y) / (t_2 / z);
} else if (y <= 2.65e+35) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = ((y * (a - b)) + (z * (x + y))) / (x + y)
t_2 = y + (x + t)
t_3 = (z + a) - b
if (y <= (-44000000.0d0)) then
tmp = t_3
else if (y <= (-1.28d-135)) then
tmp = (y * t_3) / t_2
else if (y <= 1.05d-99) then
tmp = ((x * z) + (t * a)) / (x + t)
else if (y <= 6.2d-55) then
tmp = t_1
else if (y <= 4.3d-6) then
tmp = (x + y) / (t_2 / z)
else if (y <= 2.65d+35) then
tmp = t_1
else
tmp = t_3
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 * (a - b)) + (z * (x + y))) / (x + y);
double t_2 = y + (x + t);
double t_3 = (z + a) - b;
double tmp;
if (y <= -44000000.0) {
tmp = t_3;
} else if (y <= -1.28e-135) {
tmp = (y * t_3) / t_2;
} else if (y <= 1.05e-99) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 6.2e-55) {
tmp = t_1;
} else if (y <= 4.3e-6) {
tmp = (x + y) / (t_2 / z);
} else if (y <= 2.65e+35) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((y * (a - b)) + (z * (x + y))) / (x + y) t_2 = y + (x + t) t_3 = (z + a) - b tmp = 0 if y <= -44000000.0: tmp = t_3 elif y <= -1.28e-135: tmp = (y * t_3) / t_2 elif y <= 1.05e-99: tmp = ((x * z) + (t * a)) / (x + t) elif y <= 6.2e-55: tmp = t_1 elif y <= 4.3e-6: tmp = (x + y) / (t_2 / z) elif y <= 2.65e+35: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * Float64(a - b)) + Float64(z * Float64(x + y))) / Float64(x + y)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -44000000.0) tmp = t_3; elseif (y <= -1.28e-135) tmp = Float64(Float64(y * t_3) / t_2); elseif (y <= 1.05e-99) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); elseif (y <= 6.2e-55) tmp = t_1; elseif (y <= 4.3e-6) tmp = Float64(Float64(x + y) / Float64(t_2 / z)); elseif (y <= 2.65e+35) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((y * (a - b)) + (z * (x + y))) / (x + y); t_2 = y + (x + t); t_3 = (z + a) - b; tmp = 0.0; if (y <= -44000000.0) tmp = t_3; elseif (y <= -1.28e-135) tmp = (y * t_3) / t_2; elseif (y <= 1.05e-99) tmp = ((x * z) + (t * a)) / (x + t); elseif (y <= 6.2e-55) tmp = t_1; elseif (y <= 4.3e-6) tmp = (x + y) / (t_2 / z); elseif (y <= 2.65e+35) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -44000000.0], t$95$3, If[LessEqual[y, -1.28e-135], N[(N[(y * t$95$3), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[y, 1.05e-99], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-55], t$95$1, If[LessEqual[y, 4.3e-6], N[(N[(x + y), $MachinePrecision] / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e+35], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(a - b\right) + z \cdot \left(x + y\right)}{x + y}\\
t_2 := y + \left(x + t\right)\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -44000000:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -1.28 \cdot 10^{-135}:\\
\;\;\;\;\frac{y \cdot t_3}{t_2}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-99}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-6}:\\
\;\;\;\;\frac{x + y}{\frac{t_2}{z}}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -4.4e7 or 2.65000000000000005e35 < y Initial program 37.0%
Taylor expanded in y around inf 74.2%
+-commutative74.2%
Simplified74.2%
if -4.4e7 < y < -1.27999999999999997e-135Initial program 79.5%
Taylor expanded in y around inf 58.6%
+-commutative58.6%
Simplified58.6%
if -1.27999999999999997e-135 < y < 1.04999999999999992e-99Initial program 73.6%
Taylor expanded in y around 0 65.2%
if 1.04999999999999992e-99 < y < 6.19999999999999993e-55 or 4.30000000000000033e-6 < y < 2.65000000000000005e35Initial program 81.9%
*-commutative81.9%
distribute-rgt-in81.9%
associate-+r+81.9%
associate--l+81.9%
+-commutative81.9%
+-commutative81.9%
distribute-lft-out--81.9%
fma-def81.9%
+-commutative81.9%
fma-def81.9%
associate-+l+81.9%
+-commutative81.9%
Simplified81.9%
Taylor expanded in t around 0 78.4%
if 6.19999999999999993e-55 < y < 4.30000000000000033e-6Initial program 53.8%
Taylor expanded in z around inf 18.6%
associate-/l*64.8%
Simplified64.8%
Final simplification69.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.32e+37) (not (<= y 1.5e+74))) (- (+ z a) b) (+ (/ (+ x y) (/ (+ y (+ x t)) z)) (+ a (/ (* y (- a b)) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.32e+37) || !(y <= 1.5e+74)) {
tmp = (z + a) - b;
} else {
tmp = ((x + y) / ((y + (x + t)) / z)) + (a + ((y * (a - b)) / 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.32d+37)) .or. (.not. (y <= 1.5d+74))) then
tmp = (z + a) - b
else
tmp = ((x + y) / ((y + (x + t)) / z)) + (a + ((y * (a - b)) / 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.32e+37) || !(y <= 1.5e+74)) {
tmp = (z + a) - b;
} else {
tmp = ((x + y) / ((y + (x + t)) / z)) + (a + ((y * (a - b)) / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.32e+37) or not (y <= 1.5e+74): tmp = (z + a) - b else: tmp = ((x + y) / ((y + (x + t)) / z)) + (a + ((y * (a - b)) / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.32e+37) || !(y <= 1.5e+74)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(x + y) / Float64(Float64(y + Float64(x + t)) / z)) + Float64(a + Float64(Float64(y * Float64(a - b)) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.32e+37) || ~((y <= 1.5e+74))) tmp = (z + a) - b; else tmp = ((x + y) / ((y + (x + t)) / z)) + (a + ((y * (a - b)) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.32e+37], N[Not[LessEqual[y, 1.5e+74]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(x + y), $MachinePrecision] / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(a + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.32 \cdot 10^{+37} \lor \neg \left(y \leq 1.5 \cdot 10^{+74}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y}{\frac{y + \left(x + t\right)}{z}} + \left(a + \frac{y \cdot \left(a - b\right)}{t}\right)\\
\end{array}
\end{array}
if y < -1.3199999999999999e37 or 1.5e74 < y Initial program 32.9%
Taylor expanded in y around inf 78.0%
+-commutative78.0%
Simplified78.0%
if -1.3199999999999999e37 < y < 1.5e74Initial program 74.3%
*-commutative74.3%
distribute-rgt-in74.3%
associate-+r+74.3%
associate--l+74.3%
+-commutative74.3%
+-commutative74.3%
distribute-lft-out--74.3%
fma-def74.3%
+-commutative74.3%
fma-def74.3%
associate-+l+74.3%
+-commutative74.3%
Simplified74.3%
Taylor expanded in z around inf 74.3%
associate-/l*82.3%
+-commutative82.3%
associate-/l*81.0%
Simplified81.0%
Taylor expanded in t around inf 81.6%
Taylor expanded in t around inf 70.7%
Final simplification74.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) b)))
(if (<= y -24000000.0)
t_2
(if (<= y -3.3e-130)
(/ (* y t_2) t_1)
(if (<= y 4.9e-119)
(/ (+ (* x z) (* t a)) (+ x t))
(if (<= y 3.4e-54)
(/ a (/ t_1 (+ y t)))
(if (<= y 2.45e-46)
(+ a (/ (* x (- z a)) t))
(if (<= y 1700000.0) (/ (+ x y) (/ t_1 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 = (z + a) - b;
double tmp;
if (y <= -24000000.0) {
tmp = t_2;
} else if (y <= -3.3e-130) {
tmp = (y * t_2) / t_1;
} else if (y <= 4.9e-119) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 3.4e-54) {
tmp = a / (t_1 / (y + t));
} else if (y <= 2.45e-46) {
tmp = a + ((x * (z - a)) / t);
} else if (y <= 1700000.0) {
tmp = (x + y) / (t_1 / z);
} 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 + a) - b
if (y <= (-24000000.0d0)) then
tmp = t_2
else if (y <= (-3.3d-130)) then
tmp = (y * t_2) / t_1
else if (y <= 4.9d-119) then
tmp = ((x * z) + (t * a)) / (x + t)
else if (y <= 3.4d-54) then
tmp = a / (t_1 / (y + t))
else if (y <= 2.45d-46) then
tmp = a + ((x * (z - a)) / t)
else if (y <= 1700000.0d0) then
tmp = (x + y) / (t_1 / z)
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 + a) - b;
double tmp;
if (y <= -24000000.0) {
tmp = t_2;
} else if (y <= -3.3e-130) {
tmp = (y * t_2) / t_1;
} else if (y <= 4.9e-119) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 3.4e-54) {
tmp = a / (t_1 / (y + t));
} else if (y <= 2.45e-46) {
tmp = a + ((x * (z - a)) / t);
} else if (y <= 1700000.0) {
tmp = (x + y) / (t_1 / z);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - b tmp = 0 if y <= -24000000.0: tmp = t_2 elif y <= -3.3e-130: tmp = (y * t_2) / t_1 elif y <= 4.9e-119: tmp = ((x * z) + (t * a)) / (x + t) elif y <= 3.4e-54: tmp = a / (t_1 / (y + t)) elif y <= 2.45e-46: tmp = a + ((x * (z - a)) / t) elif y <= 1700000.0: tmp = (x + y) / (t_1 / z) 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(z + a) - b) tmp = 0.0 if (y <= -24000000.0) tmp = t_2; elseif (y <= -3.3e-130) tmp = Float64(Float64(y * t_2) / t_1); elseif (y <= 4.9e-119) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); elseif (y <= 3.4e-54) tmp = Float64(a / Float64(t_1 / Float64(y + t))); elseif (y <= 2.45e-46) tmp = Float64(a + Float64(Float64(x * Float64(z - a)) / t)); elseif (y <= 1700000.0) tmp = Float64(Float64(x + y) / Float64(t_1 / z)); 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 + a) - b; tmp = 0.0; if (y <= -24000000.0) tmp = t_2; elseif (y <= -3.3e-130) tmp = (y * t_2) / t_1; elseif (y <= 4.9e-119) tmp = ((x * z) + (t * a)) / (x + t); elseif (y <= 3.4e-54) tmp = a / (t_1 / (y + t)); elseif (y <= 2.45e-46) tmp = a + ((x * (z - a)) / t); elseif (y <= 1700000.0) tmp = (x + y) / (t_1 / z); 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[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -24000000.0], t$95$2, If[LessEqual[y, -3.3e-130], N[(N[(y * t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 4.9e-119], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-54], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e-46], N[(a + N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1700000.0], N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -24000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-130}:\\
\;\;\;\;\frac{y \cdot t_2}{t_1}\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{-119}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-54}:\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-46}:\\
\;\;\;\;a + \frac{x \cdot \left(z - a\right)}{t}\\
\mathbf{elif}\;y \leq 1700000:\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.4e7 or 1.7e6 < y Initial program 38.8%
Taylor expanded in y around inf 72.7%
+-commutative72.7%
Simplified72.7%
if -2.4e7 < y < -3.2999999999999998e-130Initial program 79.5%
Taylor expanded in y around inf 58.6%
+-commutative58.6%
Simplified58.6%
if -3.2999999999999998e-130 < y < 4.9e-119Initial program 75.4%
Taylor expanded in y around 0 66.6%
if 4.9e-119 < y < 3.39999999999999987e-54Initial program 71.1%
Taylor expanded in a around inf 51.9%
associate-/l*80.3%
Simplified80.3%
if 3.39999999999999987e-54 < y < 2.45e-46Initial program 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in t around -inf 100.0%
mul-1-neg100.0%
unsub-neg100.0%
distribute-lft-out--100.0%
distribute-rgt-out--100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
if 2.45e-46 < y < 1.7e6Initial program 53.8%
Taylor expanded in z around inf 19.4%
associate-/l*65.4%
Simplified65.4%
Final simplification69.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.65e+37)
t_1
(if (<= y -1.02e-204)
(/ (- (+ (* y z) (* a (+ y t))) (* y b)) (+ y t))
(if (<= y 1.8e-104) (/ (+ (* x z) (* t a)) (+ x t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.65e+37) {
tmp = t_1;
} else if (y <= -1.02e-204) {
tmp = (((y * z) + (a * (y + t))) - (y * b)) / (y + t);
} else if (y <= 1.8e-104) {
tmp = ((x * z) + (t * a)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-1.65d+37)) then
tmp = t_1
else if (y <= (-1.02d-204)) then
tmp = (((y * z) + (a * (y + t))) - (y * b)) / (y + t)
else if (y <= 1.8d-104) then
tmp = ((x * z) + (t * a)) / (x + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.65e+37) {
tmp = t_1;
} else if (y <= -1.02e-204) {
tmp = (((y * z) + (a * (y + t))) - (y * b)) / (y + t);
} else if (y <= 1.8e-104) {
tmp = ((x * z) + (t * a)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.65e+37: tmp = t_1 elif y <= -1.02e-204: tmp = (((y * z) + (a * (y + t))) - (y * b)) / (y + t) elif y <= 1.8e-104: tmp = ((x * z) + (t * a)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.65e+37) tmp = t_1; elseif (y <= -1.02e-204) tmp = Float64(Float64(Float64(Float64(y * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + t)); elseif (y <= 1.8e-104) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.65e+37) tmp = t_1; elseif (y <= -1.02e-204) tmp = (((y * z) + (a * (y + t))) - (y * b)) / (y + t); elseif (y <= 1.8e-104) tmp = ((x * z) + (t * a)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.65e+37], t$95$1, If[LessEqual[y, -1.02e-204], N[(N[(N[(N[(y * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-104], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{-204}:\\
\;\;\;\;\frac{\left(y \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{y + t}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-104}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.65e37 or 1.7999999999999999e-104 < y Initial program 40.6%
Taylor expanded in y around inf 72.0%
+-commutative72.0%
Simplified72.0%
if -1.65e37 < y < -1.0200000000000001e-204Initial program 76.1%
Taylor expanded in x around 0 60.5%
if -1.0200000000000001e-204 < y < 1.7999999999999999e-104Initial program 75.2%
Taylor expanded in y around 0 66.9%
Final simplification68.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -32000000.0) (not (<= t 2e+150))) (/ a (/ (+ y (+ x t)) (+ y t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -32000000.0) || !(t <= 2e+150)) {
tmp = a / ((y + (x + t)) / (y + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-32000000.0d0)) .or. (.not. (t <= 2d+150))) then
tmp = a / ((y + (x + t)) / (y + t))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -32000000.0) || !(t <= 2e+150)) {
tmp = a / ((y + (x + t)) / (y + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -32000000.0) or not (t <= 2e+150): tmp = a / ((y + (x + t)) / (y + t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -32000000.0) || !(t <= 2e+150)) tmp = Float64(a / Float64(Float64(y + Float64(x + t)) / Float64(y + t))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -32000000.0) || ~((t <= 2e+150))) tmp = a / ((y + (x + t)) / (y + t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -32000000.0], N[Not[LessEqual[t, 2e+150]], $MachinePrecision]], N[(a / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -32000000 \lor \neg \left(t \leq 2 \cdot 10^{+150}\right):\\
\;\;\;\;\frac{a}{\frac{y + \left(x + t\right)}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -3.2e7 or 1.99999999999999996e150 < t Initial program 48.1%
Taylor expanded in a around inf 29.8%
associate-/l*59.4%
Simplified59.4%
if -3.2e7 < t < 1.99999999999999996e150Initial program 60.2%
Taylor expanded in y around inf 67.9%
+-commutative67.9%
Simplified67.9%
Final simplification64.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9.2e+45) a (if (<= t 6.6e+173) (- (+ z a) b) (+ a (/ (* x (- z a)) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.2e+45) {
tmp = a;
} else if (t <= 6.6e+173) {
tmp = (z + a) - b;
} else {
tmp = a + ((x * (z - a)) / 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 (t <= (-9.2d+45)) then
tmp = a
else if (t <= 6.6d+173) then
tmp = (z + a) - b
else
tmp = a + ((x * (z - a)) / 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 (t <= -9.2e+45) {
tmp = a;
} else if (t <= 6.6e+173) {
tmp = (z + a) - b;
} else {
tmp = a + ((x * (z - a)) / t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9.2e+45: tmp = a elif t <= 6.6e+173: tmp = (z + a) - b else: tmp = a + ((x * (z - a)) / t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.2e+45) tmp = a; elseif (t <= 6.6e+173) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a + Float64(Float64(x * Float64(z - a)) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9.2e+45) tmp = a; elseif (t <= 6.6e+173) tmp = (z + a) - b; else tmp = a + ((x * (z - a)) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.2e+45], a, If[LessEqual[t, 6.6e+173], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+45}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+173}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + \frac{x \cdot \left(z - a\right)}{t}\\
\end{array}
\end{array}
if t < -9.20000000000000049e45Initial program 56.5%
Taylor expanded in t around inf 55.9%
if -9.20000000000000049e45 < t < 6.59999999999999993e173Initial program 59.1%
Taylor expanded in y around inf 66.8%
+-commutative66.8%
Simplified66.8%
if 6.59999999999999993e173 < t Initial program 38.8%
Taylor expanded in y around 0 27.4%
Taylor expanded in t around -inf 56.1%
mul-1-neg56.1%
unsub-neg56.1%
distribute-lft-out--56.1%
distribute-rgt-out--56.2%
associate-*r*56.2%
neg-mul-156.2%
Simplified56.2%
Final simplification63.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.85e+234) z (if (<= z -1.9e+156) a (if (<= z -1.6e+86) z (if (<= z 7.8e-16) a z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.85e+234) {
tmp = z;
} else if (z <= -1.9e+156) {
tmp = a;
} else if (z <= -1.6e+86) {
tmp = z;
} else if (z <= 7.8e-16) {
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.85d+234)) then
tmp = z
else if (z <= (-1.9d+156)) then
tmp = a
else if (z <= (-1.6d+86)) then
tmp = z
else if (z <= 7.8d-16) 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.85e+234) {
tmp = z;
} else if (z <= -1.9e+156) {
tmp = a;
} else if (z <= -1.6e+86) {
tmp = z;
} else if (z <= 7.8e-16) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.85e+234: tmp = z elif z <= -1.9e+156: tmp = a elif z <= -1.6e+86: tmp = z elif z <= 7.8e-16: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.85e+234) tmp = z; elseif (z <= -1.9e+156) tmp = a; elseif (z <= -1.6e+86) tmp = z; elseif (z <= 7.8e-16) 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.85e+234) tmp = z; elseif (z <= -1.9e+156) tmp = a; elseif (z <= -1.6e+86) tmp = z; elseif (z <= 7.8e-16) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.85e+234], z, If[LessEqual[z, -1.9e+156], a, If[LessEqual[z, -1.6e+86], z, If[LessEqual[z, 7.8e-16], a, z]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+234}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{+156}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{+86}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-16}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -2.85000000000000002e234 or -1.90000000000000012e156 < z < -1.6e86 or 7.79999999999999954e-16 < z Initial program 44.5%
Taylor expanded in x around inf 57.9%
if -2.85000000000000002e234 < z < -1.90000000000000012e156 or -1.6e86 < z < 7.79999999999999954e-16Initial program 62.7%
Taylor expanded in t around inf 49.5%
Final simplification52.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9.2e+45) a (if (<= t 5.6e+172) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9.2e+45) {
tmp = a;
} else if (t <= 5.6e+172) {
tmp = (z + a) - b;
} else {
tmp = 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 <= (-9.2d+45)) then
tmp = a
else if (t <= 5.6d+172) then
tmp = (z + a) - b
else
tmp = 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 <= -9.2e+45) {
tmp = a;
} else if (t <= 5.6e+172) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9.2e+45: tmp = a elif t <= 5.6e+172: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9.2e+45) tmp = a; elseif (t <= 5.6e+172) tmp = Float64(Float64(z + a) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -9.2e+45) tmp = a; elseif (t <= 5.6e+172) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9.2e+45], a, If[LessEqual[t, 5.6e+172], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+45}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+172}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -9.20000000000000049e45 or 5.5999999999999999e172 < t Initial program 49.1%
Taylor expanded in t around inf 54.8%
if -9.20000000000000049e45 < t < 5.5999999999999999e172Initial program 58.9%
Taylor expanded in y around inf 67.1%
+-commutative67.1%
Simplified67.1%
Final simplification62.9%
(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 55.5%
Taylor expanded in t around inf 36.1%
Final simplification36.1%
(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 2023213
(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)))