
(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 16 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 (+ t (+ y x))))
(if (or (<= y -1.9e+196) (not (<= y 4e+190)))
(- (+ a z) b)
(-
(+
(* z (+ (/ x t_1) (/ y t_1)))
(* a (expm1 (log1p (/ (+ y t) (+ y (+ x t)))))))
(/ (* y b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double tmp;
if ((y <= -1.9e+196) || !(y <= 4e+190)) {
tmp = (a + z) - b;
} else {
tmp = ((z * ((x / t_1) + (y / t_1))) + (a * expm1(log1p(((y + t) / (y + (x + t))))))) - ((y * b) / t_1);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double tmp;
if ((y <= -1.9e+196) || !(y <= 4e+190)) {
tmp = (a + z) - b;
} else {
tmp = ((z * ((x / t_1) + (y / t_1))) + (a * Math.expm1(Math.log1p(((y + t) / (y + (x + t))))))) - ((y * b) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (y + x) tmp = 0 if (y <= -1.9e+196) or not (y <= 4e+190): tmp = (a + z) - b else: tmp = ((z * ((x / t_1) + (y / t_1))) + (a * math.expm1(math.log1p(((y + t) / (y + (x + t))))))) - ((y * b) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) tmp = 0.0 if ((y <= -1.9e+196) || !(y <= 4e+190)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(Float64(z * Float64(Float64(x / t_1) + Float64(y / t_1))) + Float64(a * expm1(log1p(Float64(Float64(y + t) / Float64(y + Float64(x + t))))))) - Float64(Float64(y * b) / t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -1.9e+196], N[Not[LessEqual[y, 4e+190]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(Exp[N[Log[1 + N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+196} \lor \neg \left(y \leq 4 \cdot 10^{+190}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(\frac{x}{t_1} + \frac{y}{t_1}\right) + a \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y + t}{y + \left(x + t\right)}\right)\right)\right) - \frac{y \cdot b}{t_1}\\
\end{array}
\end{array}
if y < -1.9000000000000001e196 or 4.0000000000000003e190 < y Initial program 13.8%
Taylor expanded in y around inf 95.7%
if -1.9000000000000001e196 < y < 4.0000000000000003e190Initial program 67.5%
Taylor expanded in z around 0 78.7%
div-inv78.6%
+-commutative78.6%
Applied egg-rr78.6%
associate-*l*94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
Simplified94.5%
expm1-log1p-u94.5%
un-div-inv94.6%
associate-+l+94.6%
Applied egg-rr94.6%
Final simplification94.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) (+ y (+ x t))))
(t_2 (+ t (+ y x)))
(t_3
(-
(+ (* z (+ (/ x t_2) (/ y t_2))) (* (+ y t) (/ a t_2)))
(/ (* y b) t_2))))
(if (<= t_1 (- INFINITY))
t_3
(if (<= t_1 2e+83) t_1 (if (<= t_1 INFINITY) t_3 (- (+ a z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double t_2 = t + (y + x);
double t_3 = ((z * ((x / t_2) + (y / t_2))) + ((y + t) * (a / t_2))) - ((y * b) / t_2);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_1 <= 2e+83) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = (a + z) - b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double t_2 = t + (y + x);
double t_3 = ((z * ((x / t_2) + (y / t_2))) + ((y + t) * (a / t_2))) - ((y * b) / t_2);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_1 <= 2e+83) {
tmp = t_1;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t)) t_2 = t + (y + x) t_3 = ((z * ((x / t_2) + (y / t_2))) + ((y + t) * (a / t_2))) - ((y * b) / t_2) tmp = 0 if t_1 <= -math.inf: tmp = t_3 elif t_1 <= 2e+83: tmp = t_1 elif t_1 <= math.inf: tmp = t_3 else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(t + Float64(y + x)) t_3 = Float64(Float64(Float64(z * Float64(Float64(x / t_2) + Float64(y / t_2))) + Float64(Float64(y + t) * Float64(a / t_2))) - Float64(Float64(y * b) / t_2)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_3; elseif (t_1 <= 2e+83) tmp = t_1; elseif (t_1 <= Inf) tmp = t_3; else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t)); t_2 = t + (y + x); t_3 = ((z * ((x / t_2) + (y / t_2))) + ((y + t) * (a / t_2))) - ((y * b) / t_2); tmp = 0.0; if (t_1 <= -Inf) tmp = t_3; elseif (t_1 <= 2e+83) tmp = t_1; elseif (t_1 <= Inf) tmp = t_3; else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(z * N[(N[(x / t$95$2), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * N[(a / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$3, If[LessEqual[t$95$1, 2e+83], t$95$1, If[LessEqual[t$95$1, Infinity], t$95$3, N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := t + \left(y + x\right)\\
t_3 := \left(z \cdot \left(\frac{x}{t_2} + \frac{y}{t_2}\right) + \left(y + t\right) \cdot \frac{a}{t_2}\right) - \frac{y \cdot b}{t_2}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\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.0 or 2.00000000000000006e83 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < +inf.0Initial program 25.6%
Taylor expanded in z around 0 48.9%
expm1-log1p-u41.5%
expm1-udef41.5%
associate-/l*58.4%
+-commutative58.4%
Applied egg-rr58.4%
expm1-def58.4%
expm1-log1p86.9%
associate-/r/86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000006e83Initial program 99.8%
if +inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 0.0%
Taylor expanded in y around inf 82.9%
Final simplification92.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+282))) (- (+ a z) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+282)) {
tmp = (a + z) - 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 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+282)) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+282): tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+282)) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+282))) tmp = (a + z) - 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[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+282]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 2 \cdot 10^{+282}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 2.00000000000000007e282 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.0%
Taylor expanded in y around inf 74.5%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.00000000000000007e282Initial program 99.8%
Final simplification88.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ y x)))
(t_2 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
(if (<= t_2 (- INFINITY))
(- (+ z (* a (* (+ y t) (/ 1.0 t_1)))) (/ (* y b) t_1))
(if (<= t_2 2e+282) t_2 (- (+ a z) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z + (a * ((y + t) * (1.0 / t_1)))) - ((y * b) / t_1);
} else if (t_2 <= 2e+282) {
tmp = t_2;
} else {
tmp = (a + z) - b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (z + (a * ((y + t) * (1.0 / t_1)))) - ((y * b) / t_1);
} else if (t_2 <= 2e+282) {
tmp = t_2;
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (y + x) t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if t_2 <= -math.inf: tmp = (z + (a * ((y + t) * (1.0 / t_1)))) - ((y * b) / t_1) elif t_2 <= 2e+282: tmp = t_2 else: tmp = (a + z) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) t_2 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z + Float64(a * Float64(Float64(y + t) * Float64(1.0 / t_1)))) - Float64(Float64(y * b) / t_1)); elseif (t_2 <= 2e+282) tmp = t_2; else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (y + x); t_2 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if (t_2 <= -Inf) tmp = (z + (a * ((y + t) * (1.0 / t_1)))) - ((y * b) / t_1); elseif (t_2 <= 2e+282) tmp = t_2; else tmp = (a + z) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z + N[(a * N[(N[(y + t), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+282], t$95$2, N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
t_2 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\left(z + a \cdot \left(\left(y + t\right) \cdot \frac{1}{t_1}\right)\right) - \frac{y \cdot b}{t_1}\\
\mathbf{elif}\;t_2 \leq 2 \cdot 10^{+282}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\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 6.4%
Taylor expanded in z around 0 35.3%
div-inv35.3%
+-commutative35.3%
Applied egg-rr35.3%
associate-*l*85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in x around inf 83.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)) < 2.00000000000000007e282Initial program 99.8%
if 2.00000000000000007e282 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.1%
Taylor expanded in y around inf 69.9%
Final simplification88.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ y x))))
(if (or (<= y -3.8e+185) (not (<= y 3.45e+190)))
(- (+ a z) b)
(-
(+ (* z (+ (/ x t_1) (/ y t_1))) (* a (* (+ y t) (/ 1.0 t_1))))
(/ (* y b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double tmp;
if ((y <= -3.8e+185) || !(y <= 3.45e+190)) {
tmp = (a + z) - b;
} else {
tmp = ((z * ((x / t_1) + (y / t_1))) + (a * ((y + t) * (1.0 / t_1)))) - ((y * b) / 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 = t + (y + x)
if ((y <= (-3.8d+185)) .or. (.not. (y <= 3.45d+190))) then
tmp = (a + z) - b
else
tmp = ((z * ((x / t_1) + (y / t_1))) + (a * ((y + t) * (1.0d0 / t_1)))) - ((y * b) / 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 = t + (y + x);
double tmp;
if ((y <= -3.8e+185) || !(y <= 3.45e+190)) {
tmp = (a + z) - b;
} else {
tmp = ((z * ((x / t_1) + (y / t_1))) + (a * ((y + t) * (1.0 / t_1)))) - ((y * b) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (y + x) tmp = 0 if (y <= -3.8e+185) or not (y <= 3.45e+190): tmp = (a + z) - b else: tmp = ((z * ((x / t_1) + (y / t_1))) + (a * ((y + t) * (1.0 / t_1)))) - ((y * b) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) tmp = 0.0 if ((y <= -3.8e+185) || !(y <= 3.45e+190)) tmp = Float64(Float64(a + z) - b); else tmp = Float64(Float64(Float64(z * Float64(Float64(x / t_1) + Float64(y / t_1))) + Float64(a * Float64(Float64(y + t) * Float64(1.0 / t_1)))) - Float64(Float64(y * b) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (y + x); tmp = 0.0; if ((y <= -3.8e+185) || ~((y <= 3.45e+190))) tmp = (a + z) - b; else tmp = ((z * ((x / t_1) + (y / t_1))) + (a * ((y + t) * (1.0 / t_1)))) - ((y * b) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -3.8e+185], N[Not[LessEqual[y, 3.45e+190]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[(y + t), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{+185} \lor \neg \left(y \leq 3.45 \cdot 10^{+190}\right):\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(\frac{x}{t_1} + \frac{y}{t_1}\right) + a \cdot \left(\left(y + t\right) \cdot \frac{1}{t_1}\right)\right) - \frac{y \cdot b}{t_1}\\
\end{array}
\end{array}
if y < -3.7999999999999998e185 or 3.45e190 < y Initial program 15.1%
Taylor expanded in y around inf 95.9%
if -3.7999999999999998e185 < y < 3.45e190Initial program 68.0%
Taylor expanded in z around 0 78.8%
div-inv78.7%
+-commutative78.7%
Applied egg-rr78.7%
associate-*l*94.4%
+-commutative94.4%
+-commutative94.4%
+-commutative94.4%
+-commutative94.4%
Simplified94.4%
Final simplification94.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ y x))) (t_2 (* (/ y t_1) (+ a (- z b)))))
(if (<= b -1e+123)
t_2
(if (<= b -2.6e-43)
(/ a (/ t_1 (+ y t)))
(if (<= b 2.15e-175)
(- (+ a z) b)
(if (<= b 2.7e+20) (/ (+ (* a t) (* z x)) (+ x t)) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (y / t_1) * (a + (z - b));
double tmp;
if (b <= -1e+123) {
tmp = t_2;
} else if (b <= -2.6e-43) {
tmp = a / (t_1 / (y + t));
} else if (b <= 2.15e-175) {
tmp = (a + z) - b;
} else if (b <= 2.7e+20) {
tmp = ((a * t) + (z * x)) / (x + t);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t + (y + x)
t_2 = (y / t_1) * (a + (z - b))
if (b <= (-1d+123)) then
tmp = t_2
else if (b <= (-2.6d-43)) then
tmp = a / (t_1 / (y + t))
else if (b <= 2.15d-175) then
tmp = (a + z) - b
else if (b <= 2.7d+20) then
tmp = ((a * t) + (z * x)) / (x + t)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (y / t_1) * (a + (z - b));
double tmp;
if (b <= -1e+123) {
tmp = t_2;
} else if (b <= -2.6e-43) {
tmp = a / (t_1 / (y + t));
} else if (b <= 2.15e-175) {
tmp = (a + z) - b;
} else if (b <= 2.7e+20) {
tmp = ((a * t) + (z * x)) / (x + t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (y + x) t_2 = (y / t_1) * (a + (z - b)) tmp = 0 if b <= -1e+123: tmp = t_2 elif b <= -2.6e-43: tmp = a / (t_1 / (y + t)) elif b <= 2.15e-175: tmp = (a + z) - b elif b <= 2.7e+20: tmp = ((a * t) + (z * x)) / (x + t) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) t_2 = Float64(Float64(y / t_1) * Float64(a + Float64(z - b))) tmp = 0.0 if (b <= -1e+123) tmp = t_2; elseif (b <= -2.6e-43) tmp = Float64(a / Float64(t_1 / Float64(y + t))); elseif (b <= 2.15e-175) tmp = Float64(Float64(a + z) - b); elseif (b <= 2.7e+20) tmp = Float64(Float64(Float64(a * t) + Float64(z * x)) / Float64(x + t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (y + x); t_2 = (y / t_1) * (a + (z - b)); tmp = 0.0; if (b <= -1e+123) tmp = t_2; elseif (b <= -2.6e-43) tmp = a / (t_1 / (y + t)); elseif (b <= 2.15e-175) tmp = (a + z) - b; elseif (b <= 2.7e+20) tmp = ((a * t) + (z * x)) / (x + t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / t$95$1), $MachinePrecision] * N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1e+123], t$95$2, If[LessEqual[b, -2.6e-43], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.15e-175], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[b, 2.7e+20], N[(N[(N[(a * t), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
t_2 := \frac{y}{t_1} \cdot \left(a + \left(z - b\right)\right)\\
\mathbf{if}\;b \leq -1 \cdot 10^{+123}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -2.6 \cdot 10^{-43}:\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{-175}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{+20}:\\
\;\;\;\;\frac{a \cdot t + z \cdot x}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -9.99999999999999978e122 or 2.7e20 < b Initial program 48.2%
Taylor expanded in y around inf 36.4%
expm1-log1p-u22.3%
expm1-udef13.2%
associate-/l*25.7%
+-commutative25.7%
associate-+r+25.7%
+-commutative25.7%
associate--l+25.7%
Applied egg-rr25.7%
expm1-def34.8%
expm1-log1p62.2%
associate-/r/62.6%
+-commutative62.6%
+-commutative62.6%
+-commutative62.6%
Simplified62.6%
if -9.99999999999999978e122 < b < -2.6e-43Initial program 53.8%
Taylor expanded in a around inf 32.1%
associate-/l*65.7%
+-commutative65.7%
Simplified65.7%
if -2.6e-43 < b < 2.14999999999999999e-175Initial program 58.9%
Taylor expanded in y around inf 69.9%
if 2.14999999999999999e-175 < b < 2.7e20Initial program 75.7%
Taylor expanded in y around 0 73.3%
Final simplification67.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -1.05e-32)
t_1
(if (<= y -1.14e-215)
(/ z (/ (+ x t) x))
(if (<= y -4.4e-304)
(/ a (/ (+ t (+ y x)) (+ y t)))
(if (<= y 1.9e-300)
z
(if (<= y 6.5e-169) (+ a (/ (* y (- z b)) t)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -1.05e-32) {
tmp = t_1;
} else if (y <= -1.14e-215) {
tmp = z / ((x + t) / x);
} else if (y <= -4.4e-304) {
tmp = a / ((t + (y + x)) / (y + t));
} else if (y <= 1.9e-300) {
tmp = z;
} else if (y <= 6.5e-169) {
tmp = a + ((y * (z - b)) / 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 = (a + z) - b
if (y <= (-1.05d-32)) then
tmp = t_1
else if (y <= (-1.14d-215)) then
tmp = z / ((x + t) / x)
else if (y <= (-4.4d-304)) then
tmp = a / ((t + (y + x)) / (y + t))
else if (y <= 1.9d-300) then
tmp = z
else if (y <= 6.5d-169) then
tmp = a + ((y * (z - b)) / 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 = (a + z) - b;
double tmp;
if (y <= -1.05e-32) {
tmp = t_1;
} else if (y <= -1.14e-215) {
tmp = z / ((x + t) / x);
} else if (y <= -4.4e-304) {
tmp = a / ((t + (y + x)) / (y + t));
} else if (y <= 1.9e-300) {
tmp = z;
} else if (y <= 6.5e-169) {
tmp = a + ((y * (z - b)) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -1.05e-32: tmp = t_1 elif y <= -1.14e-215: tmp = z / ((x + t) / x) elif y <= -4.4e-304: tmp = a / ((t + (y + x)) / (y + t)) elif y <= 1.9e-300: tmp = z elif y <= 6.5e-169: tmp = a + ((y * (z - b)) / t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -1.05e-32) tmp = t_1; elseif (y <= -1.14e-215) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (y <= -4.4e-304) tmp = Float64(a / Float64(Float64(t + Float64(y + x)) / Float64(y + t))); elseif (y <= 1.9e-300) tmp = z; elseif (y <= 6.5e-169) tmp = Float64(a + Float64(Float64(y * Float64(z - b)) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -1.05e-32) tmp = t_1; elseif (y <= -1.14e-215) tmp = z / ((x + t) / x); elseif (y <= -4.4e-304) tmp = a / ((t + (y + x)) / (y + t)); elseif (y <= 1.9e-300) tmp = z; elseif (y <= 6.5e-169) tmp = a + ((y * (z - b)) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.05e-32], t$95$1, If[LessEqual[y, -1.14e-215], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.4e-304], N[(a / N[(N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-300], z, If[LessEqual[y, 6.5e-169], N[(a + N[(N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.14 \cdot 10^{-215}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{-304}:\\
\;\;\;\;\frac{a}{\frac{t + \left(y + x\right)}{y + t}}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-300}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-169}:\\
\;\;\;\;a + \frac{y \cdot \left(z - b\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.05e-32 or 6.5000000000000002e-169 < y Initial program 47.3%
Taylor expanded in y around inf 71.8%
if -1.05e-32 < y < -1.14000000000000001e-215Initial program 77.7%
Taylor expanded in z around inf 47.4%
associate-/l*64.5%
+-commutative64.5%
+-commutative64.5%
Simplified64.5%
Taylor expanded in y around 0 61.8%
if -1.14000000000000001e-215 < y < -4.4e-304Initial program 52.0%
Taylor expanded in a around inf 31.3%
associate-/l*67.7%
+-commutative67.7%
Simplified67.7%
if -4.4e-304 < y < 1.90000000000000006e-300Initial program 61.9%
Taylor expanded in x around inf 80.8%
if 1.90000000000000006e-300 < y < 6.5000000000000002e-169Initial program 81.5%
Taylor expanded in x around 0 50.7%
associate--l+50.7%
*-commutative50.7%
distribute-lft-out--50.7%
Simplified50.7%
Taylor expanded in t around inf 58.4%
Final simplification68.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ y x))) (t_2 (- (+ a z) b)))
(if (<= y -1.6e-31)
t_2
(if (<= y -1.08e-215)
(/ z (/ t_1 (+ y x)))
(if (<= y -9.6e-299)
(/ a (/ t_1 (+ y t)))
(if (<= y 4.5e-301)
z
(if (<= y 3.2e-169) (+ a (/ (* y (- z b)) t)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (a + z) - b;
double tmp;
if (y <= -1.6e-31) {
tmp = t_2;
} else if (y <= -1.08e-215) {
tmp = z / (t_1 / (y + x));
} else if (y <= -9.6e-299) {
tmp = a / (t_1 / (y + t));
} else if (y <= 4.5e-301) {
tmp = z;
} else if (y <= 3.2e-169) {
tmp = a + ((y * (z - b)) / t);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t + (y + x)
t_2 = (a + z) - b
if (y <= (-1.6d-31)) then
tmp = t_2
else if (y <= (-1.08d-215)) then
tmp = z / (t_1 / (y + x))
else if (y <= (-9.6d-299)) then
tmp = a / (t_1 / (y + t))
else if (y <= 4.5d-301) then
tmp = z
else if (y <= 3.2d-169) then
tmp = a + ((y * (z - b)) / t)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (a + z) - b;
double tmp;
if (y <= -1.6e-31) {
tmp = t_2;
} else if (y <= -1.08e-215) {
tmp = z / (t_1 / (y + x));
} else if (y <= -9.6e-299) {
tmp = a / (t_1 / (y + t));
} else if (y <= 4.5e-301) {
tmp = z;
} else if (y <= 3.2e-169) {
tmp = a + ((y * (z - b)) / t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (y + x) t_2 = (a + z) - b tmp = 0 if y <= -1.6e-31: tmp = t_2 elif y <= -1.08e-215: tmp = z / (t_1 / (y + x)) elif y <= -9.6e-299: tmp = a / (t_1 / (y + t)) elif y <= 4.5e-301: tmp = z elif y <= 3.2e-169: tmp = a + ((y * (z - b)) / t) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -1.6e-31) tmp = t_2; elseif (y <= -1.08e-215) tmp = Float64(z / Float64(t_1 / Float64(y + x))); elseif (y <= -9.6e-299) tmp = Float64(a / Float64(t_1 / Float64(y + t))); elseif (y <= 4.5e-301) tmp = z; elseif (y <= 3.2e-169) tmp = Float64(a + Float64(Float64(y * Float64(z - b)) / t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (y + x); t_2 = (a + z) - b; tmp = 0.0; if (y <= -1.6e-31) tmp = t_2; elseif (y <= -1.08e-215) tmp = z / (t_1 / (y + x)); elseif (y <= -9.6e-299) tmp = a / (t_1 / (y + t)); elseif (y <= 4.5e-301) tmp = z; elseif (y <= 3.2e-169) tmp = a + ((y * (z - b)) / t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.6e-31], t$95$2, If[LessEqual[y, -1.08e-215], N[(z / N[(t$95$1 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.6e-299], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-301], z, If[LessEqual[y, 3.2e-169], N[(a + N[(N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-31}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{-215}:\\
\;\;\;\;\frac{z}{\frac{t_1}{y + x}}\\
\mathbf{elif}\;y \leq -9.6 \cdot 10^{-299}:\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-301}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-169}:\\
\;\;\;\;a + \frac{y \cdot \left(z - b\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.60000000000000009e-31 or 3.19999999999999995e-169 < y Initial program 47.3%
Taylor expanded in y around inf 71.8%
if -1.60000000000000009e-31 < y < -1.08e-215Initial program 77.7%
Taylor expanded in z around inf 47.4%
associate-/l*64.5%
+-commutative64.5%
+-commutative64.5%
Simplified64.5%
if -1.08e-215 < y < -9.60000000000000077e-299Initial program 52.0%
Taylor expanded in a around inf 31.3%
associate-/l*67.7%
+-commutative67.7%
Simplified67.7%
if -9.60000000000000077e-299 < y < 4.5000000000000002e-301Initial program 61.9%
Taylor expanded in x around inf 80.8%
if 4.5000000000000002e-301 < y < 3.19999999999999995e-169Initial program 81.5%
Taylor expanded in x around 0 50.7%
associate--l+50.7%
*-commutative50.7%
distribute-lft-out--50.7%
Simplified50.7%
Taylor expanded in t around inf 58.4%
Final simplification68.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ y x))) (t_2 (- (+ a z) b)))
(if (<= y -1.9e-26)
t_2
(if (<= y -1.14e-215)
(/ z (/ t_1 (+ y x)))
(if (<= y -1.9e-291)
(/ a (/ t_1 (+ y t)))
(if (<= y 1.5e-164) (/ (+ (* a t) (* z x)) (+ x t)) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (a + z) - b;
double tmp;
if (y <= -1.9e-26) {
tmp = t_2;
} else if (y <= -1.14e-215) {
tmp = z / (t_1 / (y + x));
} else if (y <= -1.9e-291) {
tmp = a / (t_1 / (y + t));
} else if (y <= 1.5e-164) {
tmp = ((a * t) + (z * x)) / (x + t);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t + (y + x)
t_2 = (a + z) - b
if (y <= (-1.9d-26)) then
tmp = t_2
else if (y <= (-1.14d-215)) then
tmp = z / (t_1 / (y + x))
else if (y <= (-1.9d-291)) then
tmp = a / (t_1 / (y + t))
else if (y <= 1.5d-164) then
tmp = ((a * t) + (z * x)) / (x + t)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (y + x);
double t_2 = (a + z) - b;
double tmp;
if (y <= -1.9e-26) {
tmp = t_2;
} else if (y <= -1.14e-215) {
tmp = z / (t_1 / (y + x));
} else if (y <= -1.9e-291) {
tmp = a / (t_1 / (y + t));
} else if (y <= 1.5e-164) {
tmp = ((a * t) + (z * x)) / (x + t);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (y + x) t_2 = (a + z) - b tmp = 0 if y <= -1.9e-26: tmp = t_2 elif y <= -1.14e-215: tmp = z / (t_1 / (y + x)) elif y <= -1.9e-291: tmp = a / (t_1 / (y + t)) elif y <= 1.5e-164: tmp = ((a * t) + (z * x)) / (x + t) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(y + x)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -1.9e-26) tmp = t_2; elseif (y <= -1.14e-215) tmp = Float64(z / Float64(t_1 / Float64(y + x))); elseif (y <= -1.9e-291) tmp = Float64(a / Float64(t_1 / Float64(y + t))); elseif (y <= 1.5e-164) tmp = Float64(Float64(Float64(a * t) + Float64(z * x)) / Float64(x + t)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (y + x); t_2 = (a + z) - b; tmp = 0.0; if (y <= -1.9e-26) tmp = t_2; elseif (y <= -1.14e-215) tmp = z / (t_1 / (y + x)); elseif (y <= -1.9e-291) tmp = a / (t_1 / (y + t)); elseif (y <= 1.5e-164) tmp = ((a * t) + (z * x)) / (x + t); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.9e-26], t$95$2, If[LessEqual[y, -1.14e-215], N[(z / N[(t$95$1 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.9e-291], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-164], N[(N[(N[(a * t), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y + x\right)\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-26}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.14 \cdot 10^{-215}:\\
\;\;\;\;\frac{z}{\frac{t_1}{y + x}}\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-291}:\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-164}:\\
\;\;\;\;\frac{a \cdot t + z \cdot x}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.90000000000000007e-26 or 1.5e-164 < y Initial program 47.3%
Taylor expanded in y around inf 71.8%
if -1.90000000000000007e-26 < y < -1.14000000000000001e-215Initial program 77.7%
Taylor expanded in z around inf 47.4%
associate-/l*64.5%
+-commutative64.5%
+-commutative64.5%
Simplified64.5%
if -1.14000000000000001e-215 < y < -1.8999999999999999e-291Initial program 52.0%
Taylor expanded in a around inf 31.3%
associate-/l*67.7%
+-commutative67.7%
Simplified67.7%
if -1.8999999999999999e-291 < y < 1.5e-164Initial program 79.1%
Taylor expanded in y around 0 55.5%
Final simplification67.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -4.4e-28)
t_1
(if (<= y 3.7e-293)
(/ z (/ (+ x t) x))
(if (<= y 6.4e-168) (+ a (/ (* y (- z b)) t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -4.4e-28) {
tmp = t_1;
} else if (y <= 3.7e-293) {
tmp = z / ((x + t) / x);
} else if (y <= 6.4e-168) {
tmp = a + ((y * (z - b)) / 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 = (a + z) - b
if (y <= (-4.4d-28)) then
tmp = t_1
else if (y <= 3.7d-293) then
tmp = z / ((x + t) / x)
else if (y <= 6.4d-168) then
tmp = a + ((y * (z - b)) / 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 = (a + z) - b;
double tmp;
if (y <= -4.4e-28) {
tmp = t_1;
} else if (y <= 3.7e-293) {
tmp = z / ((x + t) / x);
} else if (y <= 6.4e-168) {
tmp = a + ((y * (z - b)) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -4.4e-28: tmp = t_1 elif y <= 3.7e-293: tmp = z / ((x + t) / x) elif y <= 6.4e-168: tmp = a + ((y * (z - b)) / t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -4.4e-28) tmp = t_1; elseif (y <= 3.7e-293) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (y <= 6.4e-168) tmp = Float64(a + Float64(Float64(y * Float64(z - b)) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -4.4e-28) tmp = t_1; elseif (y <= 3.7e-293) tmp = z / ((x + t) / x); elseif (y <= 6.4e-168) tmp = a + ((y * (z - b)) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -4.4e-28], t$95$1, If[LessEqual[y, 3.7e-293], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e-168], N[(a + N[(N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{-28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-293}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-168}:\\
\;\;\;\;a + \frac{y \cdot \left(z - b\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.39999999999999992e-28 or 6.40000000000000013e-168 < y Initial program 47.3%
Taylor expanded in y around inf 71.8%
if -4.39999999999999992e-28 < y < 3.70000000000000008e-293Initial program 68.8%
Taylor expanded in z around inf 38.7%
associate-/l*55.6%
+-commutative55.6%
+-commutative55.6%
Simplified55.6%
Taylor expanded in y around 0 53.8%
if 3.70000000000000008e-293 < y < 6.40000000000000013e-168Initial program 81.5%
Taylor expanded in x around 0 50.7%
associate--l+50.7%
*-commutative50.7%
distribute-lft-out--50.7%
Simplified50.7%
Taylor expanded in t around inf 58.4%
Final simplification65.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -1.05e-84)
t_1
(if (<= y -1.14e-215) z (if (<= y 5.5e-168) (+ a (/ (* y z) t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -1.05e-84) {
tmp = t_1;
} else if (y <= -1.14e-215) {
tmp = z;
} else if (y <= 5.5e-168) {
tmp = a + ((y * z) / 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 = (a + z) - b
if (y <= (-1.05d-84)) then
tmp = t_1
else if (y <= (-1.14d-215)) then
tmp = z
else if (y <= 5.5d-168) then
tmp = a + ((y * z) / 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 = (a + z) - b;
double tmp;
if (y <= -1.05e-84) {
tmp = t_1;
} else if (y <= -1.14e-215) {
tmp = z;
} else if (y <= 5.5e-168) {
tmp = a + ((y * z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -1.05e-84: tmp = t_1 elif y <= -1.14e-215: tmp = z elif y <= 5.5e-168: tmp = a + ((y * z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -1.05e-84) tmp = t_1; elseif (y <= -1.14e-215) tmp = z; elseif (y <= 5.5e-168) tmp = Float64(a + Float64(Float64(y * z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -1.05e-84) tmp = t_1; elseif (y <= -1.14e-215) tmp = z; elseif (y <= 5.5e-168) tmp = a + ((y * z) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.05e-84], t$95$1, If[LessEqual[y, -1.14e-215], z, If[LessEqual[y, 5.5e-168], N[(a + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.14 \cdot 10^{-215}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-168}:\\
\;\;\;\;a + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.04999999999999999e-84 or 5.4999999999999999e-168 < y Initial program 50.4%
Taylor expanded in y around inf 69.3%
if -1.04999999999999999e-84 < y < -1.14000000000000001e-215Initial program 71.3%
Taylor expanded in x around inf 52.1%
if -1.14000000000000001e-215 < y < 5.4999999999999999e-168Initial program 70.9%
Taylor expanded in x around 0 39.2%
associate--l+39.2%
*-commutative39.2%
distribute-lft-out--39.2%
Simplified39.2%
Taylor expanded in t around inf 50.7%
Taylor expanded in z around inf 44.9%
Final simplification61.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -3.6e-30)
t_1
(if (<= y 3.7e-299)
(/ z (/ (+ x t) x))
(if (<= y 4.6e-167) (+ a (/ (* y z) t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -3.6e-30) {
tmp = t_1;
} else if (y <= 3.7e-299) {
tmp = z / ((x + t) / x);
} else if (y <= 4.6e-167) {
tmp = a + ((y * z) / 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 = (a + z) - b
if (y <= (-3.6d-30)) then
tmp = t_1
else if (y <= 3.7d-299) then
tmp = z / ((x + t) / x)
else if (y <= 4.6d-167) then
tmp = a + ((y * z) / 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 = (a + z) - b;
double tmp;
if (y <= -3.6e-30) {
tmp = t_1;
} else if (y <= 3.7e-299) {
tmp = z / ((x + t) / x);
} else if (y <= 4.6e-167) {
tmp = a + ((y * z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -3.6e-30: tmp = t_1 elif y <= 3.7e-299: tmp = z / ((x + t) / x) elif y <= 4.6e-167: tmp = a + ((y * z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -3.6e-30) tmp = t_1; elseif (y <= 3.7e-299) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (y <= 4.6e-167) tmp = Float64(a + Float64(Float64(y * z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -3.6e-30) tmp = t_1; elseif (y <= 3.7e-299) tmp = z / ((x + t) / x); elseif (y <= 4.6e-167) tmp = a + ((y * z) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3.6e-30], t$95$1, If[LessEqual[y, 3.7e-299], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e-167], N[(a + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{-30}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-299}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-167}:\\
\;\;\;\;a + \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.6000000000000003e-30 or 4.6000000000000003e-167 < y Initial program 47.3%
Taylor expanded in y around inf 71.8%
if -3.6000000000000003e-30 < y < 3.70000000000000014e-299Initial program 68.8%
Taylor expanded in z around inf 38.7%
associate-/l*55.6%
+-commutative55.6%
+-commutative55.6%
Simplified55.6%
Taylor expanded in y around 0 53.8%
if 3.70000000000000014e-299 < y < 4.6000000000000003e-167Initial program 81.5%
Taylor expanded in x around 0 50.7%
associate--l+50.7%
*-commutative50.7%
distribute-lft-out--50.7%
Simplified50.7%
Taylor expanded in t around inf 58.4%
Taylor expanded in z around inf 48.9%
Final simplification64.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -3.1e-32)
t_1
(if (<= y 9.5e-296)
(/ z (/ (+ x t) x))
(if (<= y 2.3e-170) (- a (/ (* y b) t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -3.1e-32) {
tmp = t_1;
} else if (y <= 9.5e-296) {
tmp = z / ((x + t) / x);
} else if (y <= 2.3e-170) {
tmp = a - ((y * b) / 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 = (a + z) - b
if (y <= (-3.1d-32)) then
tmp = t_1
else if (y <= 9.5d-296) then
tmp = z / ((x + t) / x)
else if (y <= 2.3d-170) then
tmp = a - ((y * b) / 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 = (a + z) - b;
double tmp;
if (y <= -3.1e-32) {
tmp = t_1;
} else if (y <= 9.5e-296) {
tmp = z / ((x + t) / x);
} else if (y <= 2.3e-170) {
tmp = a - ((y * b) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -3.1e-32: tmp = t_1 elif y <= 9.5e-296: tmp = z / ((x + t) / x) elif y <= 2.3e-170: tmp = a - ((y * b) / t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -3.1e-32) tmp = t_1; elseif (y <= 9.5e-296) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (y <= 2.3e-170) tmp = Float64(a - Float64(Float64(y * b) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -3.1e-32) tmp = t_1; elseif (y <= 9.5e-296) tmp = z / ((x + t) / x); elseif (y <= 2.3e-170) tmp = a - ((y * b) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3.1e-32], t$95$1, If[LessEqual[y, 9.5e-296], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e-170], N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-296}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-170}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.10000000000000011e-32 or 2.29999999999999987e-170 < y Initial program 47.3%
Taylor expanded in y around inf 71.8%
if -3.10000000000000011e-32 < y < 9.50000000000000046e-296Initial program 68.8%
Taylor expanded in z around inf 38.7%
associate-/l*55.6%
+-commutative55.6%
+-commutative55.6%
Simplified55.6%
Taylor expanded in y around 0 53.8%
if 9.50000000000000046e-296 < y < 2.29999999999999987e-170Initial program 81.5%
Taylor expanded in x around 0 50.7%
associate--l+50.7%
*-commutative50.7%
distribute-lft-out--50.7%
Simplified50.7%
Taylor expanded in t around inf 58.4%
Taylor expanded in z around 0 53.8%
associate-*r/53.8%
*-commutative53.8%
associate-*r*53.8%
mul-1-neg53.8%
Simplified53.8%
Final simplification65.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -7.5e-84)
t_1
(if (<= y -1.08e-215) z (if (<= y 4.3e-165) a t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -7.5e-84) {
tmp = t_1;
} else if (y <= -1.08e-215) {
tmp = z;
} else if (y <= 4.3e-165) {
tmp = a;
} 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 = (a + z) - b
if (y <= (-7.5d-84)) then
tmp = t_1
else if (y <= (-1.08d-215)) then
tmp = z
else if (y <= 4.3d-165) then
tmp = a
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 = (a + z) - b;
double tmp;
if (y <= -7.5e-84) {
tmp = t_1;
} else if (y <= -1.08e-215) {
tmp = z;
} else if (y <= 4.3e-165) {
tmp = a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -7.5e-84: tmp = t_1 elif y <= -1.08e-215: tmp = z elif y <= 4.3e-165: tmp = a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -7.5e-84) tmp = t_1; elseif (y <= -1.08e-215) tmp = z; elseif (y <= 4.3e-165) tmp = a; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -7.5e-84) tmp = t_1; elseif (y <= -1.08e-215) tmp = z; elseif (y <= 4.3e-165) tmp = a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -7.5e-84], t$95$1, If[LessEqual[y, -1.08e-215], z, If[LessEqual[y, 4.3e-165], a, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{-215}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 4.3 \cdot 10^{-165}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -7.50000000000000026e-84 or 4.30000000000000007e-165 < y Initial program 50.4%
Taylor expanded in y around inf 69.3%
if -7.50000000000000026e-84 < y < -1.08e-215Initial program 71.3%
Taylor expanded in x around inf 52.1%
if -1.08e-215 < y < 4.30000000000000007e-165Initial program 70.9%
Taylor expanded in t around inf 42.0%
Final simplification61.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.8e+24) z (if (<= x 6.5e+154) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+24) {
tmp = z;
} else if (x <= 6.5e+154) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-8.8d+24)) then
tmp = z
else if (x <= 6.5d+154) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+24) {
tmp = z;
} else if (x <= 6.5e+154) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.8e+24: tmp = z elif x <= 6.5e+154: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.8e+24) tmp = z; elseif (x <= 6.5e+154) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -8.8e+24) tmp = z; elseif (x <= 6.5e+154) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.8e+24], z, If[LessEqual[x, 6.5e+154], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+24}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+154}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -8.80000000000000007e24 or 6.5000000000000005e154 < x Initial program 47.3%
Taylor expanded in x around inf 48.6%
if -8.80000000000000007e24 < x < 6.5000000000000005e154Initial program 63.2%
Taylor expanded in t around inf 49.8%
Final simplification49.4%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 57.2%
Taylor expanded in t around inf 37.8%
Final simplification37.8%
(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 2023302
(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)))