
(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 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* (+ y t) a) (* (+ x y) z)) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 -2e+302) (not (<= t_1 1e+268))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -2e+302) || !(t_1 <= 1e+268)) {
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 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t))
if ((t_1 <= (-2d+302)) .or. (.not. (t_1 <= 1d+268))) 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 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -2e+302) || !(t_1 <= 1e+268)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -2e+302) or not (t_1 <= 1e+268): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= -2e+302) || !(t_1 <= 1e+268)) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -2e+302) || ~((t_1 <= 1e+268))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+302], N[Not[LessEqual[t$95$1, 1e+268]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(y + t\right) \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+302} \lor \neg \left(t\_1 \leq 10^{+268}\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)) < -2.0000000000000002e302 or 9.9999999999999997e267 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 9.5%
Taylor expanded in y around inf 77.4%
if -2.0000000000000002e302 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999997e267Initial program 99.7%
Final simplification90.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- a (* y (/ b (+ x (+ y t))))))
(t_2 (+ (+ x y) t))
(t_3 (* z (/ (+ x y) t_2))))
(if (<= z -7.2e+141)
t_3
(if (<= z -1.86e+87)
t_1
(if (<= z -1.5e+73)
t_3
(if (<= z -1.4e-131)
(* a (/ (+ y t) t_2))
(if (<= z 1.9e+106) t_1 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a - (y * (b / (x + (y + t))));
double t_2 = (x + y) + t;
double t_3 = z * ((x + y) / t_2);
double tmp;
if (z <= -7.2e+141) {
tmp = t_3;
} else if (z <= -1.86e+87) {
tmp = t_1;
} else if (z <= -1.5e+73) {
tmp = t_3;
} else if (z <= -1.4e-131) {
tmp = a * ((y + t) / t_2);
} else if (z <= 1.9e+106) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a - (y * (b / (x + (y + t))))
t_2 = (x + y) + t
t_3 = z * ((x + y) / t_2)
if (z <= (-7.2d+141)) then
tmp = t_3
else if (z <= (-1.86d+87)) then
tmp = t_1
else if (z <= (-1.5d+73)) then
tmp = t_3
else if (z <= (-1.4d-131)) then
tmp = a * ((y + t) / t_2)
else if (z <= 1.9d+106) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a - (y * (b / (x + (y + t))));
double t_2 = (x + y) + t;
double t_3 = z * ((x + y) / t_2);
double tmp;
if (z <= -7.2e+141) {
tmp = t_3;
} else if (z <= -1.86e+87) {
tmp = t_1;
} else if (z <= -1.5e+73) {
tmp = t_3;
} else if (z <= -1.4e-131) {
tmp = a * ((y + t) / t_2);
} else if (z <= 1.9e+106) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a - (y * (b / (x + (y + t)))) t_2 = (x + y) + t t_3 = z * ((x + y) / t_2) tmp = 0 if z <= -7.2e+141: tmp = t_3 elif z <= -1.86e+87: tmp = t_1 elif z <= -1.5e+73: tmp = t_3 elif z <= -1.4e-131: tmp = a * ((y + t) / t_2) elif z <= 1.9e+106: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a - Float64(y * Float64(b / Float64(x + Float64(y + t))))) t_2 = Float64(Float64(x + y) + t) t_3 = Float64(z * Float64(Float64(x + y) / t_2)) tmp = 0.0 if (z <= -7.2e+141) tmp = t_3; elseif (z <= -1.86e+87) tmp = t_1; elseif (z <= -1.5e+73) tmp = t_3; elseif (z <= -1.4e-131) tmp = Float64(a * Float64(Float64(y + t) / t_2)); elseif (z <= 1.9e+106) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a - (y * (b / (x + (y + t)))); t_2 = (x + y) + t; t_3 = z * ((x + y) / t_2); tmp = 0.0; if (z <= -7.2e+141) tmp = t_3; elseif (z <= -1.86e+87) tmp = t_1; elseif (z <= -1.5e+73) tmp = t_3; elseif (z <= -1.4e-131) tmp = a * ((y + t) / t_2); elseif (z <= 1.9e+106) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a - N[(y * N[(b / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+141], t$95$3, If[LessEqual[z, -1.86e+87], t$95$1, If[LessEqual[z, -1.5e+73], t$95$3, If[LessEqual[z, -1.4e-131], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+106], t$95$1, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a - y \cdot \frac{b}{x + \left(y + t\right)}\\
t_2 := \left(x + y\right) + t\\
t_3 := z \cdot \frac{x + y}{t\_2}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+141}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.86 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{+73}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-131}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_2}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -7.2000000000000003e141 or -1.86000000000000011e87 < z < -1.50000000000000005e73 or 1.8999999999999999e106 < z Initial program 38.6%
Taylor expanded in z around inf 34.6%
associate-/l*83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
if -7.2000000000000003e141 < z < -1.86000000000000011e87 or -1.4e-131 < z < 1.8999999999999999e106Initial program 73.9%
div-sub73.9%
+-commutative73.9%
*-commutative73.9%
associate-+l+73.9%
+-commutative73.9%
associate-+l+73.9%
+-commutative73.9%
associate-/l*77.5%
Applied egg-rr77.5%
Taylor expanded in t around inf 66.1%
if -1.50000000000000005e73 < z < -1.4e-131Initial program 77.3%
Taylor expanded in a around inf 52.0%
associate-+l+52.0%
+-commutative52.0%
associate-+r+52.0%
associate-*r/68.1%
*-commutative68.1%
Applied egg-rr68.1%
Final simplification72.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- a (* y (/ b (+ x (+ y t))))))
(t_2 (* z (/ (+ x y) (+ (+ x y) t)))))
(if (<= z -2.4e+142)
t_2
(if (<= z -1.16e+40)
t_1
(if (<= z -4.8e-67)
(/ (- (+ (* y a) (* (+ x y) z)) (* y b)) (+ x y))
(if (<= z 1.7e+106) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a - (y * (b / (x + (y + t))));
double t_2 = z * ((x + y) / ((x + y) + t));
double tmp;
if (z <= -2.4e+142) {
tmp = t_2;
} else if (z <= -1.16e+40) {
tmp = t_1;
} else if (z <= -4.8e-67) {
tmp = (((y * a) + ((x + y) * z)) - (y * b)) / (x + y);
} else if (z <= 1.7e+106) {
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 = a - (y * (b / (x + (y + t))))
t_2 = z * ((x + y) / ((x + y) + t))
if (z <= (-2.4d+142)) then
tmp = t_2
else if (z <= (-1.16d+40)) then
tmp = t_1
else if (z <= (-4.8d-67)) then
tmp = (((y * a) + ((x + y) * z)) - (y * b)) / (x + y)
else if (z <= 1.7d+106) 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 = a - (y * (b / (x + (y + t))));
double t_2 = z * ((x + y) / ((x + y) + t));
double tmp;
if (z <= -2.4e+142) {
tmp = t_2;
} else if (z <= -1.16e+40) {
tmp = t_1;
} else if (z <= -4.8e-67) {
tmp = (((y * a) + ((x + y) * z)) - (y * b)) / (x + y);
} else if (z <= 1.7e+106) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a - (y * (b / (x + (y + t)))) t_2 = z * ((x + y) / ((x + y) + t)) tmp = 0 if z <= -2.4e+142: tmp = t_2 elif z <= -1.16e+40: tmp = t_1 elif z <= -4.8e-67: tmp = (((y * a) + ((x + y) * z)) - (y * b)) / (x + y) elif z <= 1.7e+106: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a - Float64(y * Float64(b / Float64(x + Float64(y + t))))) t_2 = Float64(z * Float64(Float64(x + y) / Float64(Float64(x + y) + t))) tmp = 0.0 if (z <= -2.4e+142) tmp = t_2; elseif (z <= -1.16e+40) tmp = t_1; elseif (z <= -4.8e-67) tmp = Float64(Float64(Float64(Float64(y * a) + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(x + y)); elseif (z <= 1.7e+106) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a - (y * (b / (x + (y + t)))); t_2 = z * ((x + y) / ((x + y) + t)); tmp = 0.0; if (z <= -2.4e+142) tmp = t_2; elseif (z <= -1.16e+40) tmp = t_1; elseif (z <= -4.8e-67) tmp = (((y * a) + ((x + y) * z)) - (y * b)) / (x + y); elseif (z <= 1.7e+106) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a - N[(y * N[(b / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x + y), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+142], t$95$2, If[LessEqual[z, -1.16e+40], t$95$1, If[LessEqual[z, -4.8e-67], N[(N[(N[(N[(y * a), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+106], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a - y \cdot \frac{b}{x + \left(y + t\right)}\\
t_2 := z \cdot \frac{x + y}{\left(x + y\right) + t}\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-67}:\\
\;\;\;\;\frac{\left(y \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{x + y}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.3999999999999999e142 or 1.69999999999999997e106 < z Initial program 37.5%
Taylor expanded in z around inf 33.3%
associate-/l*83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
if -2.3999999999999999e142 < z < -1.16000000000000012e40 or -4.8e-67 < z < 1.69999999999999997e106Initial program 72.8%
div-sub72.8%
+-commutative72.8%
*-commutative72.8%
associate-+l+72.8%
+-commutative72.8%
associate-+l+72.8%
+-commutative72.8%
associate-/l*75.9%
Applied egg-rr75.9%
Taylor expanded in t around inf 66.2%
if -1.16000000000000012e40 < z < -4.8e-67Initial program 89.3%
Taylor expanded in t around 0 71.6%
Final simplification71.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t)))
(if (or (<= z -1.2e+142) (not (<= z 1.2e+106)))
(* z (/ (+ x y) t_1))
(- (* a (/ (+ y t) t_1)) (* y (/ b (+ x (+ y t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double tmp;
if ((z <= -1.2e+142) || !(z <= 1.2e+106)) {
tmp = z * ((x + y) / t_1);
} else {
tmp = (a * ((y + t) / t_1)) - (y * (b / (x + (y + 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) + t
if ((z <= (-1.2d+142)) .or. (.not. (z <= 1.2d+106))) then
tmp = z * ((x + y) / t_1)
else
tmp = (a * ((y + t) / t_1)) - (y * (b / (x + (y + 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) + t;
double tmp;
if ((z <= -1.2e+142) || !(z <= 1.2e+106)) {
tmp = z * ((x + y) / t_1);
} else {
tmp = (a * ((y + t) / t_1)) - (y * (b / (x + (y + t))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + t tmp = 0 if (z <= -1.2e+142) or not (z <= 1.2e+106): tmp = z * ((x + y) / t_1) else: tmp = (a * ((y + t) / t_1)) - (y * (b / (x + (y + t)))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) tmp = 0.0 if ((z <= -1.2e+142) || !(z <= 1.2e+106)) tmp = Float64(z * Float64(Float64(x + y) / t_1)); else tmp = Float64(Float64(a * Float64(Float64(y + t) / t_1)) - Float64(y * Float64(b / Float64(x + Float64(y + t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) + t; tmp = 0.0; if ((z <= -1.2e+142) || ~((z <= 1.2e+106))) tmp = z * ((x + y) / t_1); else tmp = (a * ((y + t) / t_1)) - (y * (b / (x + (y + t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, If[Or[LessEqual[z, -1.2e+142], N[Not[LessEqual[z, 1.2e+106]], $MachinePrecision]], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+142} \lor \neg \left(z \leq 1.2 \cdot 10^{+106}\right):\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1} - y \cdot \frac{b}{x + \left(y + t\right)}\\
\end{array}
\end{array}
if z < -1.2e142 or 1.2e106 < z Initial program 37.5%
Taylor expanded in z around inf 33.3%
associate-/l*83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
if -1.2e142 < z < 1.2e106Initial program 74.5%
div-sub74.5%
+-commutative74.5%
*-commutative74.5%
associate-+l+74.5%
+-commutative74.5%
associate-+l+74.5%
+-commutative74.5%
associate-/l*77.3%
Applied egg-rr77.3%
Taylor expanded in z around 0 61.3%
associate-/l*76.3%
+-commutative76.3%
Simplified76.3%
Final simplification78.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.1e-66)
t_1
(if (<= y -6.2e-108)
(* z (/ (+ x y) (+ (+ x y) t)))
(if (<= y 4.5e-88) (* a (/ 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 <= -2.1e-66) {
tmp = t_1;
} else if (y <= -6.2e-108) {
tmp = z * ((x + y) / ((x + y) + t));
} else if (y <= 4.5e-88) {
tmp = a * (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 <= (-2.1d-66)) then
tmp = t_1
else if (y <= (-6.2d-108)) then
tmp = z * ((x + y) / ((x + y) + t))
else if (y <= 4.5d-88) then
tmp = a * (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 <= -2.1e-66) {
tmp = t_1;
} else if (y <= -6.2e-108) {
tmp = z * ((x + y) / ((x + y) + t));
} else if (y <= 4.5e-88) {
tmp = a * (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 <= -2.1e-66: tmp = t_1 elif y <= -6.2e-108: tmp = z * ((x + y) / ((x + y) + t)) elif y <= 4.5e-88: tmp = a * (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 <= -2.1e-66) tmp = t_1; elseif (y <= -6.2e-108) tmp = Float64(z * Float64(Float64(x + y) / Float64(Float64(x + y) + t))); elseif (y <= 4.5e-88) tmp = Float64(a * 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 <= -2.1e-66) tmp = t_1; elseif (y <= -6.2e-108) tmp = z * ((x + y) / ((x + y) + t)); elseif (y <= 4.5e-88) tmp = a * (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, -2.1e-66], t$95$1, If[LessEqual[y, -6.2e-108], N[(z * N[(N[(x + y), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-88], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-108}:\\
\;\;\;\;z \cdot \frac{x + y}{\left(x + y\right) + t}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-88}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.1e-66 or 4.49999999999999991e-88 < y Initial program 50.8%
Taylor expanded in y around inf 70.5%
if -2.1e-66 < y < -6.20000000000000028e-108Initial program 67.2%
Taylor expanded in z around inf 57.1%
associate-/l*89.1%
+-commutative89.1%
+-commutative89.1%
Simplified89.1%
if -6.20000000000000028e-108 < y < 4.49999999999999991e-88Initial program 86.6%
Taylor expanded in t around inf 58.6%
Taylor expanded in a around inf 50.7%
associate-/l*56.4%
Simplified56.4%
Taylor expanded in y around 0 56.4%
Final simplification66.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t)))
(if (or (<= z -2.7e+73) (not (<= z 1.8e+56)))
(* z (/ (+ x y) t_1))
(* a (/ (+ y t) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double tmp;
if ((z <= -2.7e+73) || !(z <= 1.8e+56)) {
tmp = z * ((x + y) / t_1);
} else {
tmp = a * ((y + 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 = (x + y) + t
if ((z <= (-2.7d+73)) .or. (.not. (z <= 1.8d+56))) then
tmp = z * ((x + y) / t_1)
else
tmp = a * ((y + 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 = (x + y) + t;
double tmp;
if ((z <= -2.7e+73) || !(z <= 1.8e+56)) {
tmp = z * ((x + y) / t_1);
} else {
tmp = a * ((y + t) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + t tmp = 0 if (z <= -2.7e+73) or not (z <= 1.8e+56): tmp = z * ((x + y) / t_1) else: tmp = a * ((y + t) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) tmp = 0.0 if ((z <= -2.7e+73) || !(z <= 1.8e+56)) tmp = Float64(z * Float64(Float64(x + y) / t_1)); else tmp = Float64(a * Float64(Float64(y + t) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) + t; tmp = 0.0; if ((z <= -2.7e+73) || ~((z <= 1.8e+56))) tmp = z * ((x + y) / t_1); else tmp = a * ((y + t) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, If[Or[LessEqual[z, -2.7e+73], N[Not[LessEqual[z, 1.8e+56]], $MachinePrecision]], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+73} \lor \neg \left(z \leq 1.8 \cdot 10^{+56}\right):\\
\;\;\;\;z \cdot \frac{x + y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\
\end{array}
\end{array}
if z < -2.6999999999999999e73 or 1.79999999999999999e56 < z Initial program 45.1%
Taylor expanded in z around inf 34.1%
associate-/l*73.8%
+-commutative73.8%
+-commutative73.8%
Simplified73.8%
if -2.6999999999999999e73 < z < 1.79999999999999999e56Initial program 75.8%
Taylor expanded in a around inf 47.7%
associate-+l+47.7%
+-commutative47.7%
associate-+r+47.7%
associate-*r/61.0%
*-commutative61.0%
Applied egg-rr61.0%
Final simplification66.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.15e+168) (not (<= t 1.5e+81))) (* a (/ t (+ x t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.15e+168) || !(t <= 1.5e+81)) {
tmp = a * (t / (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.15d+168)) .or. (.not. (t <= 1.5d+81))) then
tmp = a * (t / (x + t))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.15e+168) || !(t <= 1.5e+81)) {
tmp = a * (t / (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.15e+168) or not (t <= 1.5e+81): tmp = a * (t / (x + t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.15e+168) || !(t <= 1.5e+81)) tmp = Float64(a * Float64(t / Float64(x + t))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.15e+168) || ~((t <= 1.5e+81))) tmp = a * (t / (x + t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.15e+168], N[Not[LessEqual[t, 1.5e+81]], $MachinePrecision]], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+168} \lor \neg \left(t \leq 1.5 \cdot 10^{+81}\right):\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -1.15e168 or 1.49999999999999999e81 < t Initial program 52.1%
Taylor expanded in t around inf 45.4%
Taylor expanded in a around inf 37.1%
associate-/l*58.1%
Simplified58.1%
Taylor expanded in y around 0 62.6%
if -1.15e168 < t < 1.49999999999999999e81Initial program 67.4%
Taylor expanded in y around inf 61.8%
Final simplification62.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.4e+112) (- a (/ (* y b) (+ y t))) (if (<= t 8.6e+81) (- (+ z a) b) (* a (/ t (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.4e+112) {
tmp = a - ((y * b) / (y + t));
} else if (t <= 8.6e+81) {
tmp = (z + a) - b;
} else {
tmp = a * (t / (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 (t <= (-1.4d+112)) then
tmp = a - ((y * b) / (y + t))
else if (t <= 8.6d+81) then
tmp = (z + a) - b
else
tmp = a * (t / (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 (t <= -1.4e+112) {
tmp = a - ((y * b) / (y + t));
} else if (t <= 8.6e+81) {
tmp = (z + a) - b;
} else {
tmp = a * (t / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.4e+112: tmp = a - ((y * b) / (y + t)) elif t <= 8.6e+81: tmp = (z + a) - b else: tmp = a * (t / (x + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.4e+112) tmp = Float64(a - Float64(Float64(y * b) / Float64(y + t))); elseif (t <= 8.6e+81) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(t / Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.4e+112) tmp = a - ((y * b) / (y + t)); elseif (t <= 8.6e+81) tmp = (z + a) - b; else tmp = a * (t / (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.4e+112], N[(a - N[(N[(y * b), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e+81], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+112}:\\
\;\;\;\;a - \frac{y \cdot b}{y + t}\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{+81}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\end{array}
\end{array}
if t < -1.4000000000000001e112Initial program 56.9%
div-sub56.9%
+-commutative56.9%
*-commutative56.9%
associate-+l+56.9%
+-commutative56.9%
associate-+l+56.9%
+-commutative56.9%
associate-/l*67.2%
Applied egg-rr67.2%
Taylor expanded in z around 0 61.6%
associate-/l*76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in x around 0 56.6%
*-commutative56.6%
Simplified56.6%
if -1.4000000000000001e112 < t < 8.6000000000000003e81Initial program 67.5%
Taylor expanded in y around inf 62.2%
if 8.6000000000000003e81 < t Initial program 51.2%
Taylor expanded in t around inf 40.6%
Taylor expanded in a around inf 34.0%
associate-/l*61.3%
Simplified61.3%
Taylor expanded in y around 0 66.3%
Final simplification62.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.2e+167) a (if (<= t 1.02e+147) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e+167) {
tmp = a;
} else if (t <= 1.02e+147) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-3.2d+167)) then
tmp = a
else if (t <= 1.02d+147) then
tmp = (z + a) - b
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e+167) {
tmp = a;
} else if (t <= 1.02e+147) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.2e+167: tmp = a elif t <= 1.02e+147: tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.2e+167) tmp = a; elseif (t <= 1.02e+147) tmp = Float64(Float64(z + a) - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.2e+167) tmp = a; elseif (t <= 1.02e+147) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.2e+167], a, If[LessEqual[t, 1.02e+147], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+167}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+147}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -3.19999999999999981e167 or 1.0199999999999999e147 < t Initial program 51.3%
Taylor expanded in t around inf 60.5%
if -3.19999999999999981e167 < t < 1.0199999999999999e147Initial program 66.6%
Taylor expanded in y around inf 60.8%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.95e+68) z (if (<= z 7e+56) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.95e+68) {
tmp = z;
} else if (z <= 7e+56) {
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 (z <= (-1.95d+68)) then
tmp = z
else if (z <= 7d+56) 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 (z <= -1.95e+68) {
tmp = z;
} else if (z <= 7e+56) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.95e+68: tmp = z elif z <= 7e+56: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.95e+68) tmp = z; elseif (z <= 7e+56) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.95e+68) tmp = z; elseif (z <= 7e+56) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.95e+68], z, If[LessEqual[z, 7e+56], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+68}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+56}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.95000000000000009e68 or 6.99999999999999999e56 < z Initial program 44.3%
Taylor expanded in x around inf 56.2%
if -1.95000000000000009e68 < z < 6.99999999999999999e56Initial program 76.8%
Taylor expanded in t around inf 47.2%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 63.1%
Taylor expanded in t around inf 33.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 2024097
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))