
(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 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_1)))
(if (<= t_2 -4e+60)
(+ (/ (- z b) (/ t_1 y)) (+ (/ (* x z) t_1) (* (+ y t) (/ a t_1))))
(if (<= t_2 1e+253) t_2 (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_2 <= -4e+60) {
tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + ((y + t) * (a / t_1)));
} else if (t_2 <= 1e+253) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1
if (t_2 <= (-4d+60)) then
tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + ((y + t) * (a / t_1)))
else if (t_2 <= 1d+253) then
tmp = t_2
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_2 <= -4e+60) {
tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + ((y + t) * (a / t_1)));
} else if (t_2 <= 1e+253) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if t_2 <= -4e+60: tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + ((y + t) * (a / t_1))) elif t_2 <= 1e+253: tmp = t_2 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= -4e+60) tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(Float64(x * z) / t_1) + Float64(Float64(y + t) * Float64(a / t_1)))); elseif (t_2 <= 1e+253) tmp = t_2; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if (t_2 <= -4e+60) tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + ((y + t) * (a / t_1))); elseif (t_2 <= 1e+253) tmp = t_2; else tmp = (z + a) - b; 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[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+60], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * N[(a / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+253], t$95$2, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -4 \cdot 10^{+60}:\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{x \cdot z}{t_1} + \left(y + t\right) \cdot \frac{a}{t_1}\right)\\
\mathbf{elif}\;t_2 \leq 10^{+253}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\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)) < -3.9999999999999998e60Initial program 47.2%
Simplified47.2%
Taylor expanded in a around inf 47.2%
associate-/l*67.4%
+-commutative67.4%
associate-/l*88.4%
Simplified88.4%
associate-/r/88.4%
+-commutative88.4%
Applied egg-rr88.4%
if -3.9999999999999998e60 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999994e252Initial program 99.7%
if 9.9999999999999994e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 14.4%
Taylor expanded in y around inf 85.3%
+-commutative85.3%
Simplified85.3%
Final simplification92.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_1)))
(if (<= t_2 (- INFINITY))
(+ a (/ (- z b) (/ t_1 y)))
(if (<= t_2 1e+253) t_2 (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = a + ((z - b) / (t_1 / y));
} else if (t_2 <= 1e+253) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
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 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = a + ((z - b) / (t_1 / y));
} else if (t_2 <= 1e+253) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = a + ((z - b) / (t_1 / y)) elif t_2 <= 1e+253: tmp = t_2 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(a + Float64(Float64(z - b) / Float64(t_1 / y))); elseif (t_2 <= 1e+253) tmp = t_2; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = a + ((z - b) / (t_1 / y)); elseif (t_2 <= 1e+253) tmp = t_2; else tmp = (z + a) - b; 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[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(a + N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+253], t$95$2, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;a + \frac{z - b}{\frac{t_1}{y}}\\
\mathbf{elif}\;t_2 \leq 10^{+253}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 7.4%
Simplified7.2%
Taylor expanded in a around inf 7.4%
associate-/l*42.7%
+-commutative42.7%
associate-/l*79.7%
Simplified79.7%
Taylor expanded in y around inf 75.0%
Taylor expanded in a around inf 77.3%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999994e252Initial program 99.7%
if 9.9999999999999994e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 14.4%
Taylor expanded in y around inf 85.3%
+-commutative85.3%
Simplified85.3%
Final simplification92.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_1)))
(if (<= t_2 (- INFINITY))
(+ (/ (- z b) (/ t_1 y)) (+ (/ (* x z) t_1) (/ a (+ 1.0 (/ x t)))))
(if (<= t_2 1e+253) t_2 (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + (a / (1.0 + (x / t))));
} else if (t_2 <= 1e+253) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
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 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + (a / (1.0 + (x / t))));
} else if (t_2 <= 1e+253) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + (a / (1.0 + (x / t)))) elif t_2 <= 1e+253: tmp = t_2 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(Float64(x * z) / t_1) + Float64(a / Float64(1.0 + Float64(x / t))))); elseif (t_2 <= 1e+253) tmp = t_2; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = ((z - b) / (t_1 / y)) + (((x * z) / t_1) + (a / (1.0 + (x / t)))); elseif (t_2 <= 1e+253) tmp = t_2; else tmp = (z + a) - b; 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[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(a / N[(1.0 + N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+253], t$95$2, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{x \cdot z}{t_1} + \frac{a}{1 + \frac{x}{t}}\right)\\
\mathbf{elif}\;t_2 \leq 10^{+253}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 7.4%
Simplified7.2%
Taylor expanded in a around inf 7.4%
associate-/l*42.7%
+-commutative42.7%
associate-/l*79.7%
Simplified79.7%
Taylor expanded in t around inf 79.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)) < 9.9999999999999994e252Initial program 99.7%
if 9.9999999999999994e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 14.4%
Taylor expanded in y around inf 85.3%
+-commutative85.3%
Simplified85.3%
Final simplification92.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_1) 1e+253)
(+ (/ (- z b) (/ t_1 y)) (+ (/ a (/ t_1 (+ y t))) (/ (* x z) t_1)))
(- (+ z a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1) <= 1e+253) {
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (x + t)
if ((((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1) <= 1d+253) then
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1) <= 1e+253) {
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if (((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1) <= 1e+253: tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) <= 1e+253) tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(Float64(x * z) / t_1))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if ((((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1) <= 1e+253) tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((x * z) / t_1)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], 1e+253], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;\frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1} \leq 10^{+253}:\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{a}{\frac{t_1}{y + t}} + \frac{x \cdot z}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\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)) < 9.9999999999999994e252Initial program 79.6%
Simplified79.6%
Taylor expanded in a around inf 79.6%
associate-/l*85.9%
+-commutative85.9%
associate-/l*93.5%
Simplified93.5%
if 9.9999999999999994e252 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 14.4%
Taylor expanded in y around inf 85.3%
+-commutative85.3%
Simplified85.3%
Final simplification91.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.06e-159) (not (<= y 1.36e-138))) (+ a (/ (- z b) (/ (+ y (+ x t)) y))) (/ (+ (* x z) (* t a)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.06e-159) || !(y <= 1.36e-138)) {
tmp = a + ((z - b) / ((y + (x + t)) / y));
} else {
tmp = ((x * z) + (t * a)) / (x + t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.06d-159)) .or. (.not. (y <= 1.36d-138))) then
tmp = a + ((z - b) / ((y + (x + t)) / y))
else
tmp = ((x * z) + (t * a)) / (x + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.06e-159) || !(y <= 1.36e-138)) {
tmp = a + ((z - b) / ((y + (x + t)) / y));
} else {
tmp = ((x * z) + (t * a)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.06e-159) or not (y <= 1.36e-138): tmp = a + ((z - b) / ((y + (x + t)) / y)) else: tmp = ((x * z) + (t * a)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.06e-159) || !(y <= 1.36e-138)) tmp = Float64(a + Float64(Float64(z - b) / Float64(Float64(y + Float64(x + t)) / y))); else tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.06e-159) || ~((y <= 1.36e-138))) tmp = a + ((z - b) / ((y + (x + t)) / y)); else tmp = ((x * z) + (t * a)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.06e-159], N[Not[LessEqual[y, 1.36e-138]], $MachinePrecision]], N[(a + N[(N[(z - b), $MachinePrecision] / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.06 \cdot 10^{-159} \lor \neg \left(y \leq 1.36 \cdot 10^{-138}\right):\\
\;\;\;\;a + \frac{z - b}{\frac{y + \left(x + t\right)}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\end{array}
\end{array}
if y < -1.06e-159 or 1.36e-138 < y Initial program 56.4%
Simplified56.7%
Taylor expanded in a around inf 56.4%
associate-/l*73.3%
+-commutative73.3%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in y around inf 81.2%
Taylor expanded in a around inf 80.3%
if -1.06e-159 < y < 1.36e-138Initial program 85.1%
Taylor expanded in y around 0 78.1%
Final simplification79.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.2e-159) (not (<= y 1.15e-139))) (- (+ 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.2e-159) || !(y <= 1.15e-139)) {
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.2d-159)) .or. (.not. (y <= 1.15d-139))) 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.2e-159) || !(y <= 1.15e-139)) {
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.2e-159) or not (y <= 1.15e-139): 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.2e-159) || !(y <= 1.15e-139)) 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.2e-159) || ~((y <= 1.15e-139))) 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.2e-159], N[Not[LessEqual[y, 1.15e-139]], $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.2 \cdot 10^{-159} \lor \neg \left(y \leq 1.15 \cdot 10^{-139}\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.1999999999999998e-159 or 1.15000000000000006e-139 < y Initial program 56.4%
Taylor expanded in y around inf 66.4%
+-commutative66.4%
Simplified66.4%
if -4.1999999999999998e-159 < y < 1.15000000000000006e-139Initial program 84.2%
Taylor expanded in z around inf 46.1%
associate-/l*45.2%
Simplified45.2%
associate-/r/53.9%
+-commutative53.9%
+-commutative53.9%
Applied egg-rr53.9%
Final simplification63.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.6e-160) (not (<= y 9.5e-141))) (- (+ z a) b) (/ (+ (* x z) (* t a)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.6e-160) || !(y <= 9.5e-141)) {
tmp = (z + a) - b;
} else {
tmp = ((x * z) + (t * a)) / (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.6d-160)) .or. (.not. (y <= 9.5d-141))) then
tmp = (z + a) - b
else
tmp = ((x * z) + (t * a)) / (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.6e-160) || !(y <= 9.5e-141)) {
tmp = (z + a) - b;
} else {
tmp = ((x * z) + (t * a)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.6e-160) or not (y <= 9.5e-141): tmp = (z + a) - b else: tmp = ((x * z) + (t * a)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.6e-160) || !(y <= 9.5e-141)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.6e-160) || ~((y <= 9.5e-141))) tmp = (z + a) - b; else tmp = ((x * z) + (t * a)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.6e-160], N[Not[LessEqual[y, 9.5e-141]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-160} \lor \neg \left(y \leq 9.5 \cdot 10^{-141}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\end{array}
\end{array}
if y < -4.5999999999999997e-160 or 9.49999999999999996e-141 < y Initial program 56.1%
Taylor expanded in y around inf 66.0%
+-commutative66.0%
Simplified66.0%
if -4.5999999999999997e-160 < y < 9.49999999999999996e-141Initial program 86.4%
Taylor expanded in y around 0 79.3%
Final simplification69.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.15e+225) (not (<= b 9.5e+135))) (* (/ y (+ y (+ x t))) (- b)) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.15e+225) || !(b <= 9.5e+135)) {
tmp = (y / (y + (x + t))) * -b;
} 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 ((b <= (-2.15d+225)) .or. (.not. (b <= 9.5d+135))) then
tmp = (y / (y + (x + t))) * -b
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 ((b <= -2.15e+225) || !(b <= 9.5e+135)) {
tmp = (y / (y + (x + t))) * -b;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.15e+225) or not (b <= 9.5e+135): tmp = (y / (y + (x + t))) * -b else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.15e+225) || !(b <= 9.5e+135)) tmp = Float64(Float64(y / Float64(y + Float64(x + t))) * Float64(-b)); 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 ((b <= -2.15e+225) || ~((b <= 9.5e+135))) tmp = (y / (y + (x + t))) * -b; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.15e+225], N[Not[LessEqual[b, 9.5e+135]], $MachinePrecision]], N[(N[(y / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-b)), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.15 \cdot 10^{+225} \lor \neg \left(b \leq 9.5 \cdot 10^{+135}\right):\\
\;\;\;\;\frac{y}{y + \left(x + t\right)} \cdot \left(-b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -2.1500000000000001e225 or 9.50000000000000036e135 < b Initial program 46.9%
Taylor expanded in b around inf 30.3%
neg-mul-130.3%
distribute-rgt-neg-in30.3%
Simplified30.3%
*-un-lft-identity30.3%
associate-/l*62.8%
+-commutative62.8%
+-commutative62.8%
+-commutative62.8%
Applied egg-rr62.8%
*-lft-identity62.8%
associate-/r/65.5%
Simplified65.5%
if -2.1500000000000001e225 < b < 9.50000000000000036e135Initial program 68.7%
Taylor expanded in y around inf 62.6%
+-commutative62.6%
Simplified62.6%
Final simplification63.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= b -1.2e+225)
(/ (- y) (/ t_1 b))
(if (<= b 3.3e+134) (- (+ z a) b) (* (/ y t_1) (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (b <= -1.2e+225) {
tmp = -y / (t_1 / b);
} else if (b <= 3.3e+134) {
tmp = (z + a) - b;
} else {
tmp = (y / t_1) * -b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (x + t)
if (b <= (-1.2d+225)) then
tmp = -y / (t_1 / b)
else if (b <= 3.3d+134) then
tmp = (z + a) - b
else
tmp = (y / t_1) * -b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (b <= -1.2e+225) {
tmp = -y / (t_1 / b);
} else if (b <= 3.3e+134) {
tmp = (z + a) - b;
} else {
tmp = (y / t_1) * -b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if b <= -1.2e+225: tmp = -y / (t_1 / b) elif b <= 3.3e+134: tmp = (z + a) - b else: tmp = (y / t_1) * -b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (b <= -1.2e+225) tmp = Float64(Float64(-y) / Float64(t_1 / b)); elseif (b <= 3.3e+134) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(y / t_1) * Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (b <= -1.2e+225) tmp = -y / (t_1 / b); elseif (b <= 3.3e+134) tmp = (z + a) - b; else tmp = (y / t_1) * -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.2e+225], N[((-y) / N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.3e+134], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(y / t$95$1), $MachinePrecision] * (-b)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+225}:\\
\;\;\;\;\frac{-y}{\frac{t_1}{b}}\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{+134}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t_1} \cdot \left(-b\right)\\
\end{array}
\end{array}
if b < -1.2e225Initial program 41.1%
Taylor expanded in b around inf 28.5%
mul-1-neg28.5%
associate-/l*72.4%
distribute-neg-frac72.4%
Simplified72.4%
if -1.2e225 < b < 3.3e134Initial program 68.7%
Taylor expanded in y around inf 62.6%
+-commutative62.6%
Simplified62.6%
if 3.3e134 < b Initial program 50.0%
Taylor expanded in b around inf 31.2%
neg-mul-131.2%
distribute-rgt-neg-in31.2%
Simplified31.2%
*-un-lft-identity31.2%
associate-/l*57.7%
+-commutative57.7%
+-commutative57.7%
+-commutative57.7%
Applied egg-rr57.7%
*-lft-identity57.7%
associate-/r/64.2%
Simplified64.2%
Final simplification63.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2e+180) (not (<= t 1.35e+176))) (/ a (/ (+ x t) t)) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2e+180) || !(t <= 1.35e+176)) {
tmp = a / ((x + t) / 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 <= (-2d+180)) .or. (.not. (t <= 1.35d+176))) then
tmp = a / ((x + t) / 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 <= -2e+180) || !(t <= 1.35e+176)) {
tmp = a / ((x + t) / t);
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2e+180) or not (t <= 1.35e+176): tmp = a / ((x + t) / t) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2e+180) || !(t <= 1.35e+176)) tmp = Float64(a / Float64(Float64(x + t) / 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 <= -2e+180) || ~((t <= 1.35e+176))) tmp = a / ((x + t) / t); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2e+180], N[Not[LessEqual[t, 1.35e+176]], $MachinePrecision]], N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+180} \lor \neg \left(t \leq 1.35 \cdot 10^{+176}\right):\\
\;\;\;\;\frac{a}{\frac{x + t}{t}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -2e180 or 1.3499999999999999e176 < t Initial program 48.9%
Taylor expanded in a around inf 29.8%
+-commutative29.8%
associate-*l/50.6%
Applied egg-rr50.6%
Taylor expanded in y around 0 29.0%
associate-/l*60.2%
Simplified60.2%
if -2e180 < t < 1.3499999999999999e176Initial program 67.1%
Taylor expanded in y around inf 62.7%
+-commutative62.7%
Simplified62.7%
Final simplification62.2%
(FPCore (x y z t a b) :precision binary64 (if (<= t -60.0) a (if (<= t 5.4e-297) z (if (<= t 1e-233) (- b) (if (<= t 2.2e+44) z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -60.0) {
tmp = a;
} else if (t <= 5.4e-297) {
tmp = z;
} else if (t <= 1e-233) {
tmp = -b;
} else if (t <= 2.2e+44) {
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 <= (-60.0d0)) then
tmp = a
else if (t <= 5.4d-297) then
tmp = z
else if (t <= 1d-233) then
tmp = -b
else if (t <= 2.2d+44) 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 <= -60.0) {
tmp = a;
} else if (t <= 5.4e-297) {
tmp = z;
} else if (t <= 1e-233) {
tmp = -b;
} else if (t <= 2.2e+44) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -60.0: tmp = a elif t <= 5.4e-297: tmp = z elif t <= 1e-233: tmp = -b elif t <= 2.2e+44: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -60.0) tmp = a; elseif (t <= 5.4e-297) tmp = z; elseif (t <= 1e-233) tmp = Float64(-b); elseif (t <= 2.2e+44) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -60.0) tmp = a; elseif (t <= 5.4e-297) tmp = z; elseif (t <= 1e-233) tmp = -b; elseif (t <= 2.2e+44) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -60.0], a, If[LessEqual[t, 5.4e-297], z, If[LessEqual[t, 1e-233], (-b), If[LessEqual[t, 2.2e+44], z, a]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -60:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-297}:\\
\;\;\;\;z\\
\mathbf{elif}\;t \leq 10^{-233}:\\
\;\;\;\;-b\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+44}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -60 or 2.19999999999999996e44 < t Initial program 58.5%
Taylor expanded in t around inf 44.1%
if -60 < t < 5.4000000000000002e-297 or 9.99999999999999958e-234 < t < 2.19999999999999996e44Initial program 66.2%
Taylor expanded in x around inf 55.5%
if 5.4000000000000002e-297 < t < 9.99999999999999958e-234Initial program 80.8%
Taylor expanded in b around inf 40.1%
neg-mul-140.1%
distribute-rgt-neg-in40.1%
Simplified40.1%
Taylor expanded in y around inf 44.3%
neg-mul-144.3%
Simplified44.3%
Final simplification49.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.6e+210) z (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.6e+210) {
tmp = z;
} 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 <= (-2.6d+210)) then
tmp = z
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 <= -2.6e+210) {
tmp = z;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.6e+210: tmp = z else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.6e+210) tmp = z; 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 <= -2.6e+210) tmp = z; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.6e+210], z, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+210}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -2.5999999999999999e210Initial program 60.6%
Taylor expanded in x around inf 64.0%
if -2.5999999999999999e210 < x Initial program 63.9%
Taylor expanded in y around inf 60.0%
+-commutative60.0%
Simplified60.0%
Final simplification60.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.65e-11) a (if (<= t 2.1e+44) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.65e-11) {
tmp = a;
} else if (t <= 2.1e+44) {
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.65d-11)) then
tmp = a
else if (t <= 2.1d+44) 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.65e-11) {
tmp = a;
} else if (t <= 2.1e+44) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.65e-11: tmp = a elif t <= 2.1e+44: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.65e-11) tmp = a; elseif (t <= 2.1e+44) 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.65e-11) tmp = a; elseif (t <= 2.1e+44) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.65e-11], a, If[LessEqual[t, 2.1e+44], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-11}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+44}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.6500000000000001e-11 or 2.09999999999999987e44 < t Initial program 58.5%
Taylor expanded in t around inf 44.1%
if -1.6500000000000001e-11 < t < 2.09999999999999987e44Initial program 67.7%
Taylor expanded in x around inf 51.4%
Final simplification48.1%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 63.6%
Taylor expanded in t around inf 30.1%
Final simplification30.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 2023194
(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)))