
(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 15 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 (/ (- (+ (* a (+ y t)) (* z (+ x y))) (* y b)) (+ y (+ x t)))))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 5e+246)))
(+ a (* z (+ (/ x t_1) (/ y t_1))))
t_2)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 5e+246)) {
tmp = a + (z * ((x / t_1) + (y / t_1)));
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 5e+246)) {
tmp = a + (z * ((x / t_1) + (y / t_1)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 5e+246): tmp = a + (z * ((x / t_1) + (y / t_1))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 5e+246)) tmp = Float64(a + Float64(z * Float64(Float64(x / t_1) + Float64(y / t_1)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = (((a * (y + t)) + (z * (x + y))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 5e+246))) tmp = a + (z * ((x / t_1) + (y / t_1))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 5e+246]], $MachinePrecision]], N[(a + N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(x + y\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 5 \cdot 10^{+246}\right):\\
\;\;\;\;a + z \cdot \left(\frac{x}{t_1} + \frac{y}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\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 4.99999999999999976e246 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.3%
Taylor expanded in z around 0 39.9%
associate--l+39.9%
*-commutative39.9%
associate-+r+39.9%
associate-+r+39.9%
div-sub39.9%
associate-+r+39.9%
Simplified39.9%
Taylor expanded in t around inf 76.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.99999999999999976e246Initial program 99.7%
Final simplification89.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b))
(t_2 (+ y (+ x t)))
(t_3 (+ x (+ y t)))
(t_4 (* z (/ (+ x y) t_3))))
(if (<= z -9e+112)
(/ (+ x y) (/ t_3 z))
(if (<= z -2.4e+76)
a
(if (<= z -5.8e+49)
t_4
(if (<= z -24.0)
(/ (* y t_1) t_2)
(if (<= z -1.2e-160)
t_1
(if (<= z 4.2e-290)
(* (- (* a (+ y t)) (* y b)) (/ 1.0 t_2))
(if (<= z 1.2e-28)
(/ (- (+ (* y a) (* z (+ x y))) (* y b)) (+ x y))
(if (<= z 3.4e+97) t_1 t_4))))))))))
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 = x + (y + t);
double t_4 = z * ((x + y) / t_3);
double tmp;
if (z <= -9e+112) {
tmp = (x + y) / (t_3 / z);
} else if (z <= -2.4e+76) {
tmp = a;
} else if (z <= -5.8e+49) {
tmp = t_4;
} else if (z <= -24.0) {
tmp = (y * t_1) / t_2;
} else if (z <= -1.2e-160) {
tmp = t_1;
} else if (z <= 4.2e-290) {
tmp = ((a * (y + t)) - (y * b)) * (1.0 / t_2);
} else if (z <= 1.2e-28) {
tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y);
} else if (z <= 3.4e+97) {
tmp = t_1;
} 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 = (z + a) - b
t_2 = y + (x + t)
t_3 = x + (y + t)
t_4 = z * ((x + y) / t_3)
if (z <= (-9d+112)) then
tmp = (x + y) / (t_3 / z)
else if (z <= (-2.4d+76)) then
tmp = a
else if (z <= (-5.8d+49)) then
tmp = t_4
else if (z <= (-24.0d0)) then
tmp = (y * t_1) / t_2
else if (z <= (-1.2d-160)) then
tmp = t_1
else if (z <= 4.2d-290) then
tmp = ((a * (y + t)) - (y * b)) * (1.0d0 / t_2)
else if (z <= 1.2d-28) then
tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y)
else if (z <= 3.4d+97) then
tmp = t_1
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 = (z + a) - b;
double t_2 = y + (x + t);
double t_3 = x + (y + t);
double t_4 = z * ((x + y) / t_3);
double tmp;
if (z <= -9e+112) {
tmp = (x + y) / (t_3 / z);
} else if (z <= -2.4e+76) {
tmp = a;
} else if (z <= -5.8e+49) {
tmp = t_4;
} else if (z <= -24.0) {
tmp = (y * t_1) / t_2;
} else if (z <= -1.2e-160) {
tmp = t_1;
} else if (z <= 4.2e-290) {
tmp = ((a * (y + t)) - (y * b)) * (1.0 / t_2);
} else if (z <= 1.2e-28) {
tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y);
} else if (z <= 3.4e+97) {
tmp = t_1;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = y + (x + t) t_3 = x + (y + t) t_4 = z * ((x + y) / t_3) tmp = 0 if z <= -9e+112: tmp = (x + y) / (t_3 / z) elif z <= -2.4e+76: tmp = a elif z <= -5.8e+49: tmp = t_4 elif z <= -24.0: tmp = (y * t_1) / t_2 elif z <= -1.2e-160: tmp = t_1 elif z <= 4.2e-290: tmp = ((a * (y + t)) - (y * b)) * (1.0 / t_2) elif z <= 1.2e-28: tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y) elif z <= 3.4e+97: tmp = t_1 else: tmp = t_4 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(x + Float64(y + t)) t_4 = Float64(z * Float64(Float64(x + y) / t_3)) tmp = 0.0 if (z <= -9e+112) tmp = Float64(Float64(x + y) / Float64(t_3 / z)); elseif (z <= -2.4e+76) tmp = a; elseif (z <= -5.8e+49) tmp = t_4; elseif (z <= -24.0) tmp = Float64(Float64(y * t_1) / t_2); elseif (z <= -1.2e-160) tmp = t_1; elseif (z <= 4.2e-290) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) * Float64(1.0 / t_2)); elseif (z <= 1.2e-28) tmp = Float64(Float64(Float64(Float64(y * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(x + y)); elseif (z <= 3.4e+97) tmp = t_1; else tmp = t_4; 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 = x + (y + t); t_4 = z * ((x + y) / t_3); tmp = 0.0; if (z <= -9e+112) tmp = (x + y) / (t_3 / z); elseif (z <= -2.4e+76) tmp = a; elseif (z <= -5.8e+49) tmp = t_4; elseif (z <= -24.0) tmp = (y * t_1) / t_2; elseif (z <= -1.2e-160) tmp = t_1; elseif (z <= 4.2e-290) tmp = ((a * (y + t)) - (y * b)) * (1.0 / t_2); elseif (z <= 1.2e-28) tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y); elseif (z <= 3.4e+97) tmp = t_1; else tmp = t_4; 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[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+112], N[(N[(x + y), $MachinePrecision] / N[(t$95$3 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e+76], a, If[LessEqual[z, -5.8e+49], t$95$4, If[LessEqual[z, -24.0], N[(N[(y * t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[z, -1.2e-160], t$95$1, If[LessEqual[z, 4.2e-290], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-28], N[(N[(N[(N[(y * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+97], t$95$1, t$95$4]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := y + \left(x + t\right)\\
t_3 := x + \left(y + t\right)\\
t_4 := z \cdot \frac{x + y}{t_3}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+112}:\\
\;\;\;\;\frac{x + y}{\frac{t_3}{z}}\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{+76}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{+49}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq -24:\\
\;\;\;\;\frac{y \cdot t_1}{t_2}\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-290}:\\
\;\;\;\;\left(a \cdot \left(y + t\right) - y \cdot b\right) \cdot \frac{1}{t_2}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-28}:\\
\;\;\;\;\frac{\left(y \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{x + y}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if z < -8.9999999999999998e112Initial program 45.7%
Taylor expanded in z around inf 32.0%
associate-/l*68.5%
associate-+r+68.5%
Simplified68.5%
if -8.9999999999999998e112 < z < -2.4e76Initial program 52.8%
Taylor expanded in t around inf 83.6%
if -2.4e76 < z < -5.8e49 or 3.4000000000000001e97 < z Initial program 36.2%
Taylor expanded in z around inf 25.3%
associate-/l*75.7%
associate-+r+75.7%
Simplified75.7%
associate-/r/75.8%
+-commutative75.8%
+-commutative75.8%
Applied egg-rr75.8%
if -5.8e49 < z < -24Initial program 99.7%
Taylor expanded in y around inf 99.7%
if -24 < z < -1.19999999999999995e-160 or 1.2000000000000001e-28 < z < 3.4000000000000001e97Initial program 62.7%
Taylor expanded in y around inf 75.1%
if -1.19999999999999995e-160 < z < 4.2000000000000002e-290Initial program 75.9%
Taylor expanded in z around 0 73.4%
associate-+r+73.4%
Simplified73.4%
div-inv73.7%
associate-+l+73.7%
Applied egg-rr73.7%
if 4.2000000000000002e-290 < z < 1.2000000000000001e-28Initial program 84.6%
Taylor expanded in t around 0 71.3%
Final simplification73.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b))
(t_2 (+ y (+ x t)))
(t_3 (+ x (+ y t)))
(t_4 (* z (/ (+ x y) t_3))))
(if (<= z -9e+112)
(/ (+ x y) (/ t_3 z))
(if (<= z -6.5e+78)
a
(if (<= z -3e+49)
t_4
(if (<= z -24.0)
(/ (* y t_1) t_2)
(if (<= z -6e-161)
t_1
(if (<= z 1.8e-67)
(* (- (* a (+ y t)) (* y b)) (/ 1.0 t_2))
(if (<= z 4e+97) t_1 t_4)))))))))
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 = x + (y + t);
double t_4 = z * ((x + y) / t_3);
double tmp;
if (z <= -9e+112) {
tmp = (x + y) / (t_3 / z);
} else if (z <= -6.5e+78) {
tmp = a;
} else if (z <= -3e+49) {
tmp = t_4;
} else if (z <= -24.0) {
tmp = (y * t_1) / t_2;
} else if (z <= -6e-161) {
tmp = t_1;
} else if (z <= 1.8e-67) {
tmp = ((a * (y + t)) - (y * b)) * (1.0 / t_2);
} else if (z <= 4e+97) {
tmp = t_1;
} 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 = (z + a) - b
t_2 = y + (x + t)
t_3 = x + (y + t)
t_4 = z * ((x + y) / t_3)
if (z <= (-9d+112)) then
tmp = (x + y) / (t_3 / z)
else if (z <= (-6.5d+78)) then
tmp = a
else if (z <= (-3d+49)) then
tmp = t_4
else if (z <= (-24.0d0)) then
tmp = (y * t_1) / t_2
else if (z <= (-6d-161)) then
tmp = t_1
else if (z <= 1.8d-67) then
tmp = ((a * (y + t)) - (y * b)) * (1.0d0 / t_2)
else if (z <= 4d+97) then
tmp = t_1
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 = (z + a) - b;
double t_2 = y + (x + t);
double t_3 = x + (y + t);
double t_4 = z * ((x + y) / t_3);
double tmp;
if (z <= -9e+112) {
tmp = (x + y) / (t_3 / z);
} else if (z <= -6.5e+78) {
tmp = a;
} else if (z <= -3e+49) {
tmp = t_4;
} else if (z <= -24.0) {
tmp = (y * t_1) / t_2;
} else if (z <= -6e-161) {
tmp = t_1;
} else if (z <= 1.8e-67) {
tmp = ((a * (y + t)) - (y * b)) * (1.0 / t_2);
} else if (z <= 4e+97) {
tmp = t_1;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = y + (x + t) t_3 = x + (y + t) t_4 = z * ((x + y) / t_3) tmp = 0 if z <= -9e+112: tmp = (x + y) / (t_3 / z) elif z <= -6.5e+78: tmp = a elif z <= -3e+49: tmp = t_4 elif z <= -24.0: tmp = (y * t_1) / t_2 elif z <= -6e-161: tmp = t_1 elif z <= 1.8e-67: tmp = ((a * (y + t)) - (y * b)) * (1.0 / t_2) elif z <= 4e+97: tmp = t_1 else: tmp = t_4 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(x + Float64(y + t)) t_4 = Float64(z * Float64(Float64(x + y) / t_3)) tmp = 0.0 if (z <= -9e+112) tmp = Float64(Float64(x + y) / Float64(t_3 / z)); elseif (z <= -6.5e+78) tmp = a; elseif (z <= -3e+49) tmp = t_4; elseif (z <= -24.0) tmp = Float64(Float64(y * t_1) / t_2); elseif (z <= -6e-161) tmp = t_1; elseif (z <= 1.8e-67) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) * Float64(1.0 / t_2)); elseif (z <= 4e+97) tmp = t_1; else tmp = t_4; 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 = x + (y + t); t_4 = z * ((x + y) / t_3); tmp = 0.0; if (z <= -9e+112) tmp = (x + y) / (t_3 / z); elseif (z <= -6.5e+78) tmp = a; elseif (z <= -3e+49) tmp = t_4; elseif (z <= -24.0) tmp = (y * t_1) / t_2; elseif (z <= -6e-161) tmp = t_1; elseif (z <= 1.8e-67) tmp = ((a * (y + t)) - (y * b)) * (1.0 / t_2); elseif (z <= 4e+97) tmp = t_1; else tmp = t_4; 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[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+112], N[(N[(x + y), $MachinePrecision] / N[(t$95$3 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.5e+78], a, If[LessEqual[z, -3e+49], t$95$4, If[LessEqual[z, -24.0], N[(N[(y * t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[z, -6e-161], t$95$1, If[LessEqual[z, 1.8e-67], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+97], t$95$1, t$95$4]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := y + \left(x + t\right)\\
t_3 := x + \left(y + t\right)\\
t_4 := z \cdot \frac{x + y}{t_3}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+112}:\\
\;\;\;\;\frac{x + y}{\frac{t_3}{z}}\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{+78}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -3 \cdot 10^{+49}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;z \leq -24:\\
\;\;\;\;\frac{y \cdot t_1}{t_2}\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-161}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-67}:\\
\;\;\;\;\left(a \cdot \left(y + t\right) - y \cdot b\right) \cdot \frac{1}{t_2}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if z < -8.9999999999999998e112Initial program 45.7%
Taylor expanded in z around inf 32.0%
associate-/l*68.5%
associate-+r+68.5%
Simplified68.5%
if -8.9999999999999998e112 < z < -6.50000000000000036e78Initial program 52.8%
Taylor expanded in t around inf 83.6%
if -6.50000000000000036e78 < z < -3.0000000000000002e49 or 4.0000000000000003e97 < z Initial program 36.2%
Taylor expanded in z around inf 25.3%
associate-/l*75.7%
associate-+r+75.7%
Simplified75.7%
associate-/r/75.8%
+-commutative75.8%
+-commutative75.8%
Applied egg-rr75.8%
if -3.0000000000000002e49 < z < -24Initial program 99.7%
Taylor expanded in y around inf 99.7%
if -24 < z < -5.99999999999999977e-161 or 1.8e-67 < z < 4.0000000000000003e97Initial program 67.7%
Taylor expanded in y around inf 74.2%
if -5.99999999999999977e-161 < z < 1.8e-67Initial program 78.8%
Taylor expanded in z around 0 67.0%
associate-+r+67.0%
Simplified67.0%
div-inv67.1%
associate-+l+67.1%
Applied egg-rr67.1%
Final simplification72.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t)))
(t_2 (- (* a (+ y t)) (* y b)))
(t_3 (+ a (* z (+ (/ x t_1) (/ y t_1))))))
(if (<= z -2.5e+49)
t_3
(if (<= z -3.5e-89)
(/ t_2 t_1)
(if (<= z -4.2e-160)
(- a b)
(if (<= z 3.7e-290)
(* t_2 (/ 1.0 (+ y (+ x t))))
(if (<= z 8.5e-16)
(/ (- (+ (* y a) (* z (+ x y))) (* y b)) (+ x y))
t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = (a * (y + t)) - (y * b);
double t_3 = a + (z * ((x / t_1) + (y / t_1)));
double tmp;
if (z <= -2.5e+49) {
tmp = t_3;
} else if (z <= -3.5e-89) {
tmp = t_2 / t_1;
} else if (z <= -4.2e-160) {
tmp = a - b;
} else if (z <= 3.7e-290) {
tmp = t_2 * (1.0 / (y + (x + t)));
} else if (z <= 8.5e-16) {
tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y);
} 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 = x + (y + t)
t_2 = (a * (y + t)) - (y * b)
t_3 = a + (z * ((x / t_1) + (y / t_1)))
if (z <= (-2.5d+49)) then
tmp = t_3
else if (z <= (-3.5d-89)) then
tmp = t_2 / t_1
else if (z <= (-4.2d-160)) then
tmp = a - b
else if (z <= 3.7d-290) then
tmp = t_2 * (1.0d0 / (y + (x + t)))
else if (z <= 8.5d-16) then
tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y)
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 = x + (y + t);
double t_2 = (a * (y + t)) - (y * b);
double t_3 = a + (z * ((x / t_1) + (y / t_1)));
double tmp;
if (z <= -2.5e+49) {
tmp = t_3;
} else if (z <= -3.5e-89) {
tmp = t_2 / t_1;
} else if (z <= -4.2e-160) {
tmp = a - b;
} else if (z <= 3.7e-290) {
tmp = t_2 * (1.0 / (y + (x + t)));
} else if (z <= 8.5e-16) {
tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y);
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = (a * (y + t)) - (y * b) t_3 = a + (z * ((x / t_1) + (y / t_1))) tmp = 0 if z <= -2.5e+49: tmp = t_3 elif z <= -3.5e-89: tmp = t_2 / t_1 elif z <= -4.2e-160: tmp = a - b elif z <= 3.7e-290: tmp = t_2 * (1.0 / (y + (x + t))) elif z <= 8.5e-16: tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(Float64(a * Float64(y + t)) - Float64(y * b)) t_3 = Float64(a + Float64(z * Float64(Float64(x / t_1) + Float64(y / t_1)))) tmp = 0.0 if (z <= -2.5e+49) tmp = t_3; elseif (z <= -3.5e-89) tmp = Float64(t_2 / t_1); elseif (z <= -4.2e-160) tmp = Float64(a - b); elseif (z <= 3.7e-290) tmp = Float64(t_2 * Float64(1.0 / Float64(y + Float64(x + t)))); elseif (z <= 8.5e-16) tmp = Float64(Float64(Float64(Float64(y * a) + Float64(z * Float64(x + y))) - Float64(y * b)) / Float64(x + y)); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = (a * (y + t)) - (y * b); t_3 = a + (z * ((x / t_1) + (y / t_1))); tmp = 0.0; if (z <= -2.5e+49) tmp = t_3; elseif (z <= -3.5e-89) tmp = t_2 / t_1; elseif (z <= -4.2e-160) tmp = a - b; elseif (z <= 3.7e-290) tmp = t_2 * (1.0 / (y + (x + t))); elseif (z <= 8.5e-16) tmp = (((y * a) + (z * (x + y))) - (y * b)) / (x + y); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a + N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+49], t$95$3, If[LessEqual[z, -3.5e-89], N[(t$95$2 / t$95$1), $MachinePrecision], If[LessEqual[z, -4.2e-160], N[(a - b), $MachinePrecision], If[LessEqual[z, 3.7e-290], N[(t$95$2 * N[(1.0 / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-16], N[(N[(N[(N[(y * a), $MachinePrecision] + N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := a \cdot \left(y + t\right) - y \cdot b\\
t_3 := a + z \cdot \left(\frac{x}{t_1} + \frac{y}{t_1}\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+49}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-89}:\\
\;\;\;\;\frac{t_2}{t_1}\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-160}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-290}:\\
\;\;\;\;t_2 \cdot \frac{1}{y + \left(x + t\right)}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{\left(y \cdot a + z \cdot \left(x + y\right)\right) - y \cdot b}{x + y}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -2.5000000000000002e49 or 8.5000000000000001e-16 < z Initial program 44.4%
Taylor expanded in z around 0 70.7%
associate--l+70.7%
*-commutative70.7%
associate-+r+70.7%
associate-+r+70.7%
div-sub70.7%
associate-+r+70.7%
Simplified70.7%
Taylor expanded in t around inf 83.1%
if -2.5000000000000002e49 < z < -3.4999999999999997e-89Initial program 84.1%
Taylor expanded in z around 0 68.0%
associate-+r+68.0%
Simplified68.0%
if -3.4999999999999997e-89 < z < -4.2000000000000001e-160Initial program 59.7%
Taylor expanded in z around 0 42.0%
associate-+r+42.0%
Simplified42.0%
Taylor expanded in y around inf 69.9%
if -4.2000000000000001e-160 < z < 3.69999999999999977e-290Initial program 75.9%
Taylor expanded in z around 0 73.4%
associate-+r+73.4%
Simplified73.4%
div-inv73.7%
associate-+l+73.7%
Applied egg-rr73.7%
if 3.69999999999999977e-290 < z < 8.5000000000000001e-16Initial program 83.7%
Taylor expanded in t around 0 71.1%
Final simplification77.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (+ x (+ y t))) (t_3 (* z (/ (+ x y) t_2))))
(if (<= z -1.2e+113)
(/ (+ x y) (/ t_2 z))
(if (<= z -5.5e+77)
a
(if (<= z -3.4e+49)
t_3
(if (<= z -24.0)
(/ (* y t_1) (+ y (+ x t)))
(if (<= z -2.2e-162)
t_1
(if (<= z 2.6e-68)
(/ (- (* a (+ y t)) (* y b)) t_2)
(if (<= z 3.4e+97) 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 = x + (y + t);
double t_3 = z * ((x + y) / t_2);
double tmp;
if (z <= -1.2e+113) {
tmp = (x + y) / (t_2 / z);
} else if (z <= -5.5e+77) {
tmp = a;
} else if (z <= -3.4e+49) {
tmp = t_3;
} else if (z <= -24.0) {
tmp = (y * t_1) / (y + (x + t));
} else if (z <= -2.2e-162) {
tmp = t_1;
} else if (z <= 2.6e-68) {
tmp = ((a * (y + t)) - (y * b)) / t_2;
} else if (z <= 3.4e+97) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (z + a) - b
t_2 = x + (y + t)
t_3 = z * ((x + y) / t_2)
if (z <= (-1.2d+113)) then
tmp = (x + y) / (t_2 / z)
else if (z <= (-5.5d+77)) then
tmp = a
else if (z <= (-3.4d+49)) then
tmp = t_3
else if (z <= (-24.0d0)) then
tmp = (y * t_1) / (y + (x + t))
else if (z <= (-2.2d-162)) then
tmp = t_1
else if (z <= 2.6d-68) then
tmp = ((a * (y + t)) - (y * b)) / t_2
else if (z <= 3.4d+97) 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 = x + (y + t);
double t_3 = z * ((x + y) / t_2);
double tmp;
if (z <= -1.2e+113) {
tmp = (x + y) / (t_2 / z);
} else if (z <= -5.5e+77) {
tmp = a;
} else if (z <= -3.4e+49) {
tmp = t_3;
} else if (z <= -24.0) {
tmp = (y * t_1) / (y + (x + t));
} else if (z <= -2.2e-162) {
tmp = t_1;
} else if (z <= 2.6e-68) {
tmp = ((a * (y + t)) - (y * b)) / t_2;
} else if (z <= 3.4e+97) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = x + (y + t) t_3 = z * ((x + y) / t_2) tmp = 0 if z <= -1.2e+113: tmp = (x + y) / (t_2 / z) elif z <= -5.5e+77: tmp = a elif z <= -3.4e+49: tmp = t_3 elif z <= -24.0: tmp = (y * t_1) / (y + (x + t)) elif z <= -2.2e-162: tmp = t_1 elif z <= 2.6e-68: tmp = ((a * (y + t)) - (y * b)) / t_2 elif z <= 3.4e+97: 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(x + Float64(y + t)) t_3 = Float64(z * Float64(Float64(x + y) / t_2)) tmp = 0.0 if (z <= -1.2e+113) tmp = Float64(Float64(x + y) / Float64(t_2 / z)); elseif (z <= -5.5e+77) tmp = a; elseif (z <= -3.4e+49) tmp = t_3; elseif (z <= -24.0) tmp = Float64(Float64(y * t_1) / Float64(y + Float64(x + t))); elseif (z <= -2.2e-162) tmp = t_1; elseif (z <= 2.6e-68) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / t_2); elseif (z <= 3.4e+97) 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 = x + (y + t); t_3 = z * ((x + y) / t_2); tmp = 0.0; if (z <= -1.2e+113) tmp = (x + y) / (t_2 / z); elseif (z <= -5.5e+77) tmp = a; elseif (z <= -3.4e+49) tmp = t_3; elseif (z <= -24.0) tmp = (y * t_1) / (y + (x + t)); elseif (z <= -2.2e-162) tmp = t_1; elseif (z <= 2.6e-68) tmp = ((a * (y + t)) - (y * b)) / t_2; elseif (z <= 3.4e+97) 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[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+113], N[(N[(x + y), $MachinePrecision] / N[(t$95$2 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.5e+77], a, If[LessEqual[z, -3.4e+49], t$95$3, If[LessEqual[z, -24.0], N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.2e-162], t$95$1, If[LessEqual[z, 2.6e-68], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[z, 3.4e+97], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := x + \left(y + t\right)\\
t_3 := z \cdot \frac{x + y}{t_2}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+113}:\\
\;\;\;\;\frac{x + y}{\frac{t_2}{z}}\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{+77}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{+49}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -24:\\
\;\;\;\;\frac{y \cdot t_1}{y + \left(x + t\right)}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-162}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-68}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{t_2}\\
\mathbf{elif}\;z \leq 3.4 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -1.19999999999999992e113Initial program 45.7%
Taylor expanded in z around inf 32.0%
associate-/l*68.5%
associate-+r+68.5%
Simplified68.5%
if -1.19999999999999992e113 < z < -5.50000000000000036e77Initial program 52.8%
Taylor expanded in t around inf 83.6%
if -5.50000000000000036e77 < z < -3.4000000000000001e49 or 3.4000000000000001e97 < z Initial program 36.2%
Taylor expanded in z around inf 25.3%
associate-/l*75.7%
associate-+r+75.7%
Simplified75.7%
associate-/r/75.8%
+-commutative75.8%
+-commutative75.8%
Applied egg-rr75.8%
if -3.4000000000000001e49 < z < -24Initial program 99.7%
Taylor expanded in y around inf 99.7%
if -24 < z < -2.1999999999999999e-162 or 2.5999999999999998e-68 < z < 3.4000000000000001e97Initial program 67.7%
Taylor expanded in y around inf 74.2%
if -2.1999999999999999e-162 < z < 2.5999999999999998e-68Initial program 78.8%
Taylor expanded in z around 0 67.0%
associate-+r+67.0%
Simplified67.0%
Final simplification72.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (/ (+ x y) (+ x (+ y t))))))
(if (<= x -1.82e+176)
(+ z (* (- a b) (/ y x)))
(if (<= x -2.35e+22)
t_1
(if (<= x -2.06e-44) a (if (<= x 1.04e+77) (- (+ z a) b) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * ((x + y) / (x + (y + t)));
double tmp;
if (x <= -1.82e+176) {
tmp = z + ((a - b) * (y / x));
} else if (x <= -2.35e+22) {
tmp = t_1;
} else if (x <= -2.06e-44) {
tmp = a;
} else if (x <= 1.04e+77) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * ((x + y) / (x + (y + t)))
if (x <= (-1.82d+176)) then
tmp = z + ((a - b) * (y / x))
else if (x <= (-2.35d+22)) then
tmp = t_1
else if (x <= (-2.06d-44)) then
tmp = a
else if (x <= 1.04d+77) then
tmp = (z + a) - b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * ((x + y) / (x + (y + t)));
double tmp;
if (x <= -1.82e+176) {
tmp = z + ((a - b) * (y / x));
} else if (x <= -2.35e+22) {
tmp = t_1;
} else if (x <= -2.06e-44) {
tmp = a;
} else if (x <= 1.04e+77) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * ((x + y) / (x + (y + t))) tmp = 0 if x <= -1.82e+176: tmp = z + ((a - b) * (y / x)) elif x <= -2.35e+22: tmp = t_1 elif x <= -2.06e-44: tmp = a elif x <= 1.04e+77: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(Float64(x + y) / Float64(x + Float64(y + t)))) tmp = 0.0 if (x <= -1.82e+176) tmp = Float64(z + Float64(Float64(a - b) * Float64(y / x))); elseif (x <= -2.35e+22) tmp = t_1; elseif (x <= -2.06e-44) tmp = a; elseif (x <= 1.04e+77) tmp = Float64(Float64(z + a) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * ((x + y) / (x + (y + t))); tmp = 0.0; if (x <= -1.82e+176) tmp = z + ((a - b) * (y / x)); elseif (x <= -2.35e+22) tmp = t_1; elseif (x <= -2.06e-44) tmp = a; elseif (x <= 1.04e+77) 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[(z * N[(N[(x + y), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.82e+176], N[(z + N[(N[(a - b), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.35e+22], t$95$1, If[LessEqual[x, -2.06e-44], a, If[LessEqual[x, 1.04e+77], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x + y}{x + \left(y + t\right)}\\
\mathbf{if}\;x \leq -1.82 \cdot 10^{+176}:\\
\;\;\;\;z + \left(a - b\right) \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -2.35 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.06 \cdot 10^{-44}:\\
\;\;\;\;a\\
\mathbf{elif}\;x \leq 1.04 \cdot 10^{+77}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.8200000000000001e176Initial program 45.4%
Taylor expanded in x around inf 58.7%
associate--l+58.7%
associate-/l*66.3%
associate-/l*63.5%
Simplified63.5%
Taylor expanded in t around 0 69.5%
associate--l+69.5%
*-commutative69.5%
associate-/l*66.5%
Simplified66.5%
Taylor expanded in y around 0 73.4%
+-commutative73.4%
distribute-lft-out--73.4%
associate-*r/66.4%
associate-/l*73.4%
associate-*r/76.5%
associate-*l/72.7%
associate-/r/72.8%
distribute-lft-out--72.8%
Simplified72.8%
if -1.8200000000000001e176 < x < -2.3500000000000001e22 or 1.04e77 < x Initial program 56.1%
Taylor expanded in z around inf 32.9%
associate-/l*50.1%
associate-+r+50.1%
Simplified50.1%
associate-/r/59.9%
+-commutative59.9%
+-commutative59.9%
Applied egg-rr59.9%
if -2.3500000000000001e22 < x < -2.06e-44Initial program 87.2%
Taylor expanded in t around inf 61.3%
if -2.06e-44 < x < 1.04e77Initial program 63.9%
Taylor expanded in y around inf 69.3%
Final simplification66.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))))
(if (<= x -1.06e+154)
(+ z (* (- a b) (/ y x)))
(if (<= x -1.3e+119)
(/ a (/ t_1 (+ y t)))
(if (<= x -1.5e+77)
z
(if (<= x 8.8e+80) (- (+ z a) b) (* z (/ (+ x y) t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double tmp;
if (x <= -1.06e+154) {
tmp = z + ((a - b) * (y / x));
} else if (x <= -1.3e+119) {
tmp = a / (t_1 / (y + t));
} else if (x <= -1.5e+77) {
tmp = z;
} else if (x <= 8.8e+80) {
tmp = (z + a) - b;
} else {
tmp = z * ((x + y) / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y + t)
if (x <= (-1.06d+154)) then
tmp = z + ((a - b) * (y / x))
else if (x <= (-1.3d+119)) then
tmp = a / (t_1 / (y + t))
else if (x <= (-1.5d+77)) then
tmp = z
else if (x <= 8.8d+80) then
tmp = (z + a) - b
else
tmp = z * ((x + y) / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double tmp;
if (x <= -1.06e+154) {
tmp = z + ((a - b) * (y / x));
} else if (x <= -1.3e+119) {
tmp = a / (t_1 / (y + t));
} else if (x <= -1.5e+77) {
tmp = z;
} else if (x <= 8.8e+80) {
tmp = (z + a) - b;
} else {
tmp = z * ((x + y) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) tmp = 0 if x <= -1.06e+154: tmp = z + ((a - b) * (y / x)) elif x <= -1.3e+119: tmp = a / (t_1 / (y + t)) elif x <= -1.5e+77: tmp = z elif x <= 8.8e+80: tmp = (z + a) - b else: tmp = z * ((x + y) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) tmp = 0.0 if (x <= -1.06e+154) tmp = Float64(z + Float64(Float64(a - b) * Float64(y / x))); elseif (x <= -1.3e+119) tmp = Float64(a / Float64(t_1 / Float64(y + t))); elseif (x <= -1.5e+77) tmp = z; elseif (x <= 8.8e+80) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z * Float64(Float64(x + y) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); tmp = 0.0; if (x <= -1.06e+154) tmp = z + ((a - b) * (y / x)); elseif (x <= -1.3e+119) tmp = a / (t_1 / (y + t)); elseif (x <= -1.5e+77) tmp = z; elseif (x <= 8.8e+80) tmp = (z + a) - b; else tmp = z * ((x + y) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.06e+154], N[(z + N[(N[(a - b), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.3e+119], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.5e+77], z, If[LessEqual[x, 8.8e+80], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
\mathbf{if}\;x \leq -1.06 \cdot 10^{+154}:\\
\;\;\;\;z + \left(a - b\right) \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{+119}:\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{+77}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{+80}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{x + y}{t_1}\\
\end{array}
\end{array}
if x < -1.06e154Initial program 42.6%
Taylor expanded in x around inf 52.6%
associate--l+52.6%
associate-/l*61.4%
associate-/l*59.2%
Simplified59.2%
Taylor expanded in t around 0 64.3%
associate--l+64.3%
*-commutative64.3%
associate-/l*61.9%
Simplified61.9%
Taylor expanded in y around 0 67.4%
+-commutative67.4%
distribute-lft-out--67.4%
associate-*r/61.8%
associate-/l*67.3%
associate-*r/69.8%
associate-*l/66.8%
associate-/r/66.8%
distribute-lft-out--66.8%
Simplified66.8%
if -1.06e154 < x < -1.3e119Initial program 44.4%
Taylor expanded in a around inf 27.8%
associate-/l*59.4%
associate-+r+59.4%
Simplified59.4%
if -1.3e119 < x < -1.4999999999999999e77Initial program 81.1%
Taylor expanded in x around inf 62.9%
if -1.4999999999999999e77 < x < 8.80000000000000011e80Initial program 66.0%
Taylor expanded in y around inf 66.1%
if 8.80000000000000011e80 < x Initial program 58.9%
Taylor expanded in z around inf 35.1%
associate-/l*51.8%
associate-+r+51.8%
Simplified51.8%
associate-/r/65.3%
+-commutative65.3%
+-commutative65.3%
Applied egg-rr65.3%
Final simplification65.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (* z (/ (+ x y) (+ x (+ y t))))))
(if (<= x -6e+175)
(+ z (* (- a b) (/ y x)))
(if (<= x -1.15e+20)
t_2
(if (<= x -1.12e-58)
(/ (* y t_1) (+ y (+ x t)))
(if (<= x 4.5e+76) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = z * ((x + y) / (x + (y + t)));
double tmp;
if (x <= -6e+175) {
tmp = z + ((a - b) * (y / x));
} else if (x <= -1.15e+20) {
tmp = t_2;
} else if (x <= -1.12e-58) {
tmp = (y * t_1) / (y + (x + t));
} else if (x <= 4.5e+76) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = z * ((x + y) / (x + (y + t)))
if (x <= (-6d+175)) then
tmp = z + ((a - b) * (y / x))
else if (x <= (-1.15d+20)) then
tmp = t_2
else if (x <= (-1.12d-58)) then
tmp = (y * t_1) / (y + (x + t))
else if (x <= 4.5d+76) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = z * ((x + y) / (x + (y + t)));
double tmp;
if (x <= -6e+175) {
tmp = z + ((a - b) * (y / x));
} else if (x <= -1.15e+20) {
tmp = t_2;
} else if (x <= -1.12e-58) {
tmp = (y * t_1) / (y + (x + t));
} else if (x <= 4.5e+76) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = z * ((x + y) / (x + (y + t))) tmp = 0 if x <= -6e+175: tmp = z + ((a - b) * (y / x)) elif x <= -1.15e+20: tmp = t_2 elif x <= -1.12e-58: tmp = (y * t_1) / (y + (x + t)) elif x <= 4.5e+76: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(z * Float64(Float64(x + y) / Float64(x + Float64(y + t)))) tmp = 0.0 if (x <= -6e+175) tmp = Float64(z + Float64(Float64(a - b) * Float64(y / x))); elseif (x <= -1.15e+20) tmp = t_2; elseif (x <= -1.12e-58) tmp = Float64(Float64(y * t_1) / Float64(y + Float64(x + t))); elseif (x <= 4.5e+76) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = z * ((x + y) / (x + (y + t))); tmp = 0.0; if (x <= -6e+175) tmp = z + ((a - b) * (y / x)); elseif (x <= -1.15e+20) tmp = t_2; elseif (x <= -1.12e-58) tmp = (y * t_1) / (y + (x + t)); elseif (x <= 4.5e+76) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x + y), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6e+175], N[(z + N[(N[(a - b), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e+20], t$95$2, If[LessEqual[x, -1.12e-58], N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e+76], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := z \cdot \frac{x + y}{x + \left(y + t\right)}\\
\mathbf{if}\;x \leq -6 \cdot 10^{+175}:\\
\;\;\;\;z + \left(a - b\right) \cdot \frac{y}{x}\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{+20}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{-58}:\\
\;\;\;\;\frac{y \cdot t_1}{y + \left(x + t\right)}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -6.0000000000000003e175Initial program 45.4%
Taylor expanded in x around inf 58.7%
associate--l+58.7%
associate-/l*66.3%
associate-/l*63.5%
Simplified63.5%
Taylor expanded in t around 0 69.5%
associate--l+69.5%
*-commutative69.5%
associate-/l*66.5%
Simplified66.5%
Taylor expanded in y around 0 73.4%
+-commutative73.4%
distribute-lft-out--73.4%
associate-*r/66.4%
associate-/l*73.4%
associate-*r/76.5%
associate-*l/72.7%
associate-/r/72.8%
distribute-lft-out--72.8%
Simplified72.8%
if -6.0000000000000003e175 < x < -1.15e20 or 4.4999999999999997e76 < x Initial program 56.6%
Taylor expanded in z around inf 32.6%
associate-/l*49.6%
associate-+r+49.6%
Simplified49.6%
associate-/r/59.3%
+-commutative59.3%
+-commutative59.3%
Applied egg-rr59.3%
if -1.15e20 < x < -1.11999999999999992e-58Initial program 87.9%
Taylor expanded in y around inf 69.7%
if -1.11999999999999992e-58 < x < 4.4999999999999997e76Initial program 63.3%
Taylor expanded in y around inf 69.6%
Final simplification66.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -4.9e+67) (not (<= x 9.4e+141))) (+ z (* (- a b) (/ y x))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.9e+67) || !(x <= 9.4e+141)) {
tmp = z + ((a - b) * (y / x));
} 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 ((x <= (-4.9d+67)) .or. (.not. (x <= 9.4d+141))) then
tmp = z + ((a - b) * (y / x))
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 ((x <= -4.9e+67) || !(x <= 9.4e+141)) {
tmp = z + ((a - b) * (y / x));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -4.9e+67) or not (x <= 9.4e+141): tmp = z + ((a - b) * (y / x)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -4.9e+67) || !(x <= 9.4e+141)) tmp = Float64(z + Float64(Float64(a - b) * Float64(y / x))); 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 ((x <= -4.9e+67) || ~((x <= 9.4e+141))) tmp = z + ((a - b) * (y / x)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -4.9e+67], N[Not[LessEqual[x, 9.4e+141]], $MachinePrecision]], N[(z + N[(N[(a - b), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{+67} \lor \neg \left(x \leq 9.4 \cdot 10^{+141}\right):\\
\;\;\;\;z + \left(a - b\right) \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -4.8999999999999999e67 or 9.39999999999999958e141 < x Initial program 50.9%
Taylor expanded in x around inf 53.7%
associate--l+53.8%
associate-/l*58.3%
associate-/l*57.5%
Simplified57.5%
Taylor expanded in t around 0 58.5%
associate--l+58.5%
*-commutative58.5%
associate-/l*59.9%
Simplified59.9%
Taylor expanded in y around 0 64.1%
+-commutative64.1%
distribute-lft-out--64.1%
associate-*r/59.8%
associate-/l*64.1%
associate-*r/62.8%
associate-*l/63.9%
associate-/r/63.9%
distribute-lft-out--63.9%
Simplified63.9%
if -4.8999999999999999e67 < x < 9.39999999999999958e141Initial program 65.8%
Taylor expanded in y around inf 62.8%
Final simplification63.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -4.1e+142) (not (<= x 7.2e+142))) (- z (* y (/ b x))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -4.1e+142) || !(x <= 7.2e+142)) {
tmp = z - (y * (b / x));
} 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 ((x <= (-4.1d+142)) .or. (.not. (x <= 7.2d+142))) then
tmp = z - (y * (b / x))
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 ((x <= -4.1e+142) || !(x <= 7.2e+142)) {
tmp = z - (y * (b / x));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -4.1e+142) or not (x <= 7.2e+142): tmp = z - (y * (b / x)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -4.1e+142) || !(x <= 7.2e+142)) tmp = Float64(z - Float64(y * Float64(b / x))); 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 ((x <= -4.1e+142) || ~((x <= 7.2e+142))) tmp = z - (y * (b / x)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -4.1e+142], N[Not[LessEqual[x, 7.2e+142]], $MachinePrecision]], N[(z - N[(y * N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{+142} \lor \neg \left(x \leq 7.2 \cdot 10^{+142}\right):\\
\;\;\;\;z - y \cdot \frac{b}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -4.09999999999999982e142 or 7.2000000000000003e142 < x Initial program 49.2%
Taylor expanded in x around inf 56.9%
associate--l+57.0%
associate-/l*61.0%
associate-/l*60.0%
Simplified60.0%
Taylor expanded in t around 0 63.6%
associate--l+63.7%
*-commutative63.7%
associate-/l*65.3%
Simplified65.3%
Taylor expanded in a around 0 60.9%
associate-*r/62.5%
Simplified62.5%
if -4.09999999999999982e142 < x < 7.2000000000000003e142Initial program 65.3%
Taylor expanded in y around inf 61.3%
Final simplification61.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7.2e+142) (- z (/ (* y b) x)) (if (<= x 1.85e+142) (- (+ z a) b) (- z (* y (/ b x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.2e+142) {
tmp = z - ((y * b) / x);
} else if (x <= 1.85e+142) {
tmp = (z + a) - b;
} else {
tmp = z - (y * (b / x));
}
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+142)) then
tmp = z - ((y * b) / x)
else if (x <= 1.85d+142) then
tmp = (z + a) - b
else
tmp = z - (y * (b / x))
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+142) {
tmp = z - ((y * b) / x);
} else if (x <= 1.85e+142) {
tmp = (z + a) - b;
} else {
tmp = z - (y * (b / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7.2e+142: tmp = z - ((y * b) / x) elif x <= 1.85e+142: tmp = (z + a) - b else: tmp = z - (y * (b / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.2e+142) tmp = Float64(z - Float64(Float64(y * b) / x)); elseif (x <= 1.85e+142) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z - Float64(y * Float64(b / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -7.2e+142) tmp = z - ((y * b) / x); elseif (x <= 1.85e+142) tmp = (z + a) - b; else tmp = z - (y * (b / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.2e+142], N[(z - N[(N[(y * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e+142], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z - N[(y * N[(b / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{+142}:\\
\;\;\;\;z - \frac{y \cdot b}{x}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+142}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z - y \cdot \frac{b}{x}\\
\end{array}
\end{array}
if x < -7.2000000000000003e142Initial program 42.6%
Taylor expanded in x around inf 48.5%
associate--l+48.5%
associate-/l*56.3%
associate-/l*54.3%
Simplified54.3%
Taylor expanded in t around 0 58.3%
associate--l+58.3%
*-commutative58.3%
associate-/l*56.3%
Simplified56.3%
Taylor expanded in a around 0 54.1%
if -7.2000000000000003e142 < x < 1.8499999999999999e142Initial program 65.3%
Taylor expanded in y around inf 61.3%
if 1.8499999999999999e142 < x Initial program 56.5%
Taylor expanded in x around inf 65.9%
associate--l+66.1%
associate-/l*66.2%
associate-/l*66.2%
Simplified66.2%
Taylor expanded in t around 0 69.4%
associate--l+69.4%
*-commutative69.4%
associate-/l*75.2%
Simplified75.2%
Taylor expanded in a around 0 68.3%
associate-*r/73.9%
Simplified73.9%
Final simplification62.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.5e+76) z (if (<= x 4.8e+79) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.5e+76) {
tmp = z;
} else if (x <= 4.8e+79) {
tmp = 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.5d+76)) then
tmp = z
else if (x <= 4.8d+79) then
tmp = 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.5e+76) {
tmp = z;
} else if (x <= 4.8e+79) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.5e+76: tmp = z elif x <= 4.8e+79: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.5e+76) tmp = z; elseif (x <= 4.8e+79) tmp = Float64(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.5e+76) tmp = z; elseif (x <= 4.8e+79) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.5e+76], z, If[LessEqual[x, 4.8e+79], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+76}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+79}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -3.5e76 or 4.79999999999999971e79 < x Initial program 53.2%
Taylor expanded in x around inf 46.7%
if -3.5e76 < x < 4.79999999999999971e79Initial program 66.0%
Taylor expanded in z around 0 50.0%
associate-+r+50.0%
Simplified50.0%
Taylor expanded in y around inf 53.2%
Final simplification50.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9e+150) a (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9e+150) {
tmp = a;
} 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 <= (-9d+150)) then
tmp = a
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 <= -9e+150) {
tmp = a;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9e+150: tmp = a else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9e+150) tmp = a; 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 <= -9e+150) tmp = a; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9e+150], a, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+150}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -9.00000000000000001e150Initial program 46.8%
Taylor expanded in t around inf 66.3%
if -9.00000000000000001e150 < t Initial program 62.8%
Taylor expanded in y around inf 59.4%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a -9.2e+45) a (if (<= a 1.15e+66) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9.2e+45) {
tmp = a;
} else if (a <= 1.15e+66) {
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 <= (-9.2d+45)) then
tmp = a
else if (a <= 1.15d+66) 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 <= -9.2e+45) {
tmp = a;
} else if (a <= 1.15e+66) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9.2e+45: tmp = a elif a <= 1.15e+66: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9.2e+45) tmp = a; elseif (a <= 1.15e+66) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -9.2e+45) tmp = a; elseif (a <= 1.15e+66) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9.2e+45], a, If[LessEqual[a, 1.15e+66], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{+45}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+66}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -9.20000000000000049e45 or 1.15e66 < a Initial program 44.9%
Taylor expanded in t around inf 55.3%
if -9.20000000000000049e45 < a < 1.15e66Initial program 70.5%
Taylor expanded in x around inf 39.9%
Final simplification45.8%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 60.7%
Taylor expanded in t around inf 31.0%
Final simplification31.0%
(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 2023263
(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)))