
(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 14 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 (+ x (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) t_2)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 5e+292)))
(+
(/ (+ x y) (/ t_1 z))
(- (* a (+ (/ y t_1) (/ t t_1))) (* b (/ y t_2))))
t_3)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = y + (x + t);
double t_3 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 5e+292)) {
tmp = ((x + y) / (t_1 / z)) + ((a * ((y / t_1) + (t / t_1))) - (b * (y / t_2)));
} else {
tmp = t_3;
}
return tmp;
}
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 = y + (x + t);
double t_3 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 5e+292)) {
tmp = ((x + y) / (t_1 / z)) + ((a * ((y / t_1) + (t / t_1))) - (b * (y / t_2)));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = y + (x + t) t_3 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_2 tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 5e+292): tmp = ((x + y) / (t_1 / z)) + ((a * ((y / t_1) + (t / t_1))) - (b * (y / t_2))) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / t_2) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 5e+292)) tmp = Float64(Float64(Float64(x + y) / Float64(t_1 / z)) + Float64(Float64(a * Float64(Float64(y / t_1) + Float64(t / t_1))) - Float64(b * Float64(y / t_2)))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = y + (x + t); t_3 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / t_2; tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 5e+292))) tmp = ((x + y) / (t_1 / z)) + ((a * ((y / t_1) + (t / t_1))) - (b * (y / t_2))); else tmp = t_3; 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[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$2), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 5e+292]], $MachinePrecision]], N[(N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(N[(y / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{t_2}\\
\mathbf{if}\;t_3 \leq -\infty \lor \neg \left(t_3 \leq 5 \cdot 10^{+292}\right):\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}} + \left(a \cdot \left(\frac{y}{t_1} + \frac{t}{t_1}\right) - b \cdot \frac{y}{t_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\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 4.9999999999999996e292 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.4%
Taylor expanded in a around 0 32.3%
associate--l+32.3%
associate-/l*79.0%
associate-+r+79.0%
associate-+r+79.0%
associate-+r+79.0%
associate-/l*99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-/r/99.9%
associate-+l+99.9%
+-commutative99.9%
Applied egg-rr99.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)) < 4.9999999999999996e292Initial program 99.6%
Final simplification99.7%
(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 5e+292)))
(+ (/ (+ x y) (/ (+ x (+ y t)) z)) (- a (* b (/ y t_1))))
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 <= 5e+292)) {
tmp = ((x + y) / ((x + (y + t)) / z)) + (a - (b * (y / t_1)));
} 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 <= 5e+292)) {
tmp = ((x + y) / ((x + (y + t)) / z)) + (a - (b * (y / t_1)));
} 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 <= 5e+292): tmp = ((x + y) / ((x + (y + t)) / z)) + (a - (b * (y / t_1))) 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 <= 5e+292)) tmp = Float64(Float64(Float64(x + y) / Float64(Float64(x + Float64(y + t)) / z)) + Float64(a - Float64(b * Float64(y / t_1)))); 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 <= 5e+292))) tmp = ((x + y) / ((x + (y + t)) / z)) + (a - (b * (y / t_1))); 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, 5e+292]], $MachinePrecision]], N[(N[(N[(x + y), $MachinePrecision] / N[(N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(a - N[(b * N[(y / t$95$1), $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 5 \cdot 10^{+292}\right):\\
\;\;\;\;\frac{x + y}{\frac{x + \left(y + t\right)}{z}} + \left(a - b \cdot \frac{y}{t_1}\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 4.9999999999999996e292 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.4%
Taylor expanded in a around 0 32.3%
associate--l+32.3%
associate-/l*79.0%
associate-+r+79.0%
associate-+r+79.0%
associate-+r+79.0%
associate-/l*99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
associate-/r/99.9%
associate-+l+99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 91.0%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999996e292Initial program 99.6%
Final simplification95.8%
(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 5e+292))) (- (+ 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 <= 5e+292)) {
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 <= 5e+292)) {
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 <= 5e+292): 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 <= 5e+292)) 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 <= 5e+292))) 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, 5e+292]], $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 5 \cdot 10^{+292}\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 4.9999999999999996e292 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.4%
Taylor expanded in y around inf 76.6%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999996e292Initial program 99.6%
Final simplification89.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (- (+ z a) b))
(t_3 (/ (+ (* a (+ y t)) (* z (+ x y))) t_1)))
(if (<= y -48000000000000.0)
t_2
(if (<= y -4.1e-76)
(/ (- (* t a) (* y b)) t_1)
(if (<= y -8e-144)
t_3
(if (<= y -8.8e-167)
(/ (- (* x z) (* y b)) t_1)
(if (<= y 1.9e+26) t_3 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 t_3 = ((a * (y + t)) + (z * (x + y))) / t_1;
double tmp;
if (y <= -48000000000000.0) {
tmp = t_2;
} else if (y <= -4.1e-76) {
tmp = ((t * a) - (y * b)) / t_1;
} else if (y <= -8e-144) {
tmp = t_3;
} else if (y <= -8.8e-167) {
tmp = ((x * z) - (y * b)) / t_1;
} else if (y <= 1.9e+26) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (z + a) - b
t_3 = ((a * (y + t)) + (z * (x + y))) / t_1
if (y <= (-48000000000000.0d0)) then
tmp = t_2
else if (y <= (-4.1d-76)) then
tmp = ((t * a) - (y * b)) / t_1
else if (y <= (-8d-144)) then
tmp = t_3
else if (y <= (-8.8d-167)) then
tmp = ((x * z) - (y * b)) / t_1
else if (y <= 1.9d+26) then
tmp = t_3
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 t_3 = ((a * (y + t)) + (z * (x + y))) / t_1;
double tmp;
if (y <= -48000000000000.0) {
tmp = t_2;
} else if (y <= -4.1e-76) {
tmp = ((t * a) - (y * b)) / t_1;
} else if (y <= -8e-144) {
tmp = t_3;
} else if (y <= -8.8e-167) {
tmp = ((x * z) - (y * b)) / t_1;
} else if (y <= 1.9e+26) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - b t_3 = ((a * (y + t)) + (z * (x + y))) / t_1 tmp = 0 if y <= -48000000000000.0: tmp = t_2 elif y <= -4.1e-76: tmp = ((t * a) - (y * b)) / t_1 elif y <= -8e-144: tmp = t_3 elif y <= -8.8e-167: tmp = ((x * z) - (y * b)) / t_1 elif y <= 1.9e+26: tmp = t_3 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) t_3 = Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) / t_1) tmp = 0.0 if (y <= -48000000000000.0) tmp = t_2; elseif (y <= -4.1e-76) tmp = Float64(Float64(Float64(t * a) - Float64(y * b)) / t_1); elseif (y <= -8e-144) tmp = t_3; elseif (y <= -8.8e-167) tmp = Float64(Float64(Float64(x * z) - Float64(y * b)) / t_1); elseif (y <= 1.9e+26) tmp = t_3; 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; t_3 = ((a * (y + t)) + (z * (x + y))) / t_1; tmp = 0.0; if (y <= -48000000000000.0) tmp = t_2; elseif (y <= -4.1e-76) tmp = ((t * a) - (y * b)) / t_1; elseif (y <= -8e-144) tmp = t_3; elseif (y <= -8.8e-167) tmp = ((x * z) - (y * b)) / t_1; elseif (y <= 1.9e+26) tmp = t_3; 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]}, Block[{t$95$3 = N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[y, -48000000000000.0], t$95$2, If[LessEqual[y, -4.1e-76], N[(N[(N[(t * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, -8e-144], t$95$3, If[LessEqual[y, -8.8e-167], N[(N[(N[(x * z), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 1.9e+26], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - b\\
t_3 := \frac{a \cdot \left(y + t\right) + z \cdot \left(x + y\right)}{t_1}\\
\mathbf{if}\;y \leq -48000000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{-76}:\\
\;\;\;\;\frac{t \cdot a - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq -8 \cdot 10^{-144}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-167}:\\
\;\;\;\;\frac{x \cdot z - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+26}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -4.8e13 or 1.9000000000000001e26 < y Initial program 34.0%
Taylor expanded in y around inf 77.8%
if -4.8e13 < y < -4.0999999999999998e-76Initial program 89.1%
Taylor expanded in t around inf 69.9%
if -4.0999999999999998e-76 < y < -7.9999999999999996e-144 or -8.7999999999999999e-167 < y < 1.9000000000000001e26Initial program 76.0%
Taylor expanded in b around 0 69.1%
if -7.9999999999999996e-144 < y < -8.7999999999999999e-167Initial program 99.7%
Taylor expanded in x around inf 80.9%
Final simplification73.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) b)))
(if (<= y -2700000000000.0)
t_2
(if (<= y -1e-75)
(/ (- (* t a) (* y b)) t_1)
(if (<= y -2.4e-117)
(/ (+ x y) (/ (+ x (+ y t)) z))
(if (<= y 1.6e-51)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 3e+64) (* z (/ (+ x y) t_1)) 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 <= -2700000000000.0) {
tmp = t_2;
} else if (y <= -1e-75) {
tmp = ((t * a) - (y * b)) / t_1;
} else if (y <= -2.4e-117) {
tmp = (x + y) / ((x + (y + t)) / z);
} else if (y <= 1.6e-51) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 3e+64) {
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 = y + (x + t)
t_2 = (z + a) - b
if (y <= (-2700000000000.0d0)) then
tmp = t_2
else if (y <= (-1d-75)) then
tmp = ((t * a) - (y * b)) / t_1
else if (y <= (-2.4d-117)) then
tmp = (x + y) / ((x + (y + t)) / z)
else if (y <= 1.6d-51) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 3d+64) 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 = y + (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -2700000000000.0) {
tmp = t_2;
} else if (y <= -1e-75) {
tmp = ((t * a) - (y * b)) / t_1;
} else if (y <= -2.4e-117) {
tmp = (x + y) / ((x + (y + t)) / z);
} else if (y <= 1.6e-51) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 3e+64) {
tmp = z * ((x + y) / t_1);
} 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 <= -2700000000000.0: tmp = t_2 elif y <= -1e-75: tmp = ((t * a) - (y * b)) / t_1 elif y <= -2.4e-117: tmp = (x + y) / ((x + (y + t)) / z) elif y <= 1.6e-51: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 3e+64: tmp = z * ((x + y) / t_1) 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 <= -2700000000000.0) tmp = t_2; elseif (y <= -1e-75) tmp = Float64(Float64(Float64(t * a) - Float64(y * b)) / t_1); elseif (y <= -2.4e-117) tmp = Float64(Float64(x + y) / Float64(Float64(x + Float64(y + t)) / z)); elseif (y <= 1.6e-51) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 3e+64) 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 = y + (x + t); t_2 = (z + a) - b; tmp = 0.0; if (y <= -2700000000000.0) tmp = t_2; elseif (y <= -1e-75) tmp = ((t * a) - (y * b)) / t_1; elseif (y <= -2.4e-117) tmp = (x + y) / ((x + (y + t)) / z); elseif (y <= 1.6e-51) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 3e+64) 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[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2700000000000.0], t$95$2, If[LessEqual[y, -1e-75], N[(N[(N[(t * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, -2.4e-117], N[(N[(x + y), $MachinePrecision] / N[(N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-51], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+64], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $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 -2700000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1 \cdot 10^{-75}:\\
\;\;\;\;\frac{t \cdot a - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-117}:\\
\;\;\;\;\frac{x + y}{\frac{x + \left(y + t\right)}{z}}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+64}:\\
\;\;\;\;z \cdot \frac{x + y}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.7e12 or 3.0000000000000002e64 < y Initial program 33.9%
Taylor expanded in y around inf 80.2%
if -2.7e12 < y < -9.9999999999999996e-76Initial program 89.1%
Taylor expanded in t around inf 69.9%
if -9.9999999999999996e-76 < y < -2.40000000000000014e-117Initial program 72.9%
Taylor expanded in z around inf 59.4%
associate-/l*86.3%
associate-+r+86.3%
Simplified86.3%
if -2.40000000000000014e-117 < y < 1.6e-51Initial program 77.3%
Taylor expanded in y around 0 62.8%
if 1.6e-51 < y < 3.0000000000000002e64Initial program 63.2%
Taylor expanded in z around inf 47.2%
associate-/l*73.0%
associate-+r+73.0%
Simplified73.0%
associate-/r/78.7%
associate-+l+78.7%
+-commutative78.7%
Applied egg-rr78.7%
Final simplification72.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -4.6e-113)
t_1
(if (<= y 7.5e-52)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 4.2e+65) (* z (/ (+ x y) (+ 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.6e-113) {
tmp = t_1;
} else if (y <= 7.5e-52) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 4.2e+65) {
tmp = z * ((x + y) / (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.6d-113)) then
tmp = t_1
else if (y <= 7.5d-52) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 4.2d+65) then
tmp = z * ((x + y) / (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.6e-113) {
tmp = t_1;
} else if (y <= 7.5e-52) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 4.2e+65) {
tmp = z * ((x + y) / (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.6e-113: tmp = t_1 elif y <= 7.5e-52: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 4.2e+65: tmp = z * ((x + y) / (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.6e-113) tmp = t_1; elseif (y <= 7.5e-52) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 4.2e+65) tmp = Float64(z * Float64(Float64(x + y) / 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 <= -4.6e-113) tmp = t_1; elseif (y <= 7.5e-52) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 4.2e+65) tmp = z * ((x + y) / (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.6e-113], t$95$1, If[LessEqual[y, 7.5e-52], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+65], N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + 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 -4.6 \cdot 10^{-113}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-52}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+65}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.60000000000000016e-113 or 4.19999999999999983e65 < y Initial program 43.0%
Taylor expanded in y around inf 75.3%
if -4.60000000000000016e-113 < y < 7.50000000000000006e-52Initial program 76.8%
Taylor expanded in y around 0 62.6%
if 7.50000000000000006e-52 < y < 4.19999999999999983e65Initial program 63.2%
Taylor expanded in z around inf 47.2%
associate-/l*73.0%
associate-+r+73.0%
Simplified73.0%
associate-/r/78.7%
associate-+l+78.7%
+-commutative78.7%
Applied egg-rr78.7%
Final simplification70.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.9e-73) (not (<= y 3e+64))) (- (+ z a) b) (* z (/ (+ x y) (+ y (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.9e-73) || !(y <= 3e+64)) {
tmp = (z + a) - b;
} else {
tmp = z * ((x + y) / (y + (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 <= (-4.9d-73)) .or. (.not. (y <= 3d+64))) then
tmp = (z + a) - b
else
tmp = z * ((x + y) / (y + (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 <= -4.9e-73) || !(y <= 3e+64)) {
tmp = (z + a) - b;
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.9e-73) or not (y <= 3e+64): tmp = (z + a) - b else: tmp = z * ((x + y) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.9e-73) || !(y <= 3e+64)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.9e-73) || ~((y <= 3e+64))) tmp = (z + a) - b; else tmp = z * ((x + y) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.9e-73], N[Not[LessEqual[y, 3e+64]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{-73} \lor \neg \left(y \leq 3 \cdot 10^{+64}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if y < -4.90000000000000028e-73 or 3.0000000000000002e64 < y Initial program 41.1%
Taylor expanded in y around inf 76.2%
if -4.90000000000000028e-73 < y < 3.0000000000000002e64Initial program 75.2%
Taylor expanded in z around inf 35.7%
associate-/l*43.9%
associate-+r+43.9%
Simplified43.9%
associate-/r/49.8%
associate-+l+49.8%
+-commutative49.8%
Applied egg-rr49.8%
Final simplification63.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -4.9e+93)
a
(if (<= t -6.5e+64)
(- z b)
(if (<= t -3.1e-41) a (if (<= t 2.1e+18) (- z b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.9e+93) {
tmp = a;
} else if (t <= -6.5e+64) {
tmp = z - b;
} else if (t <= -3.1e-41) {
tmp = a;
} else if (t <= 2.1e+18) {
tmp = z - 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 <= (-4.9d+93)) then
tmp = a
else if (t <= (-6.5d+64)) then
tmp = z - b
else if (t <= (-3.1d-41)) then
tmp = a
else if (t <= 2.1d+18) then
tmp = z - 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 <= -4.9e+93) {
tmp = a;
} else if (t <= -6.5e+64) {
tmp = z - b;
} else if (t <= -3.1e-41) {
tmp = a;
} else if (t <= 2.1e+18) {
tmp = z - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.9e+93: tmp = a elif t <= -6.5e+64: tmp = z - b elif t <= -3.1e-41: tmp = a elif t <= 2.1e+18: tmp = z - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.9e+93) tmp = a; elseif (t <= -6.5e+64) tmp = Float64(z - b); elseif (t <= -3.1e-41) tmp = a; elseif (t <= 2.1e+18) tmp = Float64(z - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -4.9e+93) tmp = a; elseif (t <= -6.5e+64) tmp = z - b; elseif (t <= -3.1e-41) tmp = a; elseif (t <= 2.1e+18) tmp = z - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.9e+93], a, If[LessEqual[t, -6.5e+64], N[(z - b), $MachinePrecision], If[LessEqual[t, -3.1e-41], a, If[LessEqual[t, 2.1e+18], N[(z - b), $MachinePrecision], a]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{+93}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{+64}:\\
\;\;\;\;z - b\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-41}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+18}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -4.89999999999999969e93 or -6.50000000000000007e64 < t < -3.10000000000000001e-41 or 2.1e18 < t Initial program 52.2%
Taylor expanded in t around inf 50.9%
if -4.89999999999999969e93 < t < -6.50000000000000007e64 or -3.10000000000000001e-41 < t < 2.1e18Initial program 63.1%
Taylor expanded in z around inf 45.7%
Taylor expanded in y around inf 55.9%
Final simplification53.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.45e+203) (not (<= x 1.6e+124))) (- z (/ b (/ x y))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.45e+203) || !(x <= 1.6e+124)) {
tmp = z - (b / (x / y));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= (-1.45d+203)) .or. (.not. (x <= 1.6d+124))) then
tmp = z - (b / (x / y))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.45e+203) || !(x <= 1.6e+124)) {
tmp = z - (b / (x / y));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.45e+203) or not (x <= 1.6e+124): tmp = z - (b / (x / y)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.45e+203) || !(x <= 1.6e+124)) tmp = Float64(z - Float64(b / Float64(x / y))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -1.45e+203) || ~((x <= 1.6e+124))) tmp = z - (b / (x / y)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.45e+203], N[Not[LessEqual[x, 1.6e+124]], $MachinePrecision]], N[(z - N[(b / N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+203} \lor \neg \left(x \leq 1.6 \cdot 10^{+124}\right):\\
\;\;\;\;z - \frac{b}{\frac{x}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -1.45000000000000005e203 or 1.59999999999999996e124 < x Initial program 40.2%
Taylor expanded in z around inf 28.6%
Taylor expanded in t around 0 28.5%
Taylor expanded in y around 0 62.3%
+-commutative62.3%
mul-1-neg62.3%
unsub-neg62.3%
*-commutative62.3%
associate-/l*63.6%
Simplified63.6%
if -1.45000000000000005e203 < x < 1.59999999999999996e124Initial program 63.4%
Taylor expanded in y around inf 60.5%
Final simplification61.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.9e-137) (not (<= y 6e-113))) (- (+ z a) b) (/ z (/ (+ x t) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.9e-137) || !(y <= 6e-113)) {
tmp = (z + a) - b;
} else {
tmp = z / ((x + t) / x);
}
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 <= (-2.9d-137)) .or. (.not. (y <= 6d-113))) then
tmp = (z + a) - b
else
tmp = z / ((x + t) / x)
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 <= -2.9e-137) || !(y <= 6e-113)) {
tmp = (z + a) - b;
} else {
tmp = z / ((x + t) / x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.9e-137) or not (y <= 6e-113): tmp = (z + a) - b else: tmp = z / ((x + t) / x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.9e-137) || !(y <= 6e-113)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z / Float64(Float64(x + t) / x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.9e-137) || ~((y <= 6e-113))) tmp = (z + a) - b; else tmp = z / ((x + t) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.9e-137], N[Not[LessEqual[y, 6e-113]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{-137} \lor \neg \left(y \leq 6 \cdot 10^{-113}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\end{array}
\end{array}
if y < -2.89999999999999985e-137 or 6.0000000000000002e-113 < y Initial program 48.3%
Taylor expanded in y around inf 70.3%
if -2.89999999999999985e-137 < y < 6.0000000000000002e-113Initial program 77.0%
Taylor expanded in z around inf 34.6%
associate-/l*39.2%
associate-+r+39.2%
Simplified39.2%
Taylor expanded in y around 0 33.5%
associate-/l*45.5%
+-commutative45.5%
Simplified45.5%
Final simplification61.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.12e-70) a (if (<= t -1.4e-303) z (if (<= t 7e-296) (- b) (if (<= t 8.5e+80) z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.12e-70) {
tmp = a;
} else if (t <= -1.4e-303) {
tmp = z;
} else if (t <= 7e-296) {
tmp = -b;
} else if (t <= 8.5e+80) {
tmp = z;
} 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 <= (-1.12d-70)) then
tmp = a
else if (t <= (-1.4d-303)) then
tmp = z
else if (t <= 7d-296) then
tmp = -b
else if (t <= 8.5d+80) then
tmp = z
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 <= -1.12e-70) {
tmp = a;
} else if (t <= -1.4e-303) {
tmp = z;
} else if (t <= 7e-296) {
tmp = -b;
} else if (t <= 8.5e+80) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.12e-70: tmp = a elif t <= -1.4e-303: tmp = z elif t <= 7e-296: tmp = -b elif t <= 8.5e+80: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.12e-70) tmp = a; elseif (t <= -1.4e-303) tmp = z; elseif (t <= 7e-296) tmp = Float64(-b); elseif (t <= 8.5e+80) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.12e-70) tmp = a; elseif (t <= -1.4e-303) tmp = z; elseif (t <= 7e-296) tmp = -b; elseif (t <= 8.5e+80) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.12e-70], a, If[LessEqual[t, -1.4e-303], z, If[LessEqual[t, 7e-296], (-b), If[LessEqual[t, 8.5e+80], z, a]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{-70}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq -1.4 \cdot 10^{-303}:\\
\;\;\;\;z\\
\mathbf{elif}\;t \leq 7 \cdot 10^{-296}:\\
\;\;\;\;-b\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+80}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.12e-70 or 8.50000000000000007e80 < t Initial program 51.3%
Taylor expanded in t around inf 50.4%
if -1.12e-70 < t < -1.4e-303 or 6.9999999999999998e-296 < t < 8.50000000000000007e80Initial program 63.5%
Taylor expanded in x around inf 52.7%
if -1.4e-303 < t < 6.9999999999999998e-296Initial program 67.3%
Taylor expanded in b around inf 54.6%
associate-*r/54.6%
neg-mul-154.6%
distribute-rgt-neg-in54.6%
associate-+r+54.6%
Simplified54.6%
Taylor expanded in y around inf 69.9%
mul-1-neg69.9%
Simplified69.9%
Final simplification52.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t 5.2e+175) (- (+ z a) b) a))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 5.2e+175) {
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 <= 5.2d+175) 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 <= 5.2e+175) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= 5.2e+175: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 5.2e+175) 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 <= 5.2e+175) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 5.2e+175], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.2 \cdot 10^{+175}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < 5.2000000000000001e175Initial program 60.2%
Taylor expanded in y around inf 57.7%
if 5.2000000000000001e175 < t Initial program 40.9%
Taylor expanded in t around inf 64.4%
Final simplification58.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.12e-70) a (if (<= t 5.8e+80) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.12e-70) {
tmp = a;
} else if (t <= 5.8e+80) {
tmp = z;
} 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 <= (-1.12d-70)) then
tmp = a
else if (t <= 5.8d+80) then
tmp = z
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 <= -1.12e-70) {
tmp = a;
} else if (t <= 5.8e+80) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.12e-70: tmp = a elif t <= 5.8e+80: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.12e-70) tmp = a; elseif (t <= 5.8e+80) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.12e-70) tmp = a; elseif (t <= 5.8e+80) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.12e-70], a, If[LessEqual[t, 5.8e+80], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{-70}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+80}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.12e-70 or 5.79999999999999971e80 < t Initial program 51.3%
Taylor expanded in t around inf 50.4%
if -1.12e-70 < t < 5.79999999999999971e80Initial program 63.7%
Taylor expanded in x around inf 50.6%
Final simplification50.5%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 58.0%
Taylor expanded in t around inf 30.9%
Final simplification30.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t_2}{t_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t_1}{t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
herbie shell --seed 2023274
(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)))