
(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 (* z (+ x y)))
(t_2 (+ y (+ x t)))
(t_3 (* (+ y t) a))
(t_4 (/ (- (+ t_3 t_1) (* y b)) t_2))
(t_5 (+ t (+ x y))))
(if (or (<= t_4 (- INFINITY)) (not (<= t_4 5e+241)))
(+ a (fma z (+ (/ x t_2) (/ y t_2)) (* y (/ b (- (- y) (+ x t))))))
(+ (/ t_3 t_5) (/ (- t_1 (* y b)) t_5)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x + y);
double t_2 = y + (x + t);
double t_3 = (y + t) * a;
double t_4 = ((t_3 + t_1) - (y * b)) / t_2;
double t_5 = t + (x + y);
double tmp;
if ((t_4 <= -((double) INFINITY)) || !(t_4 <= 5e+241)) {
tmp = a + fma(z, ((x / t_2) + (y / t_2)), (y * (b / (-y - (x + t)))));
} else {
tmp = (t_3 / t_5) + ((t_1 - (y * b)) / t_5);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(y + t) * a) t_4 = Float64(Float64(Float64(t_3 + t_1) - Float64(y * b)) / t_2) t_5 = Float64(t + Float64(x + y)) tmp = 0.0 if ((t_4 <= Float64(-Inf)) || !(t_4 <= 5e+241)) tmp = Float64(a + fma(z, Float64(Float64(x / t_2) + Float64(y / t_2)), Float64(y * Float64(b / Float64(Float64(-y) - Float64(x + t)))))); else tmp = Float64(Float64(t_3 / t_5) + Float64(Float64(t_1 - Float64(y * b)) / t_5)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$4, (-Infinity)], N[Not[LessEqual[t$95$4, 5e+241]], $MachinePrecision]], N[(a + N[(z * N[(N[(x / t$95$2), $MachinePrecision] + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(y * N[(b / N[((-y) - N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 / t$95$5), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$5), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \left(y + t\right) \cdot a\\
t_4 := \frac{\left(t\_3 + t\_1\right) - y \cdot b}{t\_2}\\
t_5 := t + \left(x + y\right)\\
\mathbf{if}\;t\_4 \leq -\infty \lor \neg \left(t\_4 \leq 5 \cdot 10^{+241}\right):\\
\;\;\;\;a + \mathsf{fma}\left(z, \frac{x}{t\_2} + \frac{y}{t\_2}, y \cdot \frac{b}{\left(-y\right) - \left(x + t\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_3}{t\_5} + \frac{t\_1 - y \cdot b}{t\_5}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5.00000000000000025e241 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.0%
Taylor expanded in z around inf 7.0%
associate--l+7.0%
+-commutative7.0%
div-sub7.0%
+-commutative7.0%
*-commutative7.0%
+-commutative7.0%
Simplified7.0%
Taylor expanded in z around 0 37.8%
+-commutative37.8%
fma-define37.8%
associate-+r+37.8%
+-commutative37.8%
associate-+r+37.8%
+-commutative37.8%
mul-1-neg37.8%
*-commutative37.8%
+-commutative37.8%
+-commutative37.8%
associate-+r+37.8%
associate-/l*54.6%
distribute-rgt-neg-in54.6%
+-commutative54.6%
Simplified54.6%
Taylor expanded in t around inf 90.0%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000025e241Initial program 99.8%
Taylor expanded in z around inf 99.8%
associate--l+99.8%
+-commutative99.8%
div-sub99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification95.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ x y)))
(t_2 (+ t (+ x y)))
(t_3 (* (+ y t) a))
(t_4 (/ (- (+ t_3 t_1) (* y b)) (+ y (+ x t)))))
(if (or (<= t_4 (- INFINITY)) (not (<= t_4 1e+301)))
(- (+ z a) b)
(+ (/ t_3 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 = z * (x + y);
double t_2 = t + (x + y);
double t_3 = (y + t) * a;
double t_4 = ((t_3 + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_4 <= -((double) INFINITY)) || !(t_4 <= 1e+301)) {
tmp = (z + a) - b;
} else {
tmp = (t_3 / 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 = z * (x + y);
double t_2 = t + (x + y);
double t_3 = (y + t) * a;
double t_4 = ((t_3 + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_4 <= -Double.POSITIVE_INFINITY) || !(t_4 <= 1e+301)) {
tmp = (z + a) - b;
} else {
tmp = (t_3 / t_2) + ((t_1 - (y * b)) / t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x + y) t_2 = t + (x + y) t_3 = (y + t) * a t_4 = ((t_3 + t_1) - (y * b)) / (y + (x + t)) tmp = 0 if (t_4 <= -math.inf) or not (t_4 <= 1e+301): tmp = (z + a) - b else: tmp = (t_3 / t_2) + ((t_1 - (y * b)) / t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x + y)) t_2 = Float64(t + Float64(x + y)) t_3 = Float64(Float64(y + t) * a) t_4 = Float64(Float64(Float64(t_3 + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_4 <= Float64(-Inf)) || !(t_4 <= 1e+301)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(t_3 / 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 = z * (x + y); t_2 = t + (x + y); t_3 = (y + t) * a; t_4 = ((t_3 + t_1) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_4 <= -Inf) || ~((t_4 <= 1e+301))) tmp = (z + a) - b; else tmp = (t_3 / 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[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$4, (-Infinity)], N[Not[LessEqual[t$95$4, 1e+301]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(t$95$3 / t$95$2), $MachinePrecision] + N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + y\right)\\
t_2 := t + \left(x + y\right)\\
t_3 := \left(y + t\right) \cdot a\\
t_4 := \frac{\left(t\_3 + t\_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_4 \leq -\infty \lor \neg \left(t\_4 \leq 10^{+301}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_3}{t\_2} + \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 1.00000000000000005e301 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.4%
Taylor expanded in y around inf 71.6%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000005e301Initial program 99.8%
Taylor expanded in z around inf 99.8%
associate--l+99.8%
+-commutative99.8%
div-sub99.8%
+-commutative99.8%
*-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification87.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* (+ y t) a) (* z (+ x y))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+301))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+301)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+301)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+301): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+301)) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((y + t) * a) + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+301))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(x + y), $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, 1e+301]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(y + t\right) \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+301}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.00000000000000005e301 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.4%
Taylor expanded in y around inf 71.6%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000005e301Initial program 99.8%
Final simplification87.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b))
(t_2 (+ y (+ x t)))
(t_3 (* z (/ (+ x y) t_2)))
(t_4 (* a (/ (+ y t) t_2))))
(if (<= z -1.45e+143)
t_3
(if (<= z -620000.0)
t_1
(if (<= z -8.5e-90)
t_4
(if (<= z -1.5e-164) t_1 (if (<= z 6.8e+29) t_4 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = y + (x + t);
double t_3 = z * ((x + y) / t_2);
double t_4 = a * ((y + t) / t_2);
double tmp;
if (z <= -1.45e+143) {
tmp = t_3;
} else if (z <= -620000.0) {
tmp = t_1;
} else if (z <= -8.5e-90) {
tmp = t_4;
} else if (z <= -1.5e-164) {
tmp = t_1;
} else if (z <= 6.8e+29) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (z + a) - b
t_2 = y + (x + t)
t_3 = z * ((x + y) / t_2)
t_4 = a * ((y + t) / t_2)
if (z <= (-1.45d+143)) then
tmp = t_3
else if (z <= (-620000.0d0)) then
tmp = t_1
else if (z <= (-8.5d-90)) then
tmp = t_4
else if (z <= (-1.5d-164)) then
tmp = t_1
else if (z <= 6.8d+29) then
tmp = t_4
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = y + (x + t);
double t_3 = z * ((x + y) / t_2);
double t_4 = a * ((y + t) / t_2);
double tmp;
if (z <= -1.45e+143) {
tmp = t_3;
} else if (z <= -620000.0) {
tmp = t_1;
} else if (z <= -8.5e-90) {
tmp = t_4;
} else if (z <= -1.5e-164) {
tmp = t_1;
} else if (z <= 6.8e+29) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = y + (x + t) t_3 = z * ((x + y) / t_2) t_4 = a * ((y + t) / t_2) tmp = 0 if z <= -1.45e+143: tmp = t_3 elif z <= -620000.0: tmp = t_1 elif z <= -8.5e-90: tmp = t_4 elif z <= -1.5e-164: tmp = t_1 elif z <= 6.8e+29: tmp = t_4 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(z * Float64(Float64(x + y) / t_2)) t_4 = Float64(a * Float64(Float64(y + t) / t_2)) tmp = 0.0 if (z <= -1.45e+143) tmp = t_3; elseif (z <= -620000.0) tmp = t_1; elseif (z <= -8.5e-90) tmp = t_4; elseif (z <= -1.5e-164) tmp = t_1; elseif (z <= 6.8e+29) tmp = t_4; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = y + (x + t); t_3 = z * ((x + y) / t_2); t_4 = a * ((y + t) / t_2); tmp = 0.0; if (z <= -1.45e+143) tmp = t_3; elseif (z <= -620000.0) tmp = t_1; elseif (z <= -8.5e-90) tmp = t_4; elseif (z <= -1.5e-164) tmp = t_1; elseif (z <= 6.8e+29) tmp = t_4; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(a * N[(N[(y + t), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.45e+143], t$95$3, If[LessEqual[z, -620000.0], t$95$1, If[LessEqual[z, -8.5e-90], t$95$4, If[LessEqual[z, -1.5e-164], t$95$1, If[LessEqual[z, 6.8e+29], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := y + \left(x + t\right)\\
t_3 := z \cdot \frac{x + y}{t\_2}\\
t_4 := a \cdot \frac{y + t}{t\_2}\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{+143}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -620000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-90}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-164}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+29}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.4499999999999999e143 or 6.79999999999999963e29 < z Initial program 45.7%
Taylor expanded in z around inf 36.6%
associate-/l*75.1%
+-commutative75.1%
+-commutative75.1%
+-commutative75.1%
associate-+l+75.1%
+-commutative75.1%
Simplified75.1%
if -1.4499999999999999e143 < z < -6.2e5 or -8.5000000000000001e-90 < z < -1.5e-164Initial program 54.7%
Taylor expanded in y around inf 69.8%
if -6.2e5 < z < -8.5000000000000001e-90 or -1.5e-164 < z < 6.79999999999999963e29Initial program 69.8%
Taylor expanded in a around inf 44.0%
associate-/l*65.7%
+-commutative65.7%
+-commutative65.7%
associate-+l+65.7%
+-commutative65.7%
Simplified65.7%
Final simplification69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.12e-35)
t_1
(if (<= y 2.2e-220)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 3.7e-24)
(+ z (/ (* (+ y t) a) (+ t (+ x y))))
(if (<= y 5.5e+91)
(/ (- (* z (+ x y)) (* y b)) (+ y (+ 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.12e-35) {
tmp = t_1;
} else if (y <= 2.2e-220) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 3.7e-24) {
tmp = z + (((y + t) * a) / (t + (x + y)));
} else if (y <= 5.5e+91) {
tmp = ((z * (x + y)) - (y * b)) / (y + (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.12d-35)) then
tmp = t_1
else if (y <= 2.2d-220) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 3.7d-24) then
tmp = z + (((y + t) * a) / (t + (x + y)))
else if (y <= 5.5d+91) then
tmp = ((z * (x + y)) - (y * b)) / (y + (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.12e-35) {
tmp = t_1;
} else if (y <= 2.2e-220) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 3.7e-24) {
tmp = z + (((y + t) * a) / (t + (x + y)));
} else if (y <= 5.5e+91) {
tmp = ((z * (x + y)) - (y * b)) / (y + (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.12e-35: tmp = t_1 elif y <= 2.2e-220: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 3.7e-24: tmp = z + (((y + t) * a) / (t + (x + y))) elif y <= 5.5e+91: tmp = ((z * (x + y)) - (y * b)) / (y + (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.12e-35) tmp = t_1; elseif (y <= 2.2e-220) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 3.7e-24) tmp = Float64(z + Float64(Float64(Float64(y + t) * a) / Float64(t + Float64(x + y)))); elseif (y <= 5.5e+91) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + 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.12e-35) tmp = t_1; elseif (y <= 2.2e-220) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 3.7e-24) tmp = z + (((y + t) * a) / (t + (x + y))); elseif (y <= 5.5e+91) tmp = ((z * (x + y)) - (y * b)) / (y + (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.12e-35], t$95$1, If[LessEqual[y, 2.2e-220], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e-24], N[(z + N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+91], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.12 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-220}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-24}:\\
\;\;\;\;z + \frac{\left(y + t\right) \cdot a}{t + \left(x + y\right)}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+91}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.12e-35 or 5.4999999999999998e91 < y Initial program 38.5%
Taylor expanded in y around inf 74.1%
if -1.12e-35 < y < 2.19999999999999987e-220Initial program 76.3%
Taylor expanded in y around 0 65.6%
if 2.19999999999999987e-220 < y < 3.69999999999999981e-24Initial program 69.4%
Taylor expanded in z around inf 69.4%
associate--l+69.4%
+-commutative69.4%
div-sub69.4%
+-commutative69.4%
*-commutative69.4%
+-commutative69.4%
Simplified69.4%
Taylor expanded in x around inf 68.4%
if 3.69999999999999981e-24 < y < 5.4999999999999998e91Initial program 77.0%
Taylor expanded in z around inf 65.5%
+-commutative65.5%
Simplified65.5%
Final simplification69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.15e-36)
t_1
(if (<= y 8.5e-220)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 7.4e-19)
(+ z (/ (* (+ y t) a) (+ t (+ x y))))
(if (<= y 5.9e+91) (/ (* y t_1) (+ y (+ 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 <= -2.15e-36) {
tmp = t_1;
} else if (y <= 8.5e-220) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 7.4e-19) {
tmp = z + (((y + t) * a) / (t + (x + y)));
} else if (y <= 5.9e+91) {
tmp = (y * t_1) / (y + (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 <= (-2.15d-36)) then
tmp = t_1
else if (y <= 8.5d-220) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 7.4d-19) then
tmp = z + (((y + t) * a) / (t + (x + y)))
else if (y <= 5.9d+91) then
tmp = (y * t_1) / (y + (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 <= -2.15e-36) {
tmp = t_1;
} else if (y <= 8.5e-220) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 7.4e-19) {
tmp = z + (((y + t) * a) / (t + (x + y)));
} else if (y <= 5.9e+91) {
tmp = (y * t_1) / (y + (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 <= -2.15e-36: tmp = t_1 elif y <= 8.5e-220: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 7.4e-19: tmp = z + (((y + t) * a) / (t + (x + y))) elif y <= 5.9e+91: tmp = (y * t_1) / (y + (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 <= -2.15e-36) tmp = t_1; elseif (y <= 8.5e-220) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 7.4e-19) tmp = Float64(z + Float64(Float64(Float64(y + t) * a) / Float64(t + Float64(x + y)))); elseif (y <= 5.9e+91) tmp = Float64(Float64(y * t_1) / Float64(y + 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 <= -2.15e-36) tmp = t_1; elseif (y <= 8.5e-220) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 7.4e-19) tmp = z + (((y + t) * a) / (t + (x + y))); elseif (y <= 5.9e+91) tmp = (y * t_1) / (y + (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, -2.15e-36], t$95$1, If[LessEqual[y, 8.5e-220], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-19], N[(z + N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.9e+91], N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.15 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-220}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-19}:\\
\;\;\;\;z + \frac{\left(y + t\right) \cdot a}{t + \left(x + y\right)}\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{+91}:\\
\;\;\;\;\frac{y \cdot t\_1}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.1500000000000001e-36 or 5.9000000000000002e91 < y Initial program 38.5%
Taylor expanded in y around inf 74.1%
if -2.1500000000000001e-36 < y < 8.4999999999999996e-220Initial program 76.3%
Taylor expanded in y around 0 65.6%
if 8.4999999999999996e-220 < y < 7.40000000000000011e-19Initial program 69.4%
Taylor expanded in z around inf 69.4%
associate--l+69.4%
+-commutative69.4%
div-sub69.4%
+-commutative69.4%
*-commutative69.4%
+-commutative69.4%
Simplified69.4%
Taylor expanded in x around inf 68.4%
if 7.40000000000000011e-19 < y < 5.9000000000000002e91Initial program 77.0%
Taylor expanded in y around inf 61.4%
Final simplification69.4%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= t -1.1e+161)
(not (or (<= t -5.2e+97) (and (not (<= t -6.5e+59)) (<= t 9.5e+38)))))
(+ a (* z (/ (+ x y) t)))
(- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.1e+161) || !((t <= -5.2e+97) || (!(t <= -6.5e+59) && (t <= 9.5e+38)))) {
tmp = a + (z * ((x + y) / 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 <= (-1.1d+161)) .or. (.not. (t <= (-5.2d+97)) .or. (.not. (t <= (-6.5d+59))) .and. (t <= 9.5d+38))) then
tmp = a + (z * ((x + y) / 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 <= -1.1e+161) || !((t <= -5.2e+97) || (!(t <= -6.5e+59) && (t <= 9.5e+38)))) {
tmp = a + (z * ((x + y) / t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.1e+161) or not ((t <= -5.2e+97) or (not (t <= -6.5e+59) and (t <= 9.5e+38))): tmp = a + (z * ((x + y) / t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.1e+161) || !((t <= -5.2e+97) || (!(t <= -6.5e+59) && (t <= 9.5e+38)))) tmp = Float64(a + Float64(z * Float64(Float64(x + y) / 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 <= -1.1e+161) || ~(((t <= -5.2e+97) || (~((t <= -6.5e+59)) && (t <= 9.5e+38))))) tmp = a + (z * ((x + y) / t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.1e+161], N[Not[Or[LessEqual[t, -5.2e+97], And[N[Not[LessEqual[t, -6.5e+59]], $MachinePrecision], LessEqual[t, 9.5e+38]]]], $MachinePrecision]], N[(a + N[(z * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+161} \lor \neg \left(t \leq -5.2 \cdot 10^{+97} \lor \neg \left(t \leq -6.5 \cdot 10^{+59}\right) \land t \leq 9.5 \cdot 10^{+38}\right):\\
\;\;\;\;a + z \cdot \frac{x + y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -1.1e161 or -5.2e97 < t < -6.50000000000000021e59 or 9.4999999999999995e38 < t Initial program 55.8%
Taylor expanded in t around inf 60.3%
associate--l+61.3%
associate-/l*61.4%
associate-/l*67.6%
+-commutative67.6%
associate-/l*72.8%
+-commutative72.8%
associate-/l*75.8%
Simplified75.8%
Taylor expanded in z around -inf 63.2%
associate-*r/69.4%
+-commutative69.4%
Simplified69.4%
if -1.1e161 < t < -5.2e97 or -6.50000000000000021e59 < t < 9.4999999999999995e38Initial program 60.1%
Taylor expanded in y around inf 64.3%
Final simplification66.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.3e-35)
t_1
(if (<= y 4700000.0)
(/ (+ (* (+ y t) a) (* z (+ x y))) (+ t (+ x y)))
(if (<= y 1.05e+92) (/ (* y t_1) (+ y (+ 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 <= -2.3e-35) {
tmp = t_1;
} else if (y <= 4700000.0) {
tmp = (((y + t) * a) + (z * (x + y))) / (t + (x + y));
} else if (y <= 1.05e+92) {
tmp = (y * t_1) / (y + (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 <= (-2.3d-35)) then
tmp = t_1
else if (y <= 4700000.0d0) then
tmp = (((y + t) * a) + (z * (x + y))) / (t + (x + y))
else if (y <= 1.05d+92) then
tmp = (y * t_1) / (y + (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 <= -2.3e-35) {
tmp = t_1;
} else if (y <= 4700000.0) {
tmp = (((y + t) * a) + (z * (x + y))) / (t + (x + y));
} else if (y <= 1.05e+92) {
tmp = (y * t_1) / (y + (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 <= -2.3e-35: tmp = t_1 elif y <= 4700000.0: tmp = (((y + t) * a) + (z * (x + y))) / (t + (x + y)) elif y <= 1.05e+92: tmp = (y * t_1) / (y + (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 <= -2.3e-35) tmp = t_1; elseif (y <= 4700000.0) tmp = Float64(Float64(Float64(Float64(y + t) * a) + Float64(z * Float64(x + y))) / Float64(t + Float64(x + y))); elseif (y <= 1.05e+92) tmp = Float64(Float64(y * t_1) / Float64(y + 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 <= -2.3e-35) tmp = t_1; elseif (y <= 4700000.0) tmp = (((y + t) * a) + (z * (x + y))) / (t + (x + y)); elseif (y <= 1.05e+92) tmp = (y * t_1) / (y + (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, -2.3e-35], t$95$1, If[LessEqual[y, 4700000.0], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+92], N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4700000:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a + z \cdot \left(x + y\right)}{t + \left(x + y\right)}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+92}:\\
\;\;\;\;\frac{y \cdot t\_1}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2999999999999999e-35 or 1.04999999999999993e92 < y Initial program 38.5%
Taylor expanded in y around inf 74.1%
if -2.2999999999999999e-35 < y < 4.7e6Initial program 75.3%
Taylor expanded in b around 0 70.6%
if 4.7e6 < y < 1.04999999999999993e92Initial program 73.4%
Taylor expanded in y around inf 68.1%
Final simplification72.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (+ a (* y (/ z t)))))
(if (<= t -3.3e+160)
t_2
(if (<= t -1.2e+98)
t_1
(if (<= t -3.5e+59)
t_2
(if (<= t 2.2e+123) t_1 (+ a (* x (/ z t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a + (y * (z / t));
double tmp;
if (t <= -3.3e+160) {
tmp = t_2;
} else if (t <= -1.2e+98) {
tmp = t_1;
} else if (t <= -3.5e+59) {
tmp = t_2;
} else if (t <= 2.2e+123) {
tmp = t_1;
} else {
tmp = a + (x * (z / 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) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = a + (y * (z / t))
if (t <= (-3.3d+160)) then
tmp = t_2
else if (t <= (-1.2d+98)) then
tmp = t_1
else if (t <= (-3.5d+59)) then
tmp = t_2
else if (t <= 2.2d+123) then
tmp = t_1
else
tmp = a + (x * (z / 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 t_2 = a + (y * (z / t));
double tmp;
if (t <= -3.3e+160) {
tmp = t_2;
} else if (t <= -1.2e+98) {
tmp = t_1;
} else if (t <= -3.5e+59) {
tmp = t_2;
} else if (t <= 2.2e+123) {
tmp = t_1;
} else {
tmp = a + (x * (z / t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = a + (y * (z / t)) tmp = 0 if t <= -3.3e+160: tmp = t_2 elif t <= -1.2e+98: tmp = t_1 elif t <= -3.5e+59: tmp = t_2 elif t <= 2.2e+123: tmp = t_1 else: tmp = a + (x * (z / t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(a + Float64(y * Float64(z / t))) tmp = 0.0 if (t <= -3.3e+160) tmp = t_2; elseif (t <= -1.2e+98) tmp = t_1; elseif (t <= -3.5e+59) tmp = t_2; elseif (t <= 2.2e+123) tmp = t_1; else tmp = Float64(a + Float64(x * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = a + (y * (z / t)); tmp = 0.0; if (t <= -3.3e+160) tmp = t_2; elseif (t <= -1.2e+98) tmp = t_1; elseif (t <= -3.5e+59) tmp = t_2; elseif (t <= 2.2e+123) tmp = t_1; else tmp = a + (x * (z / t)); 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[(a + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.3e+160], t$95$2, If[LessEqual[t, -1.2e+98], t$95$1, If[LessEqual[t, -3.5e+59], t$95$2, If[LessEqual[t, 2.2e+123], t$95$1, N[(a + N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := a + y \cdot \frac{z}{t}\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{+160}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{+59}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a + x \cdot \frac{z}{t}\\
\end{array}
\end{array}
if t < -3.2999999999999997e160 or -1.1999999999999999e98 < t < -3.5e59Initial program 59.9%
Taylor expanded in t around inf 74.3%
associate--l+74.3%
associate-/l*74.4%
associate-/l*79.3%
+-commutative79.3%
associate-/l*84.3%
+-commutative84.3%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in z around -inf 73.4%
Taylor expanded in x around 0 71.5%
associate-/l*73.7%
Simplified73.7%
if -3.2999999999999997e160 < t < -1.1999999999999999e98 or -3.5e59 < t < 2.19999999999999992e123Initial program 59.5%
Taylor expanded in y around inf 61.7%
if 2.19999999999999992e123 < t Initial program 52.0%
Taylor expanded in t around inf 53.7%
associate--l+56.2%
associate-/l*56.3%
associate-/l*66.4%
+-commutative66.4%
associate-/l*74.2%
+-commutative74.2%
associate-/l*76.7%
Simplified76.7%
Taylor expanded in z around -inf 61.1%
Taylor expanded in x around inf 62.6%
associate-/l*70.1%
Simplified70.1%
Final simplification64.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= t -4.2e+164)
(- a (* y (/ b t)))
(if (<= t -1.35e+98)
t_1
(if (<= t -5.6e+59)
(+ a (* y (/ z t)))
(if (<= t 1.85e+123) t_1 (+ a (* x (/ z t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -4.2e+164) {
tmp = a - (y * (b / t));
} else if (t <= -1.35e+98) {
tmp = t_1;
} else if (t <= -5.6e+59) {
tmp = a + (y * (z / t));
} else if (t <= 1.85e+123) {
tmp = t_1;
} else {
tmp = a + (x * (z / 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 (t <= (-4.2d+164)) then
tmp = a - (y * (b / t))
else if (t <= (-1.35d+98)) then
tmp = t_1
else if (t <= (-5.6d+59)) then
tmp = a + (y * (z / t))
else if (t <= 1.85d+123) then
tmp = t_1
else
tmp = a + (x * (z / 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 (t <= -4.2e+164) {
tmp = a - (y * (b / t));
} else if (t <= -1.35e+98) {
tmp = t_1;
} else if (t <= -5.6e+59) {
tmp = a + (y * (z / t));
} else if (t <= 1.85e+123) {
tmp = t_1;
} else {
tmp = a + (x * (z / t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if t <= -4.2e+164: tmp = a - (y * (b / t)) elif t <= -1.35e+98: tmp = t_1 elif t <= -5.6e+59: tmp = a + (y * (z / t)) elif t <= 1.85e+123: tmp = t_1 else: tmp = a + (x * (z / t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (t <= -4.2e+164) tmp = Float64(a - Float64(y * Float64(b / t))); elseif (t <= -1.35e+98) tmp = t_1; elseif (t <= -5.6e+59) tmp = Float64(a + Float64(y * Float64(z / t))); elseif (t <= 1.85e+123) tmp = t_1; else tmp = Float64(a + Float64(x * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (t <= -4.2e+164) tmp = a - (y * (b / t)); elseif (t <= -1.35e+98) tmp = t_1; elseif (t <= -5.6e+59) tmp = a + (y * (z / t)); elseif (t <= 1.85e+123) tmp = t_1; else tmp = a + (x * (z / 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[t, -4.2e+164], N[(a - N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e+98], t$95$1, If[LessEqual[t, -5.6e+59], N[(a + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.85e+123], t$95$1, N[(a + N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+164}:\\
\;\;\;\;a - y \cdot \frac{b}{t}\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.6 \cdot 10^{+59}:\\
\;\;\;\;a + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a + x \cdot \frac{z}{t}\\
\end{array}
\end{array}
if t < -4.1999999999999998e164Initial program 51.1%
Taylor expanded in t around inf 71.5%
associate--l+71.5%
associate-/l*71.7%
associate-/l*78.4%
+-commutative78.4%
associate-/l*85.3%
+-commutative85.3%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in b around inf 75.3%
mul-1-neg75.3%
*-commutative75.3%
associate-/l*77.2%
distribute-rgt-neg-in77.2%
distribute-neg-frac277.2%
Simplified77.2%
if -4.1999999999999998e164 < t < -1.35e98 or -5.5999999999999996e59 < t < 1.84999999999999998e123Initial program 59.5%
Taylor expanded in y around inf 61.7%
if -1.35e98 < t < -5.5999999999999996e59Initial program 83.0%
Taylor expanded in t around inf 81.6%
associate--l+81.6%
associate-/l*81.6%
associate-/l*81.7%
+-commutative81.7%
associate-/l*81.8%
+-commutative81.8%
associate-/l*81.8%
Simplified81.8%
Taylor expanded in z around -inf 72.3%
Taylor expanded in x around 0 65.1%
associate-/l*65.1%
Simplified65.1%
if 1.84999999999999998e123 < t Initial program 52.0%
Taylor expanded in t around inf 53.7%
associate--l+56.2%
associate-/l*56.3%
associate-/l*66.4%
+-commutative66.4%
associate-/l*74.2%
+-commutative74.2%
associate-/l*76.7%
Simplified76.7%
Taylor expanded in z around -inf 61.1%
Taylor expanded in x around inf 62.6%
associate-/l*70.1%
Simplified70.1%
Final simplification64.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -9.6e-36)
t_1
(if (<= y 2.5e-43)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 1e-12) (* z (/ (+ x y) (+ y (+ 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 <= -9.6e-36) {
tmp = t_1;
} else if (y <= 2.5e-43) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1e-12) {
tmp = z * ((x + y) / (y + (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 <= (-9.6d-36)) then
tmp = t_1
else if (y <= 2.5d-43) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 1d-12) then
tmp = z * ((x + y) / (y + (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 <= -9.6e-36) {
tmp = t_1;
} else if (y <= 2.5e-43) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1e-12) {
tmp = z * ((x + y) / (y + (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 <= -9.6e-36: tmp = t_1 elif y <= 2.5e-43: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 1e-12: tmp = z * ((x + y) / (y + (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 <= -9.6e-36) tmp = t_1; elseif (y <= 2.5e-43) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 1e-12) tmp = Float64(z * Float64(Float64(x + y) / Float64(y + 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 <= -9.6e-36) tmp = t_1; elseif (y <= 2.5e-43) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 1e-12) tmp = z * ((x + y) / (y + (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, -9.6e-36], t$95$1, If[LessEqual[y, 2.5e-43], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-12], N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -9.6 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 10^{-12}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.6e-36 or 9.9999999999999998e-13 < y Initial program 43.3%
Taylor expanded in y around inf 69.4%
if -9.6e-36 < y < 2.50000000000000009e-43Initial program 76.0%
Taylor expanded in y around 0 63.1%
if 2.50000000000000009e-43 < y < 9.9999999999999998e-13Initial program 71.6%
Taylor expanded in z around inf 55.0%
associate-/l*82.3%
+-commutative82.3%
+-commutative82.3%
+-commutative82.3%
associate-+l+82.3%
+-commutative82.3%
Simplified82.3%
Final simplification67.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.2e+57) (not (<= t 3.6e+132))) (* a (/ t (+ x t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.2e+57) || !(t <= 3.6e+132)) {
tmp = a * (t / (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 <= (-1.2d+57)) .or. (.not. (t <= 3.6d+132))) then
tmp = a * (t / (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 <= -1.2e+57) || !(t <= 3.6e+132)) {
tmp = a * (t / (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.2e+57) or not (t <= 3.6e+132): tmp = a * (t / (x + t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.2e+57) || !(t <= 3.6e+132)) tmp = Float64(a * Float64(t / 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 <= -1.2e+57) || ~((t <= 3.6e+132))) tmp = a * (t / (x + t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.2e+57], N[Not[LessEqual[t, 3.6e+132]], $MachinePrecision]], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+57} \lor \neg \left(t \leq 3.6 \cdot 10^{+132}\right):\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -1.20000000000000002e57 or 3.60000000000000016e132 < t Initial program 54.0%
Taylor expanded in a around inf 34.0%
associate-/l*61.6%
+-commutative61.6%
+-commutative61.6%
associate-+l+61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in y around 0 35.1%
associate-/l*61.6%
Simplified61.6%
if -1.20000000000000002e57 < t < 3.60000000000000016e132Initial program 61.1%
Taylor expanded in y around inf 60.6%
Final simplification61.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.55e+54) (* a (/ t (+ x t))) (if (<= t 3.4e+123) (- (+ z a) b) (+ a (* x (/ z t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.55e+54) {
tmp = a * (t / (x + t));
} else if (t <= 3.4e+123) {
tmp = (z + a) - b;
} else {
tmp = a + (x * (z / 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 <= (-1.55d+54)) then
tmp = a * (t / (x + t))
else if (t <= 3.4d+123) then
tmp = (z + a) - b
else
tmp = a + (x * (z / 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 <= -1.55e+54) {
tmp = a * (t / (x + t));
} else if (t <= 3.4e+123) {
tmp = (z + a) - b;
} else {
tmp = a + (x * (z / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.55e+54: tmp = a * (t / (x + t)) elif t <= 3.4e+123: tmp = (z + a) - b else: tmp = a + (x * (z / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.55e+54) tmp = Float64(a * Float64(t / Float64(x + t))); elseif (t <= 3.4e+123) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a + Float64(x * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.55e+54) tmp = a * (t / (x + t)); elseif (t <= 3.4e+123) tmp = (z + a) - b; else tmp = a + (x * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.55e+54], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+123], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{+54}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+123}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + x \cdot \frac{z}{t}\\
\end{array}
\end{array}
if t < -1.55e54Initial program 55.1%
Taylor expanded in a around inf 33.0%
associate-/l*61.2%
+-commutative61.2%
+-commutative61.2%
associate-+l+61.2%
+-commutative61.2%
Simplified61.2%
Taylor expanded in y around 0 33.0%
associate-/l*61.2%
Simplified61.2%
if -1.55e54 < t < 3.40000000000000001e123Initial program 61.3%
Taylor expanded in y around inf 61.3%
if 3.40000000000000001e123 < t Initial program 52.0%
Taylor expanded in t around inf 53.7%
associate--l+56.2%
associate-/l*56.3%
associate-/l*66.4%
+-commutative66.4%
associate-/l*74.2%
+-commutative74.2%
associate-/l*76.7%
Simplified76.7%
Taylor expanded in z around -inf 61.1%
Taylor expanded in x around inf 62.6%
associate-/l*70.1%
Simplified70.1%
Final simplification62.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6.2e+154) z (if (<= x 1.45e+71) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.2e+154) {
tmp = z;
} else if (x <= 1.45e+71) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6.2d+154)) then
tmp = z
else if (x <= 1.45d+71) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.2e+154) {
tmp = z;
} else if (x <= 1.45e+71) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.2e+154: tmp = z elif x <= 1.45e+71: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.2e+154) tmp = z; elseif (x <= 1.45e+71) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.2e+154) tmp = z; elseif (x <= 1.45e+71) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.2e+154], z, If[LessEqual[x, 1.45e+71], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+154}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+71}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -6.2000000000000003e154 or 1.45000000000000004e71 < x Initial program 47.0%
Taylor expanded in x around inf 56.9%
if -6.2000000000000003e154 < x < 1.45000000000000004e71Initial program 64.3%
Taylor expanded in t around inf 45.6%
Final simplification49.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.3e+164) a (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.3e+164) {
tmp = a;
} 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.3d+164)) then
tmp = a
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.3e+164) {
tmp = a;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.3e+164: tmp = a else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.3e+164) tmp = a; 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.3e+164) tmp = a; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.3e+164], a, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+164}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -3.29999999999999995e164Initial program 51.1%
Taylor expanded in t around inf 70.4%
if -3.29999999999999995e164 < t Initial program 59.4%
Taylor expanded in y around inf 56.3%
Final simplification57.9%
(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 58.5%
Taylor expanded in t around inf 34.5%
Final simplification34.5%
(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 2024040
(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)))