
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ y t) a))
(t_2 (/ (- (+ (* (+ x y) z) t_1) (* y b)) (+ y (+ x t)))))
(if (or (<= t_2 -1e+255) (not (<= t_2 1e+262)))
(- (+ z a) b)
(/ (- (fma (+ x y) z t_1) (* y b)) (+ x (+ y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) * a;
double t_2 = ((((x + y) * z) + t_1) - (y * b)) / (y + (x + t));
double tmp;
if ((t_2 <= -1e+255) || !(t_2 <= 1e+262)) {
tmp = (z + a) - b;
} else {
tmp = (fma((x + y), z, t_1) - (y * b)) / (x + (y + t));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) * a) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_2 <= -1e+255) || !(t_2 <= 1e+262)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(fma(Float64(x + y), z, t_1) - Float64(y * b)) / Float64(x + Float64(y + t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -1e+255], N[Not[LessEqual[t$95$2, 1e+262]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) \cdot a\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+255} \lor \neg \left(t\_2 \leq 10^{+262}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_1\right) - y \cdot b}{x + \left(y + t\right)}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999988e254 or 1e262 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.7%
Taylor expanded in y around inf 82.7%
if -9.99999999999999988e254 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e262Initial program 99.7%
fma-define99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Simplified99.7%
Final simplification91.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ y t) a)) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 -1e+255) (not (<= t_1 1e+262))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -1e+255) || !(t_1 <= 1e+262)) {
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 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t))
if ((t_1 <= (-1d+255)) .or. (.not. (t_1 <= 1d+262))) 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 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -1e+255) || !(t_1 <= 1e+262)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -1e+255) or not (t_1 <= 1e+262): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= -1e+255) || !(t_1 <= 1e+262)) 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 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -1e+255) || ~((t_1 <= 1e+262))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+255], N[Not[LessEqual[t$95$1, 1e+262]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+255} \lor \neg \left(t\_1 \leq 10^{+262}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999988e254 or 1e262 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.7%
Taylor expanded in y around inf 82.7%
if -9.99999999999999988e254 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e262Initial program 99.7%
Final simplification91.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (* (+ y t) a) (* y b)) t_2))
(t_4 (- (+ z a) b)))
(if (<= y -3.3e+15)
t_4
(if (<= y -1.15e-18)
t_3
(if (<= y -8e-61)
(/ z (/ t_1 (+ x y)))
(if (<= y -3e-132)
t_3
(if (<= y -8.2e-224)
t_4
(if (<= y 8.5e-177)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 1.46e-96)
t_4
(if (<= y 2.8e+41)
t_3
(if (<= y 8.5e+97)
(* z (/ (+ x y) t_2))
(/ -1.0 (/ (/ t_1 y) (- (- b z) a))))))))))))))
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) * a) - (y * b)) / t_2;
double t_4 = (z + a) - b;
double tmp;
if (y <= -3.3e+15) {
tmp = t_4;
} else if (y <= -1.15e-18) {
tmp = t_3;
} else if (y <= -8e-61) {
tmp = z / (t_1 / (x + y));
} else if (y <= -3e-132) {
tmp = t_3;
} else if (y <= -8.2e-224) {
tmp = t_4;
} else if (y <= 8.5e-177) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.46e-96) {
tmp = t_4;
} else if (y <= 2.8e+41) {
tmp = t_3;
} else if (y <= 8.5e+97) {
tmp = z * ((x + y) / t_2);
} else {
tmp = -1.0 / ((t_1 / y) / ((b - z) - a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + y) + t
t_2 = y + (x + t)
t_3 = (((y + t) * a) - (y * b)) / t_2
t_4 = (z + a) - b
if (y <= (-3.3d+15)) then
tmp = t_4
else if (y <= (-1.15d-18)) then
tmp = t_3
else if (y <= (-8d-61)) then
tmp = z / (t_1 / (x + y))
else if (y <= (-3d-132)) then
tmp = t_3
else if (y <= (-8.2d-224)) then
tmp = t_4
else if (y <= 8.5d-177) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 1.46d-96) then
tmp = t_4
else if (y <= 2.8d+41) then
tmp = t_3
else if (y <= 8.5d+97) then
tmp = z * ((x + y) / t_2)
else
tmp = (-1.0d0) / ((t_1 / y) / ((b - z) - a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double t_2 = y + (x + t);
double t_3 = (((y + t) * a) - (y * b)) / t_2;
double t_4 = (z + a) - b;
double tmp;
if (y <= -3.3e+15) {
tmp = t_4;
} else if (y <= -1.15e-18) {
tmp = t_3;
} else if (y <= -8e-61) {
tmp = z / (t_1 / (x + y));
} else if (y <= -3e-132) {
tmp = t_3;
} else if (y <= -8.2e-224) {
tmp = t_4;
} else if (y <= 8.5e-177) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.46e-96) {
tmp = t_4;
} else if (y <= 2.8e+41) {
tmp = t_3;
} else if (y <= 8.5e+97) {
tmp = z * ((x + y) / t_2);
} else {
tmp = -1.0 / ((t_1 / y) / ((b - z) - a));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + t t_2 = y + (x + t) t_3 = (((y + t) * a) - (y * b)) / t_2 t_4 = (z + a) - b tmp = 0 if y <= -3.3e+15: tmp = t_4 elif y <= -1.15e-18: tmp = t_3 elif y <= -8e-61: tmp = z / (t_1 / (x + y)) elif y <= -3e-132: tmp = t_3 elif y <= -8.2e-224: tmp = t_4 elif y <= 8.5e-177: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 1.46e-96: tmp = t_4 elif y <= 2.8e+41: tmp = t_3 elif y <= 8.5e+97: tmp = z * ((x + y) / t_2) else: tmp = -1.0 / ((t_1 / y) / ((b - z) - a)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(y + t) * a) - Float64(y * b)) / t_2) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -3.3e+15) tmp = t_4; elseif (y <= -1.15e-18) tmp = t_3; elseif (y <= -8e-61) tmp = Float64(z / Float64(t_1 / Float64(x + y))); elseif (y <= -3e-132) tmp = t_3; elseif (y <= -8.2e-224) tmp = t_4; elseif (y <= 8.5e-177) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 1.46e-96) tmp = t_4; elseif (y <= 2.8e+41) tmp = t_3; elseif (y <= 8.5e+97) tmp = Float64(z * Float64(Float64(x + y) / t_2)); else tmp = Float64(-1.0 / Float64(Float64(t_1 / y) / Float64(Float64(b - z) - a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) + t; t_2 = y + (x + t); t_3 = (((y + t) * a) - (y * b)) / t_2; t_4 = (z + a) - b; tmp = 0.0; if (y <= -3.3e+15) tmp = t_4; elseif (y <= -1.15e-18) tmp = t_3; elseif (y <= -8e-61) tmp = z / (t_1 / (x + y)); elseif (y <= -3e-132) tmp = t_3; elseif (y <= -8.2e-224) tmp = t_4; elseif (y <= 8.5e-177) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 1.46e-96) tmp = t_4; elseif (y <= 2.8e+41) tmp = t_3; elseif (y <= 8.5e+97) tmp = z * ((x + y) / t_2); else tmp = -1.0 / ((t_1 / y) / ((b - z) - a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3.3e+15], t$95$4, If[LessEqual[y, -1.15e-18], t$95$3, If[LessEqual[y, -8e-61], N[(z / N[(t$95$1 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3e-132], t$95$3, If[LessEqual[y, -8.2e-224], t$95$4, If[LessEqual[y, 8.5e-177], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.46e-96], t$95$4, If[LessEqual[y, 2.8e+41], t$95$3, If[LessEqual[y, 8.5e+97], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(t$95$1 / y), $MachinePrecision] / N[(N[(b - z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(y + t\right) \cdot a - y \cdot b}{t\_2}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{+15}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-18}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -8 \cdot 10^{-61}:\\
\;\;\;\;\frac{z}{\frac{t\_1}{x + y}}\\
\mathbf{elif}\;y \leq -3 \cdot 10^{-132}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-224}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-177}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 1.46 \cdot 10^{-96}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+41}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+97}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\frac{t\_1}{y}}{\left(b - z\right) - a}}\\
\end{array}
\end{array}
if y < -3.3e15 or -3e-132 < y < -8.19999999999999972e-224 or 8.4999999999999993e-177 < y < 1.45999999999999995e-96Initial program 40.0%
Taylor expanded in y around inf 81.3%
if -3.3e15 < y < -1.15e-18 or -8.0000000000000003e-61 < y < -3e-132 or 1.45999999999999995e-96 < y < 2.7999999999999999e41Initial program 81.7%
Taylor expanded in z around 0 64.3%
*-commutative64.3%
Simplified64.3%
if -1.15e-18 < y < -8.0000000000000003e-61Initial program 68.4%
Taylor expanded in z around inf 57.2%
associate-/l*78.2%
+-commutative78.2%
+-commutative78.2%
associate-+r+78.2%
+-commutative78.2%
associate-+l+78.2%
Simplified78.2%
clear-num78.2%
un-div-inv78.4%
+-commutative78.4%
associate-+r+78.4%
+-commutative78.4%
Applied egg-rr78.4%
if -8.19999999999999972e-224 < y < 8.4999999999999993e-177Initial program 85.1%
Taylor expanded in y around 0 70.7%
if 2.7999999999999999e41 < y < 8.4999999999999993e97Initial program 39.1%
Taylor expanded in z around inf 23.2%
associate-/l*84.0%
+-commutative84.0%
+-commutative84.0%
associate-+r+84.0%
+-commutative84.0%
associate-+l+84.0%
Simplified84.0%
if 8.4999999999999993e97 < y Initial program 37.1%
Taylor expanded in y around inf 34.6%
clear-num34.6%
inv-pow34.6%
associate-/r*93.5%
+-commutative93.5%
associate-+l+93.5%
associate--l+93.5%
Applied egg-rr93.5%
unpow-193.5%
Simplified93.5%
Final simplification78.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t)))
(if (<= b -1.85e+138)
(/ -1.0 (/ (/ t_1 y) (- (- b z) a)))
(if (<= b -1.42e+60)
(/ z (/ t_1 (+ x y)))
(if (or (<= b -4200000.0) (not (<= b 2.25e+153)))
(* b (- (/ a b) (/ y (+ y (+ x t)))))
(- (+ z a) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double tmp;
if (b <= -1.85e+138) {
tmp = -1.0 / ((t_1 / y) / ((b - z) - a));
} else if (b <= -1.42e+60) {
tmp = z / (t_1 / (x + y));
} else if ((b <= -4200000.0) || !(b <= 2.25e+153)) {
tmp = b * ((a / b) - (y / (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) :: t_1
real(8) :: tmp
t_1 = (x + y) + t
if (b <= (-1.85d+138)) then
tmp = (-1.0d0) / ((t_1 / y) / ((b - z) - a))
else if (b <= (-1.42d+60)) then
tmp = z / (t_1 / (x + y))
else if ((b <= (-4200000.0d0)) .or. (.not. (b <= 2.25d+153))) then
tmp = b * ((a / b) - (y / (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 t_1 = (x + y) + t;
double tmp;
if (b <= -1.85e+138) {
tmp = -1.0 / ((t_1 / y) / ((b - z) - a));
} else if (b <= -1.42e+60) {
tmp = z / (t_1 / (x + y));
} else if ((b <= -4200000.0) || !(b <= 2.25e+153)) {
tmp = b * ((a / b) - (y / (y + (x + t))));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + t tmp = 0 if b <= -1.85e+138: tmp = -1.0 / ((t_1 / y) / ((b - z) - a)) elif b <= -1.42e+60: tmp = z / (t_1 / (x + y)) elif (b <= -4200000.0) or not (b <= 2.25e+153): tmp = b * ((a / b) - (y / (y + (x + t)))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) tmp = 0.0 if (b <= -1.85e+138) tmp = Float64(-1.0 / Float64(Float64(t_1 / y) / Float64(Float64(b - z) - a))); elseif (b <= -1.42e+60) tmp = Float64(z / Float64(t_1 / Float64(x + y))); elseif ((b <= -4200000.0) || !(b <= 2.25e+153)) tmp = Float64(b * Float64(Float64(a / b) - Float64(y / 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) t_1 = (x + y) + t; tmp = 0.0; if (b <= -1.85e+138) tmp = -1.0 / ((t_1 / y) / ((b - z) - a)); elseif (b <= -1.42e+60) tmp = z / (t_1 / (x + y)); elseif ((b <= -4200000.0) || ~((b <= 2.25e+153))) tmp = b * ((a / b) - (y / (y + (x + t)))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[b, -1.85e+138], N[(-1.0 / N[(N[(t$95$1 / y), $MachinePrecision] / N[(N[(b - z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.42e+60], N[(z / N[(t$95$1 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, -4200000.0], N[Not[LessEqual[b, 2.25e+153]], $MachinePrecision]], N[(b * N[(N[(a / b), $MachinePrecision] - N[(y / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
\mathbf{if}\;b \leq -1.85 \cdot 10^{+138}:\\
\;\;\;\;\frac{-1}{\frac{\frac{t\_1}{y}}{\left(b - z\right) - a}}\\
\mathbf{elif}\;b \leq -1.42 \cdot 10^{+60}:\\
\;\;\;\;\frac{z}{\frac{t\_1}{x + y}}\\
\mathbf{elif}\;b \leq -4200000 \lor \neg \left(b \leq 2.25 \cdot 10^{+153}\right):\\
\;\;\;\;b \cdot \left(\frac{a}{b} - \frac{y}{y + \left(x + t\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -1.8499999999999999e138Initial program 63.6%
Taylor expanded in y around inf 45.0%
clear-num44.9%
inv-pow44.9%
associate-/r*72.2%
+-commutative72.2%
associate-+l+72.2%
associate--l+72.2%
Applied egg-rr72.2%
unpow-172.2%
Simplified72.2%
if -1.8499999999999999e138 < b < -1.42000000000000001e60Initial program 46.1%
Taylor expanded in z around inf 36.9%
associate-/l*76.5%
+-commutative76.5%
+-commutative76.5%
associate-+r+76.5%
+-commutative76.5%
associate-+l+76.5%
Simplified76.5%
clear-num76.6%
un-div-inv76.7%
+-commutative76.7%
associate-+r+76.7%
+-commutative76.7%
Applied egg-rr76.7%
if -1.42000000000000001e60 < b < -4.2e6 or 2.25e153 < b Initial program 47.9%
Taylor expanded in b around -inf 53.0%
mul-1-neg53.0%
*-commutative53.0%
distribute-rgt-neg-in53.0%
Simplified97.0%
Taylor expanded in t around inf 78.9%
if -4.2e6 < b < 2.25e153Initial program 58.6%
Taylor expanded in y around inf 67.2%
Final simplification70.2%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4.5e+194) (* y (/ b (- (- (- t) x) y))) (if (<= b 1.75e+155) (- (+ z a) b) (* b (- (/ a b) (/ y (+ y (+ x t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.5e+194) {
tmp = y * (b / ((-t - x) - y));
} else if (b <= 1.75e+155) {
tmp = (z + a) - b;
} else {
tmp = b * ((a / b) - (y / (y + (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 (b <= (-4.5d+194)) then
tmp = y * (b / ((-t - x) - y))
else if (b <= 1.75d+155) then
tmp = (z + a) - b
else
tmp = b * ((a / b) - (y / (y + (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 (b <= -4.5e+194) {
tmp = y * (b / ((-t - x) - y));
} else if (b <= 1.75e+155) {
tmp = (z + a) - b;
} else {
tmp = b * ((a / b) - (y / (y + (x + t))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.5e+194: tmp = y * (b / ((-t - x) - y)) elif b <= 1.75e+155: tmp = (z + a) - b else: tmp = b * ((a / b) - (y / (y + (x + t)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.5e+194) tmp = Float64(y * Float64(b / Float64(Float64(Float64(-t) - x) - y))); elseif (b <= 1.75e+155) tmp = Float64(Float64(z + a) - b); else tmp = Float64(b * Float64(Float64(a / b) - Float64(y / Float64(y + Float64(x + t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.5e+194) tmp = y * (b / ((-t - x) - y)); elseif (b <= 1.75e+155) tmp = (z + a) - b; else tmp = b * ((a / b) - (y / (y + (x + t)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.5e+194], N[(y * N[(b / N[(N[((-t) - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.75e+155], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(b * N[(N[(a / b), $MachinePrecision] - N[(y / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+194}:\\
\;\;\;\;y \cdot \frac{b}{\left(\left(-t\right) - x\right) - y}\\
\mathbf{elif}\;b \leq 1.75 \cdot 10^{+155}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\frac{a}{b} - \frac{y}{y + \left(x + t\right)}\right)\\
\end{array}
\end{array}
if b < -4.4999999999999998e194Initial program 59.5%
Taylor expanded in b around inf 38.4%
*-commutative38.4%
+-commutative38.4%
associate-+r+38.4%
associate-*r/68.1%
neg-mul-168.1%
distribute-rgt-neg-in68.1%
associate-+r+68.1%
+-commutative68.1%
distribute-neg-frac68.1%
+-commutative68.1%
associate-+r+68.1%
+-commutative68.1%
associate-+l+68.1%
Simplified68.1%
if -4.4999999999999998e194 < b < 1.74999999999999992e155Initial program 58.4%
Taylor expanded in y around inf 66.2%
if 1.74999999999999992e155 < b Initial program 42.1%
Taylor expanded in b around -inf 48.6%
mul-1-neg48.6%
*-commutative48.6%
distribute-rgt-neg-in48.6%
Simplified96.6%
Taylor expanded in t around inf 77.1%
Final simplification67.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.6e+124) (not (<= x 8.5e+88))) (+ z (* t (- (/ a x) (/ z x)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.6e+124) || !(x <= 8.5e+88)) {
tmp = z + (t * ((a / x) - (z / 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 <= (-1.6d+124)) .or. (.not. (x <= 8.5d+88))) then
tmp = z + (t * ((a / x) - (z / 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 <= -1.6e+124) || !(x <= 8.5e+88)) {
tmp = z + (t * ((a / x) - (z / x)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.6e+124) or not (x <= 8.5e+88): tmp = z + (t * ((a / x) - (z / x))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.6e+124) || !(x <= 8.5e+88)) tmp = Float64(z + Float64(t * Float64(Float64(a / x) - Float64(z / 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 <= -1.6e+124) || ~((x <= 8.5e+88))) tmp = z + (t * ((a / x) - (z / x))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.6e+124], N[Not[LessEqual[x, 8.5e+88]], $MachinePrecision]], N[(z + N[(t * N[(N[(a / x), $MachinePrecision] - N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+124} \lor \neg \left(x \leq 8.5 \cdot 10^{+88}\right):\\
\;\;\;\;z + t \cdot \left(\frac{a}{x} - \frac{z}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -1.59999999999999996e124 or 8.5000000000000005e88 < x Initial program 42.4%
Taylor expanded in y around 0 32.3%
Taylor expanded in t around 0 71.1%
if -1.59999999999999996e124 < x < 8.5000000000000005e88Initial program 63.3%
Taylor expanded in y around inf 67.4%
Final simplification68.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.5e+194) (not (<= b 3.5e+195))) (* y (/ b (- (- (- t) x) y))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.5e+194) || !(b <= 3.5e+195)) {
tmp = y * (b / ((-t - x) - y));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2.5d+194)) .or. (.not. (b <= 3.5d+195))) then
tmp = y * (b / ((-t - x) - y))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.5e+194) || !(b <= 3.5e+195)) {
tmp = y * (b / ((-t - x) - y));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.5e+194) or not (b <= 3.5e+195): tmp = y * (b / ((-t - x) - y)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.5e+194) || !(b <= 3.5e+195)) tmp = Float64(y * Float64(b / Float64(Float64(Float64(-t) - x) - y))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.5e+194) || ~((b <= 3.5e+195))) tmp = y * (b / ((-t - x) - y)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.5e+194], N[Not[LessEqual[b, 3.5e+195]], $MachinePrecision]], N[(y * N[(b / N[(N[((-t) - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.5 \cdot 10^{+194} \lor \neg \left(b \leq 3.5 \cdot 10^{+195}\right):\\
\;\;\;\;y \cdot \frac{b}{\left(\left(-t\right) - x\right) - y}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if b < -2.49999999999999994e194 or 3.5000000000000002e195 < b Initial program 46.6%
Taylor expanded in b around inf 31.2%
*-commutative31.2%
+-commutative31.2%
associate-+r+31.2%
associate-*r/65.7%
neg-mul-165.7%
distribute-rgt-neg-in65.7%
associate-+r+65.7%
+-commutative65.7%
distribute-neg-frac65.7%
+-commutative65.7%
associate-+r+65.7%
+-commutative65.7%
associate-+l+65.7%
Simplified65.7%
if -2.49999999999999994e194 < b < 3.5000000000000002e195Initial program 58.3%
Taylor expanded in y around inf 66.5%
Final simplification66.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -1.12e+170) (not (<= x 8.5e+138))) (* z (- 1.0 (/ t x))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -1.12e+170) || !(x <= 8.5e+138)) {
tmp = z * (1.0 - (t / 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 <= (-1.12d+170)) .or. (.not. (x <= 8.5d+138))) then
tmp = z * (1.0d0 - (t / 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 <= -1.12e+170) || !(x <= 8.5e+138)) {
tmp = z * (1.0 - (t / x));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -1.12e+170) or not (x <= 8.5e+138): tmp = z * (1.0 - (t / x)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -1.12e+170) || !(x <= 8.5e+138)) tmp = Float64(z * Float64(1.0 - Float64(t / 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 <= -1.12e+170) || ~((x <= 8.5e+138))) tmp = z * (1.0 - (t / x)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -1.12e+170], N[Not[LessEqual[x, 8.5e+138]], $MachinePrecision]], N[(z * N[(1.0 - N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.12 \cdot 10^{+170} \lor \neg \left(x \leq 8.5 \cdot 10^{+138}\right):\\
\;\;\;\;z \cdot \left(1 - \frac{t}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -1.1200000000000001e170 or 8.5000000000000006e138 < x Initial program 38.6%
Taylor expanded in z around inf 18.2%
associate-/l*66.5%
+-commutative66.5%
+-commutative66.5%
associate-+r+66.5%
+-commutative66.5%
associate-+l+66.5%
Simplified66.5%
Taylor expanded in x around inf 66.6%
mul-1-neg66.6%
unsub-neg66.6%
Simplified66.6%
if -1.1200000000000001e170 < x < 8.5000000000000006e138Initial program 62.1%
Taylor expanded in y around inf 65.5%
Final simplification65.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.8e+169) z (if (<= x 1.7e+136) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.8e+169) {
tmp = z;
} else if (x <= 1.7e+136) {
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 <= (-8.8d+169)) then
tmp = z
else if (x <= 1.7d+136) 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 <= -8.8e+169) {
tmp = z;
} else if (x <= 1.7e+136) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.8e+169: tmp = z elif x <= 1.7e+136: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.8e+169) tmp = z; elseif (x <= 1.7e+136) 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 <= -8.8e+169) tmp = z; elseif (x <= 1.7e+136) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.8e+169], z, If[LessEqual[x, 1.7e+136], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+169}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+136}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -8.8000000000000001e169 or 1.69999999999999998e136 < x Initial program 38.6%
Taylor expanded in x around inf 66.0%
if -8.8000000000000001e169 < x < 1.69999999999999998e136Initial program 62.1%
Taylor expanded in y around inf 65.5%
Final simplification65.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -9.5e+83) z (if (<= z 1.7e+28) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.5e+83) {
tmp = z;
} else if (z <= 1.7e+28) {
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 <= (-9.5d+83)) then
tmp = z
else if (z <= 1.7d+28) 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 <= -9.5e+83) {
tmp = z;
} else if (z <= 1.7e+28) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -9.5e+83: tmp = z elif z <= 1.7e+28: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -9.5e+83) tmp = z; elseif (z <= 1.7e+28) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -9.5e+83) tmp = z; elseif (z <= 1.7e+28) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -9.5e+83], z, If[LessEqual[z, 1.7e+28], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+83}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+28}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -9.5000000000000002e83 or 1.7e28 < z Initial program 37.8%
Taylor expanded in x around inf 64.2%
if -9.5000000000000002e83 < z < 1.7e28Initial program 71.0%
Taylor expanded in t around inf 47.4%
Final simplification54.7%
(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 56.6%
Taylor expanded in t around inf 33.0%
Final simplification33.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 2024130
(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)))