
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (* z (+ x y)))
(t_3 (/ (- (+ t_2 (* a (+ y t))) (* y b)) t_1)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 2e+296)))
(+ (/ (+ x y) (/ t_1 z)) (+ (/ a (/ t_1 t)) (/ y (/ t_1 (- a b)))))
(+ (/ (- t_2 (* y b)) t_1) (* a (+ (/ y t_1) (/ t t_1)))))))
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);
double t_3 = ((t_2 + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 2e+296)) {
tmp = ((x + y) / (t_1 / z)) + ((a / (t_1 / t)) + (y / (t_1 / (a - b))));
} else {
tmp = ((t_2 - (y * b)) / t_1) + (a * ((y / t_1) + (t / t_1)));
}
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);
double t_3 = ((t_2 + (a * (y + t))) - (y * b)) / t_1;
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 2e+296)) {
tmp = ((x + y) / (t_1 / z)) + ((a / (t_1 / t)) + (y / (t_1 / (a - b))));
} else {
tmp = ((t_2 - (y * b)) / t_1) + (a * ((y / t_1) + (t / t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = z * (x + y) t_3 = ((t_2 + (a * (y + t))) - (y * b)) / t_1 tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 2e+296): tmp = ((x + y) / (t_1 / z)) + ((a / (t_1 / t)) + (y / (t_1 / (a - b)))) else: tmp = ((t_2 - (y * b)) / t_1) + (a * ((y / t_1) + (t / t_1))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(z * Float64(x + y)) t_3 = Float64(Float64(Float64(t_2 + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 2e+296)) tmp = Float64(Float64(Float64(x + y) / Float64(t_1 / z)) + Float64(Float64(a / Float64(t_1 / t)) + Float64(y / Float64(t_1 / Float64(a - b))))); else tmp = Float64(Float64(Float64(t_2 - Float64(y * b)) / t_1) + Float64(a * Float64(Float64(y / t_1) + Float64(t / t_1)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = z * (x + y); t_3 = ((t_2 + (a * (y + t))) - (y * b)) / t_1; tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 2e+296))) tmp = ((x + y) / (t_1 / z)) + ((a / (t_1 / t)) + (y / (t_1 / (a - b)))); else tmp = ((t_2 - (y * b)) / t_1) + (a * ((y / t_1) + (t / 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]}, Block[{t$95$2 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 2e+296]], $MachinePrecision]], N[(N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(a * N[(N[(y / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := z \cdot \left(x + y\right)\\
t_3 := \frac{\left(t_2 + a \cdot \left(y + t\right)\right) - y \cdot b}{t_1}\\
\mathbf{if}\;t_3 \leq -\infty \lor \neg \left(t_3 \leq 2 \cdot 10^{+296}\right):\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}} + \left(\frac{a}{\frac{t_1}{t}} + \frac{y}{\frac{t_1}{a - b}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2 - y \cdot b}{t_1} + a \cdot \left(\frac{y}{t_1} + \frac{t}{t_1}\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.0 or 1.99999999999999996e296 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.9%
*-commutative4.9%
distribute-rgt-in4.8%
associate-+r+4.8%
associate--l+4.8%
+-commutative4.8%
+-commutative4.8%
distribute-lft-out--5.1%
fma-def5.6%
+-commutative5.6%
fma-def5.9%
associate-+l+5.9%
+-commutative5.9%
Simplified5.9%
Taylor expanded in z around inf 5.1%
associate-/l*29.8%
+-commutative29.8%
associate-/l*52.0%
associate-/l*99.7%
Simplified99.7%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999996e296Initial program 99.8%
Taylor expanded in a around 0 99.9%
sub-neg99.9%
mul-1-neg99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
Simplified99.9%
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 2e+296)))
(+ (/ (+ x y) (/ t_1 z)) (+ (/ a (/ t_1 t)) (/ y (/ t_1 (- a b)))))
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 <= 2e+296)) {
tmp = ((x + y) / (t_1 / z)) + ((a / (t_1 / t)) + (y / (t_1 / (a - b))));
} 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 <= 2e+296)) {
tmp = ((x + y) / (t_1 / z)) + ((a / (t_1 / t)) + (y / (t_1 / (a - b))));
} 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 <= 2e+296): tmp = ((x + y) / (t_1 / z)) + ((a / (t_1 / t)) + (y / (t_1 / (a - b)))) 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 <= 2e+296)) tmp = Float64(Float64(Float64(x + y) / Float64(t_1 / z)) + Float64(Float64(a / Float64(t_1 / t)) + Float64(y / Float64(t_1 / Float64(a - b))))); 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 <= 2e+296))) tmp = ((x + y) / (t_1 / z)) + ((a / (t_1 / t)) + (y / (t_1 / (a - b)))); 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, 2e+296]], $MachinePrecision]], N[(N[(N[(x + y), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t$95$1 / N[(a - b), $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 2 \cdot 10^{+296}\right):\\
\;\;\;\;\frac{x + y}{\frac{t_1}{z}} + \left(\frac{a}{\frac{t_1}{t}} + \frac{y}{\frac{t_1}{a - b}}\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 1.99999999999999996e296 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.9%
*-commutative4.9%
distribute-rgt-in4.8%
associate-+r+4.8%
associate--l+4.8%
+-commutative4.8%
+-commutative4.8%
distribute-lft-out--5.1%
fma-def5.6%
+-commutative5.6%
fma-def5.9%
associate-+l+5.9%
+-commutative5.9%
Simplified5.9%
Taylor expanded in z around inf 5.1%
associate-/l*29.8%
+-commutative29.8%
associate-/l*52.0%
associate-/l*99.7%
Simplified99.7%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999996e296Initial program 99.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 2e+296)))
(+ z (+ (/ a (/ t_1 t)) (/ y (/ t_1 (- a b)))))
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 <= 2e+296)) {
tmp = z + ((a / (t_1 / t)) + (y / (t_1 / (a - b))));
} 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 <= 2e+296)) {
tmp = z + ((a / (t_1 / t)) + (y / (t_1 / (a - b))));
} 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 <= 2e+296): tmp = z + ((a / (t_1 / t)) + (y / (t_1 / (a - b)))) 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 <= 2e+296)) tmp = Float64(z + Float64(Float64(a / Float64(t_1 / t)) + Float64(y / Float64(t_1 / Float64(a - b))))); 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 <= 2e+296))) tmp = z + ((a / (t_1 / t)) + (y / (t_1 / (a - b)))); 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, 2e+296]], $MachinePrecision]], N[(z + N[(N[(a / N[(t$95$1 / t), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t$95$1 / N[(a - b), $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 2 \cdot 10^{+296}\right):\\
\;\;\;\;z + \left(\frac{a}{\frac{t_1}{t}} + \frac{y}{\frac{t_1}{a - b}}\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 1.99999999999999996e296 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.9%
*-commutative4.9%
distribute-rgt-in4.8%
associate-+r+4.8%
associate--l+4.8%
+-commutative4.8%
+-commutative4.8%
distribute-lft-out--5.1%
fma-def5.6%
+-commutative5.6%
fma-def5.9%
associate-+l+5.9%
+-commutative5.9%
Simplified5.9%
Taylor expanded in z around inf 5.1%
associate-/l*29.8%
+-commutative29.8%
associate-/l*52.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around inf 93.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)) < 1.99999999999999996e296Initial program 99.8%
Final simplification97.4%
(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 2e+296)))
(+ z (+ a (/ y (/ t_1 (- a b)))))
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 <= 2e+296)) {
tmp = z + (a + (y / (t_1 / (a - b))));
} 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 <= 2e+296)) {
tmp = z + (a + (y / (t_1 / (a - b))));
} 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 <= 2e+296): tmp = z + (a + (y / (t_1 / (a - b)))) 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 <= 2e+296)) tmp = Float64(z + Float64(a + Float64(y / Float64(t_1 / Float64(a - b))))); 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 <= 2e+296))) tmp = z + (a + (y / (t_1 / (a - b)))); 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, 2e+296]], $MachinePrecision]], N[(z + N[(a + N[(y / N[(t$95$1 / N[(a - b), $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 2 \cdot 10^{+296}\right):\\
\;\;\;\;z + \left(a + \frac{y}{\frac{t_1}{a - b}}\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 1.99999999999999996e296 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.9%
*-commutative4.9%
distribute-rgt-in4.8%
associate-+r+4.8%
associate--l+4.8%
+-commutative4.8%
+-commutative4.8%
distribute-lft-out--5.1%
fma-def5.6%
+-commutative5.6%
fma-def5.9%
associate-+l+5.9%
+-commutative5.9%
Simplified5.9%
Taylor expanded in z around inf 5.1%
associate-/l*29.8%
+-commutative29.8%
associate-/l*52.0%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in y around inf 93.9%
Taylor expanded in t around inf 70.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)) < 1.99999999999999996e296Initial program 99.8%
Final simplification87.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b))
(t_2 (+ x (+ y t)))
(t_3 (/ (- z b) (/ t_2 y)))
(t_4 (+ y (+ x t))))
(if (<= b -4.1e+146)
t_3
(if (<= b -1.35e+34)
t_1
(if (<= b -3e-277)
(/ a (/ t_4 (+ y t)))
(if (<= b 5e-296)
(/ (+ x y) (/ t_4 z))
(if (<= b 3.6e-243)
(* (+ y t) (/ a t_2))
(if (<= b 1.5e+57) 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 = x + (y + t);
double t_3 = (z - b) / (t_2 / y);
double t_4 = y + (x + t);
double tmp;
if (b <= -4.1e+146) {
tmp = t_3;
} else if (b <= -1.35e+34) {
tmp = t_1;
} else if (b <= -3e-277) {
tmp = a / (t_4 / (y + t));
} else if (b <= 5e-296) {
tmp = (x + y) / (t_4 / z);
} else if (b <= 3.6e-243) {
tmp = (y + t) * (a / t_2);
} else if (b <= 1.5e+57) {
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 = x + (y + t)
t_3 = (z - b) / (t_2 / y)
t_4 = y + (x + t)
if (b <= (-4.1d+146)) then
tmp = t_3
else if (b <= (-1.35d+34)) then
tmp = t_1
else if (b <= (-3d-277)) then
tmp = a / (t_4 / (y + t))
else if (b <= 5d-296) then
tmp = (x + y) / (t_4 / z)
else if (b <= 3.6d-243) then
tmp = (y + t) * (a / t_2)
else if (b <= 1.5d+57) 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 = x + (y + t);
double t_3 = (z - b) / (t_2 / y);
double t_4 = y + (x + t);
double tmp;
if (b <= -4.1e+146) {
tmp = t_3;
} else if (b <= -1.35e+34) {
tmp = t_1;
} else if (b <= -3e-277) {
tmp = a / (t_4 / (y + t));
} else if (b <= 5e-296) {
tmp = (x + y) / (t_4 / z);
} else if (b <= 3.6e-243) {
tmp = (y + t) * (a / t_2);
} else if (b <= 1.5e+57) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = x + (y + t) t_3 = (z - b) / (t_2 / y) t_4 = y + (x + t) tmp = 0 if b <= -4.1e+146: tmp = t_3 elif b <= -1.35e+34: tmp = t_1 elif b <= -3e-277: tmp = a / (t_4 / (y + t)) elif b <= 5e-296: tmp = (x + y) / (t_4 / z) elif b <= 3.6e-243: tmp = (y + t) * (a / t_2) elif b <= 1.5e+57: 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(x + Float64(y + t)) t_3 = Float64(Float64(z - b) / Float64(t_2 / y)) t_4 = Float64(y + Float64(x + t)) tmp = 0.0 if (b <= -4.1e+146) tmp = t_3; elseif (b <= -1.35e+34) tmp = t_1; elseif (b <= -3e-277) tmp = Float64(a / Float64(t_4 / Float64(y + t))); elseif (b <= 5e-296) tmp = Float64(Float64(x + y) / Float64(t_4 / z)); elseif (b <= 3.6e-243) tmp = Float64(Float64(y + t) * Float64(a / t_2)); elseif (b <= 1.5e+57) 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 = x + (y + t); t_3 = (z - b) / (t_2 / y); t_4 = y + (x + t); tmp = 0.0; if (b <= -4.1e+146) tmp = t_3; elseif (b <= -1.35e+34) tmp = t_1; elseif (b <= -3e-277) tmp = a / (t_4 / (y + t)); elseif (b <= 5e-296) tmp = (x + y) / (t_4 / z); elseif (b <= 3.6e-243) tmp = (y + t) * (a / t_2); elseif (b <= 1.5e+57) 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[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z - b), $MachinePrecision] / N[(t$95$2 / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.1e+146], t$95$3, If[LessEqual[b, -1.35e+34], t$95$1, If[LessEqual[b, -3e-277], N[(a / N[(t$95$4 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-296], N[(N[(x + y), $MachinePrecision] / N[(t$95$4 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.6e-243], N[(N[(y + t), $MachinePrecision] * N[(a / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e+57], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := x + \left(y + t\right)\\
t_3 := \frac{z - b}{\frac{t_2}{y}}\\
t_4 := y + \left(x + t\right)\\
\mathbf{if}\;b \leq -4.1 \cdot 10^{+146}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \leq -1.35 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -3 \cdot 10^{-277}:\\
\;\;\;\;\frac{a}{\frac{t_4}{y + t}}\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-296}:\\
\;\;\;\;\frac{x + y}{\frac{t_4}{z}}\\
\mathbf{elif}\;b \leq 3.6 \cdot 10^{-243}:\\
\;\;\;\;\left(y + t\right) \cdot \frac{a}{t_2}\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+57}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if b < -4.1000000000000004e146 or 1.5e57 < b Initial program 49.1%
Taylor expanded in y around inf 33.0%
+-commutative33.0%
Simplified33.0%
Taylor expanded in a around 0 30.9%
associate-/l*58.1%
associate-+r+58.1%
+-commutative58.1%
+-commutative58.1%
Simplified58.1%
if -4.1000000000000004e146 < b < -1.35e34 or 3.6000000000000001e-243 < b < 1.5e57Initial program 65.2%
Taylor expanded in y around inf 72.5%
+-commutative72.5%
Simplified72.5%
if -1.35e34 < b < -2.99999999999999978e-277Initial program 73.5%
Taylor expanded in a around inf 47.2%
associate-/l*70.0%
Simplified70.0%
if -2.99999999999999978e-277 < b < 5.0000000000000003e-296Initial program 73.6%
Taylor expanded in z around inf 65.1%
associate-/l*73.9%
Simplified73.9%
if 5.0000000000000003e-296 < b < 3.6000000000000001e-243Initial program 66.8%
Taylor expanded in a around inf 52.7%
associate-/l*84.0%
Simplified84.0%
associate-/r/84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
+-commutative84.3%
Applied egg-rr84.3%
Final simplification66.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (+ x (+ y t))) (t_3 (/ (- z b) (/ t_2 y))))
(if (<= b -4.1e+146)
t_3
(if (<= b -9.6e+33)
t_1
(if (<= b -6.8e-279)
(* a (/ 1.0 (/ t_2 (+ y t))))
(if (<= b 3.4e-296)
(/ (+ x y) (/ (+ y (+ x t)) z))
(if (<= b 3.7e-243)
(* (+ y t) (/ a t_2))
(if (<= b 1.5e+57) 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 = x + (y + t);
double t_3 = (z - b) / (t_2 / y);
double tmp;
if (b <= -4.1e+146) {
tmp = t_3;
} else if (b <= -9.6e+33) {
tmp = t_1;
} else if (b <= -6.8e-279) {
tmp = a * (1.0 / (t_2 / (y + t)));
} else if (b <= 3.4e-296) {
tmp = (x + y) / ((y + (x + t)) / z);
} else if (b <= 3.7e-243) {
tmp = (y + t) * (a / t_2);
} else if (b <= 1.5e+57) {
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) :: tmp
t_1 = (z + a) - b
t_2 = x + (y + t)
t_3 = (z - b) / (t_2 / y)
if (b <= (-4.1d+146)) then
tmp = t_3
else if (b <= (-9.6d+33)) then
tmp = t_1
else if (b <= (-6.8d-279)) then
tmp = a * (1.0d0 / (t_2 / (y + t)))
else if (b <= 3.4d-296) then
tmp = (x + y) / ((y + (x + t)) / z)
else if (b <= 3.7d-243) then
tmp = (y + t) * (a / t_2)
else if (b <= 1.5d+57) 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 = x + (y + t);
double t_3 = (z - b) / (t_2 / y);
double tmp;
if (b <= -4.1e+146) {
tmp = t_3;
} else if (b <= -9.6e+33) {
tmp = t_1;
} else if (b <= -6.8e-279) {
tmp = a * (1.0 / (t_2 / (y + t)));
} else if (b <= 3.4e-296) {
tmp = (x + y) / ((y + (x + t)) / z);
} else if (b <= 3.7e-243) {
tmp = (y + t) * (a / t_2);
} else if (b <= 1.5e+57) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = x + (y + t) t_3 = (z - b) / (t_2 / y) tmp = 0 if b <= -4.1e+146: tmp = t_3 elif b <= -9.6e+33: tmp = t_1 elif b <= -6.8e-279: tmp = a * (1.0 / (t_2 / (y + t))) elif b <= 3.4e-296: tmp = (x + y) / ((y + (x + t)) / z) elif b <= 3.7e-243: tmp = (y + t) * (a / t_2) elif b <= 1.5e+57: 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(x + Float64(y + t)) t_3 = Float64(Float64(z - b) / Float64(t_2 / y)) tmp = 0.0 if (b <= -4.1e+146) tmp = t_3; elseif (b <= -9.6e+33) tmp = t_1; elseif (b <= -6.8e-279) tmp = Float64(a * Float64(1.0 / Float64(t_2 / Float64(y + t)))); elseif (b <= 3.4e-296) tmp = Float64(Float64(x + y) / Float64(Float64(y + Float64(x + t)) / z)); elseif (b <= 3.7e-243) tmp = Float64(Float64(y + t) * Float64(a / t_2)); elseif (b <= 1.5e+57) 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 = x + (y + t); t_3 = (z - b) / (t_2 / y); tmp = 0.0; if (b <= -4.1e+146) tmp = t_3; elseif (b <= -9.6e+33) tmp = t_1; elseif (b <= -6.8e-279) tmp = a * (1.0 / (t_2 / (y + t))); elseif (b <= 3.4e-296) tmp = (x + y) / ((y + (x + t)) / z); elseif (b <= 3.7e-243) tmp = (y + t) * (a / t_2); elseif (b <= 1.5e+57) 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[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z - b), $MachinePrecision] / N[(t$95$2 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -4.1e+146], t$95$3, If[LessEqual[b, -9.6e+33], t$95$1, If[LessEqual[b, -6.8e-279], N[(a * N[(1.0 / N[(t$95$2 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.4e-296], N[(N[(x + y), $MachinePrecision] / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e-243], N[(N[(y + t), $MachinePrecision] * N[(a / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e+57], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := x + \left(y + t\right)\\
t_3 := \frac{z - b}{\frac{t_2}{y}}\\
\mathbf{if}\;b \leq -4.1 \cdot 10^{+146}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \leq -9.6 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -6.8 \cdot 10^{-279}:\\
\;\;\;\;a \cdot \frac{1}{\frac{t_2}{y + t}}\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{-296}:\\
\;\;\;\;\frac{x + y}{\frac{y + \left(x + t\right)}{z}}\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{-243}:\\
\;\;\;\;\left(y + t\right) \cdot \frac{a}{t_2}\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+57}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if b < -4.1000000000000004e146 or 1.5e57 < b Initial program 49.1%
Taylor expanded in y around inf 33.0%
+-commutative33.0%
Simplified33.0%
Taylor expanded in a around 0 30.9%
associate-/l*58.1%
associate-+r+58.1%
+-commutative58.1%
+-commutative58.1%
Simplified58.1%
if -4.1000000000000004e146 < b < -9.5999999999999999e33 or 3.7e-243 < b < 1.5e57Initial program 65.2%
Taylor expanded in y around inf 72.5%
+-commutative72.5%
Simplified72.5%
if -9.5999999999999999e33 < b < -6.8000000000000003e-279Initial program 73.5%
Taylor expanded in a around inf 47.2%
associate-/l*70.0%
Simplified70.0%
div-inv70.0%
+-commutative70.0%
+-commutative70.0%
associate-+l+70.0%
+-commutative70.0%
Applied egg-rr70.0%
if -6.8000000000000003e-279 < b < 3.39999999999999997e-296Initial program 73.6%
Taylor expanded in z around inf 65.1%
associate-/l*73.9%
Simplified73.9%
if 3.39999999999999997e-296 < b < 3.7e-243Initial program 66.8%
Taylor expanded in a around inf 52.7%
associate-/l*84.0%
Simplified84.0%
associate-/r/84.3%
+-commutative84.3%
+-commutative84.3%
associate-+l+84.3%
+-commutative84.3%
Applied egg-rr84.3%
Final simplification66.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.4e+62) (not (<= y 0.08))) (* (/ y (+ x (+ y t))) (+ z (- a b))) (+ z (/ (- (* a (+ y t)) (* y b)) (+ y (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+62) || !(y <= 0.08)) {
tmp = (y / (x + (y + t))) * (z + (a - b));
} else {
tmp = z + (((a * (y + t)) - (y * b)) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.4d+62)) .or. (.not. (y <= 0.08d0))) then
tmp = (y / (x + (y + t))) * (z + (a - b))
else
tmp = z + (((a * (y + t)) - (y * b)) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+62) || !(y <= 0.08)) {
tmp = (y / (x + (y + t))) * (z + (a - b));
} else {
tmp = z + (((a * (y + t)) - (y * b)) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.4e+62) or not (y <= 0.08): tmp = (y / (x + (y + t))) * (z + (a - b)) else: tmp = z + (((a * (y + t)) - (y * b)) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.4e+62) || !(y <= 0.08)) tmp = Float64(Float64(y / Float64(x + Float64(y + t))) * Float64(z + Float64(a - b))); else tmp = Float64(z + Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.4e+62) || ~((y <= 0.08))) tmp = (y / (x + (y + t))) * (z + (a - b)); else tmp = z + (((a * (y + t)) - (y * b)) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.4e+62], N[Not[LessEqual[y, 0.08]], $MachinePrecision]], N[(N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+62} \lor \neg \left(y \leq 0.08\right):\\
\;\;\;\;\frac{y}{x + \left(y + t\right)} \cdot \left(z + \left(a - b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z + \frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if y < -2.4e62 or 0.0800000000000000017 < y Initial program 39.0%
Taylor expanded in y around inf 36.0%
+-commutative36.0%
Simplified36.0%
expm1-log1p-u26.4%
expm1-udef16.8%
associate-/l*36.4%
associate-+l+36.4%
+-commutative36.4%
Applied egg-rr36.4%
expm1-def42.4%
expm1-log1p81.0%
associate-/r/84.7%
+-commutative84.7%
associate--l+84.7%
Simplified84.7%
if -2.4e62 < y < 0.0800000000000000017Initial program 77.8%
Taylor expanded in z around inf 77.8%
associate--l+77.8%
associate-/l*78.5%
div-sub78.5%
Simplified78.5%
Taylor expanded in y around inf 72.4%
Final simplification77.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ y (+ x (+ y t))) (+ z (- a b)))) (t_2 (+ y (+ x t))))
(if (<= y -5.7e-42)
t_1
(if (<= y -3.9e-170)
(/ (+ x y) (/ t_2 z))
(if (<= y 0.00094) (/ a (/ t_2 (+ y t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y / (x + (y + t))) * (z + (a - b));
double t_2 = y + (x + t);
double tmp;
if (y <= -5.7e-42) {
tmp = t_1;
} else if (y <= -3.9e-170) {
tmp = (x + y) / (t_2 / z);
} else if (y <= 0.00094) {
tmp = a / (t_2 / (y + 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 = (y / (x + (y + t))) * (z + (a - b))
t_2 = y + (x + t)
if (y <= (-5.7d-42)) then
tmp = t_1
else if (y <= (-3.9d-170)) then
tmp = (x + y) / (t_2 / z)
else if (y <= 0.00094d0) then
tmp = a / (t_2 / (y + 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 = (y / (x + (y + t))) * (z + (a - b));
double t_2 = y + (x + t);
double tmp;
if (y <= -5.7e-42) {
tmp = t_1;
} else if (y <= -3.9e-170) {
tmp = (x + y) / (t_2 / z);
} else if (y <= 0.00094) {
tmp = a / (t_2 / (y + t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y / (x + (y + t))) * (z + (a - b)) t_2 = y + (x + t) tmp = 0 if y <= -5.7e-42: tmp = t_1 elif y <= -3.9e-170: tmp = (x + y) / (t_2 / z) elif y <= 0.00094: tmp = a / (t_2 / (y + t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y / Float64(x + Float64(y + t))) * Float64(z + Float64(a - b))) t_2 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -5.7e-42) tmp = t_1; elseif (y <= -3.9e-170) tmp = Float64(Float64(x + y) / Float64(t_2 / z)); elseif (y <= 0.00094) tmp = Float64(a / Float64(t_2 / Float64(y + t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y / (x + (y + t))) * (z + (a - b)); t_2 = y + (x + t); tmp = 0.0; if (y <= -5.7e-42) tmp = t_1; elseif (y <= -3.9e-170) tmp = (x + y) / (t_2 / z); elseif (y <= 0.00094) tmp = a / (t_2 / (y + t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(z + N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.7e-42], t$95$1, If[LessEqual[y, -3.9e-170], N[(N[(x + y), $MachinePrecision] / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00094], N[(a / N[(t$95$2 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{x + \left(y + t\right)} \cdot \left(z + \left(a - b\right)\right)\\
t_2 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -5.7 \cdot 10^{-42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.9 \cdot 10^{-170}:\\
\;\;\;\;\frac{x + y}{\frac{t_2}{z}}\\
\mathbf{elif}\;y \leq 0.00094:\\
\;\;\;\;\frac{a}{\frac{t_2}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -5.6999999999999999e-42 or 9.39999999999999972e-4 < y Initial program 47.1%
Taylor expanded in y around inf 39.0%
+-commutative39.0%
Simplified39.0%
expm1-log1p-u27.6%
expm1-udef17.3%
associate-/l*32.7%
associate-+l+32.7%
+-commutative32.7%
Applied egg-rr32.7%
expm1-def40.2%
expm1-log1p75.2%
associate-/r/78.9%
+-commutative78.9%
associate--l+78.9%
Simplified78.9%
if -5.6999999999999999e-42 < y < -3.90000000000000021e-170Initial program 80.3%
Taylor expanded in z around inf 48.8%
associate-/l*51.8%
Simplified51.8%
if -3.90000000000000021e-170 < y < 9.39999999999999972e-4Initial program 75.1%
Taylor expanded in a around inf 43.5%
associate-/l*56.2%
Simplified56.2%
Final simplification67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (or (<= a -1.15e+151) (not (<= a 3.5e+116)))
(/ a (/ t_1 (+ y t)))
(+ z (+ a (/ y (/ t_1 (- a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((a <= -1.15e+151) || !(a <= 3.5e+116)) {
tmp = a / (t_1 / (y + t));
} else {
tmp = z + (a + (y / (t_1 / (a - b))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (x + t)
if ((a <= (-1.15d+151)) .or. (.not. (a <= 3.5d+116))) then
tmp = a / (t_1 / (y + t))
else
tmp = z + (a + (y / (t_1 / (a - b))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((a <= -1.15e+151) || !(a <= 3.5e+116)) {
tmp = a / (t_1 / (y + t));
} else {
tmp = z + (a + (y / (t_1 / (a - b))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if (a <= -1.15e+151) or not (a <= 3.5e+116): tmp = a / (t_1 / (y + t)) else: tmp = z + (a + (y / (t_1 / (a - b)))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if ((a <= -1.15e+151) || !(a <= 3.5e+116)) tmp = Float64(a / Float64(t_1 / Float64(y + t))); else tmp = Float64(z + Float64(a + Float64(y / Float64(t_1 / Float64(a - b))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if ((a <= -1.15e+151) || ~((a <= 3.5e+116))) tmp = a / (t_1 / (y + t)); else tmp = z + (a + (y / (t_1 / (a - b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -1.15e+151], N[Not[LessEqual[a, 3.5e+116]], $MachinePrecision]], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(a + N[(y / N[(t$95$1 / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;a \leq -1.15 \cdot 10^{+151} \lor \neg \left(a \leq 3.5 \cdot 10^{+116}\right):\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\
\mathbf{else}:\\
\;\;\;\;z + \left(a + \frac{y}{\frac{t_1}{a - b}}\right)\\
\end{array}
\end{array}
if a < -1.15e151 or 3.49999999999999997e116 < a Initial program 40.1%
Taylor expanded in a around inf 35.8%
associate-/l*76.6%
Simplified76.6%
if -1.15e151 < a < 3.49999999999999997e116Initial program 70.3%
*-commutative70.3%
distribute-rgt-in70.3%
associate-+r+70.3%
associate--l+70.3%
+-commutative70.3%
+-commutative70.3%
distribute-lft-out--70.3%
fma-def70.5%
+-commutative70.5%
fma-def70.5%
associate-+l+70.5%
+-commutative70.5%
Simplified70.5%
Taylor expanded in z around inf 70.4%
associate-/l*74.3%
+-commutative74.3%
associate-/l*77.6%
associate-/l*90.7%
Simplified90.7%
Taylor expanded in y around inf 84.2%
Taylor expanded in t around inf 74.3%
Final simplification75.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.2e+92) (/ a (/ (+ y (+ x t)) (+ y t))) (if (<= t 1.9e+165) (- (+ z a) b) (/ a (/ (+ x t) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e+92) {
tmp = a / ((y + (x + t)) / (y + t));
} else if (t <= 1.9e+165) {
tmp = (z + a) - b;
} else {
tmp = a / ((x + t) / 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 (t <= (-3.2d+92)) then
tmp = a / ((y + (x + t)) / (y + t))
else if (t <= 1.9d+165) then
tmp = (z + a) - b
else
tmp = a / ((x + t) / 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 (t <= -3.2e+92) {
tmp = a / ((y + (x + t)) / (y + t));
} else if (t <= 1.9e+165) {
tmp = (z + a) - b;
} else {
tmp = a / ((x + t) / t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.2e+92: tmp = a / ((y + (x + t)) / (y + t)) elif t <= 1.9e+165: tmp = (z + a) - b else: tmp = a / ((x + t) / t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.2e+92) tmp = Float64(a / Float64(Float64(y + Float64(x + t)) / Float64(y + t))); elseif (t <= 1.9e+165) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a / Float64(Float64(x + t) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.2e+92) tmp = a / ((y + (x + t)) / (y + t)); elseif (t <= 1.9e+165) tmp = (z + a) - b; else tmp = a / ((x + t) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.2e+92], N[(a / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+165], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{a}{\frac{y + \left(x + t\right)}{y + t}}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+165}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{x + t}{t}}\\
\end{array}
\end{array}
if t < -3.20000000000000025e92Initial program 48.2%
Taylor expanded in a around inf 26.9%
associate-/l*56.8%
Simplified56.8%
if -3.20000000000000025e92 < t < 1.89999999999999995e165Initial program 67.5%
Taylor expanded in y around inf 59.0%
+-commutative59.0%
Simplified59.0%
if 1.89999999999999995e165 < t Initial program 37.1%
Taylor expanded in a around inf 37.9%
associate-/l*86.6%
Simplified86.6%
Taylor expanded in y around 0 81.5%
+-commutative81.5%
Simplified81.5%
Taylor expanded in y around 0 37.9%
associate-/l*86.6%
Simplified86.6%
Final simplification61.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.5e+183) (not (<= t 1.6e+166))) (/ a (+ 1.0 (/ x t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.5e+183) || !(t <= 1.6e+166)) {
tmp = a / (1.0 + (x / t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-3.5d+183)) .or. (.not. (t <= 1.6d+166))) then
tmp = a / (1.0d0 + (x / t))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.5e+183) || !(t <= 1.6e+166)) {
tmp = a / (1.0 + (x / t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.5e+183) or not (t <= 1.6e+166): tmp = a / (1.0 + (x / t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.5e+183) || !(t <= 1.6e+166)) tmp = Float64(a / Float64(1.0 + Float64(x / t))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.5e+183) || ~((t <= 1.6e+166))) tmp = a / (1.0 + (x / t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.5e+183], N[Not[LessEqual[t, 1.6e+166]], $MachinePrecision]], N[(a / N[(1.0 + N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+183} \lor \neg \left(t \leq 1.6 \cdot 10^{+166}\right):\\
\;\;\;\;\frac{a}{1 + \frac{x}{t}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -3.49999999999999987e183 or 1.59999999999999984e166 < t Initial program 42.0%
Taylor expanded in a around inf 33.9%
associate-/l*75.0%
Simplified75.0%
Taylor expanded in t around inf 73.1%
if -3.49999999999999987e183 < t < 1.59999999999999984e166Initial program 66.3%
Taylor expanded in y around inf 58.4%
+-commutative58.4%
Simplified58.4%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.5e+183) (/ a (+ 1.0 (/ x t))) (if (<= t 3.5e+167) (- (+ z a) b) (/ a (/ (+ x t) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.5e+183) {
tmp = a / (1.0 + (x / t));
} else if (t <= 3.5e+167) {
tmp = (z + a) - b;
} else {
tmp = a / ((x + t) / 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 (t <= (-3.5d+183)) then
tmp = a / (1.0d0 + (x / t))
else if (t <= 3.5d+167) then
tmp = (z + a) - b
else
tmp = a / ((x + t) / 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 (t <= -3.5e+183) {
tmp = a / (1.0 + (x / t));
} else if (t <= 3.5e+167) {
tmp = (z + a) - b;
} else {
tmp = a / ((x + t) / t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.5e+183: tmp = a / (1.0 + (x / t)) elif t <= 3.5e+167: tmp = (z + a) - b else: tmp = a / ((x + t) / t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.5e+183) tmp = Float64(a / Float64(1.0 + Float64(x / t))); elseif (t <= 3.5e+167) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a / Float64(Float64(x + t) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.5e+183) tmp = a / (1.0 + (x / t)); elseif (t <= 3.5e+167) tmp = (z + a) - b; else tmp = a / ((x + t) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.5e+183], N[(a / N[(1.0 + N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e+167], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+183}:\\
\;\;\;\;\frac{a}{1 + \frac{x}{t}}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{+167}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{x + t}{t}}\\
\end{array}
\end{array}
if t < -3.49999999999999987e183Initial program 47.8%
Taylor expanded in a around inf 29.1%
associate-/l*60.9%
Simplified60.9%
Taylor expanded in t around inf 56.8%
if -3.49999999999999987e183 < t < 3.49999999999999987e167Initial program 66.3%
Taylor expanded in y around inf 58.4%
+-commutative58.4%
Simplified58.4%
if 3.49999999999999987e167 < t Initial program 37.1%
Taylor expanded in a around inf 37.9%
associate-/l*86.6%
Simplified86.6%
Taylor expanded in y around 0 81.5%
+-commutative81.5%
Simplified81.5%
Taylor expanded in y around 0 37.9%
associate-/l*86.6%
Simplified86.6%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.45e+183) (* a (/ (+ y t) (+ x t))) (if (<= t 5.2e+166) (- (+ z a) b) (/ a (/ (+ x t) t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.45e+183) {
tmp = a * ((y + t) / (x + t));
} else if (t <= 5.2e+166) {
tmp = (z + a) - b;
} else {
tmp = a / ((x + t) / 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 (t <= (-3.45d+183)) then
tmp = a * ((y + t) / (x + t))
else if (t <= 5.2d+166) then
tmp = (z + a) - b
else
tmp = a / ((x + t) / 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 (t <= -3.45e+183) {
tmp = a * ((y + t) / (x + t));
} else if (t <= 5.2e+166) {
tmp = (z + a) - b;
} else {
tmp = a / ((x + t) / t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.45e+183: tmp = a * ((y + t) / (x + t)) elif t <= 5.2e+166: tmp = (z + a) - b else: tmp = a / ((x + t) / t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.45e+183) tmp = Float64(a * Float64(Float64(y + t) / Float64(x + t))); elseif (t <= 5.2e+166) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a / Float64(Float64(x + t) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.45e+183) tmp = a * ((y + t) / (x + t)); elseif (t <= 5.2e+166) tmp = (z + a) - b; else tmp = a / ((x + t) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.45e+183], N[(a * N[(N[(y + t), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e+166], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.45 \cdot 10^{+183}:\\
\;\;\;\;a \cdot \frac{y + t}{x + t}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+166}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{x + t}{t}}\\
\end{array}
\end{array}
if t < -3.4500000000000002e183Initial program 47.8%
Taylor expanded in a around inf 29.1%
associate-/l*60.9%
Simplified60.9%
Taylor expanded in y around 0 57.7%
+-commutative57.7%
Simplified57.7%
clear-num57.7%
inv-pow57.7%
Applied egg-rr57.7%
unpow-157.7%
+-commutative57.7%
Simplified57.7%
associate-/r/57.7%
/-rgt-identity57.7%
Applied egg-rr57.7%
if -3.4500000000000002e183 < t < 5.1999999999999999e166Initial program 66.3%
Taylor expanded in y around inf 58.4%
+-commutative58.4%
Simplified58.4%
if 5.1999999999999999e166 < t Initial program 37.1%
Taylor expanded in a around inf 37.9%
associate-/l*86.6%
Simplified86.6%
Taylor expanded in y around 0 81.5%
+-commutative81.5%
Simplified81.5%
Taylor expanded in y around 0 37.9%
associate-/l*86.6%
Simplified86.6%
Final simplification61.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.1e+94) a (if (<= t 2.7e+169) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4.1e+94) {
tmp = a;
} else if (t <= 2.7e+169) {
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 <= (-4.1d+94)) then
tmp = a
else if (t <= 2.7d+169) 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 <= -4.1e+94) {
tmp = a;
} else if (t <= 2.7e+169) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4.1e+94: tmp = a elif t <= 2.7e+169: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4.1e+94) tmp = a; elseif (t <= 2.7e+169) 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 <= -4.1e+94) tmp = a; elseif (t <= 2.7e+169) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4.1e+94], a, If[LessEqual[t, 2.7e+169], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+94}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+169}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -4.10000000000000031e94 or 2.69999999999999991e169 < t Initial program 43.3%
Taylor expanded in t around inf 61.0%
if -4.10000000000000031e94 < t < 2.69999999999999991e169Initial program 67.5%
Taylor expanded in y around inf 59.0%
+-commutative59.0%
Simplified59.0%
Final simplification59.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.15e-30) a (if (<= t 4.8e+41) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.15e-30) {
tmp = a;
} else if (t <= 4.8e+41) {
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 <= (-2.15d-30)) then
tmp = a
else if (t <= 4.8d+41) 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 <= -2.15e-30) {
tmp = a;
} else if (t <= 4.8e+41) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.15e-30: tmp = a elif t <= 4.8e+41: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.15e-30) tmp = a; elseif (t <= 4.8e+41) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.15e-30) tmp = a; elseif (t <= 4.8e+41) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.15e-30], a, If[LessEqual[t, 4.8e+41], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{-30}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{+41}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -2.14999999999999983e-30 or 4.8000000000000003e41 < t Initial program 51.1%
Taylor expanded in t around inf 47.8%
if -2.14999999999999983e-30 < t < 4.8000000000000003e41Initial program 70.1%
Taylor expanded in x around inf 48.6%
Final simplification48.2%
(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 31.2%
Final simplification31.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 2023185
(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)))