
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* z (+ y x)) (* a (+ y t))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 5e+257))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 5e+257)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 5e+257)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 5e+257): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(y + x)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 5e+257)) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (y + x)) + (a * (y + t))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 5e+257))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 5e+257]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(y + x\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 5 \cdot 10^{+257}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 5.00000000000000028e257 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.5%
Taylor expanded in y around inf 76.0%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.00000000000000028e257Initial program 99.7%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= z -4.4e+192)
(/ (+ y x) (/ t_1 z))
(+ (/ a (/ t_1 (+ y t))) (+ (/ (* z x) t_1) (/ (- z b) (/ t_1 y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (z <= -4.4e+192) {
tmp = (y + x) / (t_1 / z);
} else {
tmp = (a / (t_1 / (y + t))) + (((z * x) / t_1) + ((z - b) / (t_1 / 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 = y + (x + t)
if (z <= (-4.4d+192)) then
tmp = (y + x) / (t_1 / z)
else
tmp = (a / (t_1 / (y + t))) + (((z * x) / t_1) + ((z - b) / (t_1 / 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 = y + (x + t);
double tmp;
if (z <= -4.4e+192) {
tmp = (y + x) / (t_1 / z);
} else {
tmp = (a / (t_1 / (y + t))) + (((z * x) / t_1) + ((z - b) / (t_1 / y)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if z <= -4.4e+192: tmp = (y + x) / (t_1 / z) else: tmp = (a / (t_1 / (y + t))) + (((z * x) / t_1) + ((z - b) / (t_1 / y))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (z <= -4.4e+192) tmp = Float64(Float64(y + x) / Float64(t_1 / z)); else tmp = Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(Float64(Float64(z * x) / t_1) + Float64(Float64(z - b) / Float64(t_1 / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (z <= -4.4e+192) tmp = (y + x) / (t_1 / z); else tmp = (a / (t_1 / (y + t))) + (((z * x) / t_1) + ((z - b) / (t_1 / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+192], N[(N[(y + x), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision], N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+192}:\\
\;\;\;\;\frac{y + x}{\frac{t_1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}} + \left(\frac{z \cdot x}{t_1} + \frac{z - b}{\frac{t_1}{y}}\right)\\
\end{array}
\end{array}
if z < -4.4000000000000001e192Initial program 17.1%
Taylor expanded in z around inf 17.5%
associate-/l*75.6%
Simplified75.6%
if -4.4000000000000001e192 < z Initial program 67.3%
Simplified67.9%
Taylor expanded in a around inf 67.3%
+-commutative67.3%
+-commutative67.3%
associate-+l+67.3%
associate-/l*73.3%
associate-/l*91.5%
Simplified91.5%
Final simplification89.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (+ a (+ z (/ (- z b) (/ t_1 y)))))
(t_3 (/ (+ y x) (/ t_1 z))))
(if (<= z -2.1e+189)
t_3
(if (<= z -1.55e+91)
(- (+ z a) b)
(if (<= z -2.3e+75)
(+ a (* x (/ z (+ x t))))
(if (<= z -2.7e-235)
t_2
(if (<= z 3.05e-251)
(/ (- (* a (+ y t)) (* y b)) t_1)
(if (<= z 3.2e+48) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = a + (z + ((z - b) / (t_1 / y)));
double t_3 = (y + x) / (t_1 / z);
double tmp;
if (z <= -2.1e+189) {
tmp = t_3;
} else if (z <= -1.55e+91) {
tmp = (z + a) - b;
} else if (z <= -2.3e+75) {
tmp = a + (x * (z / (x + t)));
} else if (z <= -2.7e-235) {
tmp = t_2;
} else if (z <= 3.05e-251) {
tmp = ((a * (y + t)) - (y * b)) / t_1;
} else if (z <= 3.2e+48) {
tmp = t_2;
} 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 = y + (x + t)
t_2 = a + (z + ((z - b) / (t_1 / y)))
t_3 = (y + x) / (t_1 / z)
if (z <= (-2.1d+189)) then
tmp = t_3
else if (z <= (-1.55d+91)) then
tmp = (z + a) - b
else if (z <= (-2.3d+75)) then
tmp = a + (x * (z / (x + t)))
else if (z <= (-2.7d-235)) then
tmp = t_2
else if (z <= 3.05d-251) then
tmp = ((a * (y + t)) - (y * b)) / t_1
else if (z <= 3.2d+48) then
tmp = t_2
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 = y + (x + t);
double t_2 = a + (z + ((z - b) / (t_1 / y)));
double t_3 = (y + x) / (t_1 / z);
double tmp;
if (z <= -2.1e+189) {
tmp = t_3;
} else if (z <= -1.55e+91) {
tmp = (z + a) - b;
} else if (z <= -2.3e+75) {
tmp = a + (x * (z / (x + t)));
} else if (z <= -2.7e-235) {
tmp = t_2;
} else if (z <= 3.05e-251) {
tmp = ((a * (y + t)) - (y * b)) / t_1;
} else if (z <= 3.2e+48) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = a + (z + ((z - b) / (t_1 / y))) t_3 = (y + x) / (t_1 / z) tmp = 0 if z <= -2.1e+189: tmp = t_3 elif z <= -1.55e+91: tmp = (z + a) - b elif z <= -2.3e+75: tmp = a + (x * (z / (x + t))) elif z <= -2.7e-235: tmp = t_2 elif z <= 3.05e-251: tmp = ((a * (y + t)) - (y * b)) / t_1 elif z <= 3.2e+48: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(a + Float64(z + Float64(Float64(z - b) / Float64(t_1 / y)))) t_3 = Float64(Float64(y + x) / Float64(t_1 / z)) tmp = 0.0 if (z <= -2.1e+189) tmp = t_3; elseif (z <= -1.55e+91) tmp = Float64(Float64(z + a) - b); elseif (z <= -2.3e+75) tmp = Float64(a + Float64(x * Float64(z / Float64(x + t)))); elseif (z <= -2.7e-235) tmp = t_2; elseif (z <= 3.05e-251) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / t_1); elseif (z <= 3.2e+48) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = a + (z + ((z - b) / (t_1 / y))); t_3 = (y + x) / (t_1 / z); tmp = 0.0; if (z <= -2.1e+189) tmp = t_3; elseif (z <= -1.55e+91) tmp = (z + a) - b; elseif (z <= -2.3e+75) tmp = a + (x * (z / (x + t))); elseif (z <= -2.7e-235) tmp = t_2; elseif (z <= 3.05e-251) tmp = ((a * (y + t)) - (y * b)) / t_1; elseif (z <= 3.2e+48) tmp = t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(z + N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + x), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+189], t$95$3, If[LessEqual[z, -1.55e+91], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, -2.3e+75], N[(a + N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e-235], t$95$2, If[LessEqual[z, 3.05e-251], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 3.2e+48], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := a + \left(z + \frac{z - b}{\frac{t_1}{y}}\right)\\
t_3 := \frac{y + x}{\frac{t_1}{z}}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+189}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{+91}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{+75}:\\
\;\;\;\;a + x \cdot \frac{z}{x + t}\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-235}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{-251}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{t_1}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+48}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -2.09999999999999992e189 or 3.2000000000000001e48 < z Initial program 39.3%
Taylor expanded in z around inf 36.0%
associate-/l*72.6%
Simplified72.6%
if -2.09999999999999992e189 < z < -1.54999999999999999e91Initial program 53.8%
Taylor expanded in y around inf 74.1%
if -1.54999999999999999e91 < z < -2.2999999999999999e75Initial program 98.8%
Simplified98.8%
Taylor expanded in a around inf 98.8%
+-commutative98.8%
+-commutative98.8%
associate-+l+98.8%
associate-/l*99.2%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in y around inf 99.2%
Taylor expanded in y around 0 99.2%
associate-/l*100.0%
associate-/r/99.6%
Simplified99.6%
if -2.2999999999999999e75 < z < -2.7000000000000002e-235 or 3.0500000000000001e-251 < z < 3.2000000000000001e48Initial program 72.7%
Simplified73.2%
Taylor expanded in a around inf 72.7%
+-commutative72.7%
+-commutative72.7%
associate-+l+72.7%
associate-/l*82.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 85.3%
Taylor expanded in x around inf 77.4%
if -2.7000000000000002e-235 < z < 3.0500000000000001e-251Initial program 87.7%
Taylor expanded in z around 0 87.7%
Final simplification76.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ (+ y x) (/ t_1 z))))
(if (<= z -3.7e+192)
t_2
(if (<= z -1.3e+91)
(- (+ z a) b)
(if (<= z -2.6e+74)
(+ a (* x (/ z (+ x t))))
(if (<= z 4.8e+47) (+ a (+ z (/ (- z b) (/ t_1 y)))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (y + x) / (t_1 / z);
double tmp;
if (z <= -3.7e+192) {
tmp = t_2;
} else if (z <= -1.3e+91) {
tmp = (z + a) - b;
} else if (z <= -2.6e+74) {
tmp = a + (x * (z / (x + t)));
} else if (z <= 4.8e+47) {
tmp = a + (z + ((z - b) / (t_1 / 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 = y + (x + t)
t_2 = (y + x) / (t_1 / z)
if (z <= (-3.7d+192)) then
tmp = t_2
else if (z <= (-1.3d+91)) then
tmp = (z + a) - b
else if (z <= (-2.6d+74)) then
tmp = a + (x * (z / (x + t)))
else if (z <= 4.8d+47) then
tmp = a + (z + ((z - b) / (t_1 / 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 = y + (x + t);
double t_2 = (y + x) / (t_1 / z);
double tmp;
if (z <= -3.7e+192) {
tmp = t_2;
} else if (z <= -1.3e+91) {
tmp = (z + a) - b;
} else if (z <= -2.6e+74) {
tmp = a + (x * (z / (x + t)));
} else if (z <= 4.8e+47) {
tmp = a + (z + ((z - b) / (t_1 / y)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (y + x) / (t_1 / z) tmp = 0 if z <= -3.7e+192: tmp = t_2 elif z <= -1.3e+91: tmp = (z + a) - b elif z <= -2.6e+74: tmp = a + (x * (z / (x + t))) elif z <= 4.8e+47: tmp = a + (z + ((z - b) / (t_1 / y))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(y + x) / Float64(t_1 / z)) tmp = 0.0 if (z <= -3.7e+192) tmp = t_2; elseif (z <= -1.3e+91) tmp = Float64(Float64(z + a) - b); elseif (z <= -2.6e+74) tmp = Float64(a + Float64(x * Float64(z / Float64(x + t)))); elseif (z <= 4.8e+47) tmp = Float64(a + Float64(z + Float64(Float64(z - b) / Float64(t_1 / y)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (y + x) / (t_1 / z); tmp = 0.0; if (z <= -3.7e+192) tmp = t_2; elseif (z <= -1.3e+91) tmp = (z + a) - b; elseif (z <= -2.6e+74) tmp = a + (x * (z / (x + t))); elseif (z <= 4.8e+47) tmp = a + (z + ((z - b) / (t_1 / y))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + x), $MachinePrecision] / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e+192], t$95$2, If[LessEqual[z, -1.3e+91], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, -2.6e+74], N[(a + N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+47], N[(a + N[(z + N[(N[(z - b), $MachinePrecision] / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{y + x}{\frac{t_1}{z}}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{+192}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{+91}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{+74}:\\
\;\;\;\;a + x \cdot \frac{z}{x + t}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+47}:\\
\;\;\;\;a + \left(z + \frac{z - b}{\frac{t_1}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.7000000000000001e192 or 4.80000000000000037e47 < z Initial program 39.3%
Taylor expanded in z around inf 36.0%
associate-/l*72.6%
Simplified72.6%
if -3.7000000000000001e192 < z < -1.3e91Initial program 53.8%
Taylor expanded in y around inf 74.1%
if -1.3e91 < z < -2.6000000000000001e74Initial program 98.8%
Simplified98.8%
Taylor expanded in a around inf 98.8%
+-commutative98.8%
+-commutative98.8%
associate-+l+98.8%
associate-/l*99.2%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in y around inf 99.2%
Taylor expanded in y around 0 99.2%
associate-/l*100.0%
associate-/r/99.6%
Simplified99.6%
if -2.6000000000000001e74 < z < 4.80000000000000037e47Initial program 75.2%
Simplified75.8%
Taylor expanded in a around inf 75.2%
+-commutative75.2%
+-commutative75.2%
associate-+l+75.2%
associate-/l*82.0%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in y around inf 81.0%
Taylor expanded in x around inf 73.8%
Final simplification73.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ y x) (/ (+ y (+ x t)) z))))
(if (<= z -1.46e+100)
t_1
(if (<= z -1.8e-58)
(+ a (* x (/ z (+ x t))))
(if (<= z 8e+46) (- a (* b (/ y (+ t (+ y x))))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) / ((y + (x + t)) / z);
double tmp;
if (z <= -1.46e+100) {
tmp = t_1;
} else if (z <= -1.8e-58) {
tmp = a + (x * (z / (x + t)));
} else if (z <= 8e+46) {
tmp = a - (b * (y / (t + (y + x))));
} 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 + x) / ((y + (x + t)) / z)
if (z <= (-1.46d+100)) then
tmp = t_1
else if (z <= (-1.8d-58)) then
tmp = a + (x * (z / (x + t)))
else if (z <= 8d+46) then
tmp = a - (b * (y / (t + (y + x))))
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 + x) / ((y + (x + t)) / z);
double tmp;
if (z <= -1.46e+100) {
tmp = t_1;
} else if (z <= -1.8e-58) {
tmp = a + (x * (z / (x + t)));
} else if (z <= 8e+46) {
tmp = a - (b * (y / (t + (y + x))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y + x) / ((y + (x + t)) / z) tmp = 0 if z <= -1.46e+100: tmp = t_1 elif z <= -1.8e-58: tmp = a + (x * (z / (x + t))) elif z <= 8e+46: tmp = a - (b * (y / (t + (y + x)))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) / Float64(Float64(y + Float64(x + t)) / z)) tmp = 0.0 if (z <= -1.46e+100) tmp = t_1; elseif (z <= -1.8e-58) tmp = Float64(a + Float64(x * Float64(z / Float64(x + t)))); elseif (z <= 8e+46) tmp = Float64(a - Float64(b * Float64(y / Float64(t + Float64(y + x))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y + x) / ((y + (x + t)) / z); tmp = 0.0; if (z <= -1.46e+100) tmp = t_1; elseif (z <= -1.8e-58) tmp = a + (x * (z / (x + t))); elseif (z <= 8e+46) tmp = a - (b * (y / (t + (y + x)))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] / N[(N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.46e+100], t$95$1, If[LessEqual[z, -1.8e-58], N[(a + N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+46], N[(a - N[(b * N[(y / N[(t + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y + x}{\frac{y + \left(x + t\right)}{z}}\\
\mathbf{if}\;z \leq -1.46 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-58}:\\
\;\;\;\;a + x \cdot \frac{z}{x + t}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+46}:\\
\;\;\;\;a - b \cdot \frac{y}{t + \left(y + x\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.46e100 or 7.9999999999999999e46 < z Initial program 42.2%
Taylor expanded in z around inf 37.9%
associate-/l*70.5%
Simplified70.5%
if -1.46e100 < z < -1.80000000000000005e-58Initial program 85.1%
Simplified85.4%
Taylor expanded in a around inf 85.0%
+-commutative85.0%
+-commutative85.0%
associate-+l+85.0%
associate-/l*96.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 81.5%
Taylor expanded in y around 0 67.5%
associate-/l*67.6%
associate-/r/65.5%
Simplified65.5%
if -1.80000000000000005e-58 < z < 7.9999999999999999e46Initial program 73.0%
Simplified73.7%
Taylor expanded in a around inf 73.0%
+-commutative73.0%
+-commutative73.0%
associate-+l+73.0%
associate-/l*78.1%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in y around inf 81.9%
Taylor expanded in z around 0 49.9%
mul-1-neg49.9%
unsub-neg49.9%
associate-/l*66.0%
associate-/r/68.9%
+-commutative68.9%
associate-+l+68.9%
Simplified68.9%
Final simplification69.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3e+183) (not (<= t 2.15e+152))) (+ a (* y (- (/ z t) (/ b t)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3e+183) || !(t <= 2.15e+152)) {
tmp = a + (y * ((z / t) - (b / 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 <= (-3d+183)) .or. (.not. (t <= 2.15d+152))) then
tmp = a + (y * ((z / t) - (b / 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 <= -3e+183) || !(t <= 2.15e+152)) {
tmp = a + (y * ((z / t) - (b / t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3e+183) or not (t <= 2.15e+152): tmp = a + (y * ((z / t) - (b / t))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3e+183) || !(t <= 2.15e+152)) tmp = Float64(a + Float64(y * Float64(Float64(z / t) - Float64(b / 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 <= -3e+183) || ~((t <= 2.15e+152))) tmp = a + (y * ((z / t) - (b / t))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3e+183], N[Not[LessEqual[t, 2.15e+152]], $MachinePrecision]], N[(a + N[(y * N[(N[(z / t), $MachinePrecision] - N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{+183} \lor \neg \left(t \leq 2.15 \cdot 10^{+152}\right):\\
\;\;\;\;a + y \cdot \left(\frac{z}{t} - \frac{b}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -2.99999999999999996e183 or 2.14999999999999997e152 < t Initial program 53.2%
Simplified53.7%
Taylor expanded in x around 0 45.1%
Taylor expanded in y around 0 76.4%
if -2.99999999999999996e183 < t < 2.14999999999999997e152Initial program 63.8%
Taylor expanded in y around inf 63.1%
Final simplification65.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.15e+183) (+ a (/ y (/ t z))) (if (<= t 6.4e+105) (- (+ z a) b) (+ a (* x (/ z (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.15e+183) {
tmp = a + (y / (t / z));
} else if (t <= 6.4e+105) {
tmp = (z + a) - b;
} else {
tmp = a + (x * (z / (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.15d+183)) then
tmp = a + (y / (t / z))
else if (t <= 6.4d+105) then
tmp = (z + a) - b
else
tmp = a + (x * (z / (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.15e+183) {
tmp = a + (y / (t / z));
} else if (t <= 6.4e+105) {
tmp = (z + a) - b;
} else {
tmp = a + (x * (z / (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.15e+183: tmp = a + (y / (t / z)) elif t <= 6.4e+105: tmp = (z + a) - b else: tmp = a + (x * (z / (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.15e+183) tmp = Float64(a + Float64(y / Float64(t / z))); elseif (t <= 6.4e+105) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a + Float64(x * Float64(z / Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.15e+183) tmp = a + (y / (t / z)); elseif (t <= 6.4e+105) tmp = (z + a) - b; else tmp = a + (x * (z / (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.15e+183], N[(a + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e+105], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a + N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+183}:\\
\;\;\;\;a + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{+105}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + x \cdot \frac{z}{x + t}\\
\end{array}
\end{array}
if t < -2.1500000000000002e183Initial program 48.4%
Simplified49.0%
Taylor expanded in x around 0 35.7%
Taylor expanded in y around 0 76.4%
Taylor expanded in b around 0 38.7%
associate-/l*60.5%
Simplified60.5%
if -2.1500000000000002e183 < t < 6.4e105Initial program 63.3%
Taylor expanded in y around inf 64.0%
if 6.4e105 < t Initial program 62.5%
Simplified62.8%
Taylor expanded in a around inf 62.8%
+-commutative62.8%
+-commutative62.8%
associate-+l+62.8%
associate-/l*77.2%
associate-/l*85.7%
Simplified85.7%
Taylor expanded in y around inf 82.7%
Taylor expanded in y around 0 57.6%
associate-/l*66.0%
associate-/r/63.7%
Simplified63.7%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.35e+185) (+ a (/ y (/ t z))) (if (<= t 1.5e+152) (- (+ z a) b) (- a (* b (/ y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.35e+185) {
tmp = a + (y / (t / z));
} else if (t <= 1.5e+152) {
tmp = (z + a) - b;
} else {
tmp = a - (b * (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) :: tmp
if (t <= (-1.35d+185)) then
tmp = a + (y / (t / z))
else if (t <= 1.5d+152) then
tmp = (z + a) - b
else
tmp = a - (b * (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 tmp;
if (t <= -1.35e+185) {
tmp = a + (y / (t / z));
} else if (t <= 1.5e+152) {
tmp = (z + a) - b;
} else {
tmp = a - (b * (y / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.35e+185: tmp = a + (y / (t / z)) elif t <= 1.5e+152: tmp = (z + a) - b else: tmp = a - (b * (y / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.35e+185) tmp = Float64(a + Float64(y / Float64(t / z))); elseif (t <= 1.5e+152) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a - Float64(b * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.35e+185) tmp = a + (y / (t / z)); elseif (t <= 1.5e+152) tmp = (z + a) - b; else tmp = a - (b * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.35e+185], N[(a + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+152], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(b * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+185}:\\
\;\;\;\;a + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+152}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - b \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -1.35000000000000003e185Initial program 48.4%
Simplified49.0%
Taylor expanded in x around 0 35.7%
Taylor expanded in y around 0 76.4%
Taylor expanded in b around 0 38.7%
associate-/l*60.5%
Simplified60.5%
if -1.35000000000000003e185 < t < 1.49999999999999995e152Initial program 63.8%
Taylor expanded in y around inf 63.1%
if 1.49999999999999995e152 < t Initial program 57.8%
Simplified58.2%
Taylor expanded in x around 0 54.1%
Taylor expanded in y around 0 76.3%
Taylor expanded in z around 0 57.9%
mul-1-neg57.9%
unsub-neg57.9%
associate-/l*69.0%
associate-/r/65.5%
Simplified65.5%
Final simplification63.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.15e+183) (+ a (/ y (/ t z))) (if (<= t 3.75e+152) (- (+ z a) b) (- a (* y (/ b t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.15e+183) {
tmp = a + (y / (t / z));
} else if (t <= 3.75e+152) {
tmp = (z + a) - b;
} else {
tmp = a - (y * (b / 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 <= (-2.15d+183)) then
tmp = a + (y / (t / z))
else if (t <= 3.75d+152) then
tmp = (z + a) - b
else
tmp = a - (y * (b / 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 <= -2.15e+183) {
tmp = a + (y / (t / z));
} else if (t <= 3.75e+152) {
tmp = (z + a) - b;
} else {
tmp = a - (y * (b / t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.15e+183: tmp = a + (y / (t / z)) elif t <= 3.75e+152: tmp = (z + a) - b else: tmp = a - (y * (b / t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.15e+183) tmp = Float64(a + Float64(y / Float64(t / z))); elseif (t <= 3.75e+152) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a - Float64(y * Float64(b / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.15e+183) tmp = a + (y / (t / z)); elseif (t <= 3.75e+152) tmp = (z + a) - b; else tmp = a - (y * (b / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.15e+183], N[(a + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.75e+152], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a - N[(y * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+183}:\\
\;\;\;\;a + \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;t \leq 3.75 \cdot 10^{+152}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a - y \cdot \frac{b}{t}\\
\end{array}
\end{array}
if t < -2.1500000000000002e183Initial program 48.4%
Simplified49.0%
Taylor expanded in x around 0 35.7%
Taylor expanded in y around 0 76.4%
Taylor expanded in b around 0 38.7%
associate-/l*60.5%
Simplified60.5%
if -2.1500000000000002e183 < t < 3.75000000000000023e152Initial program 63.8%
Taylor expanded in y around inf 63.1%
if 3.75000000000000023e152 < t Initial program 57.8%
Simplified58.2%
Taylor expanded in x around 0 54.1%
Taylor expanded in y around 0 76.3%
Taylor expanded in z around 0 69.1%
neg-mul-169.1%
distribute-neg-frac69.1%
Simplified69.1%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.8e-128) (not (<= y 1.05e-120))) (- (+ z a) b) (+ z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.8e-128) || !(y <= 1.05e-120)) {
tmp = (z + a) - b;
} else {
tmp = z + a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-8.8d-128)) .or. (.not. (y <= 1.05d-120))) then
tmp = (z + a) - b
else
tmp = z + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.8e-128) || !(y <= 1.05e-120)) {
tmp = (z + a) - b;
} else {
tmp = z + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.8e-128) or not (y <= 1.05e-120): tmp = (z + a) - b else: tmp = z + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.8e-128) || !(y <= 1.05e-120)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.8e-128) || ~((y <= 1.05e-120))) tmp = (z + a) - b; else tmp = z + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.8e-128], N[Not[LessEqual[y, 1.05e-120]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{-128} \lor \neg \left(y \leq 1.05 \cdot 10^{-120}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + a\\
\end{array}
\end{array}
if y < -8.80000000000000037e-128 or 1.05e-120 < y Initial program 54.6%
Taylor expanded in y around inf 65.5%
if -8.80000000000000037e-128 < y < 1.05e-120Initial program 82.6%
Simplified82.6%
Taylor expanded in a around inf 82.6%
+-commutative82.6%
+-commutative82.6%
associate-+l+82.6%
associate-/l*88.4%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in y around inf 68.4%
Taylor expanded in x around inf 52.2%
+-commutative52.2%
Simplified52.2%
Final simplification62.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.3e+183) (+ a (/ y (/ t z))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.3e+183) {
tmp = a + (y / (t / z));
} 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.3d+183)) then
tmp = a + (y / (t / z))
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.3e+183) {
tmp = a + (y / (t / z));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.3e+183: tmp = a + (y / (t / z)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.3e+183) tmp = Float64(a + Float64(y / Float64(t / z))); 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.3e+183) tmp = a + (y / (t / z)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.3e+183], N[(a + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{+183}:\\
\;\;\;\;a + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -1.3e183Initial program 48.4%
Simplified49.0%
Taylor expanded in x around 0 35.7%
Taylor expanded in y around 0 76.4%
Taylor expanded in b around 0 38.7%
associate-/l*60.5%
Simplified60.5%
if -1.3e183 < t Initial program 63.2%
Taylor expanded in y around inf 61.2%
Final simplification61.1%
(FPCore (x y z t a b) :precision binary64 (if (<= a -68000000.0) a (if (<= a 1.8e-6) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -68000000.0) {
tmp = a;
} else if (a <= 1.8e-6) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-68000000.0d0)) then
tmp = a
else if (a <= 1.8d-6) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -68000000.0) {
tmp = a;
} else if (a <= 1.8e-6) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -68000000.0: tmp = a elif a <= 1.8e-6: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -68000000.0) tmp = a; elseif (a <= 1.8e-6) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -68000000.0) tmp = a; elseif (a <= 1.8e-6) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -68000000.0], a, If[LessEqual[a, 1.8e-6], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -68000000:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-6}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -6.8e7 or 1.79999999999999992e-6 < a Initial program 54.3%
Taylor expanded in t around inf 44.4%
if -6.8e7 < a < 1.79999999999999992e-6Initial program 68.8%
Taylor expanded in x around inf 46.5%
Final simplification45.5%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + 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 = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 61.8%
Simplified62.4%
Taylor expanded in a around inf 61.8%
+-commutative61.8%
+-commutative61.8%
associate-+l+61.8%
associate-/l*67.9%
associate-/l*87.4%
Simplified87.4%
Taylor expanded in y around inf 76.0%
Taylor expanded in x around inf 51.1%
+-commutative51.1%
Simplified51.1%
Final simplification51.1%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 61.8%
Taylor expanded in t around inf 25.6%
Final simplification25.6%
(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 2023200
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(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)))