
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t))
(t_2 (* (+ y t) a))
(t_3 (/ (- (+ t_2 (* (+ x y) z)) (* y b)) (+ y (+ x t)))))
(if (<= t_3 -5e+281)
(- (+ z a) b)
(if (<= t_3 5e+292)
(/ (- (fma (+ x y) z t_2) (* y b)) (+ x (+ y t)))
(* a (+ (/ t t_1) (fma z (/ (/ (+ x y) a) t_1) (/ y t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double t_2 = (y + t) * a;
double t_3 = ((t_2 + ((x + y) * z)) - (y * b)) / (y + (x + t));
double tmp;
if (t_3 <= -5e+281) {
tmp = (z + a) - b;
} else if (t_3 <= 5e+292) {
tmp = (fma((x + y), z, t_2) - (y * b)) / (x + (y + t));
} else {
tmp = a * ((t / t_1) + fma(z, (((x + y) / a) / t_1), (y / t_1)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) t_2 = Float64(Float64(y + t) * a) t_3 = Float64(Float64(Float64(t_2 + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if (t_3 <= -5e+281) tmp = Float64(Float64(z + a) - b); elseif (t_3 <= 5e+292) tmp = Float64(Float64(fma(Float64(x + y), z, t_2) - Float64(y * b)) / Float64(x + Float64(y + t))); else tmp = Float64(a * Float64(Float64(t / t_1) + fma(z, Float64(Float64(Float64(x + y) / a) / t_1), Float64(y / t_1)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e+281], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$3, 5e+292], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$2), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(z * N[(N[(N[(x + y), $MachinePrecision] / a), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := \left(y + t\right) \cdot a\\
t_3 := \frac{\left(t\_2 + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{+281}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_2\right) - y \cdot b}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_1} + \mathsf{fma}\left(z, \frac{\frac{x + y}{a}}{t\_1}, \frac{y}{t\_1}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.00000000000000016e281Initial program 10.0%
Taylor expanded in y around inf 63.9%
if -5.00000000000000016e281 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.9999999999999996e292Initial program 99.8%
fma-define99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Simplified99.8%
if 4.9999999999999996e292 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 4.3%
Taylor expanded in a around inf 33.3%
associate--l+33.3%
associate-+r+33.3%
+-commutative33.3%
associate-/l*50.5%
fma-define50.5%
+-commutative50.5%
associate-+r+50.5%
associate-+r+50.5%
Simplified61.9%
Taylor expanded in b around 0 35.5%
+-commutative35.5%
associate-/l*54.3%
associate-/r*68.7%
+-commutative68.7%
associate-+r+68.7%
+-commutative68.7%
+-commutative68.7%
fma-undefine68.7%
+-commutative68.7%
+-commutative68.7%
+-commutative68.7%
associate-+r+68.7%
Simplified68.7%
Final simplification87.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ y t) a))
(t_2 (/ (- (+ t_1 (* (+ x y) z)) (* y b)) (+ y (+ x t)))))
(if (or (<= t_2 -5e+281) (not (<= t_2 1e+277)))
(- (+ z a) b)
(/ (- (fma (+ x y) z t_1) (* y b)) (+ x (+ y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) * a;
double t_2 = ((t_1 + ((x + y) * z)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_2 <= -5e+281) || !(t_2 <= 1e+277)) {
tmp = (z + a) - b;
} else {
tmp = (fma((x + y), z, t_1) - (y * b)) / (x + (y + t));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) * a) t_2 = Float64(Float64(Float64(t_1 + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_2 <= -5e+281) || !(t_2 <= 1e+277)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(fma(Float64(x + y), z, t_1) - Float64(y * b)) / Float64(x + Float64(y + t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + 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$2, -5e+281], N[Not[LessEqual[t$95$2, 1e+277]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) \cdot a\\
t_2 := \frac{\left(t\_1 + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+281} \lor \neg \left(t\_2 \leq 10^{+277}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_1\right) - y \cdot b}{x + \left(y + t\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -5.00000000000000016e281 or 1e277 < (/.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 63.2%
if -5.00000000000000016e281 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e277Initial program 99.8%
fma-define99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification85.7%
(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 -5e+281) (not (<= t_1 1e+277))) (- (+ 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 <= -5e+281) || !(t_1 <= 1e+277)) {
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 <= (-5d+281)) .or. (.not. (t_1 <= 1d+277))) 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 <= -5e+281) || !(t_1 <= 1e+277)) {
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 <= -5e+281) or not (t_1 <= 1e+277): 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 <= -5e+281) || !(t_1 <= 1e+277)) 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 <= -5e+281) || ~((t_1 <= 1e+277))) 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, -5e+281], N[Not[LessEqual[t$95$1, 1e+277]], $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 -5 \cdot 10^{+281} \lor \neg \left(t\_1 \leq 10^{+277}\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)) < -5.00000000000000016e281 or 1e277 < (/.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 63.2%
if -5.00000000000000016e281 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e277Initial program 99.8%
Final simplification85.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ x y) z)) (t_2 (- (+ z a) b)))
(if (<= y -8.8e-41)
t_2
(if (<= y 1.9e-306)
(* a (+ (/ t (+ x t)) (* x (/ (/ z a) (+ x t)))))
(if (<= y 1.35e+17)
(/ (+ (* (+ y t) a) t_1) (+ (+ x y) t))
(if (<= y 1.45e+99)
(* a (+ (/ z a) (/ y (+ x y))))
(if (<= y 6.2e+137) (/ (+ t_1 (* y a)) (+ x y)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) * z;
double t_2 = (z + a) - b;
double tmp;
if (y <= -8.8e-41) {
tmp = t_2;
} else if (y <= 1.9e-306) {
tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t))));
} else if (y <= 1.35e+17) {
tmp = (((y + t) * a) + t_1) / ((x + y) + t);
} else if (y <= 1.45e+99) {
tmp = a * ((z / a) + (y / (x + y)));
} else if (y <= 6.2e+137) {
tmp = (t_1 + (y * a)) / (x + y);
} 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) * z
t_2 = (z + a) - b
if (y <= (-8.8d-41)) then
tmp = t_2
else if (y <= 1.9d-306) then
tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t))))
else if (y <= 1.35d+17) then
tmp = (((y + t) * a) + t_1) / ((x + y) + t)
else if (y <= 1.45d+99) then
tmp = a * ((z / a) + (y / (x + y)))
else if (y <= 6.2d+137) then
tmp = (t_1 + (y * a)) / (x + y)
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) * z;
double t_2 = (z + a) - b;
double tmp;
if (y <= -8.8e-41) {
tmp = t_2;
} else if (y <= 1.9e-306) {
tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t))));
} else if (y <= 1.35e+17) {
tmp = (((y + t) * a) + t_1) / ((x + y) + t);
} else if (y <= 1.45e+99) {
tmp = a * ((z / a) + (y / (x + y)));
} else if (y <= 6.2e+137) {
tmp = (t_1 + (y * a)) / (x + y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) * z t_2 = (z + a) - b tmp = 0 if y <= -8.8e-41: tmp = t_2 elif y <= 1.9e-306: tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t)))) elif y <= 1.35e+17: tmp = (((y + t) * a) + t_1) / ((x + y) + t) elif y <= 1.45e+99: tmp = a * ((z / a) + (y / (x + y))) elif y <= 6.2e+137: tmp = (t_1 + (y * a)) / (x + y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) * z) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -8.8e-41) tmp = t_2; elseif (y <= 1.9e-306) tmp = Float64(a * Float64(Float64(t / Float64(x + t)) + Float64(x * Float64(Float64(z / a) / Float64(x + t))))); elseif (y <= 1.35e+17) tmp = Float64(Float64(Float64(Float64(y + t) * a) + t_1) / Float64(Float64(x + y) + t)); elseif (y <= 1.45e+99) tmp = Float64(a * Float64(Float64(z / a) + Float64(y / Float64(x + y)))); elseif (y <= 6.2e+137) tmp = Float64(Float64(t_1 + Float64(y * a)) / Float64(x + y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) * z; t_2 = (z + a) - b; tmp = 0.0; if (y <= -8.8e-41) tmp = t_2; elseif (y <= 1.9e-306) tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t)))); elseif (y <= 1.35e+17) tmp = (((y + t) * a) + t_1) / ((x + y) + t); elseif (y <= 1.45e+99) tmp = a * ((z / a) + (y / (x + y))); elseif (y <= 6.2e+137) tmp = (t_1 + (y * a)) / (x + y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -8.8e-41], t$95$2, If[LessEqual[y, 1.9e-306], N[(a * N[(N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(z / a), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+17], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+99], N[(a * N[(N[(z / a), $MachinePrecision] + N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+137], N[(N[(t$95$1 + N[(y * a), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) \cdot z\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -8.8 \cdot 10^{-41}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-306}:\\
\;\;\;\;a \cdot \left(\frac{t}{x + t} + x \cdot \frac{\frac{z}{a}}{x + t}\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+17}:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a + t\_1}{\left(x + y\right) + t}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+99}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + \frac{y}{x + y}\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+137}:\\
\;\;\;\;\frac{t\_1 + y \cdot a}{x + y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.7999999999999999e-41 or 6.1999999999999999e137 < y Initial program 46.3%
Taylor expanded in y around inf 72.5%
if -8.7999999999999999e-41 < y < 1.9e-306Initial program 68.4%
Taylor expanded in a around inf 82.9%
associate--l+82.9%
associate-+r+82.9%
+-commutative82.9%
associate-/l*89.7%
fma-define89.7%
+-commutative89.7%
associate-+r+89.7%
associate-+r+89.7%
Simplified89.5%
Taylor expanded in y around 0 71.0%
+-commutative71.0%
associate-/l*75.8%
associate-/r*82.0%
+-commutative82.0%
Simplified82.0%
if 1.9e-306 < y < 1.35e17Initial program 88.7%
Taylor expanded in b around 0 75.5%
if 1.35e17 < y < 1.4500000000000001e99Initial program 65.2%
Taylor expanded in a around inf 69.0%
associate--l+69.0%
associate-+r+69.0%
+-commutative69.0%
associate-/l*79.0%
fma-define79.0%
+-commutative79.0%
associate-+r+79.0%
associate-+r+79.0%
Simplified84.0%
Taylor expanded in b around 0 48.8%
+-commutative48.8%
associate-/l*58.8%
associate-/r*59.0%
+-commutative59.0%
associate-+r+59.0%
+-commutative59.0%
+-commutative59.0%
fma-undefine59.0%
+-commutative59.0%
+-commutative59.0%
+-commutative59.0%
associate-+r+59.0%
Simplified59.0%
Taylor expanded in t around 0 64.5%
+-commutative64.5%
Simplified64.5%
if 1.4500000000000001e99 < y < 6.1999999999999999e137Initial program 87.3%
Taylor expanded in b around 0 75.0%
Taylor expanded in t around 0 75.0%
Final simplification74.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (/ (+ x y) (+ (+ x y) t)))))
(if (<= x -3.1e+193)
t_1
(if (<= x -1.26e+116)
(* a (/ (+ y t) (+ y (+ x t))))
(if (<= x -7.5e+80)
t_1
(if (<= x 4.6e+43) (- (+ z a) b) (* a (+ (/ z a) (/ y (+ x y))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * ((x + y) / ((x + y) + t));
double tmp;
if (x <= -3.1e+193) {
tmp = t_1;
} else if (x <= -1.26e+116) {
tmp = a * ((y + t) / (y + (x + t)));
} else if (x <= -7.5e+80) {
tmp = t_1;
} else if (x <= 4.6e+43) {
tmp = (z + a) - b;
} else {
tmp = a * ((z / a) + (y / (x + y)));
}
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 * ((x + y) / ((x + y) + t))
if (x <= (-3.1d+193)) then
tmp = t_1
else if (x <= (-1.26d+116)) then
tmp = a * ((y + t) / (y + (x + t)))
else if (x <= (-7.5d+80)) then
tmp = t_1
else if (x <= 4.6d+43) then
tmp = (z + a) - b
else
tmp = a * ((z / a) + (y / (x + y)))
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 * ((x + y) / ((x + y) + t));
double tmp;
if (x <= -3.1e+193) {
tmp = t_1;
} else if (x <= -1.26e+116) {
tmp = a * ((y + t) / (y + (x + t)));
} else if (x <= -7.5e+80) {
tmp = t_1;
} else if (x <= 4.6e+43) {
tmp = (z + a) - b;
} else {
tmp = a * ((z / a) + (y / (x + y)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * ((x + y) / ((x + y) + t)) tmp = 0 if x <= -3.1e+193: tmp = t_1 elif x <= -1.26e+116: tmp = a * ((y + t) / (y + (x + t))) elif x <= -7.5e+80: tmp = t_1 elif x <= 4.6e+43: tmp = (z + a) - b else: tmp = a * ((z / a) + (y / (x + y))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(Float64(x + y) / Float64(Float64(x + y) + t))) tmp = 0.0 if (x <= -3.1e+193) tmp = t_1; elseif (x <= -1.26e+116) tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); elseif (x <= -7.5e+80) tmp = t_1; elseif (x <= 4.6e+43) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(Float64(z / a) + Float64(y / Float64(x + y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * ((x + y) / ((x + y) + t)); tmp = 0.0; if (x <= -3.1e+193) tmp = t_1; elseif (x <= -1.26e+116) tmp = a * ((y + t) / (y + (x + t))); elseif (x <= -7.5e+80) tmp = t_1; elseif (x <= 4.6e+43) tmp = (z + a) - b; else tmp = a * ((z / a) + (y / (x + y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(N[(x + y), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.1e+193], t$95$1, If[LessEqual[x, -1.26e+116], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e+80], t$95$1, If[LessEqual[x, 4.6e+43], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(N[(z / a), $MachinePrecision] + N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x + y}{\left(x + y\right) + t}\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{+193}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{+116}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+43}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + \frac{y}{x + y}\right)\\
\end{array}
\end{array}
if x < -3.09999999999999986e193 or -1.2599999999999999e116 < x < -7.49999999999999994e80Initial program 59.2%
Taylor expanded in z around inf 43.0%
associate-/l*75.2%
+-commutative75.2%
+-commutative75.2%
Simplified75.2%
if -3.09999999999999986e193 < x < -1.2599999999999999e116Initial program 58.0%
Taylor expanded in a around inf 47.3%
associate-/l*78.7%
associate-+r+78.7%
Simplified78.7%
if -7.49999999999999994e80 < x < 4.6000000000000005e43Initial program 70.1%
Taylor expanded in y around inf 64.1%
if 4.6000000000000005e43 < x Initial program 49.8%
Taylor expanded in a around inf 52.2%
associate--l+52.2%
associate-+r+52.2%
+-commutative52.2%
associate-/l*67.0%
fma-define67.0%
+-commutative67.0%
associate-+r+67.0%
associate-+r+67.0%
Simplified70.9%
Taylor expanded in b around 0 44.1%
+-commutative44.1%
associate-/l*59.0%
associate-/r*57.4%
+-commutative57.4%
associate-+r+57.4%
+-commutative57.4%
+-commutative57.4%
fma-undefine57.3%
+-commutative57.3%
+-commutative57.3%
+-commutative57.3%
associate-+r+57.3%
Simplified57.3%
Taylor expanded in t around 0 60.2%
+-commutative60.2%
Simplified60.2%
Final simplification65.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.05e-58)
t_1
(if (<= y 3.4e-124)
(* a (/ (+ t (* x (/ z a))) (+ x t)))
(if (<= y 2150000000000.0)
(/ (+ (* (+ y t) a) (* y z)) (+ y t))
(if (<= y 1.36e+80) (* a (+ (/ z a) (/ y (+ x y)))) 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.05e-58) {
tmp = t_1;
} else if (y <= 3.4e-124) {
tmp = a * ((t + (x * (z / a))) / (x + t));
} else if (y <= 2150000000000.0) {
tmp = (((y + t) * a) + (y * z)) / (y + t);
} else if (y <= 1.36e+80) {
tmp = a * ((z / a) + (y / (x + y)));
} 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.05d-58)) then
tmp = t_1
else if (y <= 3.4d-124) then
tmp = a * ((t + (x * (z / a))) / (x + t))
else if (y <= 2150000000000.0d0) then
tmp = (((y + t) * a) + (y * z)) / (y + t)
else if (y <= 1.36d+80) then
tmp = a * ((z / a) + (y / (x + y)))
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.05e-58) {
tmp = t_1;
} else if (y <= 3.4e-124) {
tmp = a * ((t + (x * (z / a))) / (x + t));
} else if (y <= 2150000000000.0) {
tmp = (((y + t) * a) + (y * z)) / (y + t);
} else if (y <= 1.36e+80) {
tmp = a * ((z / a) + (y / (x + y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.05e-58: tmp = t_1 elif y <= 3.4e-124: tmp = a * ((t + (x * (z / a))) / (x + t)) elif y <= 2150000000000.0: tmp = (((y + t) * a) + (y * z)) / (y + t) elif y <= 1.36e+80: tmp = a * ((z / a) + (y / (x + y))) 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.05e-58) tmp = t_1; elseif (y <= 3.4e-124) tmp = Float64(a * Float64(Float64(t + Float64(x * Float64(z / a))) / Float64(x + t))); elseif (y <= 2150000000000.0) tmp = Float64(Float64(Float64(Float64(y + t) * a) + Float64(y * z)) / Float64(y + t)); elseif (y <= 1.36e+80) tmp = Float64(a * Float64(Float64(z / a) + Float64(y / Float64(x + y)))); 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.05e-58) tmp = t_1; elseif (y <= 3.4e-124) tmp = a * ((t + (x * (z / a))) / (x + t)); elseif (y <= 2150000000000.0) tmp = (((y + t) * a) + (y * z)) / (y + t); elseif (y <= 1.36e+80) tmp = a * ((z / a) + (y / (x + y))); 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.05e-58], t$95$1, If[LessEqual[y, 3.4e-124], N[(a * N[(N[(t + N[(x * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2150000000000.0], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.36e+80], N[(a * N[(N[(z / a), $MachinePrecision] + N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.05 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-124}:\\
\;\;\;\;a \cdot \frac{t + x \cdot \frac{z}{a}}{x + t}\\
\mathbf{elif}\;y \leq 2150000000000:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a + y \cdot z}{y + t}\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+80}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + \frac{y}{x + y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.05000000000000014e-58 or 1.36000000000000013e80 < y Initial program 50.1%
Taylor expanded in y around inf 70.8%
if -2.05000000000000014e-58 < y < 3.4000000000000001e-124Initial program 75.9%
Taylor expanded in a around inf 70.1%
Taylor expanded in y around 0 58.0%
associate-/l*71.5%
associate-/l*76.2%
+-commutative76.2%
Simplified76.2%
if 3.4000000000000001e-124 < y < 2.15e12Initial program 89.9%
Taylor expanded in b around 0 68.0%
Taylor expanded in x around 0 57.6%
if 2.15e12 < y < 1.36000000000000013e80Initial program 73.2%
Taylor expanded in a around inf 72.5%
associate--l+72.5%
associate-+r+72.5%
+-commutative72.5%
associate-/l*78.0%
fma-define78.0%
+-commutative78.0%
associate-+r+78.0%
associate-+r+78.0%
Simplified83.3%
Taylor expanded in b around 0 51.2%
+-commutative51.2%
associate-/l*56.6%
associate-/r*67.5%
+-commutative67.5%
associate-+r+67.5%
+-commutative67.5%
+-commutative67.5%
fma-undefine67.5%
+-commutative67.5%
+-commutative67.5%
+-commutative67.5%
associate-+r+67.5%
Simplified67.5%
Taylor expanded in t around 0 57.2%
+-commutative57.2%
Simplified57.2%
Final simplification70.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.25e-40)
t_1
(if (<= y 3.1e-124)
(* a (+ (/ t (+ x t)) (* x (/ (/ z a) (+ x t)))))
(if (<= y 3.2e+100) (* a (+ (/ z a) (/ y (+ x y)))) 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.25e-40) {
tmp = t_1;
} else if (y <= 3.1e-124) {
tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t))));
} else if (y <= 3.2e+100) {
tmp = a * ((z / a) + (y / (x + y)));
} 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.25d-40)) then
tmp = t_1
else if (y <= 3.1d-124) then
tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t))))
else if (y <= 3.2d+100) then
tmp = a * ((z / a) + (y / (x + y)))
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.25e-40) {
tmp = t_1;
} else if (y <= 3.1e-124) {
tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t))));
} else if (y <= 3.2e+100) {
tmp = a * ((z / a) + (y / (x + y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.25e-40: tmp = t_1 elif y <= 3.1e-124: tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t)))) elif y <= 3.2e+100: tmp = a * ((z / a) + (y / (x + y))) 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.25e-40) tmp = t_1; elseif (y <= 3.1e-124) tmp = Float64(a * Float64(Float64(t / Float64(x + t)) + Float64(x * Float64(Float64(z / a) / Float64(x + t))))); elseif (y <= 3.2e+100) tmp = Float64(a * Float64(Float64(z / a) + Float64(y / Float64(x + y)))); 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.25e-40) tmp = t_1; elseif (y <= 3.1e-124) tmp = a * ((t / (x + t)) + (x * ((z / a) / (x + t)))); elseif (y <= 3.2e+100) tmp = a * ((z / a) + (y / (x + y))); 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.25e-40], t$95$1, If[LessEqual[y, 3.1e-124], N[(a * N[(N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(z / a), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+100], N[(a * N[(N[(z / a), $MachinePrecision] + N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-124}:\\
\;\;\;\;a \cdot \left(\frac{t}{x + t} + x \cdot \frac{\frac{z}{a}}{x + t}\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+100}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + \frac{y}{x + y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.24999999999999991e-40 or 3.1999999999999999e100 < y Initial program 48.6%
Taylor expanded in y around inf 71.6%
if -1.24999999999999991e-40 < y < 3.0999999999999998e-124Initial program 76.7%
Taylor expanded in a around inf 84.7%
associate--l+84.7%
associate-+r+84.7%
+-commutative84.7%
associate-/l*90.7%
fma-define90.7%
+-commutative90.7%
associate-+r+90.7%
associate-+r+90.7%
Simplified90.6%
Taylor expanded in y around 0 71.9%
+-commutative71.9%
associate-/l*75.8%
associate-/r*79.2%
+-commutative79.2%
Simplified79.2%
if 3.0999999999999998e-124 < y < 3.1999999999999999e100Initial program 81.3%
Taylor expanded in a around inf 74.1%
associate--l+74.1%
associate-+r+74.1%
+-commutative74.1%
associate-/l*78.1%
fma-define78.1%
+-commutative78.1%
associate-+r+78.1%
associate-+r+78.1%
Simplified80.0%
Taylor expanded in b around 0 57.9%
+-commutative57.9%
associate-/l*61.8%
associate-/r*68.0%
+-commutative68.0%
associate-+r+68.0%
+-commutative68.0%
+-commutative68.0%
fma-undefine68.0%
+-commutative68.0%
+-commutative68.0%
+-commutative68.0%
associate-+r+68.0%
Simplified68.0%
Taylor expanded in t around 0 55.5%
+-commutative55.5%
Simplified55.5%
Final simplification71.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -2.05e-94)
t_1
(if (<= y 2.9e-131)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 2.1e+100) (* a (+ (/ z a) (/ y (+ x y)))) 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.05e-94) {
tmp = t_1;
} else if (y <= 2.9e-131) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.1e+100) {
tmp = a * ((z / a) + (y / (x + y)));
} 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.05d-94)) then
tmp = t_1
else if (y <= 2.9d-131) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 2.1d+100) then
tmp = a * ((z / a) + (y / (x + y)))
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.05e-94) {
tmp = t_1;
} else if (y <= 2.9e-131) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.1e+100) {
tmp = a * ((z / a) + (y / (x + y)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -2.05e-94: tmp = t_1 elif y <= 2.9e-131: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 2.1e+100: tmp = a * ((z / a) + (y / (x + y))) 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.05e-94) tmp = t_1; elseif (y <= 2.9e-131) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 2.1e+100) tmp = Float64(a * Float64(Float64(z / a) + Float64(y / Float64(x + y)))); 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.05e-94) tmp = t_1; elseif (y <= 2.9e-131) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 2.1e+100) tmp = a * ((z / a) + (y / (x + y))); 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.05e-94], t$95$1, If[LessEqual[y, 2.9e-131], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+100], N[(a * N[(N[(z / a), $MachinePrecision] + N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.05 \cdot 10^{-94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-131}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+100}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + \frac{y}{x + y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.05e-94 or 2.0999999999999999e100 < y Initial program 49.6%
Taylor expanded in y around inf 70.0%
if -2.05e-94 < y < 2.9000000000000002e-131Initial program 79.9%
Taylor expanded in y around 0 67.9%
if 2.9000000000000002e-131 < y < 2.0999999999999999e100Initial program 78.4%
Taylor expanded in a around inf 73.3%
associate--l+73.3%
associate-+r+73.3%
+-commutative73.3%
associate-/l*78.9%
fma-define78.9%
+-commutative78.9%
associate-+r+78.9%
associate-+r+78.9%
Simplified80.7%
Taylor expanded in b around 0 57.7%
+-commutative57.7%
associate-/l*63.3%
associate-/r*67.4%
+-commutative67.4%
associate-+r+67.4%
+-commutative67.4%
+-commutative67.4%
fma-undefine67.4%
+-commutative67.4%
+-commutative67.4%
+-commutative67.4%
associate-+r+67.4%
Simplified67.4%
Taylor expanded in t around 0 55.3%
+-commutative55.3%
Simplified55.3%
Final simplification66.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.4e-58) (not (<= y 2.3e+34))) (- (+ z a) b) (* a (/ (+ t (* x (/ z a))) (+ x t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.4e-58) || !(y <= 2.3e+34)) {
tmp = (z + a) - b;
} else {
tmp = a * ((t + (x * (z / a))) / (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 <= (-1.4d-58)) .or. (.not. (y <= 2.3d+34))) then
tmp = (z + a) - b
else
tmp = a * ((t + (x * (z / a))) / (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 <= -1.4e-58) || !(y <= 2.3e+34)) {
tmp = (z + a) - b;
} else {
tmp = a * ((t + (x * (z / a))) / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.4e-58) or not (y <= 2.3e+34): tmp = (z + a) - b else: tmp = a * ((t + (x * (z / a))) / (x + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.4e-58) || !(y <= 2.3e+34)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(Float64(t + Float64(x * Float64(z / a))) / Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.4e-58) || ~((y <= 2.3e+34))) tmp = (z + a) - b; else tmp = a * ((t + (x * (z / a))) / (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.4e-58], N[Not[LessEqual[y, 2.3e+34]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(N[(t + N[(x * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-58} \lor \neg \left(y \leq 2.3 \cdot 10^{+34}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t + x \cdot \frac{z}{a}}{x + t}\\
\end{array}
\end{array}
if y < -1.4e-58 or 2.2999999999999998e34 < y Initial program 50.9%
Taylor expanded in y around inf 68.6%
if -1.4e-58 < y < 2.2999999999999998e34Initial program 80.1%
Taylor expanded in a around inf 74.5%
Taylor expanded in y around 0 53.7%
associate-/l*63.0%
associate-/l*67.9%
+-commutative67.9%
Simplified67.9%
Final simplification68.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.2e+54) (* a (/ (+ y t) (+ y (+ x t)))) (if (<= a 7800000000000.0) (- (+ z a) b) (* a (+ (/ z a) (/ y (+ x y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.2e+54) {
tmp = a * ((y + t) / (y + (x + t)));
} else if (a <= 7800000000000.0) {
tmp = (z + a) - b;
} else {
tmp = a * ((z / a) + (y / (x + y)));
}
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 <= (-4.2d+54)) then
tmp = a * ((y + t) / (y + (x + t)))
else if (a <= 7800000000000.0d0) then
tmp = (z + a) - b
else
tmp = a * ((z / a) + (y / (x + y)))
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 <= -4.2e+54) {
tmp = a * ((y + t) / (y + (x + t)));
} else if (a <= 7800000000000.0) {
tmp = (z + a) - b;
} else {
tmp = a * ((z / a) + (y / (x + y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -4.2e+54: tmp = a * ((y + t) / (y + (x + t))) elif a <= 7800000000000.0: tmp = (z + a) - b else: tmp = a * ((z / a) + (y / (x + y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.2e+54) tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); elseif (a <= 7800000000000.0) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(Float64(z / a) + Float64(y / Float64(x + y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -4.2e+54) tmp = a * ((y + t) / (y + (x + t))); elseif (a <= 7800000000000.0) tmp = (z + a) - b; else tmp = a * ((z / a) + (y / (x + y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.2e+54], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7800000000000.0], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(N[(z / a), $MachinePrecision] + N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{+54}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{elif}\;a \leq 7800000000000:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + \frac{y}{x + y}\right)\\
\end{array}
\end{array}
if a < -4.19999999999999972e54Initial program 49.1%
Taylor expanded in a around inf 44.9%
associate-/l*75.7%
associate-+r+75.7%
Simplified75.7%
if -4.19999999999999972e54 < a < 7.8e12Initial program 73.9%
Taylor expanded in y around inf 53.4%
if 7.8e12 < a Initial program 57.5%
Taylor expanded in a around inf 77.2%
associate--l+77.2%
associate-+r+77.2%
+-commutative77.2%
associate-/l*80.6%
fma-define80.6%
+-commutative80.6%
associate-+r+80.6%
associate-+r+80.6%
Simplified83.8%
Taylor expanded in b around 0 76.8%
+-commutative76.8%
associate-/l*80.3%
associate-/r*90.0%
+-commutative90.0%
associate-+r+90.0%
+-commutative90.0%
+-commutative90.0%
fma-undefine90.0%
+-commutative90.0%
+-commutative90.0%
+-commutative90.0%
associate-+r+90.0%
Simplified90.0%
Taylor expanded in t around 0 66.6%
+-commutative66.6%
Simplified66.6%
Final simplification61.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.4e+81) z (if (or (<= x -1.6e-236) (not (<= x -2.7e-275))) (- (+ z a) b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.4e+81) {
tmp = z;
} else if ((x <= -1.6e-236) || !(x <= -2.7e-275)) {
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 (x <= (-1.4d+81)) then
tmp = z
else if ((x <= (-1.6d-236)) .or. (.not. (x <= (-2.7d-275)))) 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 (x <= -1.4e+81) {
tmp = z;
} else if ((x <= -1.6e-236) || !(x <= -2.7e-275)) {
tmp = (z + a) - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.4e+81: tmp = z elif (x <= -1.6e-236) or not (x <= -2.7e-275): tmp = (z + a) - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.4e+81) tmp = z; elseif ((x <= -1.6e-236) || !(x <= -2.7e-275)) 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 (x <= -1.4e+81) tmp = z; elseif ((x <= -1.6e-236) || ~((x <= -2.7e-275))) tmp = (z + a) - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.4e+81], z, If[Or[LessEqual[x, -1.6e-236], N[Not[LessEqual[x, -2.7e-275]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+81}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-236} \lor \neg \left(x \leq -2.7 \cdot 10^{-275}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if x < -1.39999999999999997e81Initial program 58.9%
Taylor expanded in x around inf 53.6%
if -1.39999999999999997e81 < x < -1.6e-236 or -2.69999999999999993e-275 < x Initial program 64.3%
Taylor expanded in y around inf 59.8%
if -1.6e-236 < x < -2.69999999999999993e-275Initial program 85.1%
Taylor expanded in t around inf 92.3%
Final simplification60.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.18e+107) (not (<= b 2.2e+77))) (* y (/ b (- (- (- x) t) y))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.18e+107) || !(b <= 2.2e+77)) {
tmp = y * (b / ((-x - t) - y));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.18d+107)) .or. (.not. (b <= 2.2d+77))) then
tmp = y * (b / ((-x - t) - y))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.18e+107) || !(b <= 2.2e+77)) {
tmp = y * (b / ((-x - t) - y));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.18e+107) or not (b <= 2.2e+77): tmp = y * (b / ((-x - t) - y)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.18e+107) || !(b <= 2.2e+77)) tmp = Float64(y * Float64(b / Float64(Float64(Float64(-x) - t) - y))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.18e+107) || ~((b <= 2.2e+77))) tmp = y * (b / ((-x - t) - y)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.18e+107], N[Not[LessEqual[b, 2.2e+77]], $MachinePrecision]], N[(y * N[(b / N[(N[((-x) - t), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.18 \cdot 10^{+107} \lor \neg \left(b \leq 2.2 \cdot 10^{+77}\right):\\
\;\;\;\;y \cdot \frac{b}{\left(\left(-x\right) - t\right) - y}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -1.18000000000000005e107 or 2.2e77 < b Initial program 51.3%
Taylor expanded in b around inf 30.3%
associate-*r*30.3%
neg-mul-130.3%
*-commutative30.3%
Simplified30.3%
associate-/l*53.5%
+-commutative53.5%
+-commutative53.5%
+-commutative53.5%
Applied egg-rr53.5%
if -1.18000000000000005e107 < b < 2.2e77Initial program 71.0%
Taylor expanded in y around inf 62.8%
Final simplification59.8%
(FPCore (x y z t a b) :precision binary64 (if (<= a 126000000000.0) (- (+ z a) b) (* a (+ (/ z a) (/ y (+ x y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 126000000000.0) {
tmp = (z + a) - b;
} else {
tmp = a * ((z / a) + (y / (x + y)));
}
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 <= 126000000000.0d0) then
tmp = (z + a) - b
else
tmp = a * ((z / a) + (y / (x + y)))
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 <= 126000000000.0) {
tmp = (z + a) - b;
} else {
tmp = a * ((z / a) + (y / (x + y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 126000000000.0: tmp = (z + a) - b else: tmp = a * ((z / a) + (y / (x + y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 126000000000.0) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(Float64(z / a) + Float64(y / Float64(x + y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 126000000000.0) tmp = (z + a) - b; else tmp = a * ((z / a) + (y / (x + y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 126000000000.0], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(N[(z / a), $MachinePrecision] + N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 126000000000:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{z}{a} + \frac{y}{x + y}\right)\\
\end{array}
\end{array}
if a < 1.26e11Initial program 67.3%
Taylor expanded in y around inf 57.0%
if 1.26e11 < a Initial program 57.5%
Taylor expanded in a around inf 77.2%
associate--l+77.2%
associate-+r+77.2%
+-commutative77.2%
associate-/l*80.6%
fma-define80.6%
+-commutative80.6%
associate-+r+80.6%
associate-+r+80.6%
Simplified83.8%
Taylor expanded in b around 0 76.8%
+-commutative76.8%
associate-/l*80.3%
associate-/r*90.0%
+-commutative90.0%
associate-+r+90.0%
+-commutative90.0%
+-commutative90.0%
fma-undefine90.0%
+-commutative90.0%
+-commutative90.0%
+-commutative90.0%
associate-+r+90.0%
Simplified90.0%
Taylor expanded in t around 0 66.6%
+-commutative66.6%
Simplified66.6%
Final simplification59.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7.2e+119) a (if (<= t 1.1e+134) (+ z a) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.2e+119) {
tmp = a;
} else if (t <= 1.1e+134) {
tmp = z + a;
} 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 <= (-7.2d+119)) then
tmp = a
else if (t <= 1.1d+134) then
tmp = z + a
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 <= -7.2e+119) {
tmp = a;
} else if (t <= 1.1e+134) {
tmp = z + a;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.2e+119: tmp = a elif t <= 1.1e+134: tmp = z + a else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.2e+119) tmp = a; elseif (t <= 1.1e+134) tmp = Float64(z + a); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.2e+119) tmp = a; elseif (t <= 1.1e+134) tmp = z + a; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.2e+119], a, If[LessEqual[t, 1.1e+134], N[(z + a), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+119}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+134}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -7.20000000000000003e119 or 1.1e134 < t Initial program 44.3%
Taylor expanded in t around inf 55.1%
if -7.20000000000000003e119 < t < 1.1e134Initial program 74.8%
Taylor expanded in b around 0 59.5%
Taylor expanded in y around inf 56.3%
Final simplification55.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7.8e-103) a (if (<= t 65000000.0) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.8e-103) {
tmp = a;
} else if (t <= 65000000.0) {
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 (t <= (-7.8d-103)) then
tmp = a
else if (t <= 65000000.0d0) 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 (t <= -7.8e-103) {
tmp = a;
} else if (t <= 65000000.0) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.8e-103: tmp = a elif t <= 65000000.0: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.8e-103) tmp = a; elseif (t <= 65000000.0) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.8e-103) tmp = a; elseif (t <= 65000000.0) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.8e-103], a, If[LessEqual[t, 65000000.0], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-103}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 65000000:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -7.8000000000000004e-103 or 6.5e7 < t Initial program 54.5%
Taylor expanded in t around inf 48.2%
if -7.8000000000000004e-103 < t < 6.5e7Initial program 79.1%
Taylor expanded in x around inf 48.8%
Final simplification48.5%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 64.6%
Taylor expanded in t around inf 37.1%
Final simplification37.1%
(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 2024079
(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)))