
(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)))) (fma z (+ (/ x t_1) (/ y t_1)) (+ (/ y (/ t_1 (- a b))) (/ a (/ t_1 t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
return fma(z, ((x / t_1) + (y / t_1)), ((y / (t_1 / (a - b))) + (a / (t_1 / t))));
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) return fma(z, Float64(Float64(x / t_1) + Float64(y / t_1)), Float64(Float64(y / Float64(t_1 / Float64(a - b))) + Float64(a / Float64(t_1 / t)))) end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathsf{fma}\left(z, \frac{x}{t_1} + \frac{y}{t_1}, \frac{y}{\frac{t_1}{a - b}} + \frac{a}{\frac{t_1}{t}}\right)
\end{array}
\end{array}
Initial program 57.0%
Simplified57.4%
Taylor expanded in z around 0 70.1%
*-commutative70.1%
fma-def70.1%
associate-/l*83.3%
associate-/l*97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* z (+ x y)) t_1) (* y b)) t_2)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 4e+202)))
(+ z (+ (/ y (/ t_2 (- a b))) (/ a (/ t_2 t))))
(+ (* z (+ (/ x t_2) (/ y t_2))) (/ (- t_1 (* y b)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (((z * (x + y)) + t_1) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 4e+202)) {
tmp = z + ((y / (t_2 / (a - b))) + (a / (t_2 / t)));
} else {
tmp = (z * ((x / t_2) + (y / t_2))) + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (((z * (x + y)) + t_1) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 4e+202)) {
tmp = z + ((y / (t_2 / (a - b))) + (a / (t_2 / t)));
} else {
tmp = (z * ((x / t_2) + (y / t_2))) + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) t_3 = (((z * (x + y)) + t_1) - (y * b)) / t_2 tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 4e+202): tmp = z + ((y / (t_2 / (a - b))) + (a / (t_2 / t))) else: tmp = (z * ((x / t_2) + (y / t_2))) + ((t_1 - (y * b)) / t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + t_1) - Float64(y * b)) / t_2) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 4e+202)) tmp = Float64(z + Float64(Float64(y / Float64(t_2 / Float64(a - b))) + Float64(a / Float64(t_2 / t)))); else tmp = Float64(Float64(z * Float64(Float64(x / t_2) + Float64(y / t_2))) + Float64(Float64(t_1 - Float64(y * b)) / t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); t_3 = (((z * (x + y)) + t_1) - (y * b)) / t_2; tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 4e+202))) tmp = z + ((y / (t_2 / (a - b))) + (a / (t_2 / t))); else tmp = (z * ((x / t_2) + (y / t_2))) + ((t_1 - (y * b)) / t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 4e+202]], $MachinePrecision]], N[(z + N[(N[(y / N[(t$95$2 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(t$95$2 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(N[(x / t$95$2), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(z \cdot \left(x + y\right) + t_1\right) - y \cdot b}{t_2}\\
\mathbf{if}\;t_3 \leq -\infty \lor \neg \left(t_3 \leq 4 \cdot 10^{+202}\right):\\
\;\;\;\;z + \left(\frac{y}{\frac{t_2}{a - b}} + \frac{a}{\frac{t_2}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x}{t_2} + \frac{y}{t_2}\right) + \frac{t_1 - y \cdot b}{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 3.9999999999999996e202 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.2%
Simplified10.1%
Taylor expanded in z around inf 9.1%
*-commutative9.1%
associate-/l*33.2%
associate-/l*56.0%
Simplified56.0%
Taylor expanded in y around inf 92.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)) < 3.9999999999999996e202Initial program 99.8%
Taylor expanded in z around 0 99.8%
associate--l+99.8%
*-commutative99.8%
div-sub99.9%
Simplified99.9%
Final simplification96.5%
(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 4e+202)))
(+ z (+ (/ y (/ t_1 (- a b))) (/ a (/ t_1 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 <= 4e+202)) {
tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / 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 <= 4e+202)) {
tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / 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 <= 4e+202): tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / 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 <= 4e+202)) tmp = Float64(z + Float64(Float64(y / Float64(t_1 / Float64(a - b))) + Float64(a / Float64(t_1 / 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 <= 4e+202))) tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / 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, 4e+202]], $MachinePrecision]], N[(z + N[(N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(t$95$1 / t), $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 4 \cdot 10^{+202}\right):\\
\;\;\;\;z + \left(\frac{y}{\frac{t_1}{a - b}} + \frac{a}{\frac{t_1}{t}}\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 3.9999999999999996e202 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.2%
Simplified10.1%
Taylor expanded in z around inf 9.1%
*-commutative9.1%
associate-/l*33.2%
associate-/l*56.0%
Simplified56.0%
Taylor expanded in y around inf 92.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)) < 3.9999999999999996e202Initial program 99.8%
Final simplification96.5%
(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+202)))
(+ (/ (- z b) (/ (+ y t) y)) (/ (+ y t) (/ (+ y t) a)))
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+202)) {
tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a));
} 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+202)) {
tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a));
} 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+202): tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a)) 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+202)) tmp = Float64(Float64(Float64(z - b) / Float64(Float64(y + t) / y)) + Float64(Float64(y + t) / Float64(Float64(y + t) / a))); 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+202))) tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a)); 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+202]], $MachinePrecision]], N[(N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $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^{+202}\right):\\
\;\;\;\;\frac{z - b}{\frac{y + t}{y}} + \frac{y + t}{\frac{y + t}{a}}\\
\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.9999999999999996e202 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.2%
Simplified10.1%
Taylor expanded in x around 0 16.5%
Taylor expanded in a around -inf 16.3%
mul-1-neg16.3%
unsub-neg16.3%
associate-/l*40.6%
associate-/l*76.5%
mul-1-neg76.5%
unsub-neg76.5%
mul-1-neg76.5%
Simplified76.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)) < 3.9999999999999996e202Initial program 99.8%
Final simplification88.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (or (<= x -4e+64) (not (<= x 9e+55)))
(+ z (+ (/ y (/ t_1 (- a b))) (/ a (/ t_1 t))))
(+ (/ (- z b) (/ t_1 y)) (+ (/ a (/ t_1 (+ y t))) (/ (* z x) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((x <= -4e+64) || !(x <= 9e+55)) {
tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / t)));
} else {
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((z * x) / 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 = y + (x + t)
if ((x <= (-4d+64)) .or. (.not. (x <= 9d+55))) then
tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / t)))
else
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((z * x) / 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 = y + (x + t);
double tmp;
if ((x <= -4e+64) || !(x <= 9e+55)) {
tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / t)));
} else {
tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((z * x) / t_1));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if (x <= -4e+64) or not (x <= 9e+55): tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / t))) else: tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((z * x) / t_1)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if ((x <= -4e+64) || !(x <= 9e+55)) tmp = Float64(z + Float64(Float64(y / Float64(t_1 / Float64(a - b))) + Float64(a / Float64(t_1 / t)))); else tmp = Float64(Float64(Float64(z - b) / Float64(t_1 / y)) + Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(Float64(z * x) / t_1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if ((x <= -4e+64) || ~((x <= 9e+55))) tmp = z + ((y / (t_1 / (a - b))) + (a / (t_1 / t))); else tmp = ((z - b) / (t_1 / y)) + ((a / (t_1 / (y + t))) + ((z * x) / t_1)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -4e+64], N[Not[LessEqual[x, 9e+55]], $MachinePrecision]], N[(z + N[(N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;x \leq -4 \cdot 10^{+64} \lor \neg \left(x \leq 9 \cdot 10^{+55}\right):\\
\;\;\;\;z + \left(\frac{y}{\frac{t_1}{a - b}} + \frac{a}{\frac{t_1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z - b}{\frac{t_1}{y}} + \left(\frac{a}{\frac{t_1}{y + t}} + \frac{z \cdot x}{t_1}\right)\\
\end{array}
\end{array}
if x < -4.00000000000000009e64 or 8.99999999999999996e55 < x Initial program 44.3%
Simplified44.7%
Taylor expanded in z around inf 44.3%
*-commutative44.3%
associate-/l*57.7%
associate-/l*67.5%
Simplified67.5%
Taylor expanded in y around inf 93.9%
if -4.00000000000000009e64 < x < 8.99999999999999996e55Initial program 64.9%
Simplified65.4%
Taylor expanded in a around inf 65.2%
associate-/l*78.5%
+-commutative78.5%
associate-/l*98.1%
Simplified98.1%
Final simplification96.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ y t) (/ a (+ t (+ x y)))))
(t_2 (/ (- z b) (/ (+ y t) y)))
(t_3 (- (+ z a) b))
(t_4 (* z (/ (+ x y) (+ y (+ x t))))))
(if (<= a -7.8e+152)
t_1
(if (<= a -3.2e+71)
t_3
(if (<= a -700000.0)
t_1
(if (<= a -7.6e-62)
t_2
(if (<= a -8.8e-151)
t_4
(if (<= a 1.5e-242)
t_2
(if (<= a 5.2e-64) t_4 (if (<= a 8e+185) t_3 t_1))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) * (a / (t + (x + y)));
double t_2 = (z - b) / ((y + t) / y);
double t_3 = (z + a) - b;
double t_4 = z * ((x + y) / (y + (x + t)));
double tmp;
if (a <= -7.8e+152) {
tmp = t_1;
} else if (a <= -3.2e+71) {
tmp = t_3;
} else if (a <= -700000.0) {
tmp = t_1;
} else if (a <= -7.6e-62) {
tmp = t_2;
} else if (a <= -8.8e-151) {
tmp = t_4;
} else if (a <= 1.5e-242) {
tmp = t_2;
} else if (a <= 5.2e-64) {
tmp = t_4;
} else if (a <= 8e+185) {
tmp = t_3;
} 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (y + t) * (a / (t + (x + y)))
t_2 = (z - b) / ((y + t) / y)
t_3 = (z + a) - b
t_4 = z * ((x + y) / (y + (x + t)))
if (a <= (-7.8d+152)) then
tmp = t_1
else if (a <= (-3.2d+71)) then
tmp = t_3
else if (a <= (-700000.0d0)) then
tmp = t_1
else if (a <= (-7.6d-62)) then
tmp = t_2
else if (a <= (-8.8d-151)) then
tmp = t_4
else if (a <= 1.5d-242) then
tmp = t_2
else if (a <= 5.2d-64) then
tmp = t_4
else if (a <= 8d+185) then
tmp = t_3
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 = (y + t) * (a / (t + (x + y)));
double t_2 = (z - b) / ((y + t) / y);
double t_3 = (z + a) - b;
double t_4 = z * ((x + y) / (y + (x + t)));
double tmp;
if (a <= -7.8e+152) {
tmp = t_1;
} else if (a <= -3.2e+71) {
tmp = t_3;
} else if (a <= -700000.0) {
tmp = t_1;
} else if (a <= -7.6e-62) {
tmp = t_2;
} else if (a <= -8.8e-151) {
tmp = t_4;
} else if (a <= 1.5e-242) {
tmp = t_2;
} else if (a <= 5.2e-64) {
tmp = t_4;
} else if (a <= 8e+185) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y + t) * (a / (t + (x + y))) t_2 = (z - b) / ((y + t) / y) t_3 = (z + a) - b t_4 = z * ((x + y) / (y + (x + t))) tmp = 0 if a <= -7.8e+152: tmp = t_1 elif a <= -3.2e+71: tmp = t_3 elif a <= -700000.0: tmp = t_1 elif a <= -7.6e-62: tmp = t_2 elif a <= -8.8e-151: tmp = t_4 elif a <= 1.5e-242: tmp = t_2 elif a <= 5.2e-64: tmp = t_4 elif a <= 8e+185: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) * Float64(a / Float64(t + Float64(x + y)))) t_2 = Float64(Float64(z - b) / Float64(Float64(y + t) / y)) t_3 = Float64(Float64(z + a) - b) t_4 = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t)))) tmp = 0.0 if (a <= -7.8e+152) tmp = t_1; elseif (a <= -3.2e+71) tmp = t_3; elseif (a <= -700000.0) tmp = t_1; elseif (a <= -7.6e-62) tmp = t_2; elseif (a <= -8.8e-151) tmp = t_4; elseif (a <= 1.5e-242) tmp = t_2; elseif (a <= 5.2e-64) tmp = t_4; elseif (a <= 8e+185) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y + t) * (a / (t + (x + y))); t_2 = (z - b) / ((y + t) / y); t_3 = (z + a) - b; t_4 = z * ((x + y) / (y + (x + t))); tmp = 0.0; if (a <= -7.8e+152) tmp = t_1; elseif (a <= -3.2e+71) tmp = t_3; elseif (a <= -700000.0) tmp = t_1; elseif (a <= -7.6e-62) tmp = t_2; elseif (a <= -8.8e-151) tmp = t_4; elseif (a <= 1.5e-242) tmp = t_2; elseif (a <= 5.2e-64) tmp = t_4; elseif (a <= 8e+185) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] * N[(a / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.8e+152], t$95$1, If[LessEqual[a, -3.2e+71], t$95$3, If[LessEqual[a, -700000.0], t$95$1, If[LessEqual[a, -7.6e-62], t$95$2, If[LessEqual[a, -8.8e-151], t$95$4, If[LessEqual[a, 1.5e-242], t$95$2, If[LessEqual[a, 5.2e-64], t$95$4, If[LessEqual[a, 8e+185], t$95$3, t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) \cdot \frac{a}{t + \left(x + y\right)}\\
t_2 := \frac{z - b}{\frac{y + t}{y}}\\
t_3 := \left(z + a\right) - b\\
t_4 := z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\mathbf{if}\;a \leq -7.8 \cdot 10^{+152}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -3.2 \cdot 10^{+71}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq -700000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -7.6 \cdot 10^{-62}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -8.8 \cdot 10^{-151}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{-242}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-64}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+185}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -7.80000000000000022e152 or -3.20000000000000023e71 < a < -7e5 or 7.9999999999999998e185 < a Initial program 42.8%
Taylor expanded in a around inf 38.2%
expm1-log1p-u15.3%
expm1-udef10.4%
associate-/l*29.4%
+-commutative29.4%
Applied egg-rr29.4%
expm1-def34.4%
expm1-log1p84.8%
associate-/r/83.6%
*-commutative83.6%
*-rgt-identity83.6%
associate-*r/83.4%
associate-*r/83.6%
*-rgt-identity83.6%
associate-+r+83.6%
Simplified83.6%
if -7.80000000000000022e152 < a < -3.20000000000000023e71 or 5.2e-64 < a < 7.9999999999999998e185Initial program 55.2%
Taylor expanded in y around inf 68.4%
+-commutative68.4%
Simplified68.4%
if -7e5 < a < -7.60000000000000013e-62 or -8.7999999999999997e-151 < a < 1.5e-242Initial program 68.2%
Simplified68.7%
Taylor expanded in x around 0 54.9%
Taylor expanded in a around 0 46.9%
associate-/l*69.3%
Simplified69.3%
if -7.60000000000000013e-62 < a < -8.7999999999999997e-151 or 1.5e-242 < a < 5.2e-64Initial program 70.0%
Taylor expanded in z around inf 39.9%
*-un-lft-identity39.9%
associate-/l*60.5%
Applied egg-rr60.5%
*-lft-identity60.5%
associate-/r/63.7%
Simplified63.7%
Final simplification72.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (/ (+ (* t a) (* y t_1)) (+ y t))))
(if (<= y -3.3e+62)
t_1
(if (<= y -1.55e+14)
(/ (- z b) (/ (+ y t) y))
(if (<= y -1.15e-33)
t_2
(if (<= y -1.5e-55)
(/ (- (* z x) (* y b)) (+ y (+ x t)))
(if (<= y -4.1e-112)
t_2
(if (<= y 1.36e-157) (/ (+ (* z x) (* t a)) (+ x t)) t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = ((t * a) + (y * t_1)) / (y + t);
double tmp;
if (y <= -3.3e+62) {
tmp = t_1;
} else if (y <= -1.55e+14) {
tmp = (z - b) / ((y + t) / y);
} else if (y <= -1.15e-33) {
tmp = t_2;
} else if (y <= -1.5e-55) {
tmp = ((z * x) - (y * b)) / (y + (x + t));
} else if (y <= -4.1e-112) {
tmp = t_2;
} else if (y <= 1.36e-157) {
tmp = ((z * x) + (t * a)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = ((t * a) + (y * t_1)) / (y + t)
if (y <= (-3.3d+62)) then
tmp = t_1
else if (y <= (-1.55d+14)) then
tmp = (z - b) / ((y + t) / y)
else if (y <= (-1.15d-33)) then
tmp = t_2
else if (y <= (-1.5d-55)) then
tmp = ((z * x) - (y * b)) / (y + (x + t))
else if (y <= (-4.1d-112)) then
tmp = t_2
else if (y <= 1.36d-157) then
tmp = ((z * x) + (t * a)) / (x + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = ((t * a) + (y * t_1)) / (y + t);
double tmp;
if (y <= -3.3e+62) {
tmp = t_1;
} else if (y <= -1.55e+14) {
tmp = (z - b) / ((y + t) / y);
} else if (y <= -1.15e-33) {
tmp = t_2;
} else if (y <= -1.5e-55) {
tmp = ((z * x) - (y * b)) / (y + (x + t));
} else if (y <= -4.1e-112) {
tmp = t_2;
} else if (y <= 1.36e-157) {
tmp = ((z * x) + (t * a)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = ((t * a) + (y * t_1)) / (y + t) tmp = 0 if y <= -3.3e+62: tmp = t_1 elif y <= -1.55e+14: tmp = (z - b) / ((y + t) / y) elif y <= -1.15e-33: tmp = t_2 elif y <= -1.5e-55: tmp = ((z * x) - (y * b)) / (y + (x + t)) elif y <= -4.1e-112: tmp = t_2 elif y <= 1.36e-157: tmp = ((z * x) + (t * a)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(Float64(Float64(t * a) + Float64(y * t_1)) / Float64(y + t)) tmp = 0.0 if (y <= -3.3e+62) tmp = t_1; elseif (y <= -1.55e+14) tmp = Float64(Float64(z - b) / Float64(Float64(y + t) / y)); elseif (y <= -1.15e-33) tmp = t_2; elseif (y <= -1.5e-55) tmp = Float64(Float64(Float64(z * x) - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (y <= -4.1e-112) tmp = t_2; elseif (y <= 1.36e-157) tmp = Float64(Float64(Float64(z * x) + Float64(t * a)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = ((t * a) + (y * t_1)) / (y + t); tmp = 0.0; if (y <= -3.3e+62) tmp = t_1; elseif (y <= -1.55e+14) tmp = (z - b) / ((y + t) / y); elseif (y <= -1.15e-33) tmp = t_2; elseif (y <= -1.5e-55) tmp = ((z * x) - (y * b)) / (y + (x + t)); elseif (y <= -4.1e-112) tmp = t_2; elseif (y <= 1.36e-157) tmp = ((z * x) + (t * a)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t * a), $MachinePrecision] + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.3e+62], t$95$1, If[LessEqual[y, -1.55e+14], N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.15e-33], t$95$2, If[LessEqual[y, -1.5e-55], N[(N[(N[(z * x), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.1e-112], t$95$2, If[LessEqual[y, 1.36e-157], N[(N[(N[(z * x), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := \frac{t \cdot a + y \cdot t_1}{y + t}\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{+14}:\\
\;\;\;\;\frac{z - b}{\frac{y + t}{y}}\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-33}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-55}:\\
\;\;\;\;\frac{z \cdot x - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{-112}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{-157}:\\
\;\;\;\;\frac{z \cdot x + t \cdot a}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -3.3e62 or 1.36e-157 < y Initial program 44.7%
Taylor expanded in y around inf 70.7%
+-commutative70.7%
Simplified70.7%
if -3.3e62 < y < -1.55e14Initial program 52.8%
Simplified52.8%
Taylor expanded in x around 0 46.5%
Taylor expanded in a around 0 47.9%
associate-/l*76.1%
Simplified76.1%
if -1.55e14 < y < -1.14999999999999993e-33 or -1.50000000000000008e-55 < y < -4.09999999999999996e-112Initial program 75.2%
Simplified75.7%
Taylor expanded in x around 0 71.5%
if -1.14999999999999993e-33 < y < -1.50000000000000008e-55Initial program 100.0%
Taylor expanded in x around inf 78.2%
if -4.09999999999999996e-112 < y < 1.36e-157Initial program 77.6%
Taylor expanded in y around 0 68.5%
Final simplification70.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.1e-90) (not (<= y 2.82e-169))) (+ (/ (- z b) (/ (+ y t) y)) (/ (+ y t) (/ (+ y t) a))) (/ (+ (* z x) (* t a)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e-90) || !(y <= 2.82e-169)) {
tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a));
} else {
tmp = ((z * x) + (t * a)) / (x + t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.1d-90)) .or. (.not. (y <= 2.82d-169))) then
tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a))
else
tmp = ((z * x) + (t * a)) / (x + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e-90) || !(y <= 2.82e-169)) {
tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a));
} else {
tmp = ((z * x) + (t * a)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.1e-90) or not (y <= 2.82e-169): tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a)) else: tmp = ((z * x) + (t * a)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.1e-90) || !(y <= 2.82e-169)) tmp = Float64(Float64(Float64(z - b) / Float64(Float64(y + t) / y)) + Float64(Float64(y + t) / Float64(Float64(y + t) / a))); else tmp = Float64(Float64(Float64(z * x) + Float64(t * a)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.1e-90) || ~((y <= 2.82e-169))) tmp = ((z - b) / ((y + t) / y)) + ((y + t) / ((y + t) / a)); else tmp = ((z * x) + (t * a)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.1e-90], N[Not[LessEqual[y, 2.82e-169]], $MachinePrecision]], N[(N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * x), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-90} \lor \neg \left(y \leq 2.82 \cdot 10^{-169}\right):\\
\;\;\;\;\frac{z - b}{\frac{y + t}{y}} + \frac{y + t}{\frac{y + t}{a}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot x + t \cdot a}{x + t}\\
\end{array}
\end{array}
if y < -1.09999999999999993e-90 or 2.8199999999999998e-169 < y Initial program 50.0%
Simplified50.5%
Taylor expanded in x around 0 42.6%
Taylor expanded in a around -inf 42.5%
mul-1-neg42.5%
unsub-neg42.5%
associate-/l*57.8%
associate-/l*72.7%
mul-1-neg72.7%
unsub-neg72.7%
mul-1-neg72.7%
Simplified72.7%
if -1.09999999999999993e-90 < y < 2.8199999999999998e-169Initial program 78.0%
Taylor expanded in y around 0 68.9%
Final simplification71.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (* (+ y t) (/ a (+ t (+ x y))))))
(if (<= a -1.12e+153)
t_2
(if (<= a -1.45e+70)
t_1
(if (<= a -430000.0)
t_2
(if (<= a 2.25e-300)
(/ (- z b) (/ (+ y t) y))
(if (<= a 1.2e+185) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = (y + t) * (a / (t + (x + y)));
double tmp;
if (a <= -1.12e+153) {
tmp = t_2;
} else if (a <= -1.45e+70) {
tmp = t_1;
} else if (a <= -430000.0) {
tmp = t_2;
} else if (a <= 2.25e-300) {
tmp = (z - b) / ((y + t) / y);
} else if (a <= 1.2e+185) {
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 = (z + a) - b
t_2 = (y + t) * (a / (t + (x + y)))
if (a <= (-1.12d+153)) then
tmp = t_2
else if (a <= (-1.45d+70)) then
tmp = t_1
else if (a <= (-430000.0d0)) then
tmp = t_2
else if (a <= 2.25d-300) then
tmp = (z - b) / ((y + t) / y)
else if (a <= 1.2d+185) 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 = (z + a) - b;
double t_2 = (y + t) * (a / (t + (x + y)));
double tmp;
if (a <= -1.12e+153) {
tmp = t_2;
} else if (a <= -1.45e+70) {
tmp = t_1;
} else if (a <= -430000.0) {
tmp = t_2;
} else if (a <= 2.25e-300) {
tmp = (z - b) / ((y + t) / y);
} else if (a <= 1.2e+185) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = (y + t) * (a / (t + (x + y))) tmp = 0 if a <= -1.12e+153: tmp = t_2 elif a <= -1.45e+70: tmp = t_1 elif a <= -430000.0: tmp = t_2 elif a <= 2.25e-300: tmp = (z - b) / ((y + t) / y) elif a <= 1.2e+185: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(Float64(y + t) * Float64(a / Float64(t + Float64(x + y)))) tmp = 0.0 if (a <= -1.12e+153) tmp = t_2; elseif (a <= -1.45e+70) tmp = t_1; elseif (a <= -430000.0) tmp = t_2; elseif (a <= 2.25e-300) tmp = Float64(Float64(z - b) / Float64(Float64(y + t) / y)); elseif (a <= 1.2e+185) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = (y + t) * (a / (t + (x + y))); tmp = 0.0; if (a <= -1.12e+153) tmp = t_2; elseif (a <= -1.45e+70) tmp = t_1; elseif (a <= -430000.0) tmp = t_2; elseif (a <= 2.25e-300) tmp = (z - b) / ((y + t) / y); elseif (a <= 1.2e+185) tmp = t_1; else tmp = t_2; 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[(N[(y + t), $MachinePrecision] * N[(a / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.12e+153], t$95$2, If[LessEqual[a, -1.45e+70], t$95$1, If[LessEqual[a, -430000.0], t$95$2, If[LessEqual[a, 2.25e-300], N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e+185], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := \left(y + t\right) \cdot \frac{a}{t + \left(x + y\right)}\\
\mathbf{if}\;a \leq -1.12 \cdot 10^{+153}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -1.45 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -430000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-300}:\\
\;\;\;\;\frac{z - b}{\frac{y + t}{y}}\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+185}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -1.1200000000000001e153 or -1.4499999999999999e70 < a < -4.3e5 or 1.19999999999999995e185 < a Initial program 42.8%
Taylor expanded in a around inf 38.2%
expm1-log1p-u15.3%
expm1-udef10.4%
associate-/l*29.4%
+-commutative29.4%
Applied egg-rr29.4%
expm1-def34.4%
expm1-log1p84.8%
associate-/r/83.6%
*-commutative83.6%
*-rgt-identity83.6%
associate-*r/83.4%
associate-*r/83.6%
*-rgt-identity83.6%
associate-+r+83.6%
Simplified83.6%
if -1.1200000000000001e153 < a < -1.4499999999999999e70 or 2.25e-300 < a < 1.19999999999999995e185Initial program 62.3%
Taylor expanded in y around inf 61.4%
+-commutative61.4%
Simplified61.4%
if -4.3e5 < a < 2.25e-300Initial program 67.2%
Simplified67.3%
Taylor expanded in x around 0 57.8%
Taylor expanded in a around 0 42.0%
associate-/l*62.0%
Simplified62.0%
Final simplification68.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (* y (- (/ z t) (/ b t))))))
(if (<= t -1.5e+177)
t_1
(if (<= t 1.42e+41)
(- (+ z a) b)
(if (or (<= t 3.5e+138) (not (<= t 1.6e+168)))
t_1
(* z (/ (+ x y) (+ y (+ x t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (y * ((z / t) - (b / t)));
double tmp;
if (t <= -1.5e+177) {
tmp = t_1;
} else if (t <= 1.42e+41) {
tmp = (z + a) - b;
} else if ((t <= 3.5e+138) || !(t <= 1.6e+168)) {
tmp = t_1;
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a + (y * ((z / t) - (b / t)))
if (t <= (-1.5d+177)) then
tmp = t_1
else if (t <= 1.42d+41) then
tmp = (z + a) - b
else if ((t <= 3.5d+138) .or. (.not. (t <= 1.6d+168))) then
tmp = t_1
else
tmp = z * ((x + y) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (y * ((z / t) - (b / t)));
double tmp;
if (t <= -1.5e+177) {
tmp = t_1;
} else if (t <= 1.42e+41) {
tmp = (z + a) - b;
} else if ((t <= 3.5e+138) || !(t <= 1.6e+168)) {
tmp = t_1;
} else {
tmp = z * ((x + y) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (y * ((z / t) - (b / t))) tmp = 0 if t <= -1.5e+177: tmp = t_1 elif t <= 1.42e+41: tmp = (z + a) - b elif (t <= 3.5e+138) or not (t <= 1.6e+168): tmp = t_1 else: tmp = z * ((x + y) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(y * Float64(Float64(z / t) - Float64(b / t)))) tmp = 0.0 if (t <= -1.5e+177) tmp = t_1; elseif (t <= 1.42e+41) tmp = Float64(Float64(z + a) - b); elseif ((t <= 3.5e+138) || !(t <= 1.6e+168)) tmp = t_1; else tmp = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (y * ((z / t) - (b / t))); tmp = 0.0; if (t <= -1.5e+177) tmp = t_1; elseif (t <= 1.42e+41) tmp = (z + a) - b; elseif ((t <= 3.5e+138) || ~((t <= 1.6e+168))) tmp = t_1; else tmp = z * ((x + y) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(y * N[(N[(z / t), $MachinePrecision] - N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e+177], t$95$1, If[LessEqual[t, 1.42e+41], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[Or[LessEqual[t, 3.5e+138], N[Not[LessEqual[t, 1.6e+168]], $MachinePrecision]], t$95$1, N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + y \cdot \left(\frac{z}{t} - \frac{b}{t}\right)\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{+177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.42 \cdot 10^{+41}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+138} \lor \neg \left(t \leq 1.6 \cdot 10^{+168}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if t < -1.5e177 or 1.42000000000000007e41 < t < 3.4999999999999998e138 or 1.6000000000000001e168 < t Initial program 50.0%
Simplified50.6%
Taylor expanded in x around 0 43.0%
Taylor expanded in y around 0 76.4%
if -1.5e177 < t < 1.42000000000000007e41Initial program 61.9%
Taylor expanded in y around inf 64.1%
+-commutative64.1%
Simplified64.1%
if 3.4999999999999998e138 < t < 1.6000000000000001e168Initial program 28.9%
Taylor expanded in z around inf 21.4%
*-un-lft-identity21.4%
associate-/l*79.8%
Applied egg-rr79.8%
*-lft-identity79.8%
associate-/r/80.0%
Simplified80.0%
Final simplification68.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.85e+62)
t_1
(if (<= y -8.5e-68)
(/ (- z b) (/ (+ y t) y))
(if (<= y -1.06e-117)
a
(if (<= y -1.2e-281)
(/ z (/ (+ x t) x))
(if (<= y 4.4e-162) (/ t (/ (+ x t) a)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.85e+62) {
tmp = t_1;
} else if (y <= -8.5e-68) {
tmp = (z - b) / ((y + t) / y);
} else if (y <= -1.06e-117) {
tmp = a;
} else if (y <= -1.2e-281) {
tmp = z / ((x + t) / x);
} else if (y <= 4.4e-162) {
tmp = t / ((x + t) / 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 = (z + a) - b
if (y <= (-1.85d+62)) then
tmp = t_1
else if (y <= (-8.5d-68)) then
tmp = (z - b) / ((y + t) / y)
else if (y <= (-1.06d-117)) then
tmp = a
else if (y <= (-1.2d-281)) then
tmp = z / ((x + t) / x)
else if (y <= 4.4d-162) then
tmp = t / ((x + t) / 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 = (z + a) - b;
double tmp;
if (y <= -1.85e+62) {
tmp = t_1;
} else if (y <= -8.5e-68) {
tmp = (z - b) / ((y + t) / y);
} else if (y <= -1.06e-117) {
tmp = a;
} else if (y <= -1.2e-281) {
tmp = z / ((x + t) / x);
} else if (y <= 4.4e-162) {
tmp = t / ((x + t) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.85e+62: tmp = t_1 elif y <= -8.5e-68: tmp = (z - b) / ((y + t) / y) elif y <= -1.06e-117: tmp = a elif y <= -1.2e-281: tmp = z / ((x + t) / x) elif y <= 4.4e-162: tmp = t / ((x + t) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.85e+62) tmp = t_1; elseif (y <= -8.5e-68) tmp = Float64(Float64(z - b) / Float64(Float64(y + t) / y)); elseif (y <= -1.06e-117) tmp = a; elseif (y <= -1.2e-281) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (y <= 4.4e-162) tmp = Float64(t / Float64(Float64(x + t) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.85e+62) tmp = t_1; elseif (y <= -8.5e-68) tmp = (z - b) / ((y + t) / y); elseif (y <= -1.06e-117) tmp = a; elseif (y <= -1.2e-281) tmp = z / ((x + t) / x); elseif (y <= 4.4e-162) tmp = t / ((x + t) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.85e+62], t$95$1, If[LessEqual[y, -8.5e-68], N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.06e-117], a, If[LessEqual[y, -1.2e-281], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e-162], N[(t / N[(N[(x + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-68}:\\
\;\;\;\;\frac{z - b}{\frac{y + t}{y}}\\
\mathbf{elif}\;y \leq -1.06 \cdot 10^{-117}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-281}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-162}:\\
\;\;\;\;\frac{t}{\frac{x + t}{a}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.85000000000000007e62 or 4.3999999999999998e-162 < y Initial program 44.7%
Taylor expanded in y around inf 70.7%
+-commutative70.7%
Simplified70.7%
if -1.85000000000000007e62 < y < -8.50000000000000026e-68Initial program 72.9%
Simplified73.3%
Taylor expanded in x around 0 60.4%
Taylor expanded in a around 0 47.0%
associate-/l*57.1%
Simplified57.1%
if -8.50000000000000026e-68 < y < -1.06000000000000008e-117Initial program 74.2%
Taylor expanded in t around inf 56.3%
if -1.06000000000000008e-117 < y < -1.2e-281Initial program 81.7%
Taylor expanded in z around inf 52.0%
Taylor expanded in y around 0 49.2%
associate-/l*54.3%
Simplified54.3%
if -1.2e-281 < y < 4.3999999999999998e-162Initial program 71.1%
Taylor expanded in a around inf 41.7%
Taylor expanded in y around 0 41.7%
*-commutative41.7%
associate-/l*59.2%
+-commutative59.2%
Simplified59.2%
Final simplification65.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.05e+62)
t_1
(if (<= y -64.0)
(/ (- z b) (/ (+ y t) y))
(if (<= y 5.8e-150) (/ (+ (* z x) (* t a)) (+ x t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.05e+62) {
tmp = t_1;
} else if (y <= -64.0) {
tmp = (z - b) / ((y + t) / y);
} else if (y <= 5.8e-150) {
tmp = ((z * x) + (t * a)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-1.05d+62)) then
tmp = t_1
else if (y <= (-64.0d0)) then
tmp = (z - b) / ((y + t) / y)
else if (y <= 5.8d-150) then
tmp = ((z * x) + (t * a)) / (x + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.05e+62) {
tmp = t_1;
} else if (y <= -64.0) {
tmp = (z - b) / ((y + t) / y);
} else if (y <= 5.8e-150) {
tmp = ((z * x) + (t * a)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.05e+62: tmp = t_1 elif y <= -64.0: tmp = (z - b) / ((y + t) / y) elif y <= 5.8e-150: tmp = ((z * x) + (t * a)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.05e+62) tmp = t_1; elseif (y <= -64.0) tmp = Float64(Float64(z - b) / Float64(Float64(y + t) / y)); elseif (y <= 5.8e-150) tmp = Float64(Float64(Float64(z * x) + Float64(t * a)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.05e+62) tmp = t_1; elseif (y <= -64.0) tmp = (z - b) / ((y + t) / y); elseif (y <= 5.8e-150) tmp = ((z * x) + (t * a)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.05e+62], t$95$1, If[LessEqual[y, -64.0], N[(N[(z - b), $MachinePrecision] / N[(N[(y + t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-150], N[(N[(N[(z * x), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -64:\\
\;\;\;\;\frac{z - b}{\frac{y + t}{y}}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-150}:\\
\;\;\;\;\frac{z \cdot x + t \cdot a}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.05e62 or 5.7999999999999996e-150 < y Initial program 44.7%
Taylor expanded in y around inf 70.7%
+-commutative70.7%
Simplified70.7%
if -1.05e62 < y < -64Initial program 52.9%
Simplified52.9%
Taylor expanded in x around 0 47.7%
Taylor expanded in a around 0 48.8%
associate-/l*72.3%
Simplified72.3%
if -64 < y < 5.7999999999999996e-150Initial program 78.8%
Taylor expanded in y around 0 63.6%
Final simplification68.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= b 8e-112)
t_1
(if (<= b 3.4e-37)
(/ y (/ (+ x y) a))
(if (<= b 8.6e+136) t_1 (* b (/ (- y) (+ y (+ x t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (b <= 8e-112) {
tmp = t_1;
} else if (b <= 3.4e-37) {
tmp = y / ((x + y) / a);
} else if (b <= 8.6e+136) {
tmp = t_1;
} else {
tmp = b * (-y / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (b <= 8d-112) then
tmp = t_1
else if (b <= 3.4d-37) then
tmp = y / ((x + y) / a)
else if (b <= 8.6d+136) then
tmp = t_1
else
tmp = b * (-y / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (b <= 8e-112) {
tmp = t_1;
} else if (b <= 3.4e-37) {
tmp = y / ((x + y) / a);
} else if (b <= 8.6e+136) {
tmp = t_1;
} else {
tmp = b * (-y / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if b <= 8e-112: tmp = t_1 elif b <= 3.4e-37: tmp = y / ((x + y) / a) elif b <= 8.6e+136: tmp = t_1 else: tmp = b * (-y / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (b <= 8e-112) tmp = t_1; elseif (b <= 3.4e-37) tmp = Float64(y / Float64(Float64(x + y) / a)); elseif (b <= 8.6e+136) tmp = t_1; else tmp = Float64(b * Float64(Float64(-y) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (b <= 8e-112) tmp = t_1; elseif (b <= 3.4e-37) tmp = y / ((x + y) / a); elseif (b <= 8.6e+136) tmp = t_1; else tmp = b * (-y / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[b, 8e-112], t$95$1, If[LessEqual[b, 3.4e-37], N[(y / N[(N[(x + y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.6e+136], t$95$1, N[(b * N[((-y) / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;b \leq 8 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{-37}:\\
\;\;\;\;\frac{y}{\frac{x + y}{a}}\\
\mathbf{elif}\;b \leq 8.6 \cdot 10^{+136}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot \frac{-y}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if b < 7.9999999999999996e-112 or 3.40000000000000018e-37 < b < 8.5999999999999997e136Initial program 55.3%
Taylor expanded in y around inf 65.4%
+-commutative65.4%
Simplified65.4%
if 7.9999999999999996e-112 < b < 3.40000000000000018e-37Initial program 77.0%
Taylor expanded in a around inf 54.0%
Taylor expanded in t around 0 49.0%
*-commutative49.0%
associate-/l*62.7%
Simplified62.7%
if 8.5999999999999997e136 < b Initial program 54.4%
Taylor expanded in b around inf 27.4%
neg-mul-127.4%
distribute-rgt-neg-in27.4%
Simplified27.4%
expm1-log1p-u11.0%
expm1-udef5.9%
associate-/l*15.0%
+-commutative15.0%
Applied egg-rr15.0%
expm1-def20.0%
expm1-log1p47.9%
associate-/r/52.4%
Simplified52.4%
Final simplification63.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -5.1e-120)
t_1
(if (<= y -1.25e-284)
(/ z (/ (+ x t) x))
(if (<= y 4.5e-165) (/ t (/ (+ x t) a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -5.1e-120) {
tmp = t_1;
} else if (y <= -1.25e-284) {
tmp = z / ((x + t) / x);
} else if (y <= 4.5e-165) {
tmp = t / ((x + t) / 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 = (z + a) - b
if (y <= (-5.1d-120)) then
tmp = t_1
else if (y <= (-1.25d-284)) then
tmp = z / ((x + t) / x)
else if (y <= 4.5d-165) then
tmp = t / ((x + t) / 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 = (z + a) - b;
double tmp;
if (y <= -5.1e-120) {
tmp = t_1;
} else if (y <= -1.25e-284) {
tmp = z / ((x + t) / x);
} else if (y <= 4.5e-165) {
tmp = t / ((x + t) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -5.1e-120: tmp = t_1 elif y <= -1.25e-284: tmp = z / ((x + t) / x) elif y <= 4.5e-165: tmp = t / ((x + t) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -5.1e-120) tmp = t_1; elseif (y <= -1.25e-284) tmp = Float64(z / Float64(Float64(x + t) / x)); elseif (y <= 4.5e-165) tmp = Float64(t / Float64(Float64(x + t) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -5.1e-120) tmp = t_1; elseif (y <= -1.25e-284) tmp = z / ((x + t) / x); elseif (y <= 4.5e-165) tmp = t / ((x + t) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -5.1e-120], t$95$1, If[LessEqual[y, -1.25e-284], N[(z / N[(N[(x + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-165], N[(t / N[(N[(x + t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -5.1 \cdot 10^{-120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-284}:\\
\;\;\;\;\frac{z}{\frac{x + t}{x}}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-165}:\\
\;\;\;\;\frac{t}{\frac{x + t}{a}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.0999999999999998e-120 or 4.49999999999999992e-165 < y Initial program 50.5%
Taylor expanded in y around inf 63.9%
+-commutative63.9%
Simplified63.9%
if -5.0999999999999998e-120 < y < -1.24999999999999993e-284Initial program 81.7%
Taylor expanded in z around inf 52.0%
Taylor expanded in y around 0 49.2%
associate-/l*54.3%
Simplified54.3%
if -1.24999999999999993e-284 < y < 4.49999999999999992e-165Initial program 71.1%
Taylor expanded in a around inf 41.7%
Taylor expanded in y around 0 41.7%
*-commutative41.7%
associate-/l*59.2%
+-commutative59.2%
Simplified59.2%
Final simplification62.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.2e+99) z (if (<= x 9.6e+219) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.2e+99) {
tmp = z;
} else if (x <= 9.6e+219) {
tmp = (z + 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 (x <= (-3.2d+99)) then
tmp = z
else if (x <= 9.6d+219) then
tmp = (z + 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 (x <= -3.2e+99) {
tmp = z;
} else if (x <= 9.6e+219) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.2e+99: tmp = z elif x <= 9.6e+219: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.2e+99) tmp = z; elseif (x <= 9.6e+219) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.2e+99) tmp = z; elseif (x <= 9.6e+219) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.2e+99], z, If[LessEqual[x, 9.6e+219], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{+99}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+219}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -3.19999999999999999e99 or 9.6000000000000002e219 < x Initial program 46.5%
Taylor expanded in x around inf 59.1%
if -3.19999999999999999e99 < x < 9.6000000000000002e219Initial program 60.4%
Taylor expanded in y around inf 62.0%
+-commutative62.0%
Simplified62.0%
Final simplification61.2%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5e-68) a (if (<= t 4.3e+77) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5e-68) {
tmp = a;
} else if (t <= 4.3e+77) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-5d-68)) then
tmp = a
else if (t <= 4.3d+77) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5e-68) {
tmp = a;
} else if (t <= 4.3e+77) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5e-68: tmp = a elif t <= 4.3e+77: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5e-68) tmp = a; elseif (t <= 4.3e+77) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5e-68) tmp = a; elseif (t <= 4.3e+77) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5e-68], a, If[LessEqual[t, 4.3e+77], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-68}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+77}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -4.99999999999999971e-68 or 4.29999999999999991e77 < t Initial program 49.9%
Taylor expanded in t around inf 53.5%
if -4.99999999999999971e-68 < t < 4.29999999999999991e77Initial program 63.8%
Taylor expanded in x around inf 47.5%
Final simplification50.5%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 57.0%
Taylor expanded in t around inf 36.2%
Final simplification36.2%
(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 2023258
(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)))