
(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 12 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 (* a (+ y t)))
(t_2 (+ t (+ x y)))
(t_3 (/ (- (+ (* z (+ x y)) t_1) (* y b)) (+ y (+ x t)))))
(if (<= t_3 (- INFINITY))
(- (+ z a) b)
(if (<= t_3 5e+259)
(/ (- (fma (+ x y) z t_1) (* y b)) (+ x (+ y t)))
(+ z (* a (+ (/ y t_2) (/ t t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = t + (x + y);
double t_3 = (((z * (x + y)) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (z + a) - b;
} else if (t_3 <= 5e+259) {
tmp = (fma((x + y), z, t_1) - (y * b)) / (x + (y + t));
} else {
tmp = z + (a * ((y / t_2) + (t / t_2)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(t + Float64(x + y)) t_3 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(z + a) - b); elseif (t_3 <= 5e+259) tmp = Float64(Float64(fma(Float64(x + y), z, t_1) - Float64(y * b)) / Float64(x + Float64(y + t))); else tmp = Float64(z + Float64(a * Float64(Float64(y / t_2) + Float64(t / t_2)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$3, 5e+259], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := t + \left(x + y\right)\\
t_3 := \frac{\left(z \cdot \left(x + y\right) + t\_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_1\right) - y \cdot b}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \left(\frac{y}{t\_2} + \frac{t}{t\_2}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 7.0%
Taylor expanded in y around inf 85.5%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000033e259Initial program 99.0%
fma-define99.0%
+-commutative99.0%
associate-+l+99.0%
+-commutative99.0%
Simplified99.0%
if 5.00000000000000033e259 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.3%
Taylor expanded in a around 0 29.7%
associate--l+29.7%
+-commutative29.7%
+-commutative29.7%
+-commutative29.7%
div-sub29.7%
+-commutative29.7%
*-commutative29.7%
+-commutative29.7%
Simplified29.7%
Taylor expanded in x around inf 68.7%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
(if (<= t_2 (- INFINITY))
(- (+ z a) b)
(if (<= t_2 5e+259) t_2 (+ z (* a (+ (/ y t_1) (/ t t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z + a) - b;
} else if (t_2 <= 5e+259) {
tmp = t_2;
} else {
tmp = z + (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 = t + (x + y);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (z + a) - b;
} else if (t_2 <= 5e+259) {
tmp = t_2;
} else {
tmp = z + (a * ((y / t_1) + (t / t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if t_2 <= -math.inf: tmp = (z + a) - b elif t_2 <= 5e+259: tmp = t_2 else: tmp = z + (a * ((y / t_1) + (t / t_1))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z + a) - b); elseif (t_2 <= 5e+259) tmp = t_2; else tmp = Float64(z + 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 = t + (x + y); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if (t_2 <= -Inf) tmp = (z + a) - b; elseif (t_2 <= 5e+259) tmp = t_2; else tmp = z + (a * ((y / t_1) + (t / t_1))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $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] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$2, 5e+259], t$95$2, N[(z + 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 := t + \left(x + y\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;z + 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.0Initial program 7.0%
Taylor expanded in y around inf 85.5%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000033e259Initial program 99.0%
if 5.00000000000000033e259 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.3%
Taylor expanded in a around 0 29.7%
associate--l+29.7%
+-commutative29.7%
+-commutative29.7%
+-commutative29.7%
div-sub29.7%
+-commutative29.7%
*-commutative29.7%
+-commutative29.7%
Simplified29.7%
Taylor expanded in x around inf 68.7%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y))))
(if (or (<= b -2.9e+115) (not (<= b 1.72e+53)))
(* b (/ (- (* z (/ (+ x y) b)) y) (+ y (+ x t))))
(+ z (* a (+ (/ y t_1) (/ t t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double tmp;
if ((b <= -2.9e+115) || !(b <= 1.72e+53)) {
tmp = b * (((z * ((x + y) / b)) - y) / (y + (x + t)));
} else {
tmp = z + (a * ((y / t_1) + (t / t_1)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = t + (x + y)
if ((b <= (-2.9d+115)) .or. (.not. (b <= 1.72d+53))) then
tmp = b * (((z * ((x + y) / b)) - y) / (y + (x + t)))
else
tmp = z + (a * ((y / t_1) + (t / t_1)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double tmp;
if ((b <= -2.9e+115) || !(b <= 1.72e+53)) {
tmp = b * (((z * ((x + y) / b)) - y) / (y + (x + t)));
} else {
tmp = z + (a * ((y / t_1) + (t / t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) tmp = 0 if (b <= -2.9e+115) or not (b <= 1.72e+53): tmp = b * (((z * ((x + y) / b)) - y) / (y + (x + t))) else: tmp = z + (a * ((y / t_1) + (t / t_1))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) tmp = 0.0 if ((b <= -2.9e+115) || !(b <= 1.72e+53)) tmp = Float64(b * Float64(Float64(Float64(z * Float64(Float64(x + y) / b)) - y) / Float64(y + Float64(x + t)))); else tmp = Float64(z + 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 = t + (x + y); tmp = 0.0; if ((b <= -2.9e+115) || ~((b <= 1.72e+53))) tmp = b * (((z * ((x + y) / b)) - y) / (y + (x + t))); else tmp = z + (a * ((y / t_1) + (t / t_1))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -2.9e+115], N[Not[LessEqual[b, 1.72e+53]], $MachinePrecision]], N[(b * N[(N[(N[(z * N[(N[(x + y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z + 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 := t + \left(x + y\right)\\
\mathbf{if}\;b \leq -2.9 \cdot 10^{+115} \lor \neg \left(b \leq 1.72 \cdot 10^{+53}\right):\\
\;\;\;\;b \cdot \frac{z \cdot \frac{x + y}{b} - y}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \left(\frac{y}{t\_1} + \frac{t}{t\_1}\right)\\
\end{array}
\end{array}
if b < -2.90000000000000005e115 or 1.72e53 < b Initial program 54.7%
Taylor expanded in b around inf 55.0%
Taylor expanded in a around 0 45.4%
associate-/l*57.7%
associate-/l*76.0%
+-commutative76.0%
associate-+r+76.0%
+-commutative76.0%
Simplified76.0%
if -2.90000000000000005e115 < b < 1.72e53Initial program 64.4%
Taylor expanded in a around 0 79.8%
associate--l+79.8%
+-commutative79.8%
+-commutative79.8%
+-commutative79.8%
div-sub79.8%
+-commutative79.8%
*-commutative79.8%
+-commutative79.8%
Simplified79.8%
Taylor expanded in x around inf 76.5%
Final simplification76.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.9e+104) (not (<= b 2700000000.0))) (* b (/ (- (* z (/ (+ x y) b)) y) (+ y (+ x t)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.9e+104) || !(b <= 2700000000.0)) {
tmp = b * (((z * ((x + y) / b)) - y) / (y + (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 ((b <= (-4.9d+104)) .or. (.not. (b <= 2700000000.0d0))) then
tmp = b * (((z * ((x + y) / b)) - y) / (y + (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 ((b <= -4.9e+104) || !(b <= 2700000000.0)) {
tmp = b * (((z * ((x + y) / b)) - y) / (y + (x + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4.9e+104) or not (b <= 2700000000.0): tmp = b * (((z * ((x + y) / b)) - y) / (y + (x + t))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.9e+104) || !(b <= 2700000000.0)) tmp = Float64(b * Float64(Float64(Float64(z * Float64(Float64(x + y) / b)) - y) / Float64(y + 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 ((b <= -4.9e+104) || ~((b <= 2700000000.0))) tmp = b * (((z * ((x + y) / b)) - y) / (y + (x + t))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.9e+104], N[Not[LessEqual[b, 2700000000.0]], $MachinePrecision]], N[(b * N[(N[(N[(z * N[(N[(x + y), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.9 \cdot 10^{+104} \lor \neg \left(b \leq 2700000000\right):\\
\;\;\;\;b \cdot \frac{z \cdot \frac{x + y}{b} - y}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -4.89999999999999985e104 or 2.7e9 < b Initial program 59.7%
Taylor expanded in b around inf 60.0%
Taylor expanded in a around 0 45.7%
associate-/l*56.1%
associate-/l*71.6%
+-commutative71.6%
associate-+r+71.6%
+-commutative71.6%
Simplified71.6%
if -4.89999999999999985e104 < b < 2.7e9Initial program 61.9%
Taylor expanded in y around inf 67.5%
Final simplification69.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -6.8e+74)
(* z (/ (+ x y) (+ y (+ x t))))
(if (<= x 7.6e+51)
(- (+ z a) b)
(+ z (* a (+ (/ y (+ t (+ x y))) (/ t x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.8e+74) {
tmp = z * ((x + y) / (y + (x + t)));
} else if (x <= 7.6e+51) {
tmp = (z + a) - b;
} else {
tmp = z + (a * ((y / (t + (x + y))) + (t / x)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6.8d+74)) then
tmp = z * ((x + y) / (y + (x + t)))
else if (x <= 7.6d+51) then
tmp = (z + a) - b
else
tmp = z + (a * ((y / (t + (x + y))) + (t / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.8e+74) {
tmp = z * ((x + y) / (y + (x + t)));
} else if (x <= 7.6e+51) {
tmp = (z + a) - b;
} else {
tmp = z + (a * ((y / (t + (x + y))) + (t / x)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.8e+74: tmp = z * ((x + y) / (y + (x + t))) elif x <= 7.6e+51: tmp = (z + a) - b else: tmp = z + (a * ((y / (t + (x + y))) + (t / x))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.8e+74) tmp = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t)))); elseif (x <= 7.6e+51) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z + Float64(a * Float64(Float64(y / Float64(t + Float64(x + y))) + Float64(t / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.8e+74) tmp = z * ((x + y) / (y + (x + t))); elseif (x <= 7.6e+51) tmp = (z + a) - b; else tmp = z + (a * ((y / (t + (x + y))) + (t / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.8e+74], N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.6e+51], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + N[(a * N[(N[(y / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+74}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{+51}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \left(\frac{y}{t + \left(x + y\right)} + \frac{t}{x}\right)\\
\end{array}
\end{array}
if x < -6.7999999999999998e74Initial program 35.1%
Taylor expanded in z around inf 20.3%
associate-/l*68.6%
+-commutative68.6%
associate-+r+68.6%
Simplified68.6%
if -6.7999999999999998e74 < x < 7.5999999999999994e51Initial program 68.4%
Taylor expanded in y around inf 65.7%
if 7.5999999999999994e51 < x Initial program 56.8%
Taylor expanded in a around 0 62.4%
associate--l+62.4%
+-commutative62.4%
+-commutative62.4%
+-commutative62.4%
div-sub62.4%
+-commutative62.4%
*-commutative62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in x around inf 78.0%
Taylor expanded in x around inf 74.5%
Final simplification68.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -2e+233)
z
(if (<= x -5.2e-94)
(+ z a)
(if (<= x 4.8e-247) (- a b) (if (<= x 1.05e+149) (+ z a) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2e+233) {
tmp = z;
} else if (x <= -5.2e-94) {
tmp = z + a;
} else if (x <= 4.8e-247) {
tmp = a - b;
} else if (x <= 1.05e+149) {
tmp = z + 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 <= (-2d+233)) then
tmp = z
else if (x <= (-5.2d-94)) then
tmp = z + a
else if (x <= 4.8d-247) then
tmp = a - b
else if (x <= 1.05d+149) then
tmp = z + 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 <= -2e+233) {
tmp = z;
} else if (x <= -5.2e-94) {
tmp = z + a;
} else if (x <= 4.8e-247) {
tmp = a - b;
} else if (x <= 1.05e+149) {
tmp = z + a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2e+233: tmp = z elif x <= -5.2e-94: tmp = z + a elif x <= 4.8e-247: tmp = a - b elif x <= 1.05e+149: tmp = z + a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2e+233) tmp = z; elseif (x <= -5.2e-94) tmp = Float64(z + a); elseif (x <= 4.8e-247) tmp = Float64(a - b); elseif (x <= 1.05e+149) tmp = Float64(z + a); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2e+233) tmp = z; elseif (x <= -5.2e-94) tmp = z + a; elseif (x <= 4.8e-247) tmp = a - b; elseif (x <= 1.05e+149) tmp = z + a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2e+233], z, If[LessEqual[x, -5.2e-94], N[(z + a), $MachinePrecision], If[LessEqual[x, 4.8e-247], N[(a - b), $MachinePrecision], If[LessEqual[x, 1.05e+149], N[(z + a), $MachinePrecision], z]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+233}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{-94}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-247}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+149}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.99999999999999995e233 or 1.0500000000000001e149 < x Initial program 45.1%
Taylor expanded in x around inf 69.3%
if -1.99999999999999995e233 < x < -5.19999999999999988e-94 or 4.80000000000000022e-247 < x < 1.0500000000000001e149Initial program 64.1%
Taylor expanded in a around 0 77.9%
associate--l+77.9%
+-commutative77.9%
+-commutative77.9%
+-commutative77.9%
div-sub77.9%
+-commutative77.9%
*-commutative77.9%
+-commutative77.9%
Simplified77.9%
Taylor expanded in x around inf 63.5%
Taylor expanded in y around inf 55.2%
if -5.19999999999999988e-94 < x < 4.80000000000000022e-247Initial program 68.3%
Taylor expanded in y around inf 73.0%
Taylor expanded in z around 0 69.6%
Final simplification62.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.75e+188) (not (<= x 8.5e+124))) (+ z (* a (/ (+ y t) x))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.75e+188) || !(x <= 8.5e+124)) {
tmp = z + (a * ((y + t) / x));
} 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 ((x <= (-1.75d+188)) .or. (.not. (x <= 8.5d+124))) then
tmp = z + (a * ((y + t) / x))
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 ((x <= -1.75e+188) || !(x <= 8.5e+124)) {
tmp = z + (a * ((y + t) / x));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.75e+188) or not (x <= 8.5e+124): tmp = z + (a * ((y + t) / x)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.75e+188) || !(x <= 8.5e+124)) tmp = Float64(z + Float64(a * Float64(Float64(y + t) / x))); 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 ((x <= -1.75e+188) || ~((x <= 8.5e+124))) tmp = z + (a * ((y + t) / x)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.75e+188], N[Not[LessEqual[x, 8.5e+124]], $MachinePrecision]], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+188} \lor \neg \left(x \leq 8.5 \cdot 10^{+124}\right):\\
\;\;\;\;z + a \cdot \frac{y + t}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -1.75000000000000004e188 or 8.4999999999999997e124 < x Initial program 45.8%
Taylor expanded in a around 0 48.2%
associate--l+48.2%
+-commutative48.2%
+-commutative48.2%
+-commutative48.2%
div-sub48.2%
+-commutative48.2%
*-commutative48.2%
+-commutative48.2%
Simplified48.2%
Taylor expanded in x around inf 79.5%
Taylor expanded in x around inf 69.8%
associate-/l*74.7%
+-commutative74.7%
Simplified74.7%
if -1.75000000000000004e188 < x < 8.4999999999999997e124Initial program 66.1%
Taylor expanded in y around inf 64.1%
Final simplification66.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6.2e+74) (* z (/ (+ x y) (+ y (+ x t)))) (if (<= x 2.25e+124) (- (+ z a) b) (+ z (* a (/ (+ y t) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.2e+74) {
tmp = z * ((x + y) / (y + (x + t)));
} else if (x <= 2.25e+124) {
tmp = (z + a) - b;
} else {
tmp = z + (a * ((y + t) / x));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6.2d+74)) then
tmp = z * ((x + y) / (y + (x + t)))
else if (x <= 2.25d+124) then
tmp = (z + a) - b
else
tmp = z + (a * ((y + t) / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.2e+74) {
tmp = z * ((x + y) / (y + (x + t)));
} else if (x <= 2.25e+124) {
tmp = (z + a) - b;
} else {
tmp = z + (a * ((y + t) / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.2e+74: tmp = z * ((x + y) / (y + (x + t))) elif x <= 2.25e+124: tmp = (z + a) - b else: tmp = z + (a * ((y + t) / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.2e+74) tmp = Float64(z * Float64(Float64(x + y) / Float64(y + Float64(x + t)))); elseif (x <= 2.25e+124) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z + Float64(a * Float64(Float64(y + t) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6.2e+74) tmp = z * ((x + y) / (y + (x + t))); elseif (x <= 2.25e+124) tmp = (z + a) - b; else tmp = z + (a * ((y + t) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.2e+74], N[(z * N[(N[(x + y), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.25e+124], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + N[(a * N[(N[(y + t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+74}:\\
\;\;\;\;z \cdot \frac{x + y}{y + \left(x + t\right)}\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{+124}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a \cdot \frac{y + t}{x}\\
\end{array}
\end{array}
if x < -6.20000000000000043e74Initial program 35.1%
Taylor expanded in z around inf 20.3%
associate-/l*68.6%
+-commutative68.6%
associate-+r+68.6%
Simplified68.6%
if -6.20000000000000043e74 < x < 2.2500000000000002e124Initial program 68.0%
Taylor expanded in y around inf 65.0%
if 2.2500000000000002e124 < x Initial program 54.0%
Taylor expanded in a around 0 57.2%
associate--l+57.2%
+-commutative57.2%
+-commutative57.2%
+-commutative57.2%
div-sub57.2%
+-commutative57.2%
*-commutative57.2%
+-commutative57.2%
Simplified57.2%
Taylor expanded in x around inf 81.8%
Taylor expanded in x around inf 73.6%
associate-/l*74.3%
+-commutative74.3%
Simplified74.3%
Final simplification67.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.1e+190) z (if (<= x 1.85e+131) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.1e+190) {
tmp = z;
} else if (x <= 1.85e+131) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-2.1d+190)) then
tmp = z
else if (x <= 1.85d+131) then
tmp = (z + a) - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.1e+190) {
tmp = z;
} else if (x <= 1.85e+131) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.1e+190: tmp = z elif x <= 1.85e+131: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.1e+190) tmp = z; elseif (x <= 1.85e+131) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.1e+190) tmp = z; elseif (x <= 1.85e+131) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.1e+190], z, If[LessEqual[x, 1.85e+131], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+190}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+131}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.1000000000000001e190 or 1.84999999999999998e131 < x Initial program 45.8%
Taylor expanded in x around inf 64.1%
if -2.1000000000000001e190 < x < 1.84999999999999998e131Initial program 66.1%
Taylor expanded in y around inf 64.1%
Final simplification64.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.4e+233) z (if (<= x 1.32e+144) (+ z a) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.4e+233) {
tmp = z;
} else if (x <= 1.32e+144) {
tmp = z + 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 <= (-2.4d+233)) then
tmp = z
else if (x <= 1.32d+144) then
tmp = z + 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 <= -2.4e+233) {
tmp = z;
} else if (x <= 1.32e+144) {
tmp = z + a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.4e+233: tmp = z elif x <= 1.32e+144: tmp = z + a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.4e+233) tmp = z; elseif (x <= 1.32e+144) tmp = Float64(z + a); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.4e+233) tmp = z; elseif (x <= 1.32e+144) tmp = z + a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.4e+233], z, If[LessEqual[x, 1.32e+144], N[(z + a), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+233}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+144}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.40000000000000003e233 or 1.32e144 < x Initial program 45.1%
Taylor expanded in x around inf 69.3%
if -2.40000000000000003e233 < x < 1.32e144Initial program 65.5%
Taylor expanded in a around 0 79.8%
associate--l+79.8%
+-commutative79.8%
+-commutative79.8%
+-commutative79.8%
div-sub79.8%
+-commutative79.8%
*-commutative79.8%
+-commutative79.8%
Simplified79.8%
Taylor expanded in x around inf 60.4%
Taylor expanded in y around inf 54.5%
Final simplification57.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6.1e+65) z (if (<= x 9.2e+51) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.1e+65) {
tmp = z;
} else if (x <= 9.2e+51) {
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.1d+65)) then
tmp = z
else if (x <= 9.2d+51) 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.1e+65) {
tmp = z;
} else if (x <= 9.2e+51) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.1e+65: tmp = z elif x <= 9.2e+51: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.1e+65) tmp = z; elseif (x <= 9.2e+51) 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.1e+65) tmp = z; elseif (x <= 9.2e+51) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.1e+65], z, If[LessEqual[x, 9.2e+51], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.1 \cdot 10^{+65}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+51}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -6.09999999999999965e65 or 9.2000000000000002e51 < x Initial program 48.8%
Taylor expanded in x around inf 57.9%
if -6.09999999999999965e65 < x < 9.2000000000000002e51Initial program 68.2%
Taylor expanded in t around inf 49.5%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 61.0%
Taylor expanded in t around inf 35.4%
(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 2024135
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ 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)))