
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (/ (+ y t) t_2))
(t_4
(*
z
(+
(/ x t_2)
(- (fma (/ a z) t_3 (/ y t_2)) (* (/ b t_2) (/ y z)))))))
(if (<= z -8.8e-72)
t_4
(if (<= z 1.02e-191)
(- (/ (fma (+ x y) z (* a (+ y t))) t_1) (* y (/ b t_1)))
(if (<= z 1.9e-32)
(* a (+ t_3 (/ (/ (+ (* y (- z b)) (* z x)) t_2) a)))
t_4)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = y + (x + t);
double t_3 = (y + t) / t_2;
double t_4 = z * ((x / t_2) + (fma((a / z), t_3, (y / t_2)) - ((b / t_2) * (y / z))));
double tmp;
if (z <= -8.8e-72) {
tmp = t_4;
} else if (z <= 1.02e-191) {
tmp = (fma((x + y), z, (a * (y + t))) / t_1) - (y * (b / t_1));
} else if (z <= 1.9e-32) {
tmp = a * (t_3 + ((((y * (z - b)) + (z * x)) / t_2) / a));
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(y + t) / t_2) t_4 = Float64(z * Float64(Float64(x / t_2) + Float64(fma(Float64(a / z), t_3, Float64(y / t_2)) - Float64(Float64(b / t_2) * Float64(y / z))))) tmp = 0.0 if (z <= -8.8e-72) tmp = t_4; elseif (z <= 1.02e-191) tmp = Float64(Float64(fma(Float64(x + y), z, Float64(a * Float64(y + t))) / t_1) - Float64(y * Float64(b / t_1))); elseif (z <= 1.9e-32) tmp = Float64(a * Float64(t_3 + Float64(Float64(Float64(Float64(y * Float64(z - b)) + Float64(z * x)) / t_2) / a))); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + t), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(x / t$95$2), $MachinePrecision] + N[(N[(N[(a / z), $MachinePrecision] * t$95$3 + N[(y / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[(b / t$95$2), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.8e-72], t$95$4, If[LessEqual[z, 1.02e-191], N[(N[(N[(N[(x + y), $MachinePrecision] * z + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] - N[(y * N[(b / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e-32], N[(a * N[(t$95$3 + N[(N[(N[(N[(y * N[(z - b), $MachinePrecision]), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{y + t}{t\_2}\\
t_4 := z \cdot \left(\frac{x}{t\_2} + \left(\mathsf{fma}\left(\frac{a}{z}, t\_3, \frac{y}{t\_2}\right) - \frac{b}{t\_2} \cdot \frac{y}{z}\right)\right)\\
\mathbf{if}\;z \leq -8.8 \cdot 10^{-72}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-191}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, a \cdot \left(y + t\right)\right)}{t\_1} - y \cdot \frac{b}{t\_1}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-32}:\\
\;\;\;\;a \cdot \left(t\_3 + \frac{\frac{y \cdot \left(z - b\right) + z \cdot x}{t\_2}}{a}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if z < -8.8000000000000001e-72 or 1.90000000000000004e-32 < z Initial program 49.1%
Taylor expanded in z around inf 66.8%
associate--l+66.8%
+-commutative66.8%
associate-+r+66.8%
+-commutative66.8%
associate-+l+66.8%
Simplified95.6%
if -8.8000000000000001e-72 < z < 1.02e-191Initial program 84.1%
div-sub84.1%
fma-define84.1%
+-commutative84.1%
*-commutative84.1%
associate-+l+84.1%
+-commutative84.1%
associate-+l+84.1%
+-commutative84.1%
associate-/l*91.4%
Applied egg-rr91.4%
if 1.02e-191 < z < 1.90000000000000004e-32Initial program 70.8%
Taylor expanded in a around -inf 90.9%
Simplified90.9%
Final simplification93.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) t_1))
(t_3 (- (+ z a) b)))
(if (or (<= t_2 -2e+213) (not (<= t_2 5e+295)))
t_3
(/ (+ (* t a) (+ (* z x) (* y t_3))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -2e+213) || !(t_2 <= 5e+295)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((z * x) + (y * t_3))) / 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1
t_3 = (z + a) - b
if ((t_2 <= (-2d+213)) .or. (.not. (t_2 <= 5d+295))) then
tmp = t_3
else
tmp = ((t * a) + ((z * x) + (y * t_3))) / 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 + t);
double t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -2e+213) || !(t_2 <= 5e+295)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((z * x) + (y * t_3))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1 t_3 = (z + a) - b tmp = 0 if (t_2 <= -2e+213) or not (t_2 <= 5e+295): tmp = t_3 else: tmp = ((t * a) + ((z * x) + (y * t_3))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if ((t_2 <= -2e+213) || !(t_2 <= 5e+295)) tmp = t_3; else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(z * x) + Float64(y * t_3))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / t_1; t_3 = (z + a) - b; tmp = 0.0; if ((t_2 <= -2e+213) || ~((t_2 <= 5e+295))) tmp = t_3; else tmp = ((t * a) + ((z * x) + (y * t_3))) / t_1; 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[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2e+213], N[Not[LessEqual[t$95$2, 5e+295]], $MachinePrecision]], t$95$3, N[(N[(N[(t * a), $MachinePrecision] + N[(N[(z * x), $MachinePrecision] + N[(y * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+213} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+295}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(z \cdot x + y \cdot t\_3\right)}{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)) < -1.99999999999999997e213 or 4.99999999999999991e295 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 11.7%
Taylor expanded in y around inf 71.8%
if -1.99999999999999997e213 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.99999999999999991e295Initial program 99.6%
Taylor expanded in y around 0 99.7%
Final simplification87.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b))
(t_2 (* a (+ y t)))
(t_3 (+ y (+ x t)))
(t_4 (/ (+ (* z (+ x y)) t_2) t_3)))
(if (<= z -7e+191)
(/ z (/ t_3 (+ x y)))
(if (<= z -7.5e+92)
t_1
(if (<= z -1.25e+51)
t_4
(if (<= z -1.6e-70)
t_1
(if (<= z 1.95e-79)
(/ (- t_2 (* y b)) t_3)
(if (<= z 7e+146) t_4 (* z (/ (+ x y) t_3))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * (y + t);
double t_3 = y + (x + t);
double t_4 = ((z * (x + y)) + t_2) / t_3;
double tmp;
if (z <= -7e+191) {
tmp = z / (t_3 / (x + y));
} else if (z <= -7.5e+92) {
tmp = t_1;
} else if (z <= -1.25e+51) {
tmp = t_4;
} else if (z <= -1.6e-70) {
tmp = t_1;
} else if (z <= 1.95e-79) {
tmp = (t_2 - (y * b)) / t_3;
} else if (z <= 7e+146) {
tmp = t_4;
} else {
tmp = z * ((x + y) / t_3);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (z + a) - b
t_2 = a * (y + t)
t_3 = y + (x + t)
t_4 = ((z * (x + y)) + t_2) / t_3
if (z <= (-7d+191)) then
tmp = z / (t_3 / (x + y))
else if (z <= (-7.5d+92)) then
tmp = t_1
else if (z <= (-1.25d+51)) then
tmp = t_4
else if (z <= (-1.6d-70)) then
tmp = t_1
else if (z <= 1.95d-79) then
tmp = (t_2 - (y * b)) / t_3
else if (z <= 7d+146) then
tmp = t_4
else
tmp = z * ((x + y) / 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 = (z + a) - b;
double t_2 = a * (y + t);
double t_3 = y + (x + t);
double t_4 = ((z * (x + y)) + t_2) / t_3;
double tmp;
if (z <= -7e+191) {
tmp = z / (t_3 / (x + y));
} else if (z <= -7.5e+92) {
tmp = t_1;
} else if (z <= -1.25e+51) {
tmp = t_4;
} else if (z <= -1.6e-70) {
tmp = t_1;
} else if (z <= 1.95e-79) {
tmp = (t_2 - (y * b)) / t_3;
} else if (z <= 7e+146) {
tmp = t_4;
} else {
tmp = z * ((x + y) / t_3);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = a * (y + t) t_3 = y + (x + t) t_4 = ((z * (x + y)) + t_2) / t_3 tmp = 0 if z <= -7e+191: tmp = z / (t_3 / (x + y)) elif z <= -7.5e+92: tmp = t_1 elif z <= -1.25e+51: tmp = t_4 elif z <= -1.6e-70: tmp = t_1 elif z <= 1.95e-79: tmp = (t_2 - (y * b)) / t_3 elif z <= 7e+146: tmp = t_4 else: tmp = z * ((x + y) / t_3) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(a * Float64(y + t)) t_3 = Float64(y + Float64(x + t)) t_4 = Float64(Float64(Float64(z * Float64(x + y)) + t_2) / t_3) tmp = 0.0 if (z <= -7e+191) tmp = Float64(z / Float64(t_3 / Float64(x + y))); elseif (z <= -7.5e+92) tmp = t_1; elseif (z <= -1.25e+51) tmp = t_4; elseif (z <= -1.6e-70) tmp = t_1; elseif (z <= 1.95e-79) tmp = Float64(Float64(t_2 - Float64(y * b)) / t_3); elseif (z <= 7e+146) tmp = t_4; else tmp = Float64(z * Float64(Float64(x + y) / t_3)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = a * (y + t); t_3 = y + (x + t); t_4 = ((z * (x + y)) + t_2) / t_3; tmp = 0.0; if (z <= -7e+191) tmp = z / (t_3 / (x + y)); elseif (z <= -7.5e+92) tmp = t_1; elseif (z <= -1.25e+51) tmp = t_4; elseif (z <= -1.6e-70) tmp = t_1; elseif (z <= 1.95e-79) tmp = (t_2 - (y * b)) / t_3; elseif (z <= 7e+146) tmp = t_4; else tmp = z * ((x + y) / t_3); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[z, -7e+191], N[(z / N[(t$95$3 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5e+92], t$95$1, If[LessEqual[z, -1.25e+51], t$95$4, If[LessEqual[z, -1.6e-70], t$95$1, If[LessEqual[z, 1.95e-79], N[(N[(t$95$2 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[z, 7e+146], t$95$4, N[(z * N[(N[(x + y), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := a \cdot \left(y + t\right)\\
t_3 := y + \left(x + t\right)\\
t_4 := \frac{z \cdot \left(x + y\right) + t\_2}{t\_3}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+191}:\\
\;\;\;\;\frac{z}{\frac{t\_3}{x + y}}\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{+51}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-79}:\\
\;\;\;\;\frac{t\_2 - y \cdot b}{t\_3}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+146}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_3}\\
\end{array}
\end{array}
if z < -6.9999999999999994e191Initial program 41.0%
Taylor expanded in z around inf 36.0%
associate-/l*72.9%
+-commutative72.9%
+-commutative72.9%
associate-+r+72.9%
+-commutative72.9%
associate-+l+72.9%
Simplified72.9%
clear-num72.9%
un-div-inv73.1%
+-commutative73.1%
Applied egg-rr73.1%
if -6.9999999999999994e191 < z < -7.49999999999999946e92 or -1.25e51 < z < -1.5999999999999999e-70Initial program 51.3%
Taylor expanded in y around inf 77.3%
if -7.49999999999999946e92 < z < -1.25e51 or 1.95000000000000003e-79 < z < 7.0000000000000002e146Initial program 74.8%
Taylor expanded in b around 0 71.0%
if -1.5999999999999999e-70 < z < 1.95000000000000003e-79Initial program 81.6%
Taylor expanded in z around 0 72.7%
*-commutative72.7%
Simplified72.7%
if 7.0000000000000002e146 < z Initial program 16.0%
Taylor expanded in z around inf 16.0%
associate-/l*87.1%
+-commutative87.1%
+-commutative87.1%
associate-+r+87.1%
+-commutative87.1%
associate-+l+87.1%
Simplified87.1%
Final simplification75.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b))
(t_2 (+ y (+ x t)))
(t_3 (/ z (/ t_2 (+ x y))))
(t_4 (/ (+ (* t a) (* y (- a b))) t_2)))
(if (<= z -1.55e+189)
t_3
(if (<= z -1.3e-74)
t_1
(if (<= z 1.2e-191)
t_4
(if (<= z 1.35e-162)
(* a (/ (+ y t) t_2))
(if (<= z 1.06e-72) t_4 (if (<= z 3.5e+207) t_1 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = y + (x + t);
double t_3 = z / (t_2 / (x + y));
double t_4 = ((t * a) + (y * (a - b))) / t_2;
double tmp;
if (z <= -1.55e+189) {
tmp = t_3;
} else if (z <= -1.3e-74) {
tmp = t_1;
} else if (z <= 1.2e-191) {
tmp = t_4;
} else if (z <= 1.35e-162) {
tmp = a * ((y + t) / t_2);
} else if (z <= 1.06e-72) {
tmp = t_4;
} else if (z <= 3.5e+207) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (z + a) - b
t_2 = y + (x + t)
t_3 = z / (t_2 / (x + y))
t_4 = ((t * a) + (y * (a - b))) / t_2
if (z <= (-1.55d+189)) then
tmp = t_3
else if (z <= (-1.3d-74)) then
tmp = t_1
else if (z <= 1.2d-191) then
tmp = t_4
else if (z <= 1.35d-162) then
tmp = a * ((y + t) / t_2)
else if (z <= 1.06d-72) then
tmp = t_4
else if (z <= 3.5d+207) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = y + (x + t);
double t_3 = z / (t_2 / (x + y));
double t_4 = ((t * a) + (y * (a - b))) / t_2;
double tmp;
if (z <= -1.55e+189) {
tmp = t_3;
} else if (z <= -1.3e-74) {
tmp = t_1;
} else if (z <= 1.2e-191) {
tmp = t_4;
} else if (z <= 1.35e-162) {
tmp = a * ((y + t) / t_2);
} else if (z <= 1.06e-72) {
tmp = t_4;
} else if (z <= 3.5e+207) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = y + (x + t) t_3 = z / (t_2 / (x + y)) t_4 = ((t * a) + (y * (a - b))) / t_2 tmp = 0 if z <= -1.55e+189: tmp = t_3 elif z <= -1.3e-74: tmp = t_1 elif z <= 1.2e-191: tmp = t_4 elif z <= 1.35e-162: tmp = a * ((y + t) / t_2) elif z <= 1.06e-72: tmp = t_4 elif z <= 3.5e+207: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(z / Float64(t_2 / Float64(x + y))) t_4 = Float64(Float64(Float64(t * a) + Float64(y * Float64(a - b))) / t_2) tmp = 0.0 if (z <= -1.55e+189) tmp = t_3; elseif (z <= -1.3e-74) tmp = t_1; elseif (z <= 1.2e-191) tmp = t_4; elseif (z <= 1.35e-162) tmp = Float64(a * Float64(Float64(y + t) / t_2)); elseif (z <= 1.06e-72) tmp = t_4; elseif (z <= 3.5e+207) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = y + (x + t); t_3 = z / (t_2 / (x + y)); t_4 = ((t * a) + (y * (a - b))) / t_2; tmp = 0.0; if (z <= -1.55e+189) tmp = t_3; elseif (z <= -1.3e-74) tmp = t_1; elseif (z <= 1.2e-191) tmp = t_4; elseif (z <= 1.35e-162) tmp = a * ((y + t) / t_2); elseif (z <= 1.06e-72) tmp = t_4; elseif (z <= 3.5e+207) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z / N[(t$95$2 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t * a), $MachinePrecision] + N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[z, -1.55e+189], t$95$3, If[LessEqual[z, -1.3e-74], t$95$1, If[LessEqual[z, 1.2e-191], t$95$4, If[LessEqual[z, 1.35e-162], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.06e-72], t$95$4, If[LessEqual[z, 3.5e+207], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{z}{\frac{t\_2}{x + y}}\\
t_4 := \frac{t \cdot a + y \cdot \left(a - b\right)}{t\_2}\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+189}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-191}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-162}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_2}\\
\mathbf{elif}\;z \leq 1.06 \cdot 10^{-72}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.55e189 or 3.50000000000000028e207 < z Initial program 30.5%
Taylor expanded in z around inf 27.8%
associate-/l*82.4%
+-commutative82.4%
+-commutative82.4%
associate-+r+82.4%
+-commutative82.4%
associate-+l+82.4%
Simplified82.4%
clear-num82.4%
un-div-inv82.5%
+-commutative82.5%
Applied egg-rr82.5%
if -1.55e189 < z < -1.3e-74 or 1.05999999999999994e-72 < z < 3.50000000000000028e207Initial program 58.6%
Taylor expanded in y around inf 68.0%
if -1.3e-74 < z < 1.2e-191 or 1.34999999999999992e-162 < z < 1.05999999999999994e-72Initial program 84.3%
Taylor expanded in z around 0 74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in y around 0 74.4%
if 1.2e-191 < z < 1.34999999999999992e-162Initial program 46.8%
Taylor expanded in z around inf 36.4%
associate--l+36.4%
+-commutative36.4%
associate-+r+36.4%
+-commutative36.4%
associate-+l+36.4%
Simplified35.2%
Taylor expanded in a around -inf 47.6%
associate-/l*99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification74.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (* a (/ (+ y t) (+ y (+ x t))))))
(if (<= a -2.7e+95)
t_2
(if (<= a 1.95e-274)
t_1
(if (<= a 1.18e-60)
(/ (+ (* t a) (* z x)) (+ x t))
(if (<= a 3.7e+152) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * ((y + t) / (y + (x + t)));
double tmp;
if (a <= -2.7e+95) {
tmp = t_2;
} else if (a <= 1.95e-274) {
tmp = t_1;
} else if (a <= 1.18e-60) {
tmp = ((t * a) + (z * x)) / (x + t);
} else if (a <= 3.7e+152) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = a * ((y + t) / (y + (x + t)))
if (a <= (-2.7d+95)) then
tmp = t_2
else if (a <= 1.95d-274) then
tmp = t_1
else if (a <= 1.18d-60) then
tmp = ((t * a) + (z * x)) / (x + t)
else if (a <= 3.7d+152) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * ((y + t) / (y + (x + t)));
double tmp;
if (a <= -2.7e+95) {
tmp = t_2;
} else if (a <= 1.95e-274) {
tmp = t_1;
} else if (a <= 1.18e-60) {
tmp = ((t * a) + (z * x)) / (x + t);
} else if (a <= 3.7e+152) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = a * ((y + t) / (y + (x + t))) tmp = 0 if a <= -2.7e+95: tmp = t_2 elif a <= 1.95e-274: tmp = t_1 elif a <= 1.18e-60: tmp = ((t * a) + (z * x)) / (x + t) elif a <= 3.7e+152: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))) tmp = 0.0 if (a <= -2.7e+95) tmp = t_2; elseif (a <= 1.95e-274) tmp = t_1; elseif (a <= 1.18e-60) tmp = Float64(Float64(Float64(t * a) + Float64(z * x)) / Float64(x + t)); elseif (a <= 3.7e+152) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = a * ((y + t) / (y + (x + t))); tmp = 0.0; if (a <= -2.7e+95) tmp = t_2; elseif (a <= 1.95e-274) tmp = t_1; elseif (a <= 1.18e-60) tmp = ((t * a) + (z * x)) / (x + t); elseif (a <= 3.7e+152) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.7e+95], t$95$2, If[LessEqual[a, 1.95e-274], t$95$1, If[LessEqual[a, 1.18e-60], N[(N[(N[(t * a), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.7e+152], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{if}\;a \leq -2.7 \cdot 10^{+95}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.18 \cdot 10^{-60}:\\
\;\;\;\;\frac{t \cdot a + z \cdot x}{x + t}\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -2.7e95Initial program 33.0%
Taylor expanded in a around inf 31.1%
associate-/l*81.3%
+-commutative81.3%
associate-+r+81.3%
+-commutative81.3%
associate-+l+81.3%
Simplified81.3%
if -2.7e95 < a < 1.94999999999999993e-274 or 1.17999999999999994e-60 < a < 3.69999999999999996e152Initial program 70.8%
Taylor expanded in y around inf 65.6%
if 1.94999999999999993e-274 < a < 1.17999999999999994e-60Initial program 74.1%
Taylor expanded in y around 0 59.0%
if 3.69999999999999996e152 < a Initial program 46.1%
Taylor expanded in z around inf 41.4%
associate--l+41.4%
+-commutative41.4%
associate-+r+41.4%
+-commutative41.4%
associate-+l+41.4%
Simplified54.9%
Taylor expanded in a around -inf 43.4%
associate-/l*79.6%
+-commutative79.6%
associate-+r+79.6%
+-commutative79.6%
Simplified79.6%
Final simplification68.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (/ (- a b) (+ x y)))) (t_2 (- (+ z a) b)))
(if (<= z -8.2e-64)
t_2
(if (<= z 2.2e-196)
t_1
(if (<= z 1.22e-155) a (if (<= z 6.6e-78) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * ((a - b) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (z <= -8.2e-64) {
tmp = t_2;
} else if (z <= 2.2e-196) {
tmp = t_1;
} else if (z <= 1.22e-155) {
tmp = a;
} else if (z <= 6.6e-78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y * ((a - b) / (x + y))
t_2 = (z + a) - b
if (z <= (-8.2d-64)) then
tmp = t_2
else if (z <= 2.2d-196) then
tmp = t_1
else if (z <= 1.22d-155) then
tmp = a
else if (z <= 6.6d-78) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * ((a - b) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (z <= -8.2e-64) {
tmp = t_2;
} else if (z <= 2.2e-196) {
tmp = t_1;
} else if (z <= 1.22e-155) {
tmp = a;
} else if (z <= 6.6e-78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y * ((a - b) / (x + y)) t_2 = (z + a) - b tmp = 0 if z <= -8.2e-64: tmp = t_2 elif z <= 2.2e-196: tmp = t_1 elif z <= 1.22e-155: tmp = a elif z <= 6.6e-78: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(Float64(a - b) / Float64(x + y))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (z <= -8.2e-64) tmp = t_2; elseif (z <= 2.2e-196) tmp = t_1; elseif (z <= 1.22e-155) tmp = a; elseif (z <= 6.6e-78) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y * ((a - b) / (x + y)); t_2 = (z + a) - b; tmp = 0.0; if (z <= -8.2e-64) tmp = t_2; elseif (z <= 2.2e-196) tmp = t_1; elseif (z <= 1.22e-155) tmp = a; elseif (z <= 6.6e-78) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(N[(a - b), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[z, -8.2e-64], t$95$2, If[LessEqual[z, 2.2e-196], t$95$1, If[LessEqual[z, 1.22e-155], a, If[LessEqual[z, 6.6e-78], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{a - b}{x + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{-155}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -8.2000000000000001e-64 or 6.59999999999999963e-78 < z Initial program 50.1%
Taylor expanded in y around inf 66.1%
if -8.2000000000000001e-64 < z < 2.20000000000000015e-196 or 1.22000000000000001e-155 < z < 6.59999999999999963e-78Initial program 82.2%
Taylor expanded in z around 0 72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in t around 0 49.4%
distribute-rgt-out--49.6%
+-commutative49.6%
Simplified49.6%
associate-/l*63.0%
Applied egg-rr63.0%
if 2.20000000000000015e-196 < z < 1.22000000000000001e-155Initial program 56.5%
Taylor expanded in t around inf 82.0%
Final simplification65.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5e+61) (not (<= t 3.8e+105))) (* a (/ (+ y t) (+ y (+ x t)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5e+61) || !(t <= 3.8e+105)) {
tmp = a * ((y + t) / (y + (x + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-5d+61)) .or. (.not. (t <= 3.8d+105))) then
tmp = a * ((y + t) / (y + (x + t)))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5e+61) || !(t <= 3.8e+105)) {
tmp = a * ((y + t) / (y + (x + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5e+61) or not (t <= 3.8e+105): tmp = a * ((y + t) / (y + (x + t))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5e+61) || !(t <= 3.8e+105)) tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5e+61) || ~((t <= 3.8e+105))) tmp = a * ((y + t) / (y + (x + t))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5e+61], N[Not[LessEqual[t, 3.8e+105]], $MachinePrecision]], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+61} \lor \neg \left(t \leq 3.8 \cdot 10^{+105}\right):\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -5.00000000000000018e61Initial program 49.9%
Taylor expanded in a around inf 31.5%
associate-/l*56.3%
+-commutative56.3%
associate-+r+56.3%
+-commutative56.3%
associate-+l+56.3%
Simplified56.3%
if -5.00000000000000018e61 < t < 3.8e105Initial program 69.1%
Taylor expanded in y around inf 70.8%
if 3.8e105 < t Initial program 52.3%
Taylor expanded in z around inf 55.8%
associate--l+55.8%
+-commutative55.8%
associate-+r+55.8%
+-commutative55.8%
associate-+l+55.8%
Simplified80.3%
Taylor expanded in a around -inf 30.6%
associate-/l*61.2%
+-commutative61.2%
associate-+r+61.2%
+-commutative61.2%
Simplified61.2%
Final simplification66.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -5.2e+61) (not (<= t 2e+104))) (* a (/ (+ y t) (+ y (+ x t)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.2e+61) || !(t <= 2e+104)) {
tmp = a * ((y + t) / (y + (x + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-5.2d+61)) .or. (.not. (t <= 2d+104))) then
tmp = a * ((y + t) / (y + (x + t)))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -5.2e+61) || !(t <= 2e+104)) {
tmp = a * ((y + t) / (y + (x + t)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -5.2e+61) or not (t <= 2e+104): tmp = a * ((y + t) / (y + (x + t))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -5.2e+61) || !(t <= 2e+104)) tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -5.2e+61) || ~((t <= 2e+104))) tmp = a * ((y + t) / (y + (x + t))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.2e+61], N[Not[LessEqual[t, 2e+104]], $MachinePrecision]], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+61} \lor \neg \left(t \leq 2 \cdot 10^{+104}\right):\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -5.19999999999999945e61 or 2e104 < t Initial program 50.9%
Taylor expanded in a around inf 31.1%
associate-/l*58.4%
+-commutative58.4%
associate-+r+58.4%
+-commutative58.4%
associate-+l+58.4%
Simplified58.4%
if -5.19999999999999945e61 < t < 2e104Initial program 69.1%
Taylor expanded in y around inf 70.8%
Final simplification66.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7.2e+241) z (if (<= x 1.1e+181) (- (+ z a) b) (* x (/ z (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.2e+241) {
tmp = z;
} else if (x <= 1.1e+181) {
tmp = (z + a) - b;
} else {
tmp = 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 (x <= (-7.2d+241)) then
tmp = z
else if (x <= 1.1d+181) then
tmp = (z + a) - b
else
tmp = 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 (x <= -7.2e+241) {
tmp = z;
} else if (x <= 1.1e+181) {
tmp = (z + a) - b;
} else {
tmp = x * (z / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7.2e+241: tmp = z elif x <= 1.1e+181: tmp = (z + a) - b else: tmp = x * (z / (x + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.2e+241) tmp = z; elseif (x <= 1.1e+181) tmp = Float64(Float64(z + a) - b); else tmp = 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 (x <= -7.2e+241) tmp = z; elseif (x <= 1.1e+181) tmp = (z + a) - b; else tmp = x * (z / (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.2e+241], z, If[LessEqual[x, 1.1e+181], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(x * N[(z / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+241}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+181}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{x + t}\\
\end{array}
\end{array}
if x < -7.19999999999999966e241Initial program 68.3%
Taylor expanded in x around inf 57.6%
if -7.19999999999999966e241 < x < 1.1000000000000001e181Initial program 67.2%
Taylor expanded in y around inf 63.4%
if 1.1000000000000001e181 < x Initial program 32.7%
Taylor expanded in z around inf 18.9%
associate-/l*64.1%
+-commutative64.1%
+-commutative64.1%
associate-+r+64.1%
+-commutative64.1%
associate-+l+64.1%
Simplified64.1%
Taylor expanded in y around 0 18.9%
associate-/l*58.8%
+-commutative58.8%
Simplified58.8%
Final simplification62.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8e+75) z (if (<= x -7.2e-281) (- a b) (if (<= x 1.2e+172) a z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8e+75) {
tmp = z;
} else if (x <= -7.2e-281) {
tmp = a - b;
} else if (x <= 1.2e+172) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-8d+75)) then
tmp = z
else if (x <= (-7.2d-281)) then
tmp = a - b
else if (x <= 1.2d+172) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8e+75) {
tmp = z;
} else if (x <= -7.2e-281) {
tmp = a - b;
} else if (x <= 1.2e+172) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8e+75: tmp = z elif x <= -7.2e-281: tmp = a - b elif x <= 1.2e+172: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8e+75) tmp = z; elseif (x <= -7.2e-281) tmp = Float64(a - b); elseif (x <= 1.2e+172) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -8e+75) tmp = z; elseif (x <= -7.2e-281) tmp = a - b; elseif (x <= 1.2e+172) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8e+75], z, If[LessEqual[x, -7.2e-281], N[(a - b), $MachinePrecision], If[LessEqual[x, 1.2e+172], a, z]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+75}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-281}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+172}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -7.99999999999999941e75 or 1.2e172 < x Initial program 47.2%
Taylor expanded in x around inf 48.9%
if -7.99999999999999941e75 < x < -7.20000000000000013e-281Initial program 69.2%
Taylor expanded in z around 0 50.4%
*-commutative50.4%
Simplified50.4%
Taylor expanded in y around inf 65.1%
if -7.20000000000000013e-281 < x < 1.2e172Initial program 71.3%
Taylor expanded in t around inf 46.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.3e+242) z (if (<= x 1.3e+190) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.3e+242) {
tmp = z;
} else if (x <= 1.3e+190) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-3.3d+242)) then
tmp = z
else if (x <= 1.3d+190) then
tmp = (z + a) - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.3e+242) {
tmp = z;
} else if (x <= 1.3e+190) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.3e+242: tmp = z elif x <= 1.3e+190: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.3e+242) tmp = z; elseif (x <= 1.3e+190) tmp = Float64(Float64(z + a) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.3e+242) tmp = z; elseif (x <= 1.3e+190) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.3e+242], z, If[LessEqual[x, 1.3e+190], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{+242}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+190}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -3.30000000000000023e242 or 1.30000000000000005e190 < x Initial program 42.1%
Taylor expanded in x around inf 60.2%
if -3.30000000000000023e242 < x < 1.30000000000000005e190Initial program 66.8%
Taylor expanded in y around inf 62.5%
Final simplification62.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.1e+75) z (if (<= z 1.1e-52) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.1e+75) {
tmp = z;
} else if (z <= 1.1e-52) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.1d+75)) then
tmp = z
else if (z <= 1.1d-52) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.1e+75) {
tmp = z;
} else if (z <= 1.1e-52) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.1e+75: tmp = z elif z <= 1.1e-52: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.1e+75) tmp = z; elseif (z <= 1.1e-52) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.1e+75) tmp = z; elseif (z <= 1.1e-52) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.1e+75], z, If[LessEqual[z, 1.1e-52], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+75}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-52}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -4.0999999999999998e75 or 1.10000000000000005e-52 < z Initial program 45.0%
Taylor expanded in x around inf 53.6%
if -4.0999999999999998e75 < z < 1.10000000000000005e-52Initial program 76.9%
Taylor expanded in t around inf 43.3%
(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 62.5%
Taylor expanded in t around inf 33.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))
(t_3 (/ t_2 t_1))
(t_4 (- (+ z a) b)))
(if (< t_3 -3.5813117084150564e+153)
t_4
(if (< t_3 1.2285964308315609e+82) (/ 1.0 (/ t_1 t_2)) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + t) + y
t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b)
t_3 = t_2 / t_1
t_4 = (z + a) - b
if (t_3 < (-3.5813117084150564d+153)) then
tmp = t_4
else if (t_3 < 1.2285964308315609d+82) then
tmp = 1.0d0 / (t_1 / t_2)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b);
double t_3 = t_2 / t_1;
double t_4 = (z + a) - b;
double tmp;
if (t_3 < -3.5813117084150564e+153) {
tmp = t_4;
} else if (t_3 < 1.2285964308315609e+82) {
tmp = 1.0 / (t_1 / t_2);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + t) + y t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b) t_3 = t_2 / t_1 t_4 = (z + a) - b tmp = 0 if t_3 < -3.5813117084150564e+153: tmp = t_4 elif t_3 < 1.2285964308315609e+82: tmp = 1.0 / (t_1 / t_2) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) t_3 = Float64(t_2 / t_1) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = Float64(1.0 / Float64(t_1 / t_2)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + t) + y; t_2 = (((x + y) * z) + ((t + y) * a)) - (y * b); t_3 = t_2 / t_1; t_4 = (z + a) - b; tmp = 0.0; if (t_3 < -3.5813117084150564e+153) tmp = t_4; elseif (t_3 < 1.2285964308315609e+82) tmp = 1.0 / (t_1 / t_2); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Less[t$95$3, -3.5813117084150564e+153], t$95$4, If[Less[t$95$3, 1.2285964308315609e+82], N[(1.0 / N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b\\
t_3 := \frac{t\_2}{t\_1}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;t\_3 < -3.5813117084150564 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 < 1.2285964308315609 \cdot 10^{+82}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
herbie shell --seed 2024103
(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)))