
(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 17 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 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) t_1))
(t_3 (/ (+ x y) (/ t_1 z))))
(if (<= t_2 (- INFINITY))
(+ t_3 (- (/ (+ y t) (/ t_1 a)) (/ y (/ t_1 b))))
(if (<= t_2 5e+299)
t_2
(+ t_3 (+ (/ y (/ t_1 (- a b))) (* t (/ a (+ x (+ y t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (x + y) / (t_1 / z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3 + (((y + t) / (t_1 / a)) - (y / (t_1 / b)));
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else {
tmp = t_3 + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t)))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (x + y) / (t_1 / z);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3 + (((y + t) / (t_1 / a)) - (y / (t_1 / b)));
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else {
tmp = t_3 + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1 t_3 = (x + y) / (t_1 / z) tmp = 0 if t_2 <= -math.inf: tmp = t_3 + (((y + t) / (t_1 / a)) - (y / (t_1 / b))) elif t_2 <= 5e+299: tmp = t_2 else: tmp = t_3 + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(Float64(x + y) / Float64(t_1 / z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_3 + Float64(Float64(Float64(y + t) / Float64(t_1 / a)) - Float64(y / Float64(t_1 / b)))); elseif (t_2 <= 5e+299) tmp = t_2; else tmp = Float64(t_3 + Float64(Float64(y / Float64(t_1 / Float64(a - b))) + Float64(t * Float64(a / Float64(x + Float64(y + t)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1; t_3 = (x + y) / (t_1 / z); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3 + (((y + t) / (t_1 / a)) - (y / (t_1 / b))); elseif (t_2 <= 5e+299) tmp = t_2; else tmp = t_3 + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$3 + N[(N[(N[(y + t), $MachinePrecision] / N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision] - N[(y / N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+299], t$95$2, N[(t$95$3 + N[(N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
t_3 := \frac{x + y}{\frac{t_1}{z}}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3 + \left(\frac{y + t}{\frac{t_1}{a}} - \frac{y}{\frac{t_1}{b}}\right)\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3 + \left(\frac{y}{\frac{t_1}{a - b}} + t \cdot \frac{a}{x + \left(y + t\right)}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.6%
*-commutative6.6%
distribute-rgt-in6.1%
associate-+r+6.1%
associate--l+6.1%
+-commutative6.1%
+-commutative6.1%
distribute-lft-out--6.1%
fma-def6.5%
+-commutative6.5%
fma-def6.5%
associate-+l+6.5%
+-commutative6.5%
Simplified6.5%
Taylor expanded in a around -inf 6.6%
associate-/l*29.4%
distribute-lft-out29.4%
associate-/l*73.1%
distribute-lft-out73.1%
+-commutative73.1%
associate-/l*100.0%
Simplified100.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)) < 5.0000000000000003e299Initial program 99.7%
if 5.0000000000000003e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.2%
Simplified6.0%
Taylor expanded in z around inf 4.9%
associate-/l*31.9%
associate-/l*67.7%
associate-/l*99.7%
Simplified99.7%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+299)))
(+
(/ (+ x y) (/ t_1 z))
(+ (/ y (/ t_1 (- a b))) (* t (/ a (+ x (+ y t))))))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+299)) {
tmp = ((x + y) / (t_1 / z)) + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t)))));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+299)) {
tmp = ((x + y) / (t_1 / z)) + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t)))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+299): tmp = ((x + y) / (t_1 / z)) + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t))))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+299)) tmp = Float64(Float64(Float64(x + y) / Float64(t_1 / z)) + Float64(Float64(y / Float64(t_1 / Float64(a - b))) + Float64(t * Float64(a / Float64(x + Float64(y + t)))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+299))) tmp = ((x + y) / (t_1 / z)) + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t))))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+299]], $MachinePrecision]], N[(N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+299}\right):\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}} + \left(\frac{y}{\frac{t_1}{a - b}} + t \cdot \frac{a}{x + \left(y + t\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5.0000000000000003e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.8%
Simplified6.2%
Taylor expanded in z around inf 5.4%
associate-/l*30.5%
associate-/l*68.5%
associate-/l*99.8%
Simplified99.8%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.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)) < 5.0000000000000003e299Initial program 99.7%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) t_1))
(t_3 (/ (+ x y) (/ t_1 z)))
(t_4 (/ y (/ t_1 (- a b)))))
(if (<= t_2 (- INFINITY))
(+ t_3 (+ t_4 (/ a (/ t_1 t))))
(if (<= t_2 5e+299) t_2 (+ t_3 (+ t_4 (* t (/ a (+ x (+ y t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (x + y) / (t_1 / z);
double t_4 = y / (t_1 / (a - b));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3 + (t_4 + (a / (t_1 / t)));
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else {
tmp = t_3 + (t_4 + (t * (a / (x + (y + t)))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (x + y) / (t_1 / z);
double t_4 = y / (t_1 / (a - b));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3 + (t_4 + (a / (t_1 / t)));
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else {
tmp = t_3 + (t_4 + (t * (a / (x + (y + t)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1 t_3 = (x + y) / (t_1 / z) t_4 = y / (t_1 / (a - b)) tmp = 0 if t_2 <= -math.inf: tmp = t_3 + (t_4 + (a / (t_1 / t))) elif t_2 <= 5e+299: tmp = t_2 else: tmp = t_3 + (t_4 + (t * (a / (x + (y + t))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(Float64(x + y) / Float64(t_1 / z)) t_4 = Float64(y / Float64(t_1 / Float64(a - b))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(t_3 + Float64(t_4 + Float64(a / Float64(t_1 / t)))); elseif (t_2 <= 5e+299) tmp = t_2; else tmp = Float64(t_3 + Float64(t_4 + Float64(t * Float64(a / Float64(x + Float64(y + t)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1; t_3 = (x + y) / (t_1 / z); t_4 = y / (t_1 / (a - b)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3 + (t_4 + (a / (t_1 / t))); elseif (t_2 <= 5e+299) tmp = t_2; else tmp = t_3 + (t_4 + (t * (a / (x + (y + t))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(t$95$3 + N[(t$95$4 + N[(a / N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+299], t$95$2, N[(t$95$3 + N[(t$95$4 + N[(t * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
t_3 := \frac{x + y}{\frac{t_1}{z}}\\
t_4 := \frac{y}{\frac{t_1}{a - b}}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3 + \left(t_4 + \frac{a}{\frac{t_1}{t}}\right)\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3 + \left(t_4 + t \cdot \frac{a}{x + \left(y + t\right)}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.6%
Simplified6.5%
Taylor expanded in z around inf 6.1%
associate-/l*29.0%
associate-/l*69.5%
associate-/l*99.9%
Simplified99.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)) < 5.0000000000000003e299Initial program 99.7%
if 5.0000000000000003e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.2%
Simplified6.0%
Taylor expanded in z around inf 4.9%
associate-/l*31.9%
associate-/l*67.7%
associate-/l*99.7%
Simplified99.7%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+299)))
(+ z (+ (/ y (/ t_1 (- a b))) (* t (/ a (+ x (+ y t))))))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+299)) {
tmp = z + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t)))));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+299)) {
tmp = z + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t)))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+299): tmp = z + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t))))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+299)) tmp = Float64(z + Float64(Float64(y / Float64(t_1 / Float64(a - b))) + Float64(t * Float64(a / Float64(x + Float64(y + t)))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+299))) tmp = z + ((y / (t_1 / (a - b))) + (t * (a / (x + (y + t))))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+299]], $MachinePrecision]], N[(z + N[(N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+299}\right):\\
\;\;\;\;z + \left(\frac{y}{\frac{t_1}{a - b}} + t \cdot \frac{a}{x + \left(y + t\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5.0000000000000003e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.8%
Simplified6.2%
Taylor expanded in z around inf 5.4%
associate-/l*30.5%
associate-/l*68.5%
associate-/l*99.8%
Simplified99.8%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 95.6%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000003e299Initial program 99.7%
Final simplification98.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) t_1))
(t_3 (/ y (/ t_1 (- a b)))))
(if (<= t_2 (- INFINITY))
(+ z (+ t_3 (/ a (/ t_1 t))))
(if (<= t_2 5e+299) t_2 (+ z (+ t_3 (* t (/ a (+ x (+ y t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = y / (t_1 / (a - b));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = z + (t_3 + (a / (t_1 / t)));
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else {
tmp = z + (t_3 + (t * (a / (x + (y + t)))));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = y / (t_1 / (a - b));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = z + (t_3 + (a / (t_1 / t)));
} else if (t_2 <= 5e+299) {
tmp = t_2;
} else {
tmp = z + (t_3 + (t * (a / (x + (y + t)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1 t_3 = y / (t_1 / (a - b)) tmp = 0 if t_2 <= -math.inf: tmp = z + (t_3 + (a / (t_1 / t))) elif t_2 <= 5e+299: tmp = t_2 else: tmp = z + (t_3 + (t * (a / (x + (y + t))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(y / Float64(t_1 / Float64(a - b))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(z + Float64(t_3 + Float64(a / Float64(t_1 / t)))); elseif (t_2 <= 5e+299) tmp = t_2; else tmp = Float64(z + Float64(t_3 + Float64(t * Float64(a / Float64(x + Float64(y + t)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1; t_3 = y / (t_1 / (a - b)); tmp = 0.0; if (t_2 <= -Inf) tmp = z + (t_3 + (a / (t_1 / t))); elseif (t_2 <= 5e+299) tmp = t_2; else tmp = z + (t_3 + (t * (a / (x + (y + t))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(z + N[(t$95$3 + N[(a / N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+299], t$95$2, N[(z + N[(t$95$3 + N[(t * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
t_3 := \frac{y}{\frac{t_1}{a - b}}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;z + \left(t_3 + \frac{a}{\frac{t_1}{t}}\right)\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;z + \left(t_3 + t \cdot \frac{a}{x + \left(y + t\right)}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 6.6%
Simplified6.5%
Taylor expanded in z around inf 6.1%
associate-/l*29.0%
associate-/l*69.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 97.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)) < 5.0000000000000003e299Initial program 99.7%
if 5.0000000000000003e299 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.2%
Simplified6.0%
Taylor expanded in z around inf 4.9%
associate-/l*31.9%
associate-/l*67.7%
associate-/l*99.7%
Simplified99.7%
associate-/r/99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around inf 94.1%
Final simplification98.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+261))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+261)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+261)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 4e+261): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 4e+261)) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 4e+261))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $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, 4e+261]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\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 4 \cdot 10^{+261}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 3.9999999999999997e261 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 10.1%
Taylor expanded in y around inf 76.4%
+-commutative76.4%
Simplified76.4%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 3.9999999999999997e261Initial program 99.7%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x y) (/ (+ y (+ x t)) z))) (t_2 (+ x (+ y t))))
(if (<= z -1.35e+166)
t_1
(if (<= z -1.45e-39)
(- (+ z a) b)
(if (<= z 3.7e+105) (- (/ a (/ t_2 (+ y t))) (/ (* y b) t_2)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) / ((y + (x + t)) / z);
double t_2 = x + (y + t);
double tmp;
if (z <= -1.35e+166) {
tmp = t_1;
} else if (z <= -1.45e-39) {
tmp = (z + a) - b;
} else if (z <= 3.7e+105) {
tmp = (a / (t_2 / (y + t))) - ((y * b) / t_2);
} 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) :: t_2
real(8) :: tmp
t_1 = (x + y) / ((y + (x + t)) / z)
t_2 = x + (y + t)
if (z <= (-1.35d+166)) then
tmp = t_1
else if (z <= (-1.45d-39)) then
tmp = (z + a) - b
else if (z <= 3.7d+105) then
tmp = (a / (t_2 / (y + t))) - ((y * b) / t_2)
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 = (x + y) / ((y + (x + t)) / z);
double t_2 = x + (y + t);
double tmp;
if (z <= -1.35e+166) {
tmp = t_1;
} else if (z <= -1.45e-39) {
tmp = (z + a) - b;
} else if (z <= 3.7e+105) {
tmp = (a / (t_2 / (y + t))) - ((y * b) / t_2);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) / ((y + (x + t)) / z) t_2 = x + (y + t) tmp = 0 if z <= -1.35e+166: tmp = t_1 elif z <= -1.45e-39: tmp = (z + a) - b elif z <= 3.7e+105: tmp = (a / (t_2 / (y + t))) - ((y * b) / t_2) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) / Float64(Float64(y + Float64(x + t)) / z)) t_2 = Float64(x + Float64(y + t)) tmp = 0.0 if (z <= -1.35e+166) tmp = t_1; elseif (z <= -1.45e-39) tmp = Float64(Float64(z + a) - b); elseif (z <= 3.7e+105) tmp = Float64(Float64(a / Float64(t_2 / Float64(y + t))) - Float64(Float64(y * b) / t_2)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) / ((y + (x + t)) / z); t_2 = x + (y + t); tmp = 0.0; if (z <= -1.35e+166) tmp = t_1; elseif (z <= -1.45e-39) tmp = (z + a) - b; elseif (z <= 3.7e+105) tmp = (a / (t_2 / (y + t))) - ((y * b) / t_2); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.35e+166], t$95$1, If[LessEqual[z, -1.45e-39], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, 3.7e+105], N[(N[(a / N[(t$95$2 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * b), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y}{\frac{y + \left(x + t\right)}{z}}\\
t_2 := x + \left(y + t\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-39}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+105}:\\
\;\;\;\;\frac{a}{\frac{t_2}{y + t}} - \frac{y \cdot b}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.35000000000000006e166 or 3.69999999999999985e105 < z Initial program 46.9%
Taylor expanded in z around inf 36.8%
associate-/l*82.5%
Simplified82.5%
if -1.35000000000000006e166 < z < -1.44999999999999994e-39Initial program 50.8%
Taylor expanded in y around inf 62.1%
+-commutative62.1%
Simplified62.1%
if -1.44999999999999994e-39 < z < 3.69999999999999985e105Initial program 69.5%
Taylor expanded in z around 0 57.4%
div-sub57.4%
associate-/l*75.5%
associate-+l+75.5%
+-commutative75.5%
associate-+l+75.5%
+-commutative75.5%
Applied egg-rr75.5%
Final simplification75.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b))
(t_2 (+ y (+ x t)))
(t_3 (/ (+ x y) (/ t_2 z)))
(t_4 (/ a (/ t_2 (+ y t)))))
(if (<= z -3.7e+167)
t_3
(if (<= z -1.1e-55)
t_1
(if (<= z -2.8e-269)
t_4
(if (<= z 9.4e-125)
(/ (- (* a (+ y t)) (* y b)) t_2)
(if (<= z 1.15e-54) t_4 (if (<= z 4.8e+105) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = y + (x + t);
double t_3 = (x + y) / (t_2 / z);
double t_4 = a / (t_2 / (y + t));
double tmp;
if (z <= -3.7e+167) {
tmp = t_3;
} else if (z <= -1.1e-55) {
tmp = t_1;
} else if (z <= -2.8e-269) {
tmp = t_4;
} else if (z <= 9.4e-125) {
tmp = ((a * (y + t)) - (y * b)) / t_2;
} else if (z <= 1.15e-54) {
tmp = t_4;
} else if (z <= 4.8e+105) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (z + a) - b
t_2 = y + (x + t)
t_3 = (x + y) / (t_2 / z)
t_4 = a / (t_2 / (y + t))
if (z <= (-3.7d+167)) then
tmp = t_3
else if (z <= (-1.1d-55)) then
tmp = t_1
else if (z <= (-2.8d-269)) then
tmp = t_4
else if (z <= 9.4d-125) then
tmp = ((a * (y + t)) - (y * b)) / t_2
else if (z <= 1.15d-54) then
tmp = t_4
else if (z <= 4.8d+105) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = y + (x + t);
double t_3 = (x + y) / (t_2 / z);
double t_4 = a / (t_2 / (y + t));
double tmp;
if (z <= -3.7e+167) {
tmp = t_3;
} else if (z <= -1.1e-55) {
tmp = t_1;
} else if (z <= -2.8e-269) {
tmp = t_4;
} else if (z <= 9.4e-125) {
tmp = ((a * (y + t)) - (y * b)) / t_2;
} else if (z <= 1.15e-54) {
tmp = t_4;
} else if (z <= 4.8e+105) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = y + (x + t) t_3 = (x + y) / (t_2 / z) t_4 = a / (t_2 / (y + t)) tmp = 0 if z <= -3.7e+167: tmp = t_3 elif z <= -1.1e-55: tmp = t_1 elif z <= -2.8e-269: tmp = t_4 elif z <= 9.4e-125: tmp = ((a * (y + t)) - (y * b)) / t_2 elif z <= 1.15e-54: tmp = t_4 elif z <= 4.8e+105: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(x + y) / Float64(t_2 / z)) t_4 = Float64(a / Float64(t_2 / Float64(y + t))) tmp = 0.0 if (z <= -3.7e+167) tmp = t_3; elseif (z <= -1.1e-55) tmp = t_1; elseif (z <= -2.8e-269) tmp = t_4; elseif (z <= 9.4e-125) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / t_2); elseif (z <= 1.15e-54) tmp = t_4; elseif (z <= 4.8e+105) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = y + (x + t); t_3 = (x + y) / (t_2 / z); t_4 = a / (t_2 / (y + t)); tmp = 0.0; if (z <= -3.7e+167) tmp = t_3; elseif (z <= -1.1e-55) tmp = t_1; elseif (z <= -2.8e-269) tmp = t_4; elseif (z <= 9.4e-125) tmp = ((a * (y + t)) - (y * b)) / t_2; elseif (z <= 1.15e-54) tmp = t_4; elseif (z <= 4.8e+105) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(a / N[(t$95$2 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+167], t$95$3, If[LessEqual[z, -1.1e-55], t$95$1, If[LessEqual[z, -2.8e-269], t$95$4, If[LessEqual[z, 9.4e-125], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[z, 1.15e-54], t$95$4, If[LessEqual[z, 4.8e+105], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{x + y}{\frac{t_2}{z}}\\
t_4 := \frac{a}{\frac{t_2}{y + t}}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+167}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-269}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 9.4 \cdot 10^{-125}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{t_2}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-54}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -3.7000000000000001e167 or 4.7999999999999995e105 < z Initial program 46.9%
Taylor expanded in z around inf 36.8%
associate-/l*82.5%
Simplified82.5%
if -3.7000000000000001e167 < z < -1.1e-55 or 1.1499999999999999e-54 < z < 4.7999999999999995e105Initial program 60.5%
Taylor expanded in y around inf 62.6%
+-commutative62.6%
Simplified62.6%
if -1.1e-55 < z < -2.79999999999999995e-269 or 9.4000000000000001e-125 < z < 1.1499999999999999e-54Initial program 57.9%
Taylor expanded in a around inf 37.9%
associate-/l*71.3%
Simplified71.3%
if -2.79999999999999995e-269 < z < 9.4000000000000001e-125Initial program 80.1%
Taylor expanded in z around 0 77.8%
Final simplification72.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) b)))
(if (<= y -3e-35)
t_2
(if (<= y -1.85e-105)
(* (+ y t) (/ a (+ x (+ y t))))
(if (<= y 7.1e-130)
(/ (+ (* x z) (* t a)) (+ x t))
(if (<= y 1.2e-15)
(/ (+ x y) (/ t_1 z))
(if (<= y 1.5e+67) (/ a (/ t_1 (+ y t))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -3e-35) {
tmp = t_2;
} else if (y <= -1.85e-105) {
tmp = (y + t) * (a / (x + (y + t)));
} else if (y <= 7.1e-130) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 1.2e-15) {
tmp = (x + y) / (t_1 / z);
} else if (y <= 1.5e+67) {
tmp = a / (t_1 / (y + 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 = y + (x + t)
t_2 = (z + a) - b
if (y <= (-3d-35)) then
tmp = t_2
else if (y <= (-1.85d-105)) then
tmp = (y + t) * (a / (x + (y + t)))
else if (y <= 7.1d-130) then
tmp = ((x * z) + (t * a)) / (x + t)
else if (y <= 1.2d-15) then
tmp = (x + y) / (t_1 / z)
else if (y <= 1.5d+67) then
tmp = a / (t_1 / (y + 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 = y + (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -3e-35) {
tmp = t_2;
} else if (y <= -1.85e-105) {
tmp = (y + t) * (a / (x + (y + t)));
} else if (y <= 7.1e-130) {
tmp = ((x * z) + (t * a)) / (x + t);
} else if (y <= 1.2e-15) {
tmp = (x + y) / (t_1 / z);
} else if (y <= 1.5e+67) {
tmp = a / (t_1 / (y + t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - b tmp = 0 if y <= -3e-35: tmp = t_2 elif y <= -1.85e-105: tmp = (y + t) * (a / (x + (y + t))) elif y <= 7.1e-130: tmp = ((x * z) + (t * a)) / (x + t) elif y <= 1.2e-15: tmp = (x + y) / (t_1 / z) elif y <= 1.5e+67: tmp = a / (t_1 / (y + t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -3e-35) tmp = t_2; elseif (y <= -1.85e-105) tmp = Float64(Float64(y + t) * Float64(a / Float64(x + Float64(y + t)))); elseif (y <= 7.1e-130) tmp = Float64(Float64(Float64(x * z) + Float64(t * a)) / Float64(x + t)); elseif (y <= 1.2e-15) tmp = Float64(Float64(x + y) / Float64(t_1 / z)); elseif (y <= 1.5e+67) tmp = Float64(a / Float64(t_1 / Float64(y + t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (z + a) - b; tmp = 0.0; if (y <= -3e-35) tmp = t_2; elseif (y <= -1.85e-105) tmp = (y + t) * (a / (x + (y + t))); elseif (y <= 7.1e-130) tmp = ((x * z) + (t * a)) / (x + t); elseif (y <= 1.2e-15) tmp = (x + y) / (t_1 / z); elseif (y <= 1.5e+67) tmp = a / (t_1 / (y + t)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3e-35], t$95$2, If[LessEqual[y, -1.85e-105], N[(N[(y + t), $MachinePrecision] * N[(a / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.1e-130], N[(N[(N[(x * z), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-15], N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+67], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3 \cdot 10^{-35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-105}:\\
\;\;\;\;\left(y + t\right) \cdot \frac{a}{x + \left(y + t\right)}\\
\mathbf{elif}\;y \leq 7.1 \cdot 10^{-130}:\\
\;\;\;\;\frac{x \cdot z + t \cdot a}{x + t}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+67}:\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -2.99999999999999989e-35 or 1.50000000000000005e67 < y Initial program 40.2%
Taylor expanded in y around inf 77.7%
+-commutative77.7%
Simplified77.7%
if -2.99999999999999989e-35 < y < -1.85000000000000004e-105Initial program 69.2%
Taylor expanded in a around inf 43.4%
Taylor expanded in a around 0 43.4%
associate-/l*67.8%
associate-+r+67.8%
+-commutative67.8%
associate-/r/67.9%
+-commutative67.9%
+-commutative67.9%
Simplified67.9%
if -1.85000000000000004e-105 < y < 7.1000000000000001e-130Initial program 81.8%
Taylor expanded in y around 0 67.6%
if 7.1000000000000001e-130 < y < 1.19999999999999997e-15Initial program 72.0%
Taylor expanded in z around inf 42.5%
associate-/l*61.0%
Simplified61.0%
if 1.19999999999999997e-15 < y < 1.50000000000000005e67Initial program 80.7%
Taylor expanded in a around inf 49.8%
associate-/l*63.8%
Simplified63.8%
Final simplification71.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ a (/ (+ y (+ x t)) (+ y t)))) (t_2 (- (+ z a) b)))
(if (<= y -6.5e-35)
t_2
(if (<= y 1.6e-194)
t_1
(if (<= y 1.95e-58) (/ z (/ (+ x t) x)) (if (<= y 4.7e+67) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / ((y + (x + t)) / (y + t));
double t_2 = (z + a) - b;
double tmp;
if (y <= -6.5e-35) {
tmp = t_2;
} else if (y <= 1.6e-194) {
tmp = t_1;
} else if (y <= 1.95e-58) {
tmp = z / ((x + t) / x);
} else if (y <= 4.7e+67) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a / ((y + (x + t)) / (y + t))
t_2 = (z + a) - b
if (y <= (-6.5d-35)) then
tmp = t_2
else if (y <= 1.6d-194) then
tmp = t_1
else if (y <= 1.95d-58) then
tmp = z / ((x + t) / x)
else if (y <= 4.7d+67) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / ((y + (x + t)) / (y + t));
double t_2 = (z + a) - b;
double tmp;
if (y <= -6.5e-35) {
tmp = t_2;
} else if (y <= 1.6e-194) {
tmp = t_1;
} else if (y <= 1.95e-58) {
tmp = z / ((x + t) / x);
} else if (y <= 4.7e+67) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / ((y + (x + t)) / (y + t)) t_2 = (z + a) - b tmp = 0 if y <= -6.5e-35: tmp = t_2 elif y <= 1.6e-194: tmp = t_1 elif y <= 1.95e-58: tmp = z / ((x + t) / x) elif y <= 4.7e+67: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(Float64(y + Float64(x + t)) / Float64(y + t))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -6.5e-35) tmp = t_2; elseif (y <= 1.6e-194) tmp = t_1; elseif (y <= 1.95e-58) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (y <= 4.7e+67) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / ((y + (x + t)) / (y + t)); t_2 = (z + a) - b; tmp = 0.0; if (y <= -6.5e-35) tmp = t_2; elseif (y <= 1.6e-194) tmp = t_1; elseif (y <= 1.95e-58) tmp = z / ((x + t) / x); elseif (y <= 4.7e+67) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.5e-35], t$95$2, If[LessEqual[y, 1.6e-194], t$95$1, If[LessEqual[y, 1.95e-58], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e+67], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{y + \left(x + t\right)}{y + t}}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{-35}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-194}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-58}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -6.4999999999999999e-35 or 4.70000000000000017e67 < y Initial program 40.2%
Taylor expanded in y around inf 77.7%
+-commutative77.7%
Simplified77.7%
if -6.4999999999999999e-35 < y < 1.6000000000000001e-194 or 1.94999999999999996e-58 < y < 4.70000000000000017e67Initial program 81.9%
Taylor expanded in a around inf 46.2%
associate-/l*56.2%
Simplified56.2%
if 1.6000000000000001e-194 < y < 1.94999999999999996e-58Initial program 63.7%
Taylor expanded in z around inf 42.2%
associate-/l*62.0%
Simplified62.0%
Taylor expanded in y around 0 33.9%
associate-/l*57.8%
+-commutative57.8%
Simplified57.8%
Final simplification66.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ a (/ t_1 (+ y t)))) (t_3 (- (+ z a) b)))
(if (<= y -4.8e-35)
t_3
(if (<= y 3.5e-188)
t_2
(if (<= y 4.8e-21)
(/ (+ x y) (/ t_1 z))
(if (<= y 1.68e+75) t_2 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a / (t_1 / (y + t));
double t_3 = (z + a) - b;
double tmp;
if (y <= -4.8e-35) {
tmp = t_3;
} else if (y <= 3.5e-188) {
tmp = t_2;
} else if (y <= 4.8e-21) {
tmp = (x + y) / (t_1 / z);
} else if (y <= 1.68e+75) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = a / (t_1 / (y + t))
t_3 = (z + a) - b
if (y <= (-4.8d-35)) then
tmp = t_3
else if (y <= 3.5d-188) then
tmp = t_2
else if (y <= 4.8d-21) then
tmp = (x + y) / (t_1 / z)
else if (y <= 1.68d+75) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a / (t_1 / (y + t));
double t_3 = (z + a) - b;
double tmp;
if (y <= -4.8e-35) {
tmp = t_3;
} else if (y <= 3.5e-188) {
tmp = t_2;
} else if (y <= 4.8e-21) {
tmp = (x + y) / (t_1 / z);
} else if (y <= 1.68e+75) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = a / (t_1 / (y + t)) t_3 = (z + a) - b tmp = 0 if y <= -4.8e-35: tmp = t_3 elif y <= 3.5e-188: tmp = t_2 elif y <= 4.8e-21: tmp = (x + y) / (t_1 / z) elif y <= 1.68e+75: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(a / Float64(t_1 / Float64(y + t))) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -4.8e-35) tmp = t_3; elseif (y <= 3.5e-188) tmp = t_2; elseif (y <= 4.8e-21) tmp = Float64(Float64(x + y) / Float64(t_1 / z)); elseif (y <= 1.68e+75) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = a / (t_1 / (y + t)); t_3 = (z + a) - b; tmp = 0.0; if (y <= -4.8e-35) tmp = t_3; elseif (y <= 3.5e-188) tmp = t_2; elseif (y <= 4.8e-21) tmp = (x + y) / (t_1 / z); elseif (y <= 1.68e+75) tmp = t_2; else tmp = t_3; 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[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -4.8e-35], t$95$3, If[LessEqual[y, 3.5e-188], t$95$2, If[LessEqual[y, 4.8e-21], N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.68e+75], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{a}{\frac{t_1}{y + t}}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-35}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-188}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-21}:\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}}\\
\mathbf{elif}\;y \leq 1.68 \cdot 10^{+75}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -4.8000000000000003e-35 or 1.6799999999999999e75 < y Initial program 40.2%
Taylor expanded in y around inf 77.7%
+-commutative77.7%
Simplified77.7%
if -4.8000000000000003e-35 < y < 3.5e-188 or 4.7999999999999999e-21 < y < 1.6799999999999999e75Initial program 81.1%
Taylor expanded in a around inf 46.4%
associate-/l*56.9%
Simplified56.9%
if 3.5e-188 < y < 4.7999999999999999e-21Initial program 70.0%
Taylor expanded in z around inf 42.0%
associate-/l*61.7%
Simplified61.7%
Final simplification66.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.05e+221) a (if (<= t 1.4e+154) (- (+ z a) b) (- a (/ a (/ (+ y t) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.05e+221) {
tmp = a;
} else if (t <= 1.4e+154) {
tmp = (z + a) - b;
} else {
tmp = a - (a / ((y + t) / x));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.05d+221)) then
tmp = a
else if (t <= 1.4d+154) then
tmp = (z + a) - b
else
tmp = a - (a / ((y + t) / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.05e+221) {
tmp = a;
} else if (t <= 1.4e+154) {
tmp = (z + a) - b;
} else {
tmp = a - (a / ((y + t) / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.05e+221: tmp = a elif t <= 1.4e+154: tmp = (z + a) - b else: tmp = a - (a / ((y + t) / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.05e+221) tmp = a; elseif (t <= 1.4e+154) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a - Float64(a / Float64(Float64(y + t) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.05e+221) tmp = a; elseif (t <= 1.4e+154) tmp = (z + a) - b; else tmp = a - (a / ((y + t) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.05e+221], a, If[LessEqual[t, 1.4e+154], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(a / N[(N[(y + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+221}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - \frac{a}{\frac{y + t}{x}}\\
\end{array}
\end{array}
if t < -1.05000000000000001e221Initial program 38.9%
Taylor expanded in t around inf 89.1%
if -1.05000000000000001e221 < t < 1.4e154Initial program 63.8%
Taylor expanded in y around inf 59.3%
+-commutative59.3%
Simplified59.3%
if 1.4e154 < t Initial program 56.5%
Taylor expanded in a around inf 33.8%
Taylor expanded in x around 0 56.5%
+-commutative56.5%
mul-1-neg56.5%
unsub-neg56.5%
associate-/l*62.2%
+-commutative62.2%
Simplified62.2%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6.4e+218) a (if (<= t 1.5e+155) (- (+ z a) b) (- a (/ a (/ t x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.4e+218) {
tmp = a;
} else if (t <= 1.5e+155) {
tmp = (z + a) - b;
} else {
tmp = a - (a / (t / x));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-6.4d+218)) then
tmp = a
else if (t <= 1.5d+155) then
tmp = (z + a) - b
else
tmp = a - (a / (t / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.4e+218) {
tmp = a;
} else if (t <= 1.5e+155) {
tmp = (z + a) - b;
} else {
tmp = a - (a / (t / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.4e+218: tmp = a elif t <= 1.5e+155: tmp = (z + a) - b else: tmp = a - (a / (t / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.4e+218) tmp = a; elseif (t <= 1.5e+155) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a - Float64(a / Float64(t / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6.4e+218) tmp = a; elseif (t <= 1.5e+155) tmp = (z + a) - b; else tmp = a - (a / (t / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.4e+218], a, If[LessEqual[t, 1.5e+155], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(a / N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{+218}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+155}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - \frac{a}{\frac{t}{x}}\\
\end{array}
\end{array}
if t < -6.39999999999999975e218Initial program 38.9%
Taylor expanded in t around inf 89.1%
if -6.39999999999999975e218 < t < 1.5000000000000001e155Initial program 63.8%
Taylor expanded in y around inf 59.3%
+-commutative59.3%
Simplified59.3%
if 1.5000000000000001e155 < t Initial program 56.5%
Taylor expanded in a around inf 33.8%
Taylor expanded in x around 0 56.5%
+-commutative56.5%
mul-1-neg56.5%
unsub-neg56.5%
associate-/l*62.2%
+-commutative62.2%
Simplified62.2%
Taylor expanded in t around inf 56.3%
associate-/l*62.0%
Simplified62.0%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.2e+219) a (if (<= t 7.2e+157) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e+219) {
tmp = a;
} else if (t <= 7.2e+157) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.2d+219)) then
tmp = a
else if (t <= 7.2d+157) then
tmp = (z + a) - b
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.2e+219) {
tmp = a;
} else if (t <= 7.2e+157) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.2e+219: tmp = a elif t <= 7.2e+157: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.2e+219) tmp = a; elseif (t <= 7.2e+157) tmp = Float64(Float64(z + a) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.2e+219) tmp = a; elseif (t <= 7.2e+157) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.2e+219], a, If[LessEqual[t, 7.2e+157], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+219}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+157}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.2e219 or 7.20000000000000049e157 < t Initial program 50.5%
Taylor expanded in t around inf 70.0%
if -1.2e219 < t < 7.20000000000000049e157Initial program 63.8%
Taylor expanded in y around inf 59.3%
+-commutative59.3%
Simplified59.3%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.5e+143) z (if (<= z 3.4e+101) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.5e+143) {
tmp = z;
} else if (z <= 3.4e+101) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.5d+143)) then
tmp = z
else if (z <= 3.4d+101) then
tmp = a - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.5e+143) {
tmp = z;
} else if (z <= 3.4e+101) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.5e+143: tmp = z elif z <= 3.4e+101: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.5e+143) tmp = z; elseif (z <= 3.4e+101) tmp = Float64(a - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.5e+143) tmp = z; elseif (z <= 3.4e+101) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.5e+143], z, If[LessEqual[z, 3.4e+101], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+143}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+101}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -2.50000000000000006e143 or 3.40000000000000017e101 < z Initial program 46.1%
Taylor expanded in x around inf 64.2%
if -2.50000000000000006e143 < z < 3.40000000000000017e101Initial program 66.7%
Taylor expanded in z around 0 51.6%
Taylor expanded in y around -inf 50.1%
mul-1-neg50.1%
distribute-lft-out--50.1%
distribute-lft-neg-in50.1%
metadata-eval50.1%
Simplified50.1%
Final simplification53.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.05e-8) z (if (<= z 2.15e+104) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.05e-8) {
tmp = z;
} else if (z <= 2.15e+104) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-2.05d-8)) then
tmp = z
else if (z <= 2.15d+104) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.05e-8) {
tmp = z;
} else if (z <= 2.15e+104) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.05e-8: tmp = z elif z <= 2.15e+104: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.05e-8) tmp = z; elseif (z <= 2.15e+104) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.05e-8) tmp = z; elseif (z <= 2.15e+104) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.05e-8], z, If[LessEqual[z, 2.15e+104], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{-8}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+104}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -2.05000000000000016e-8 or 2.1500000000000001e104 < z Initial program 47.8%
Taylor expanded in x around inf 54.4%
if -2.05000000000000016e-8 < z < 2.1500000000000001e104Initial program 69.2%
Taylor expanded in t around inf 46.7%
Final simplification49.6%
(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 61.2%
Taylor expanded in t around inf 36.1%
Final simplification36.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t_2}{t_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t_1}{t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
herbie shell --seed 2023230
(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)))