
(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 13 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)) (* a (+ y t))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+286))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+286)) {
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 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+286)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+286): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+286)) 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 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+286))) 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[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+286]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+286}\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.00000000000000003e286 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.7%
Taylor expanded in y around inf 74.4%
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.00000000000000003e286Initial program 99.8%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (* a (/ (+ y t) (+ x (+ y t))))))
(if (<= a -8.2e+133)
t_2
(if (<= a -3.95e-22)
t_1
(if (<= a 1.7e-170)
(/ (- (* z (+ x y)) (* y b)) (+ y (+ x t)))
(if (<= a 7.6e+76) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * ((y + t) / (x + (y + t)));
double tmp;
if (a <= -8.2e+133) {
tmp = t_2;
} else if (a <= -3.95e-22) {
tmp = t_1;
} else if (a <= 1.7e-170) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else if (a <= 7.6e+76) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = a * ((y + t) / (x + (y + t)))
if (a <= (-8.2d+133)) then
tmp = t_2
else if (a <= (-3.95d-22)) then
tmp = t_1
else if (a <= 1.7d-170) then
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t))
else if (a <= 7.6d+76) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * ((y + t) / (x + (y + t)));
double tmp;
if (a <= -8.2e+133) {
tmp = t_2;
} else if (a <= -3.95e-22) {
tmp = t_1;
} else if (a <= 1.7e-170) {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
} else if (a <= 7.6e+76) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = a * ((y + t) / (x + (y + t))) tmp = 0 if a <= -8.2e+133: tmp = t_2 elif a <= -3.95e-22: tmp = t_1 elif a <= 1.7e-170: tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)) elif a <= 7.6e+76: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(a * Float64(Float64(y + t) / Float64(x + Float64(y + t)))) tmp = 0.0 if (a <= -8.2e+133) tmp = t_2; elseif (a <= -3.95e-22) tmp = t_1; elseif (a <= 1.7e-170) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (a <= 7.6e+76) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = a * ((y + t) / (x + (y + t))); tmp = 0.0; if (a <= -8.2e+133) tmp = t_2; elseif (a <= -3.95e-22) tmp = t_1; elseif (a <= 1.7e-170) tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)); elseif (a <= 7.6e+76) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(y + t), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.2e+133], t$95$2, If[LessEqual[a, -3.95e-22], t$95$1, If[LessEqual[a, 1.7e-170], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.6e+76], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := a \cdot \frac{y + t}{x + \left(y + t\right)}\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{+133}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -3.95 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-170}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -8.20000000000000008e133 or 7.60000000000000049e76 < a Initial program 50.3%
Taylor expanded in a around inf 40.8%
associate-/l*79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
Simplified79.2%
if -8.20000000000000008e133 < a < -3.9499999999999999e-22 or 1.70000000000000006e-170 < a < 7.60000000000000049e76Initial program 51.5%
Taylor expanded in y around inf 65.1%
if -3.9499999999999999e-22 < a < 1.70000000000000006e-170Initial program 76.1%
Taylor expanded in a around 0 65.7%
+-commutative65.7%
*-commutative65.7%
Simplified65.7%
Final simplification69.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.3e-149)
t_1
(if (<= y 1.46e-202)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 190000.0) (/ (- (* a (+ y t)) (* 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.3e-149) {
tmp = t_1;
} else if (y <= 1.46e-202) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 190000.0) {
tmp = ((a * (y + t)) - (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.3d-149)) then
tmp = t_1
else if (y <= 1.46d-202) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 190000.0d0) then
tmp = ((a * (y + t)) - (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.3e-149) {
tmp = t_1;
} else if (y <= 1.46e-202) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 190000.0) {
tmp = ((a * (y + t)) - (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.3e-149: tmp = t_1 elif y <= 1.46e-202: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 190000.0: tmp = ((a * (y + t)) - (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.3e-149) tmp = t_1; elseif (y <= 1.46e-202) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 190000.0) tmp = Float64(Float64(Float64(a * Float64(y + t)) - 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.3e-149) tmp = t_1; elseif (y <= 1.46e-202) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 190000.0) tmp = ((a * (y + t)) - (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.3e-149], t$95$1, If[LessEqual[y, 1.46e-202], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 190000.0], N[(N[(N[(a * N[(y + t), $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.3 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.46 \cdot 10^{-202}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 190000:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.29999999999999999e-149 or 1.9e5 < y Initial program 48.5%
Taylor expanded in y around inf 67.8%
if -1.29999999999999999e-149 < y < 1.45999999999999996e-202Initial program 79.8%
Taylor expanded in y around 0 70.9%
if 1.45999999999999996e-202 < y < 1.9e5Initial program 81.8%
Taylor expanded in z around 0 57.7%
+-commutative57.7%
*-commutative57.7%
Simplified57.7%
Final simplification67.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))) (t_2 (* a (/ (+ y t) t_1))))
(if (<= a -8.2e+133)
t_2
(if (<= a -7.5e-289)
(- (+ z a) b)
(if (<= a 1.8e+61) (* z (/ (+ x y) t_1)) 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 <= -8.2e+133) {
tmp = t_2;
} else if (a <= -7.5e-289) {
tmp = (z + a) - b;
} else if (a <= 1.8e+61) {
tmp = z * ((x + y) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y + t)
t_2 = a * ((y + t) / t_1)
if (a <= (-8.2d+133)) then
tmp = t_2
else if (a <= (-7.5d-289)) then
tmp = (z + a) - b
else if (a <= 1.8d+61) then
tmp = z * ((x + y) / 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 = x + (y + t);
double t_2 = a * ((y + t) / t_1);
double tmp;
if (a <= -8.2e+133) {
tmp = t_2;
} else if (a <= -7.5e-289) {
tmp = (z + a) - b;
} else if (a <= 1.8e+61) {
tmp = z * ((x + y) / t_1);
} 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 <= -8.2e+133: tmp = t_2 elif a <= -7.5e-289: tmp = (z + a) - b elif a <= 1.8e+61: tmp = z * ((x + y) / t_1) 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 <= -8.2e+133) tmp = t_2; elseif (a <= -7.5e-289) tmp = Float64(Float64(z + a) - b); elseif (a <= 1.8e+61) tmp = Float64(z * Float64(Float64(x + y) / t_1)); 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 <= -8.2e+133) tmp = t_2; elseif (a <= -7.5e-289) tmp = (z + a) - b; elseif (a <= 1.8e+61) tmp = z * ((x + y) / t_1); 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, -8.2e+133], t$95$2, If[LessEqual[a, -7.5e-289], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[a, 1.8e+61], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $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 -8.2 \cdot 10^{+133}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-289}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+61}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -8.20000000000000008e133 or 1.80000000000000005e61 < a Initial program 50.9%
Taylor expanded in a around inf 39.4%
associate-/l*77.6%
+-commutative77.6%
+-commutative77.6%
associate-+r+77.6%
Simplified77.6%
if -8.20000000000000008e133 < a < -7.49999999999999998e-289Initial program 61.0%
Taylor expanded in y around inf 54.8%
if -7.49999999999999998e-289 < a < 1.80000000000000005e61Initial program 70.3%
Taylor expanded in z around inf 44.2%
associate-/l*65.7%
+-commutative65.7%
+-commutative65.7%
associate-+r+65.7%
Simplified65.7%
Final simplification65.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5e-146) (not (<= y 1.02e-24))) (- (+ z a) b) (/ (+ (* t a) (* x z)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -5e-146) || !(y <= 1.02e-24)) {
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) :: tmp
if ((y <= (-5d-146)) .or. (.not. (y <= 1.02d-24))) 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 tmp;
if ((y <= -5e-146) || !(y <= 1.02e-24)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -5e-146) or not (y <= 1.02e-24): tmp = (z + a) - b else: tmp = ((t * a) + (x * z)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -5e-146) || !(y <= 1.02e-24)) 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) tmp = 0.0; if ((y <= -5e-146) || ~((y <= 1.02e-24))) tmp = (z + a) - b; else tmp = ((t * a) + (x * z)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5e-146], N[Not[LessEqual[y, 1.02e-24]], $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}
\mathbf{if}\;y \leq -5 \cdot 10^{-146} \lor \neg \left(y \leq 1.02 \cdot 10^{-24}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\end{array}
\end{array}
if y < -4.99999999999999957e-146 or 1.0200000000000001e-24 < y Initial program 48.8%
Taylor expanded in y around inf 67.4%
if -4.99999999999999957e-146 < y < 1.0200000000000001e-24Initial program 80.4%
Taylor expanded in y around 0 59.9%
Final simplification64.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.2e+134) (not (<= a 5.5e+75))) (* a (/ (+ y t) (+ x (+ y t)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.2e+134) || !(a <= 5.5e+75)) {
tmp = a * ((y + t) / (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 ((a <= (-1.2d+134)) .or. (.not. (a <= 5.5d+75))) then
tmp = a * ((y + t) / (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 ((a <= -1.2e+134) || !(a <= 5.5e+75)) {
tmp = a * ((y + t) / (x + (y + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.2e+134) or not (a <= 5.5e+75): tmp = a * ((y + t) / (x + (y + t))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.2e+134) || !(a <= 5.5e+75)) tmp = Float64(a * Float64(Float64(y + t) / Float64(x + Float64(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 ((a <= -1.2e+134) || ~((a <= 5.5e+75))) tmp = a * ((y + t) / (x + (y + t))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.2e+134], N[Not[LessEqual[a, 5.5e+75]], $MachinePrecision]], N[(a * N[(N[(y + t), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+134} \lor \neg \left(a \leq 5.5 \cdot 10^{+75}\right):\\
\;\;\;\;a \cdot \frac{y + t}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if a < -1.20000000000000003e134 or 5.5000000000000001e75 < a Initial program 50.3%
Taylor expanded in a around inf 40.8%
associate-/l*79.2%
+-commutative79.2%
+-commutative79.2%
associate-+r+79.2%
Simplified79.2%
if -1.20000000000000003e134 < a < 5.5000000000000001e75Initial program 65.4%
Taylor expanded in y around inf 54.0%
Final simplification61.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.85e-142)
t_1
(if (<= y -2.05e-266)
(* x (/ z (+ x t)))
(if (<= y 5.7e+71) (+ z a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.85e-142) {
tmp = t_1;
} else if (y <= -2.05e-266) {
tmp = x * (z / (x + t));
} else if (y <= 5.7e+71) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-1.85d-142)) then
tmp = t_1
else if (y <= (-2.05d-266)) then
tmp = x * (z / (x + t))
else if (y <= 5.7d+71) then
tmp = z + a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.85e-142) {
tmp = t_1;
} else if (y <= -2.05e-266) {
tmp = x * (z / (x + t));
} else if (y <= 5.7e+71) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.85e-142: tmp = t_1 elif y <= -2.05e-266: tmp = x * (z / (x + t)) elif y <= 5.7e+71: tmp = z + a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.85e-142) tmp = t_1; elseif (y <= -2.05e-266) tmp = Float64(x * Float64(z / Float64(x + t))); elseif (y <= 5.7e+71) tmp = Float64(z + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.85e-142) tmp = t_1; elseif (y <= -2.05e-266) tmp = x * (z / (x + t)); elseif (y <= 5.7e+71) tmp = z + a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.85e-142], t$95$1, If[LessEqual[y, -2.05e-266], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.7e+71], N[(z + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{-142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-266}:\\
\;\;\;\;x \cdot \frac{z}{x + t}\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{+71}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.84999999999999993e-142 or 5.7000000000000001e71 < y Initial program 46.0%
Taylor expanded in y around inf 68.3%
if -1.84999999999999993e-142 < y < -2.0500000000000001e-266Initial program 80.5%
Taylor expanded in z around inf 53.7%
+-commutative53.7%
+-commutative53.7%
associate-+r+53.7%
Simplified53.7%
Taylor expanded in y around 0 50.8%
associate-/l*56.1%
Simplified56.1%
if -2.0500000000000001e-266 < y < 5.7000000000000001e71Initial program 78.6%
Taylor expanded in y around inf 41.1%
Taylor expanded in b around 0 52.3%
+-commutative52.3%
Simplified52.3%
Final simplification61.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.9e-133)
t_1
(if (<= y -2.2e-261) z (if (<= y 5.5e+71) (+ z a) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.9e-133) {
tmp = t_1;
} else if (y <= -2.2e-261) {
tmp = z;
} else if (y <= 5.5e+71) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-1.9d-133)) then
tmp = t_1
else if (y <= (-2.2d-261)) then
tmp = z
else if (y <= 5.5d+71) then
tmp = z + a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.9e-133) {
tmp = t_1;
} else if (y <= -2.2e-261) {
tmp = z;
} else if (y <= 5.5e+71) {
tmp = z + a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.9e-133: tmp = t_1 elif y <= -2.2e-261: tmp = z elif y <= 5.5e+71: tmp = z + a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.9e-133) tmp = t_1; elseif (y <= -2.2e-261) tmp = z; elseif (y <= 5.5e+71) tmp = Float64(z + a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.9e-133) tmp = t_1; elseif (y <= -2.2e-261) tmp = z; elseif (y <= 5.5e+71) tmp = z + a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.9e-133], t$95$1, If[LessEqual[y, -2.2e-261], z, If[LessEqual[y, 5.5e+71], N[(z + a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{-133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-261}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+71}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.9000000000000002e-133 or 5.5e71 < y Initial program 46.0%
Taylor expanded in y around inf 68.3%
if -1.9000000000000002e-133 < y < -2.2000000000000002e-261Initial program 82.4%
Taylor expanded in x around inf 51.7%
if -2.2000000000000002e-261 < y < 5.5e71Initial program 77.9%
Taylor expanded in y around inf 41.3%
Taylor expanded in b around 0 52.4%
+-commutative52.4%
Simplified52.4%
Final simplification61.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.1e+136) (not (<= b 8.5e+192))) (- a b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.1e+136) || !(b <= 8.5e+192)) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-3.1d+136)) .or. (.not. (b <= 8.5d+192))) then
tmp = a - b
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.1e+136) || !(b <= 8.5e+192)) {
tmp = a - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.1e+136) or not (b <= 8.5e+192): tmp = a - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.1e+136) || !(b <= 8.5e+192)) tmp = Float64(a - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.1e+136) || ~((b <= 8.5e+192))) tmp = a - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.1e+136], N[Not[LessEqual[b, 8.5e+192]], $MachinePrecision]], N[(a - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.1 \cdot 10^{+136} \lor \neg \left(b \leq 8.5 \cdot 10^{+192}\right):\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if b < -3.09999999999999983e136 or 8.49999999999999965e192 < b Initial program 46.3%
Taylor expanded in y around inf 46.3%
Taylor expanded in z around 0 42.0%
if -3.09999999999999983e136 < b < 8.49999999999999965e192Initial program 65.1%
Taylor expanded in y around inf 56.6%
Taylor expanded in b around 0 58.1%
+-commutative58.1%
Simplified58.1%
Final simplification54.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.9e+136) (- a b) (if (<= b 9.5e+202) (+ z a) (- z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.9e+136) {
tmp = a - b;
} else if (b <= 9.5e+202) {
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 (b <= (-1.9d+136)) then
tmp = a - b
else if (b <= 9.5d+202) 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 (b <= -1.9e+136) {
tmp = a - b;
} else if (b <= 9.5e+202) {
tmp = z + a;
} else {
tmp = z - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.9e+136: tmp = a - b elif b <= 9.5e+202: tmp = z + a else: tmp = z - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.9e+136) tmp = Float64(a - b); elseif (b <= 9.5e+202) 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 (b <= -1.9e+136) tmp = a - b; elseif (b <= 9.5e+202) tmp = z + a; else tmp = z - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.9e+136], N[(a - b), $MachinePrecision], If[LessEqual[b, 9.5e+202], N[(z + a), $MachinePrecision], N[(z - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{+136}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{+202}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;z - b\\
\end{array}
\end{array}
if b < -1.90000000000000007e136Initial program 48.9%
Taylor expanded in y around inf 47.8%
Taylor expanded in z around 0 44.8%
if -1.90000000000000007e136 < b < 9.50000000000000059e202Initial program 64.8%
Taylor expanded in y around inf 56.8%
Taylor expanded in b around 0 58.1%
+-commutative58.1%
Simplified58.1%
if 9.50000000000000059e202 < b Initial program 44.6%
Taylor expanded in y around inf 41.9%
Taylor expanded in a around 0 42.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.6e+64) a (if (<= a 8.2e+42) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.6e+64) {
tmp = a;
} else if (a <= 8.2e+42) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-5.6d+64)) then
tmp = a
else if (a <= 8.2d+42) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.6e+64) {
tmp = a;
} else if (a <= 8.2e+42) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.6e+64: tmp = a elif a <= 8.2e+42: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.6e+64) tmp = a; elseif (a <= 8.2e+42) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.6e+64) tmp = a; elseif (a <= 8.2e+42) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.6e+64], a, If[LessEqual[a, 8.2e+42], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{+64}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+42}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -5.60000000000000047e64 or 8.2000000000000001e42 < a Initial program 44.7%
Taylor expanded in t around inf 51.3%
if -5.60000000000000047e64 < a < 8.2000000000000001e42Initial program 71.8%
Taylor expanded in x around inf 44.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b 1.1e+210) (+ z a) (- b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 1.1e+210) {
tmp = z + a;
} else {
tmp = -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 <= 1.1d+210) then
tmp = z + a
else
tmp = -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 <= 1.1e+210) {
tmp = z + a;
} else {
tmp = -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 1.1e+210: tmp = z + a else: tmp = -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 1.1e+210) tmp = Float64(z + a); else tmp = Float64(-b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 1.1e+210) tmp = z + a; else tmp = -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 1.1e+210], N[(z + a), $MachinePrecision], (-b)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{+210}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;-b\\
\end{array}
\end{array}
if b < 1.09999999999999993e210Initial program 62.4%
Taylor expanded in y around inf 55.5%
Taylor expanded in b around 0 53.7%
+-commutative53.7%
Simplified53.7%
if 1.09999999999999993e210 < b Initial program 44.6%
Taylor expanded in y around inf 41.9%
Taylor expanded in b around inf 35.6%
mul-1-neg35.6%
Simplified35.6%
(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 60.8%
Taylor expanded in t around inf 29.3%
(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 2024163
(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)))