
(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 14 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 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) (+ y (+ x t))))) (if (<= t_1 -1e+283) (+ z a) (if (<= t_1 5e+289) t_1 (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -1e+283) {
tmp = z + a;
} else if (t_1 <= 5e+289) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t))
if (t_1 <= (-1d+283)) then
tmp = z + a
else if (t_1 <= 5d+289) then
tmp = t_1
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 t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if (t_1 <= -1e+283) {
tmp = z + a;
} else if (t_1 <= 5e+289) {
tmp = t_1;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if t_1 <= -1e+283: tmp = z + a elif t_1 <= 5e+289: tmp = t_1 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_1 <= -1e+283) tmp = Float64(z + a); elseif (t_1 <= 5e+289) tmp = t_1; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if (t_1 <= -1e+283) tmp = z + a; elseif (t_1 <= 5e+289) tmp = t_1; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $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$1, -1e+283], N[(z + a), $MachinePrecision], If[LessEqual[t$95$1, 5e+289], t$95$1, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+283}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\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)) < -9.99999999999999955e282Initial program 8.5%
Taylor expanded in y around inf 73.6%
Taylor expanded in b around 0 75.4%
if -9.99999999999999955e282 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000031e289Initial program 99.7%
if 5.00000000000000031e289 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.7%
Taylor expanded in y around inf 73.8%
Final simplification89.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (- (+ z a) b))
(t_4 (* (+ x y) z))
(t_5 (/ (- (+ t_4 t_1) (* y b)) t_2))
(t_6 (/ (- t_4 (* y b)) t_2)))
(if (<= t_5 -5e+199)
t_3
(if (<= t_5 -2e+89)
t_6
(if (<= t_5 -2e-28)
(/ (- t_1 (* y b)) t_2)
(if (<= t_5 2e+146) t_6 t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (z + a) - b;
double t_4 = (x + y) * z;
double t_5 = ((t_4 + t_1) - (y * b)) / t_2;
double t_6 = (t_4 - (y * b)) / t_2;
double tmp;
if (t_5 <= -5e+199) {
tmp = t_3;
} else if (t_5 <= -2e+89) {
tmp = t_6;
} else if (t_5 <= -2e-28) {
tmp = (t_1 - (y * b)) / t_2;
} else if (t_5 <= 2e+146) {
tmp = t_6;
} 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) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = a * (y + t)
t_2 = y + (x + t)
t_3 = (z + a) - b
t_4 = (x + y) * z
t_5 = ((t_4 + t_1) - (y * b)) / t_2
t_6 = (t_4 - (y * b)) / t_2
if (t_5 <= (-5d+199)) then
tmp = t_3
else if (t_5 <= (-2d+89)) then
tmp = t_6
else if (t_5 <= (-2d-28)) then
tmp = (t_1 - (y * b)) / t_2
else if (t_5 <= 2d+146) then
tmp = t_6
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 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (z + a) - b;
double t_4 = (x + y) * z;
double t_5 = ((t_4 + t_1) - (y * b)) / t_2;
double t_6 = (t_4 - (y * b)) / t_2;
double tmp;
if (t_5 <= -5e+199) {
tmp = t_3;
} else if (t_5 <= -2e+89) {
tmp = t_6;
} else if (t_5 <= -2e-28) {
tmp = (t_1 - (y * b)) / t_2;
} else if (t_5 <= 2e+146) {
tmp = t_6;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) t_3 = (z + a) - b t_4 = (x + y) * z t_5 = ((t_4 + t_1) - (y * b)) / t_2 t_6 = (t_4 - (y * b)) / t_2 tmp = 0 if t_5 <= -5e+199: tmp = t_3 elif t_5 <= -2e+89: tmp = t_6 elif t_5 <= -2e-28: tmp = (t_1 - (y * b)) / t_2 elif t_5 <= 2e+146: tmp = t_6 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(z + a) - b) t_4 = Float64(Float64(x + y) * z) t_5 = Float64(Float64(Float64(t_4 + t_1) - Float64(y * b)) / t_2) t_6 = Float64(Float64(t_4 - Float64(y * b)) / t_2) tmp = 0.0 if (t_5 <= -5e+199) tmp = t_3; elseif (t_5 <= -2e+89) tmp = t_6; elseif (t_5 <= -2e-28) tmp = Float64(Float64(t_1 - Float64(y * b)) / t_2); elseif (t_5 <= 2e+146) tmp = t_6; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); t_3 = (z + a) - b; t_4 = (x + y) * z; t_5 = ((t_4 + t_1) - (y * b)) / t_2; t_6 = (t_4 - (y * b)) / t_2; tmp = 0.0; if (t_5 <= -5e+199) tmp = t_3; elseif (t_5 <= -2e+89) tmp = t_6; elseif (t_5 <= -2e-28) tmp = (t_1 - (y * b)) / t_2; elseif (t_5 <= 2e+146) tmp = t_6; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t$95$4 + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$4 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$5, -5e+199], t$95$3, If[LessEqual[t$95$5, -2e+89], t$95$6, If[LessEqual[t$95$5, -2e-28], N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$5, 2e+146], t$95$6, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \left(z + a\right) - b\\
t_4 := \left(x + y\right) \cdot z\\
t_5 := \frac{\left(t\_4 + t\_1\right) - y \cdot b}{t\_2}\\
t_6 := \frac{t\_4 - y \cdot b}{t\_2}\\
\mathbf{if}\;t\_5 \leq -5 \cdot 10^{+199}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_5 \leq -2 \cdot 10^{+89}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_5 \leq -2 \cdot 10^{-28}:\\
\;\;\;\;\frac{t\_1 - y \cdot b}{t\_2}\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+146}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\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)) < -4.9999999999999998e199 or 1.99999999999999987e146 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 24.6%
Taylor expanded in y around inf 73.0%
if -4.9999999999999998e199 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.99999999999999999e89 or -1.99999999999999994e-28 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999987e146Initial program 99.7%
Taylor expanded in a around 0 74.7%
+-commutative74.7%
*-commutative74.7%
Simplified74.7%
if -1.99999999999999999e89 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.99999999999999994e-28Initial program 99.7%
Taylor expanded in z around 0 74.1%
+-commutative74.1%
*-commutative74.1%
Simplified74.1%
Final simplification73.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (- (+ z a) b))
(t_3 (* (+ x y) z))
(t_4 (+ t_3 (* a (+ y t))))
(t_5 (/ (- t_4 (* y b)) t_1)))
(if (<= t_5 -5e+254)
t_2
(if (<= t_5 2e+57)
(/ t_4 (+ (+ x y) t))
(if (<= t_5 2e+146) (/ (- t_3 (* y b)) t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - b;
double t_3 = (x + y) * z;
double t_4 = t_3 + (a * (y + t));
double t_5 = (t_4 - (y * b)) / t_1;
double tmp;
if (t_5 <= -5e+254) {
tmp = t_2;
} else if (t_5 <= 2e+57) {
tmp = t_4 / ((x + y) + t);
} else if (t_5 <= 2e+146) {
tmp = (t_3 - (y * b)) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (z + a) - b
t_3 = (x + y) * z
t_4 = t_3 + (a * (y + t))
t_5 = (t_4 - (y * b)) / t_1
if (t_5 <= (-5d+254)) then
tmp = t_2
else if (t_5 <= 2d+57) then
tmp = t_4 / ((x + y) + t)
else if (t_5 <= 2d+146) then
tmp = (t_3 - (y * b)) / t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - b;
double t_3 = (x + y) * z;
double t_4 = t_3 + (a * (y + t));
double t_5 = (t_4 - (y * b)) / t_1;
double tmp;
if (t_5 <= -5e+254) {
tmp = t_2;
} else if (t_5 <= 2e+57) {
tmp = t_4 / ((x + y) + t);
} else if (t_5 <= 2e+146) {
tmp = (t_3 - (y * b)) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - b t_3 = (x + y) * z t_4 = t_3 + (a * (y + t)) t_5 = (t_4 - (y * b)) / t_1 tmp = 0 if t_5 <= -5e+254: tmp = t_2 elif t_5 <= 2e+57: tmp = t_4 / ((x + y) + t) elif t_5 <= 2e+146: tmp = (t_3 - (y * b)) / t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(z + a) - b) t_3 = Float64(Float64(x + y) * z) t_4 = Float64(t_3 + Float64(a * Float64(y + t))) t_5 = Float64(Float64(t_4 - Float64(y * b)) / t_1) tmp = 0.0 if (t_5 <= -5e+254) tmp = t_2; elseif (t_5 <= 2e+57) tmp = Float64(t_4 / Float64(Float64(x + y) + t)); elseif (t_5 <= 2e+146) tmp = Float64(Float64(t_3 - Float64(y * b)) / t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (z + a) - b; t_3 = (x + y) * z; t_4 = t_3 + (a * (y + t)); t_5 = (t_4 - (y * b)) / t_1; tmp = 0.0; if (t_5 <= -5e+254) tmp = t_2; elseif (t_5 <= 2e+57) tmp = t_4 / ((x + y) + t); elseif (t_5 <= 2e+146) tmp = (t_3 - (y * b)) / t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$5, -5e+254], t$95$2, If[LessEqual[t$95$5, 2e+57], N[(t$95$4 / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 2e+146], N[(N[(t$95$3 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - b\\
t_3 := \left(x + y\right) \cdot z\\
t_4 := t\_3 + a \cdot \left(y + t\right)\\
t_5 := \frac{t\_4 - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_5 \leq -5 \cdot 10^{+254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+57}:\\
\;\;\;\;\frac{t\_4}{\left(x + y\right) + t}\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+146}:\\
\;\;\;\;\frac{t\_3 - y \cdot b}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -4.99999999999999994e254 or 1.99999999999999987e146 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 19.5%
Taylor expanded in y around inf 73.5%
if -4.99999999999999994e254 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e57Initial program 99.7%
Taylor expanded in b around 0 81.7%
if 2.0000000000000001e57 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999987e146Initial program 99.7%
Taylor expanded in a around 0 85.6%
+-commutative85.6%
*-commutative85.6%
Simplified85.6%
Final simplification78.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) t_2))
(t_4 (- (+ z a) b)))
(if (<= t_3 -1e+126)
t_4
(if (<= t_3 2e+57)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= t_3 5e+289) (/ (- t_1 (* y b)) t_2) t_4)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_4 = (z + a) - b;
double tmp;
if (t_3 <= -1e+126) {
tmp = t_4;
} else if (t_3 <= 2e+57) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (t_3 <= 5e+289) {
tmp = (t_1 - (y * b)) / 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 = a * (y + t)
t_2 = y + (x + t)
t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2
t_4 = (z + a) - b
if (t_3 <= (-1d+126)) then
tmp = t_4
else if (t_3 <= 2d+57) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (t_3 <= 5d+289) then
tmp = (t_1 - (y * b)) / 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 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_4 = (z + a) - b;
double tmp;
if (t_3 <= -1e+126) {
tmp = t_4;
} else if (t_3 <= 2e+57) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (t_3 <= 5e+289) {
tmp = (t_1 - (y * b)) / t_2;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2 t_4 = (z + a) - b tmp = 0 if t_3 <= -1e+126: tmp = t_4 elif t_3 <= 2e+57: tmp = ((t * a) + (x * z)) / (x + t) elif t_3 <= 5e+289: tmp = (t_1 - (y * b)) / t_2 else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / t_2) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 <= -1e+126) tmp = t_4; elseif (t_3 <= 2e+57) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (t_3 <= 5e+289) tmp = Float64(Float64(t_1 - Float64(y * b)) / t_2); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2; t_4 = (z + a) - b; tmp = 0.0; if (t_3 <= -1e+126) tmp = t_4; elseif (t_3 <= 2e+57) tmp = ((t * a) + (x * z)) / (x + t); elseif (t_3 <= 5e+289) tmp = (t_1 - (y * b)) / t_2; else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+126], t$95$4, If[LessEqual[t$95$3, 2e+57], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+289], N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{t\_2}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{+126}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+57}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+289}:\\
\;\;\;\;\frac{t\_1 - y \cdot b}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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)) < -9.99999999999999925e125 or 5.00000000000000031e289 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 24.6%
Taylor expanded in y around inf 71.6%
if -9.99999999999999925e125 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e57Initial program 99.7%
Taylor expanded in y around 0 64.7%
if 2.0000000000000001e57 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000031e289Initial program 99.7%
Taylor expanded in z around 0 73.4%
+-commutative73.4%
*-commutative73.4%
Simplified73.4%
Final simplification69.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) (+ y (+ x t)))))
(if (or (<= t_1 -1e+126) (not (<= t_1 2e+52)))
(- (+ z a) b)
(/ (+ (* t a) (* x z)) (+ x t)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -1e+126) || !(t_1 <= 2e+52)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t))
if ((t_1 <= (-1d+126)) .or. (.not. (t_1 <= 2d+52))) then
tmp = (z + a) - b
else
tmp = ((t * a) + (x * z)) / (x + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -1e+126) || !(t_1 <= 2e+52)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -1e+126) or not (t_1 <= 2e+52): tmp = (z + a) - b else: tmp = ((t * a) + (x * z)) / (x + t) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= -1e+126) || !(t_1 <= 2e+52)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -1e+126) || ~((t_1 <= 2e+52))) tmp = (z + a) - b; else tmp = ((t * a) + (x * z)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+126], N[Not[LessEqual[t$95$1, 2e+52]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+126} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+52}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\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)) < -9.99999999999999925e125 or 2e52 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 41.0%
Taylor expanded in y around inf 68.8%
if -9.99999999999999925e125 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e52Initial program 99.7%
Taylor expanded in y around 0 64.0%
Final simplification67.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -8.6e+33)
t_1
(if (<= y -2.6e-47)
(/ (- (* a (+ y t)) (* y b)) (+ y (+ x t)))
(if (<= y 6.4e-43)
(* z (+ (/ x (+ x t)) (* (/ a z) (/ t (+ 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 <= -8.6e+33) {
tmp = t_1;
} else if (y <= -2.6e-47) {
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t));
} else if (y <= 6.4e-43) {
tmp = z * ((x / (x + t)) + ((a / z) * (t / (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 <= (-8.6d+33)) then
tmp = t_1
else if (y <= (-2.6d-47)) then
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t))
else if (y <= 6.4d-43) then
tmp = z * ((x / (x + t)) + ((a / z) * (t / (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 <= -8.6e+33) {
tmp = t_1;
} else if (y <= -2.6e-47) {
tmp = ((a * (y + t)) - (y * b)) / (y + (x + t));
} else if (y <= 6.4e-43) {
tmp = z * ((x / (x + t)) + ((a / z) * (t / (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 <= -8.6e+33: tmp = t_1 elif y <= -2.6e-47: tmp = ((a * (y + t)) - (y * b)) / (y + (x + t)) elif y <= 6.4e-43: tmp = z * ((x / (x + t)) + ((a / z) * (t / (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 <= -8.6e+33) tmp = t_1; elseif (y <= -2.6e-47) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (y <= 6.4e-43) tmp = Float64(z * Float64(Float64(x / Float64(x + t)) + Float64(Float64(a / z) * Float64(t / 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 <= -8.6e+33) tmp = t_1; elseif (y <= -2.6e-47) tmp = ((a * (y + t)) - (y * b)) / (y + (x + t)); elseif (y <= 6.4e-43) tmp = z * ((x / (x + t)) + ((a / z) * (t / (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, -8.6e+33], t$95$1, If[LessEqual[y, -2.6e-47], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e-43], N[(z * N[(N[(x / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(N[(a / z), $MachinePrecision] * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -8.6 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-47}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-43}:\\
\;\;\;\;z \cdot \left(\frac{x}{x + t} + \frac{a}{z} \cdot \frac{t}{x + t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.60000000000000057e33 or 6.3999999999999997e-43 < y Initial program 45.5%
Taylor expanded in y around inf 75.0%
if -8.60000000000000057e33 < y < -2.6e-47Initial program 94.1%
Taylor expanded in z around 0 77.1%
+-commutative77.1%
*-commutative77.1%
Simplified77.1%
if -2.6e-47 < y < 6.3999999999999997e-43Initial program 75.5%
Taylor expanded in b around inf 49.6%
+-commutative49.6%
mul-1-neg49.6%
unsub-neg49.6%
Simplified58.4%
Taylor expanded in z around inf 57.0%
Taylor expanded in y around 0 61.9%
+-commutative61.9%
times-frac72.8%
+-commutative72.8%
Simplified72.8%
Final simplification74.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))) (t_2 (* a (/ (+ y t) t_1))))
(if (<= a -4.7e-7)
t_2
(if (<= a 6e-82)
(* z (/ (+ x y) t_1))
(if (<= a 6.2e+78) (- (+ z a) b) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = a * ((y + t) / t_1);
double tmp;
if (a <= -4.7e-7) {
tmp = t_2;
} else if (a <= 6e-82) {
tmp = z * ((x + y) / t_1);
} else if (a <= 6.2e+78) {
tmp = (z + a) - b;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y + t)
t_2 = a * ((y + t) / t_1)
if (a <= (-4.7d-7)) then
tmp = t_2
else if (a <= 6d-82) then
tmp = z * ((x + y) / t_1)
else if (a <= 6.2d+78) then
tmp = (z + a) - b
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = a * ((y + t) / t_1);
double tmp;
if (a <= -4.7e-7) {
tmp = t_2;
} else if (a <= 6e-82) {
tmp = z * ((x + y) / t_1);
} else if (a <= 6.2e+78) {
tmp = (z + a) - b;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = a * ((y + t) / t_1) tmp = 0 if a <= -4.7e-7: tmp = t_2 elif a <= 6e-82: tmp = z * ((x + y) / t_1) elif a <= 6.2e+78: tmp = (z + a) - b else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(a * Float64(Float64(y + t) / t_1)) tmp = 0.0 if (a <= -4.7e-7) tmp = t_2; elseif (a <= 6e-82) tmp = Float64(z * Float64(Float64(x + y) / t_1)); elseif (a <= 6.2e+78) tmp = Float64(Float64(z + a) - b); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = a * ((y + t) / t_1); tmp = 0.0; if (a <= -4.7e-7) tmp = t_2; elseif (a <= 6e-82) tmp = z * ((x + y) / t_1); elseif (a <= 6.2e+78) tmp = (z + a) - b; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.7e-7], t$95$2, If[LessEqual[a, 6e-82], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.2e+78], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := a \cdot \frac{y + t}{t\_1}\\
\mathbf{if}\;a \leq -4.7 \cdot 10^{-7}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-82}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+78}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -4.7e-7 or 6.2e78 < a Initial program 53.1%
Taylor expanded in a around inf 38.6%
associate-/l*70.1%
+-commutative70.1%
+-commutative70.1%
associate-+r+70.1%
Simplified70.1%
if -4.7e-7 < a < 5.9999999999999998e-82Initial program 77.0%
Taylor expanded in z around inf 45.2%
associate-/l*63.2%
+-commutative63.2%
+-commutative63.2%
associate-+r+63.2%
Simplified63.2%
if 5.9999999999999998e-82 < a < 6.2e78Initial program 55.7%
Taylor expanded in y around inf 77.5%
Final simplification68.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (/ (+ y t) (+ x (+ y t))))))
(if (<= a -1.35e+104)
t_1
(if (<= a -9.6e-117) (+ z a) (if (<= a 3.3e+78) (- (+ z a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * ((y + t) / (x + (y + t)));
double tmp;
if (a <= -1.35e+104) {
tmp = t_1;
} else if (a <= -9.6e-117) {
tmp = z + a;
} else if (a <= 3.3e+78) {
tmp = (z + a) - b;
} 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 = a * ((y + t) / (x + (y + t)))
if (a <= (-1.35d+104)) then
tmp = t_1
else if (a <= (-9.6d-117)) then
tmp = z + a
else if (a <= 3.3d+78) then
tmp = (z + a) - b
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 = a * ((y + t) / (x + (y + t)));
double tmp;
if (a <= -1.35e+104) {
tmp = t_1;
} else if (a <= -9.6e-117) {
tmp = z + a;
} else if (a <= 3.3e+78) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * ((y + t) / (x + (y + t))) tmp = 0 if a <= -1.35e+104: tmp = t_1 elif a <= -9.6e-117: tmp = z + a elif a <= 3.3e+78: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(Float64(y + t) / Float64(x + Float64(y + t)))) tmp = 0.0 if (a <= -1.35e+104) tmp = t_1; elseif (a <= -9.6e-117) tmp = Float64(z + a); elseif (a <= 3.3e+78) 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 = a * ((y + t) / (x + (y + t))); tmp = 0.0; if (a <= -1.35e+104) tmp = t_1; elseif (a <= -9.6e-117) tmp = z + a; elseif (a <= 3.3e+78) 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[(a * N[(N[(y + t), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.35e+104], t$95$1, If[LessEqual[a, -9.6e-117], N[(z + a), $MachinePrecision], If[LessEqual[a, 3.3e+78], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y + t}{x + \left(y + t\right)}\\
\mathbf{if}\;a \leq -1.35 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -9.6 \cdot 10^{-117}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+78}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.34999999999999992e104 or 3.3e78 < a Initial program 47.1%
Taylor expanded in a around inf 36.2%
associate-/l*75.1%
+-commutative75.1%
+-commutative75.1%
associate-+r+75.1%
Simplified75.1%
if -1.34999999999999992e104 < a < -9.60000000000000057e-117Initial program 71.8%
Taylor expanded in y around inf 52.9%
Taylor expanded in b around 0 69.1%
if -9.60000000000000057e-117 < a < 3.3e78Initial program 71.4%
Taylor expanded in y around inf 60.9%
Final simplification67.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -9.2e+82) z (if (<= x -2e-282) (- a b) (if (<= x 3.4e+163) (+ z a) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.2e+82) {
tmp = z;
} else if (x <= -2e-282) {
tmp = a - b;
} else if (x <= 3.4e+163) {
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 <= (-9.2d+82)) then
tmp = z
else if (x <= (-2d-282)) then
tmp = a - b
else if (x <= 3.4d+163) 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 <= -9.2e+82) {
tmp = z;
} else if (x <= -2e-282) {
tmp = a - b;
} else if (x <= 3.4e+163) {
tmp = z + a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.2e+82: tmp = z elif x <= -2e-282: tmp = a - b elif x <= 3.4e+163: tmp = z + a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.2e+82) tmp = z; elseif (x <= -2e-282) tmp = Float64(a - b); elseif (x <= 3.4e+163) 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 <= -9.2e+82) tmp = z; elseif (x <= -2e-282) tmp = a - b; elseif (x <= 3.4e+163) tmp = z + a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.2e+82], z, If[LessEqual[x, -2e-282], N[(a - b), $MachinePrecision], If[LessEqual[x, 3.4e+163], N[(z + a), $MachinePrecision], z]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+82}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-282}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+163}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -9.19999999999999953e82 or 3.4000000000000001e163 < x Initial program 55.1%
Taylor expanded in x around inf 66.2%
if -9.19999999999999953e82 < x < -2e-282Initial program 70.3%
Taylor expanded in y around inf 38.5%
Taylor expanded in z around 0 31.3%
associate-/l*39.9%
+-commutative39.9%
Simplified39.9%
Taylor expanded in y around inf 55.7%
if -2e-282 < x < 3.4000000000000001e163Initial program 63.7%
Taylor expanded in y around inf 63.5%
Taylor expanded in b around 0 61.3%
Final simplification61.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.8e+136) z (if (<= x 2.4e+112) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+136) {
tmp = z;
} else if (x <= 2.4e+112) {
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 <= (-8.8d+136)) then
tmp = z
else if (x <= 2.4d+112) 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 <= -8.8e+136) {
tmp = z;
} else if (x <= 2.4e+112) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.8e+136: tmp = z elif x <= 2.4e+112: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.8e+136) tmp = z; elseif (x <= 2.4e+112) 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 <= -8.8e+136) tmp = z; elseif (x <= 2.4e+112) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.8e+136], z, If[LessEqual[x, 2.4e+112], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+136}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+112}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -8.7999999999999998e136 or 2.4e112 < x Initial program 53.1%
Taylor expanded in x around inf 66.7%
if -8.7999999999999998e136 < x < 2.4e112Initial program 67.2%
Taylor expanded in y around inf 64.0%
Final simplification64.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.12e-116) (not (<= a 2.3e+35))) (+ z a) (- z b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.12e-116) || !(a <= 2.3e+35)) {
tmp = z + a;
} else {
tmp = z - 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 ((a <= (-1.12d-116)) .or. (.not. (a <= 2.3d+35))) then
tmp = z + a
else
tmp = z - 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 ((a <= -1.12e-116) || !(a <= 2.3e+35)) {
tmp = z + a;
} else {
tmp = z - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.12e-116) or not (a <= 2.3e+35): tmp = z + a else: tmp = z - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.12e-116) || !(a <= 2.3e+35)) tmp = Float64(z + a); else tmp = Float64(z - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.12e-116) || ~((a <= 2.3e+35))) tmp = z + a; else tmp = z - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.12e-116], N[Not[LessEqual[a, 2.3e+35]], $MachinePrecision]], N[(z + a), $MachinePrecision], N[(z - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{-116} \lor \neg \left(a \leq 2.3 \cdot 10^{+35}\right):\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z - b\\
\end{array}
\end{array}
if a < -1.12e-116 or 2.2999999999999998e35 < a Initial program 56.1%
Taylor expanded in y around inf 53.6%
Taylor expanded in b around 0 61.3%
if -1.12e-116 < a < 2.2999999999999998e35Initial program 73.1%
Taylor expanded in y around inf 60.2%
Taylor expanded in a around 0 57.3%
Final simplification59.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.2e+203) z (if (<= x 3.2e+155) (+ z a) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.2e+203) {
tmp = z;
} else if (x <= 3.2e+155) {
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.2d+203)) then
tmp = z
else if (x <= 3.2d+155) 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.2e+203) {
tmp = z;
} else if (x <= 3.2e+155) {
tmp = z + a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.2e+203: tmp = z elif x <= 3.2e+155: tmp = z + a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.2e+203) tmp = z; elseif (x <= 3.2e+155) 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.2e+203) tmp = z; elseif (x <= 3.2e+155) tmp = z + a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.2e+203], z, If[LessEqual[x, 3.2e+155], N[(z + a), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+203}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+155}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.20000000000000004e203 or 3.20000000000000012e155 < x Initial program 52.5%
Taylor expanded in x around inf 68.1%
if -2.20000000000000004e203 < x < 3.20000000000000012e155Initial program 66.0%
Taylor expanded in y around inf 62.1%
Taylor expanded in b around 0 57.1%
Final simplification59.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.02e+83) z (if (<= x 7e+44) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.02e+83) {
tmp = z;
} else if (x <= 7e+44) {
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 <= (-1.02d+83)) then
tmp = z
else if (x <= 7d+44) 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 <= -1.02e+83) {
tmp = z;
} else if (x <= 7e+44) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.02e+83: tmp = z elif x <= 7e+44: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.02e+83) tmp = z; elseif (x <= 7e+44) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.02e+83) tmp = z; elseif (x <= 7e+44) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.02e+83], z, If[LessEqual[x, 7e+44], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+83}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+44}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.0200000000000001e83 or 6.9999999999999998e44 < x Initial program 53.9%
Taylor expanded in x around inf 61.0%
if -1.0200000000000001e83 < x < 6.9999999999999998e44Initial program 70.0%
Taylor expanded in t around inf 48.1%
(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 63.0%
Taylor expanded in t around inf 32.7%
(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 2024191
(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)))