
(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 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t))))
(t_2 (+ t (+ x y))))
(if (<= t_1 (- INFINITY))
(+ z (* a (+ (/ y t_2) (/ t t_2))))
(if (<= t_1 5e+274)
(/ (fma (+ x y) z (fma (+ y t) a (* b (- y)))) (+ x (+ y t)))
(- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double t_2 = t + (x + y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z + (a * ((y / t_2) + (t / t_2)));
} else if (t_1 <= 5e+274) {
tmp = fma((x + y), z, fma((y + t), a, (b * -y))) / (x + (y + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(t + Float64(x + y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z + Float64(a * Float64(Float64(y / t_2) + Float64(t / t_2)))); elseif (t_1 <= 5e+274) tmp = Float64(fma(Float64(x + y), z, fma(Float64(y + t), a, Float64(b * Float64(-y)))) / Float64(x + Float64(y + t))); else tmp = Float64(Float64(z + a) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z + N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+274], N[(N[(N[(x + y), $MachinePrecision] * z + N[(N[(y + t), $MachinePrecision] * a + N[(b * (-y)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := t + \left(x + y\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;z + a \cdot \left(\frac{y}{t_2} + \frac{t}{t_2}\right)\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, \mathsf{fma}\left(y + t, a, b \cdot \left(-y\right)\right)\right)}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\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.0Initial program 6.4%
Taylor expanded in a around 0 39.2%
associate--l+39.2%
+-commutative39.2%
+-commutative39.2%
+-commutative39.2%
div-sub39.2%
+-commutative39.2%
*-commutative39.2%
+-commutative39.2%
Simplified39.2%
Taylor expanded in x around inf 82.7%
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.9999999999999998e274Initial program 99.7%
associate--l+99.7%
fma-def99.7%
fma-neg99.7%
+-commutative99.7%
distribute-lft-neg-out99.7%
*-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Simplified99.7%
if 4.9999999999999998e274 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.9%
Taylor expanded in y around inf 77.7%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* z (+ x y)) (* a (+ y t))) (* y b)) (+ y (+ x t))))
(t_2 (+ t (+ x y))))
(if (<= t_1 (- INFINITY))
(+ z (* a (+ (/ y t_2) (/ t t_2))))
(if (<= t_1 5e+274) t_1 (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double t_2 = t + (x + y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = z + (a * ((y / t_2) + (t / t_2)));
} else if (t_1 <= 5e+274) {
tmp = t_1;
} else {
tmp = (z + a) - b;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t));
double t_2 = t + (x + y);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = z + (a * ((y / t_2) + (t / t_2)));
} else if (t_1 <= 5e+274) {
tmp = t_1;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)) t_2 = t + (x + y) tmp = 0 if t_1 <= -math.inf: tmp = z + (a * ((y / t_2) + (t / t_2))) elif t_1 <= 5e+274: tmp = t_1 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(a * Float64(y + t))) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(t + Float64(x + y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(z + Float64(a * Float64(Float64(y / t_2) + Float64(t / t_2)))); elseif (t_1 <= 5e+274) tmp = t_1; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (((z * (x + y)) + (a * (y + t))) - (y * b)) / (y + (x + t)); t_2 = t + (x + y); tmp = 0.0; if (t_1 <= -Inf) tmp = z + (a * ((y / t_2) + (t / t_2))); elseif (t_1 <= 5e+274) tmp = t_1; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(z + N[(a * N[(N[(y / t$95$2), $MachinePrecision] + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+274], t$95$1, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + a \cdot \left(y + t\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := t + \left(x + y\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;z + a \cdot \left(\frac{y}{t_2} + \frac{t}{t_2}\right)\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\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.0Initial program 6.4%
Taylor expanded in a around 0 39.2%
associate--l+39.2%
+-commutative39.2%
+-commutative39.2%
+-commutative39.2%
div-sub39.2%
+-commutative39.2%
*-commutative39.2%
+-commutative39.2%
Simplified39.2%
Taylor expanded in x around inf 82.7%
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.9999999999999998e274Initial program 99.7%
if 4.9999999999999998e274 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 7.9%
Taylor expanded in y around inf 77.7%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (* a (+ y t)) (* y b)) (+ y (+ x t)))) (t_2 (- (+ z a) b)))
(if (<= y -6.5e+130)
t_2
(if (<= y -475.0)
t_1
(if (<= y -5.1e-38)
(+ z (/ a (/ (+ x y) y)))
(if (<= y -1.2e-119)
t_1
(if (<= y 2.65e-245)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 6e-114) (+ z a) (if (<= y 1.65e-67) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((a * (y + t)) - (y * b)) / (y + (x + t));
double t_2 = (z + a) - b;
double tmp;
if (y <= -6.5e+130) {
tmp = t_2;
} else if (y <= -475.0) {
tmp = t_1;
} else if (y <= -5.1e-38) {
tmp = z + (a / ((x + y) / y));
} else if (y <= -1.2e-119) {
tmp = t_1;
} else if (y <= 2.65e-245) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 6e-114) {
tmp = z + a;
} else if (y <= 1.65e-67) {
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 = ((a * (y + t)) - (y * b)) / (y + (x + t))
t_2 = (z + a) - b
if (y <= (-6.5d+130)) then
tmp = t_2
else if (y <= (-475.0d0)) then
tmp = t_1
else if (y <= (-5.1d-38)) then
tmp = z + (a / ((x + y) / y))
else if (y <= (-1.2d-119)) then
tmp = t_1
else if (y <= 2.65d-245) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 6d-114) then
tmp = z + a
else if (y <= 1.65d-67) 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 = ((a * (y + t)) - (y * b)) / (y + (x + t));
double t_2 = (z + a) - b;
double tmp;
if (y <= -6.5e+130) {
tmp = t_2;
} else if (y <= -475.0) {
tmp = t_1;
} else if (y <= -5.1e-38) {
tmp = z + (a / ((x + y) / y));
} else if (y <= -1.2e-119) {
tmp = t_1;
} else if (y <= 2.65e-245) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 6e-114) {
tmp = z + a;
} else if (y <= 1.65e-67) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((a * (y + t)) - (y * b)) / (y + (x + t)) t_2 = (z + a) - b tmp = 0 if y <= -6.5e+130: tmp = t_2 elif y <= -475.0: tmp = t_1 elif y <= -5.1e-38: tmp = z + (a / ((x + y) / y)) elif y <= -1.2e-119: tmp = t_1 elif y <= 2.65e-245: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 6e-114: tmp = z + a elif y <= 1.65e-67: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / Float64(y + Float64(x + t))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -6.5e+130) tmp = t_2; elseif (y <= -475.0) tmp = t_1; elseif (y <= -5.1e-38) tmp = Float64(z + Float64(a / Float64(Float64(x + y) / y))); elseif (y <= -1.2e-119) tmp = t_1; elseif (y <= 2.65e-245) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 6e-114) tmp = Float64(z + a); elseif (y <= 1.65e-67) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((a * (y + t)) - (y * b)) / (y + (x + t)); t_2 = (z + a) - b; tmp = 0.0; if (y <= -6.5e+130) tmp = t_2; elseif (y <= -475.0) tmp = t_1; elseif (y <= -5.1e-38) tmp = z + (a / ((x + y) / y)); elseif (y <= -1.2e-119) tmp = t_1; elseif (y <= 2.65e-245) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 6e-114) tmp = z + a; elseif (y <= 1.65e-67) 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[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.5e+130], t$95$2, If[LessEqual[y, -475.0], t$95$1, If[LessEqual[y, -5.1e-38], N[(z + N[(a / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.2e-119], t$95$1, If[LessEqual[y, 2.65e-245], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-114], N[(z + a), $MachinePrecision], If[LessEqual[y, 1.65e-67], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a \cdot \left(y + t\right) - y \cdot b}{y + \left(x + t\right)}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+130}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -475:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -5.1 \cdot 10^{-38}:\\
\;\;\;\;z + \frac{a}{\frac{x + y}{y}}\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-245}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-114}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -6.5e130 or 1.6500000000000001e-67 < y Initial program 49.8%
Taylor expanded in y around inf 76.7%
if -6.5e130 < y < -475 or -5.10000000000000028e-38 < y < -1.20000000000000004e-119 or 6.0000000000000003e-114 < y < 1.6500000000000001e-67Initial program 78.0%
Taylor expanded in z around 0 64.1%
if -475 < y < -5.10000000000000028e-38Initial program 52.9%
Taylor expanded in a around 0 62.5%
associate--l+62.5%
+-commutative62.5%
+-commutative62.5%
+-commutative62.5%
div-sub62.5%
+-commutative62.5%
*-commutative62.5%
+-commutative62.5%
Simplified62.5%
Taylor expanded in x around inf 87.6%
Taylor expanded in t around 0 87.6%
associate-/l*87.6%
+-commutative87.6%
Simplified87.6%
if -1.20000000000000004e-119 < y < 2.64999999999999998e-245Initial program 88.1%
Taylor expanded in y around 0 77.2%
if 2.64999999999999998e-245 < y < 6.0000000000000003e-114Initial program 66.0%
Taylor expanded in a around 0 84.6%
associate--l+84.6%
+-commutative84.6%
+-commutative84.6%
+-commutative84.6%
div-sub84.6%
+-commutative84.6%
*-commutative84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in x around inf 79.1%
Taylor expanded in y around inf 63.6%
Final simplification73.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t)))
(t_2 (+ y (+ x t)))
(t_3 (/ (- t_1 (* y b)) t_2))
(t_4 (- (+ z a) b)))
(if (<= y -6.5e+130)
t_4
(if (<= y -42.0)
t_3
(if (<= y -5.6e-38)
(+ z (/ a (/ (+ x y) y)))
(if (<= y -6.2e-119)
t_3
(if (<= y 4e-32) (/ (+ (* z (+ x y)) t_1) t_2) t_4)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (t_1 - (y * b)) / t_2;
double t_4 = (z + a) - b;
double tmp;
if (y <= -6.5e+130) {
tmp = t_4;
} else if (y <= -42.0) {
tmp = t_3;
} else if (y <= -5.6e-38) {
tmp = z + (a / ((x + y) / y));
} else if (y <= -6.2e-119) {
tmp = t_3;
} else if (y <= 4e-32) {
tmp = ((z * (x + y)) + 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 = a * (y + t)
t_2 = y + (x + t)
t_3 = (t_1 - (y * b)) / t_2
t_4 = (z + a) - b
if (y <= (-6.5d+130)) then
tmp = t_4
else if (y <= (-42.0d0)) then
tmp = t_3
else if (y <= (-5.6d-38)) then
tmp = z + (a / ((x + y) / y))
else if (y <= (-6.2d-119)) then
tmp = t_3
else if (y <= 4d-32) then
tmp = ((z * (x + y)) + 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 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (t_1 - (y * b)) / t_2;
double t_4 = (z + a) - b;
double tmp;
if (y <= -6.5e+130) {
tmp = t_4;
} else if (y <= -42.0) {
tmp = t_3;
} else if (y <= -5.6e-38) {
tmp = z + (a / ((x + y) / y));
} else if (y <= -6.2e-119) {
tmp = t_3;
} else if (y <= 4e-32) {
tmp = ((z * (x + y)) + t_1) / t_2;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) t_3 = (t_1 - (y * b)) / t_2 t_4 = (z + a) - b tmp = 0 if y <= -6.5e+130: tmp = t_4 elif y <= -42.0: tmp = t_3 elif y <= -5.6e-38: tmp = z + (a / ((x + y) / y)) elif y <= -6.2e-119: tmp = t_3 elif y <= 4e-32: tmp = ((z * (x + y)) + t_1) / t_2 else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(t_1 - Float64(y * b)) / t_2) t_4 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -6.5e+130) tmp = t_4; elseif (y <= -42.0) tmp = t_3; elseif (y <= -5.6e-38) tmp = Float64(z + Float64(a / Float64(Float64(x + y) / y))); elseif (y <= -6.2e-119) tmp = t_3; elseif (y <= 4e-32) tmp = Float64(Float64(Float64(z * Float64(x + y)) + t_1) / t_2); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); t_3 = (t_1 - (y * b)) / t_2; t_4 = (z + a) - b; tmp = 0.0; if (y <= -6.5e+130) tmp = t_4; elseif (y <= -42.0) tmp = t_3; elseif (y <= -5.6e-38) tmp = z + (a / ((x + y) / y)); elseif (y <= -6.2e-119) tmp = t_3; elseif (y <= 4e-32) tmp = ((z * (x + y)) + 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[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.5e+130], t$95$4, If[LessEqual[y, -42.0], t$95$3, If[LessEqual[y, -5.6e-38], N[(z + N[(a / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.2e-119], t$95$3, If[LessEqual[y, 4e-32], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{t_1 - y \cdot b}{t_2}\\
t_4 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+130}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;y \leq -42:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -5.6 \cdot 10^{-38}:\\
\;\;\;\;z + \frac{a}{\frac{x + y}{y}}\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{-119}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-32}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) + t_1}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if y < -6.5e130 or 4.00000000000000022e-32 < y Initial program 47.0%
Taylor expanded in y around inf 77.7%
if -6.5e130 < y < -42 or -5.6e-38 < y < -6.19999999999999956e-119Initial program 77.3%
Taylor expanded in z around 0 64.7%
if -42 < y < -5.6e-38Initial program 52.9%
Taylor expanded in a around 0 62.5%
associate--l+62.5%
+-commutative62.5%
+-commutative62.5%
+-commutative62.5%
div-sub62.5%
+-commutative62.5%
*-commutative62.5%
+-commutative62.5%
Simplified62.5%
Taylor expanded in x around inf 87.6%
Taylor expanded in t around 0 87.6%
associate-/l*87.6%
+-commutative87.6%
Simplified87.6%
if -6.19999999999999956e-119 < y < 4.00000000000000022e-32Initial program 81.1%
Taylor expanded in b around 0 69.9%
Final simplification73.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y)))
(t_2 (+ y (+ x t)))
(t_3 (+ z (* a (+ (/ y t_1) (/ t t_1))))))
(if (<= a -2.3e-61)
t_3
(if (<= a -1.65e-192)
(- (+ z a) b)
(if (<= a 1.8e-87)
(/ (- (* z (+ x y)) (* y b)) t_2)
(if (<= a 2.5e+77) (/ (- (* a (+ y t)) (* y b)) t_2) t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = y + (x + t);
double t_3 = z + (a * ((y / t_1) + (t / t_1)));
double tmp;
if (a <= -2.3e-61) {
tmp = t_3;
} else if (a <= -1.65e-192) {
tmp = (z + a) - b;
} else if (a <= 1.8e-87) {
tmp = ((z * (x + y)) - (y * b)) / t_2;
} else if (a <= 2.5e+77) {
tmp = ((a * (y + t)) - (y * b)) / t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t + (x + y)
t_2 = y + (x + t)
t_3 = z + (a * ((y / t_1) + (t / t_1)))
if (a <= (-2.3d-61)) then
tmp = t_3
else if (a <= (-1.65d-192)) then
tmp = (z + a) - b
else if (a <= 1.8d-87) then
tmp = ((z * (x + y)) - (y * b)) / t_2
else if (a <= 2.5d+77) then
tmp = ((a * (y + t)) - (y * b)) / t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = y + (x + t);
double t_3 = z + (a * ((y / t_1) + (t / t_1)));
double tmp;
if (a <= -2.3e-61) {
tmp = t_3;
} else if (a <= -1.65e-192) {
tmp = (z + a) - b;
} else if (a <= 1.8e-87) {
tmp = ((z * (x + y)) - (y * b)) / t_2;
} else if (a <= 2.5e+77) {
tmp = ((a * (y + t)) - (y * b)) / t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t + (x + y) t_2 = y + (x + t) t_3 = z + (a * ((y / t_1) + (t / t_1))) tmp = 0 if a <= -2.3e-61: tmp = t_3 elif a <= -1.65e-192: tmp = (z + a) - b elif a <= 1.8e-87: tmp = ((z * (x + y)) - (y * b)) / t_2 elif a <= 2.5e+77: tmp = ((a * (y + t)) - (y * b)) / t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(z + Float64(a * Float64(Float64(y / t_1) + Float64(t / t_1)))) tmp = 0.0 if (a <= -2.3e-61) tmp = t_3; elseif (a <= -1.65e-192) tmp = Float64(Float64(z + a) - b); elseif (a <= 1.8e-87) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / t_2); elseif (a <= 2.5e+77) tmp = Float64(Float64(Float64(a * Float64(y + t)) - Float64(y * b)) / t_2); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t + (x + y); t_2 = y + (x + t); t_3 = z + (a * ((y / t_1) + (t / t_1))); tmp = 0.0; if (a <= -2.3e-61) tmp = t_3; elseif (a <= -1.65e-192) tmp = (z + a) - b; elseif (a <= 1.8e-87) tmp = ((z * (x + y)) - (y * b)) / t_2; elseif (a <= 2.5e+77) tmp = ((a * (y + t)) - (y * b)) / t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z + N[(a * N[(N[(y / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.3e-61], t$95$3, If[LessEqual[a, -1.65e-192], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[a, 1.8e-87], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[a, 2.5e+77], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := z + a \cdot \left(\frac{y}{t_1} + \frac{t}{t_1}\right)\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{-61}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;a \leq -1.65 \cdot 10^{-192}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-87}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{t_2}\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{+77}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) - y \cdot b}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if a < -2.29999999999999992e-61 or 2.50000000000000002e77 < a Initial program 55.3%
Taylor expanded in a around 0 79.6%
associate--l+79.6%
+-commutative79.6%
+-commutative79.6%
+-commutative79.6%
div-sub79.6%
+-commutative79.6%
*-commutative79.6%
+-commutative79.6%
Simplified79.6%
Taylor expanded in x around inf 85.7%
if -2.29999999999999992e-61 < a < -1.64999999999999995e-192Initial program 69.5%
Taylor expanded in y around inf 81.2%
if -1.64999999999999995e-192 < a < 1.79999999999999996e-87Initial program 73.5%
Taylor expanded in a around 0 67.7%
+-commutative67.7%
*-commutative67.7%
Simplified67.7%
if 1.79999999999999996e-87 < a < 2.50000000000000002e77Initial program 77.0%
Taylor expanded in z around 0 60.0%
Final simplification77.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ a (/ (+ x y) y)))))
(if (<= x -1.45e+79)
t_1
(if (<= x 1.5e+109)
(- (+ z a) b)
(if (<= x 2.9e+166) t_1 (/ (- (* z (+ x y)) (* y b)) (+ y (+ x t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (a / ((x + y) / y));
double tmp;
if (x <= -1.45e+79) {
tmp = t_1;
} else if (x <= 1.5e+109) {
tmp = (z + a) - b;
} else if (x <= 2.9e+166) {
tmp = t_1;
} else {
tmp = ((z * (x + y)) - (y * b)) / (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) :: t_1
real(8) :: tmp
t_1 = z + (a / ((x + y) / y))
if (x <= (-1.45d+79)) then
tmp = t_1
else if (x <= 1.5d+109) then
tmp = (z + a) - b
else if (x <= 2.9d+166) then
tmp = t_1
else
tmp = ((z * (x + y)) - (y * b)) / (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 t_1 = z + (a / ((x + y) / y));
double tmp;
if (x <= -1.45e+79) {
tmp = t_1;
} else if (x <= 1.5e+109) {
tmp = (z + a) - b;
} else if (x <= 2.9e+166) {
tmp = t_1;
} else {
tmp = ((z * (x + y)) - (y * b)) / (y + (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (a / ((x + y) / y)) tmp = 0 if x <= -1.45e+79: tmp = t_1 elif x <= 1.5e+109: tmp = (z + a) - b elif x <= 2.9e+166: tmp = t_1 else: tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(a / Float64(Float64(x + y) / y))) tmp = 0.0 if (x <= -1.45e+79) tmp = t_1; elseif (x <= 1.5e+109) tmp = Float64(Float64(z + a) - b); elseif (x <= 2.9e+166) tmp = t_1; else tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / Float64(y + Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (a / ((x + y) / y)); tmp = 0.0; if (x <= -1.45e+79) tmp = t_1; elseif (x <= 1.5e+109) tmp = (z + a) - b; elseif (x <= 2.9e+166) tmp = t_1; else tmp = ((z * (x + y)) - (y * b)) / (y + (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(a / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+79], t$95$1, If[LessEqual[x, 1.5e+109], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 2.9e+166], t$95$1, N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{a}{\frac{x + y}{y}}\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+109}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+166}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if x < -1.44999999999999996e79 or 1.50000000000000008e109 < x < 2.9000000000000001e166Initial program 56.4%
Taylor expanded in a around 0 64.3%
associate--l+64.3%
+-commutative64.3%
+-commutative64.3%
+-commutative64.3%
div-sub64.3%
+-commutative64.3%
*-commutative64.3%
+-commutative64.3%
Simplified64.3%
Taylor expanded in x around inf 79.6%
Taylor expanded in t around 0 65.8%
associate-/l*75.1%
+-commutative75.1%
Simplified75.1%
if -1.44999999999999996e79 < x < 1.50000000000000008e109Initial program 68.3%
Taylor expanded in y around inf 67.4%
if 2.9000000000000001e166 < x Initial program 61.3%
Taylor expanded in a around 0 54.1%
+-commutative54.1%
*-commutative54.1%
Simplified54.1%
Final simplification67.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -6.8e+92)
t_1
(if (<= y -3.0)
(/ (* y t_1) (+ y (+ x t)))
(if (<= y -4.1e-83)
(+ z (/ a (/ (+ x y) y)))
(if (<= y 2.65e-245) (/ (+ (* t a) (* x z)) (+ x t)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -6.8e+92) {
tmp = t_1;
} else if (y <= -3.0) {
tmp = (y * t_1) / (y + (x + t));
} else if (y <= -4.1e-83) {
tmp = z + (a / ((x + y) / y));
} else if (y <= 2.65e-245) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-6.8d+92)) then
tmp = t_1
else if (y <= (-3.0d0)) then
tmp = (y * t_1) / (y + (x + t))
else if (y <= (-4.1d-83)) then
tmp = z + (a / ((x + y) / y))
else if (y <= 2.65d-245) then
tmp = ((t * a) + (x * z)) / (x + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -6.8e+92) {
tmp = t_1;
} else if (y <= -3.0) {
tmp = (y * t_1) / (y + (x + t));
} else if (y <= -4.1e-83) {
tmp = z + (a / ((x + y) / y));
} else if (y <= 2.65e-245) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -6.8e+92: tmp = t_1 elif y <= -3.0: tmp = (y * t_1) / (y + (x + t)) elif y <= -4.1e-83: tmp = z + (a / ((x + y) / y)) elif y <= 2.65e-245: tmp = ((t * a) + (x * z)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -6.8e+92) tmp = t_1; elseif (y <= -3.0) tmp = Float64(Float64(y * t_1) / Float64(y + Float64(x + t))); elseif (y <= -4.1e-83) tmp = Float64(z + Float64(a / Float64(Float64(x + y) / y))); elseif (y <= 2.65e-245) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -6.8e+92) tmp = t_1; elseif (y <= -3.0) tmp = (y * t_1) / (y + (x + t)); elseif (y <= -4.1e-83) tmp = z + (a / ((x + y) / y)); elseif (y <= 2.65e-245) tmp = ((t * a) + (x * z)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.8e+92], t$95$1, If[LessEqual[y, -3.0], N[(N[(y * t$95$1), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.1e-83], N[(z + N[(a / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e-245], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3:\\
\;\;\;\;\frac{y \cdot t_1}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{-83}:\\
\;\;\;\;z + \frac{a}{\frac{x + y}{y}}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-245}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -6.7999999999999996e92 or 2.64999999999999998e-245 < y Initial program 55.6%
Taylor expanded in y around inf 69.9%
if -6.7999999999999996e92 < y < -3Initial program 70.3%
Taylor expanded in y around inf 55.3%
if -3 < y < -4.1e-83Initial program 68.4%
Taylor expanded in a around 0 76.4%
associate--l+76.4%
+-commutative76.4%
+-commutative76.4%
+-commutative76.4%
div-sub76.4%
+-commutative76.4%
*-commutative76.4%
+-commutative76.4%
Simplified76.4%
Taylor expanded in x around inf 74.8%
Taylor expanded in t around 0 70.9%
associate-/l*70.9%
+-commutative70.9%
Simplified70.9%
if -4.1e-83 < y < 2.64999999999999998e-245Initial program 89.1%
Taylor expanded in y around 0 75.2%
Final simplification70.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ z (+ 1.0 (/ t x)))))
(if (<= x -1.05e+137)
t_1
(if (<= x 6.2e+122)
(- (+ z a) b)
(if (<= x 1.4e+245)
t_1
(if (<= x 3.9e+301) (* a (/ 1.0 (/ (+ x t) t))) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z / (1.0 + (t / x));
double tmp;
if (x <= -1.05e+137) {
tmp = t_1;
} else if (x <= 6.2e+122) {
tmp = (z + a) - b;
} else if (x <= 1.4e+245) {
tmp = t_1;
} else if (x <= 3.9e+301) {
tmp = a * (1.0 / ((x + t) / t));
} 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) :: t_1
real(8) :: tmp
t_1 = z / (1.0d0 + (t / x))
if (x <= (-1.05d+137)) then
tmp = t_1
else if (x <= 6.2d+122) then
tmp = (z + a) - b
else if (x <= 1.4d+245) then
tmp = t_1
else if (x <= 3.9d+301) then
tmp = a * (1.0d0 / ((x + t) / t))
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 t_1 = z / (1.0 + (t / x));
double tmp;
if (x <= -1.05e+137) {
tmp = t_1;
} else if (x <= 6.2e+122) {
tmp = (z + a) - b;
} else if (x <= 1.4e+245) {
tmp = t_1;
} else if (x <= 3.9e+301) {
tmp = a * (1.0 / ((x + t) / t));
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z / (1.0 + (t / x)) tmp = 0 if x <= -1.05e+137: tmp = t_1 elif x <= 6.2e+122: tmp = (z + a) - b elif x <= 1.4e+245: tmp = t_1 elif x <= 3.9e+301: tmp = a * (1.0 / ((x + t) / t)) else: tmp = z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z / Float64(1.0 + Float64(t / x))) tmp = 0.0 if (x <= -1.05e+137) tmp = t_1; elseif (x <= 6.2e+122) tmp = Float64(Float64(z + a) - b); elseif (x <= 1.4e+245) tmp = t_1; elseif (x <= 3.9e+301) tmp = Float64(a * Float64(1.0 / Float64(Float64(x + t) / t))); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z / (1.0 + (t / x)); tmp = 0.0; if (x <= -1.05e+137) tmp = t_1; elseif (x <= 6.2e+122) tmp = (z + a) - b; elseif (x <= 1.4e+245) tmp = t_1; elseif (x <= 3.9e+301) tmp = a * (1.0 / ((x + t) / t)); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z / N[(1.0 + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+137], t$95$1, If[LessEqual[x, 6.2e+122], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 1.4e+245], t$95$1, If[LessEqual[x, 3.9e+301], N[(a * N[(1.0 / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], z]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{1 + \frac{t}{x}}\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+137}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+122}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+245}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+301}:\\
\;\;\;\;a \cdot \frac{1}{\frac{x + t}{t}}\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -1.05e137 or 6.19999999999999998e122 < x < 1.39999999999999989e245Initial program 60.2%
Taylor expanded in z around inf 40.3%
associate-/l*66.9%
+-commutative66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in x around inf 66.9%
if -1.05e137 < x < 6.19999999999999998e122Initial program 66.9%
Taylor expanded in y around inf 67.5%
if 1.39999999999999989e245 < x < 3.9000000000000001e301Initial program 52.6%
Taylor expanded in a around inf 16.7%
Taylor expanded in y around 0 16.8%
associate-/l*64.0%
Simplified64.0%
div-inv64.2%
+-commutative64.2%
Applied egg-rr64.2%
if 3.9000000000000001e301 < x Initial program 68.8%
Taylor expanded in x around inf 81.9%
Final simplification67.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ a (/ (+ x y) y)))))
(if (<= x -8e+86)
t_1
(if (<= x 2.85e+104)
(- (+ z a) b)
(if (<= x 1.2e+241)
t_1
(if (<= x 3.9e+301) (* a (/ 1.0 (/ (+ x t) t))) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (a / ((x + y) / y));
double tmp;
if (x <= -8e+86) {
tmp = t_1;
} else if (x <= 2.85e+104) {
tmp = (z + a) - b;
} else if (x <= 1.2e+241) {
tmp = t_1;
} else if (x <= 3.9e+301) {
tmp = a * (1.0 / ((x + t) / t));
} 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) :: t_1
real(8) :: tmp
t_1 = z + (a / ((x + y) / y))
if (x <= (-8d+86)) then
tmp = t_1
else if (x <= 2.85d+104) then
tmp = (z + a) - b
else if (x <= 1.2d+241) then
tmp = t_1
else if (x <= 3.9d+301) then
tmp = a * (1.0d0 / ((x + t) / t))
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 t_1 = z + (a / ((x + y) / y));
double tmp;
if (x <= -8e+86) {
tmp = t_1;
} else if (x <= 2.85e+104) {
tmp = (z + a) - b;
} else if (x <= 1.2e+241) {
tmp = t_1;
} else if (x <= 3.9e+301) {
tmp = a * (1.0 / ((x + t) / t));
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (a / ((x + y) / y)) tmp = 0 if x <= -8e+86: tmp = t_1 elif x <= 2.85e+104: tmp = (z + a) - b elif x <= 1.2e+241: tmp = t_1 elif x <= 3.9e+301: tmp = a * (1.0 / ((x + t) / t)) else: tmp = z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(a / Float64(Float64(x + y) / y))) tmp = 0.0 if (x <= -8e+86) tmp = t_1; elseif (x <= 2.85e+104) tmp = Float64(Float64(z + a) - b); elseif (x <= 1.2e+241) tmp = t_1; elseif (x <= 3.9e+301) tmp = Float64(a * Float64(1.0 / Float64(Float64(x + t) / t))); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (a / ((x + y) / y)); tmp = 0.0; if (x <= -8e+86) tmp = t_1; elseif (x <= 2.85e+104) tmp = (z + a) - b; elseif (x <= 1.2e+241) tmp = t_1; elseif (x <= 3.9e+301) tmp = a * (1.0 / ((x + t) / t)); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(a / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+86], t$95$1, If[LessEqual[x, 2.85e+104], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 1.2e+241], t$95$1, If[LessEqual[x, 3.9e+301], N[(a * N[(1.0 / N[(N[(x + t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], z]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{a}{\frac{x + y}{y}}\\
\mathbf{if}\;x \leq -8 \cdot 10^{+86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{+104}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+241}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+301}:\\
\;\;\;\;a \cdot \frac{1}{\frac{x + t}{t}}\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -8.0000000000000001e86 or 2.84999999999999993e104 < x < 1.1999999999999999e241Initial program 57.5%
Taylor expanded in a around 0 65.1%
associate--l+65.1%
+-commutative65.1%
+-commutative65.1%
+-commutative65.1%
div-sub65.1%
+-commutative65.1%
*-commutative65.1%
+-commutative65.1%
Simplified65.1%
Taylor expanded in x around inf 77.2%
Taylor expanded in t around 0 62.4%
associate-/l*70.0%
+-commutative70.0%
Simplified70.0%
if -8.0000000000000001e86 < x < 2.84999999999999993e104Initial program 68.3%
Taylor expanded in y around inf 67.4%
if 1.1999999999999999e241 < x < 3.9000000000000001e301Initial program 57.9%
Taylor expanded in a around inf 15.7%
Taylor expanded in y around 0 15.7%
associate-/l*57.7%
Simplified57.7%
div-inv57.8%
+-commutative57.8%
Applied egg-rr57.8%
if 3.9000000000000001e301 < x Initial program 68.8%
Taylor expanded in x around inf 81.9%
Final simplification68.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.2e+80)
t_1
(if (<= y -7.4e-78)
(+ z (/ a (/ (+ x y) y)))
(if (<= y 2.65e-245) (/ (+ (* t a) (* x z)) (+ x t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.2e+80) {
tmp = t_1;
} else if (y <= -7.4e-78) {
tmp = z + (a / ((x + y) / y));
} else if (y <= 2.65e-245) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-1.2d+80)) then
tmp = t_1
else if (y <= (-7.4d-78)) then
tmp = z + (a / ((x + y) / y))
else if (y <= 2.65d-245) then
tmp = ((t * a) + (x * z)) / (x + t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -1.2e+80) {
tmp = t_1;
} else if (y <= -7.4e-78) {
tmp = z + (a / ((x + y) / y));
} else if (y <= 2.65e-245) {
tmp = ((t * a) + (x * z)) / (x + t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.2e+80: tmp = t_1 elif y <= -7.4e-78: tmp = z + (a / ((x + y) / y)) elif y <= 2.65e-245: tmp = ((t * a) + (x * z)) / (x + t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.2e+80) tmp = t_1; elseif (y <= -7.4e-78) tmp = Float64(z + Float64(a / Float64(Float64(x + y) / y))); elseif (y <= 2.65e-245) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -1.2e+80) tmp = t_1; elseif (y <= -7.4e-78) tmp = z + (a / ((x + y) / y)); elseif (y <= 2.65e-245) tmp = ((t * a) + (x * z)) / (x + t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.2e+80], t$95$1, If[LessEqual[y, -7.4e-78], N[(z + N[(a / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.65e-245], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+80}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.4 \cdot 10^{-78}:\\
\;\;\;\;z + \frac{a}{\frac{x + y}{y}}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-245}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.1999999999999999e80 or 2.64999999999999998e-245 < y Initial program 55.6%
Taylor expanded in y around inf 69.1%
if -1.1999999999999999e80 < y < -7.40000000000000011e-78Initial program 70.1%
Taylor expanded in a around 0 77.1%
associate--l+77.1%
+-commutative77.1%
+-commutative77.1%
+-commutative77.1%
div-sub77.1%
+-commutative77.1%
*-commutative77.1%
+-commutative77.1%
Simplified77.1%
Taylor expanded in x around inf 63.5%
Taylor expanded in t around 0 56.7%
associate-/l*56.7%
+-commutative56.7%
Simplified56.7%
if -7.40000000000000011e-78 < y < 2.64999999999999998e-245Initial program 89.1%
Taylor expanded in y around 0 75.2%
Final simplification68.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ z (+ 1.0 (/ t x)))))
(if (<= x -7.8e+134)
t_1
(if (<= x 3.2e+117)
(- (+ z a) b)
(if (<= x 1.4e+245)
t_1
(if (<= x 3.9e+301) (/ a (+ 1.0 (/ x t))) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z / (1.0 + (t / x));
double tmp;
if (x <= -7.8e+134) {
tmp = t_1;
} else if (x <= 3.2e+117) {
tmp = (z + a) - b;
} else if (x <= 1.4e+245) {
tmp = t_1;
} else if (x <= 3.9e+301) {
tmp = a / (1.0 + (x / t));
} 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) :: t_1
real(8) :: tmp
t_1 = z / (1.0d0 + (t / x))
if (x <= (-7.8d+134)) then
tmp = t_1
else if (x <= 3.2d+117) then
tmp = (z + a) - b
else if (x <= 1.4d+245) then
tmp = t_1
else if (x <= 3.9d+301) then
tmp = a / (1.0d0 + (x / t))
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 t_1 = z / (1.0 + (t / x));
double tmp;
if (x <= -7.8e+134) {
tmp = t_1;
} else if (x <= 3.2e+117) {
tmp = (z + a) - b;
} else if (x <= 1.4e+245) {
tmp = t_1;
} else if (x <= 3.9e+301) {
tmp = a / (1.0 + (x / t));
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z / (1.0 + (t / x)) tmp = 0 if x <= -7.8e+134: tmp = t_1 elif x <= 3.2e+117: tmp = (z + a) - b elif x <= 1.4e+245: tmp = t_1 elif x <= 3.9e+301: tmp = a / (1.0 + (x / t)) else: tmp = z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z / Float64(1.0 + Float64(t / x))) tmp = 0.0 if (x <= -7.8e+134) tmp = t_1; elseif (x <= 3.2e+117) tmp = Float64(Float64(z + a) - b); elseif (x <= 1.4e+245) tmp = t_1; elseif (x <= 3.9e+301) tmp = Float64(a / Float64(1.0 + Float64(x / t))); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z / (1.0 + (t / x)); tmp = 0.0; if (x <= -7.8e+134) tmp = t_1; elseif (x <= 3.2e+117) tmp = (z + a) - b; elseif (x <= 1.4e+245) tmp = t_1; elseif (x <= 3.9e+301) tmp = a / (1.0 + (x / t)); else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z / N[(1.0 + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.8e+134], t$95$1, If[LessEqual[x, 3.2e+117], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[x, 1.4e+245], t$95$1, If[LessEqual[x, 3.9e+301], N[(a / N[(1.0 + N[(x / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], z]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{1 + \frac{t}{x}}\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+117}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+245}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+301}:\\
\;\;\;\;\frac{a}{1 + \frac{x}{t}}\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -7.79999999999999967e134 or 3.20000000000000005e117 < x < 1.39999999999999989e245Initial program 60.2%
Taylor expanded in z around inf 40.3%
associate-/l*66.9%
+-commutative66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in x around inf 66.9%
if -7.79999999999999967e134 < x < 3.20000000000000005e117Initial program 66.9%
Taylor expanded in y around inf 67.5%
if 1.39999999999999989e245 < x < 3.9000000000000001e301Initial program 52.6%
Taylor expanded in a around inf 16.7%
Taylor expanded in y around 0 16.8%
associate-/l*64.0%
Simplified64.0%
Taylor expanded in t around 0 64.0%
+-commutative64.0%
Simplified64.0%
if 3.9000000000000001e301 < x Initial program 68.8%
Taylor expanded in x around inf 81.9%
Final simplification67.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6.9e+165) z (if (<= x 4.2e+122) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6.9e+165) {
tmp = z;
} else if (x <= 4.2e+122) {
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 <= (-6.9d+165)) then
tmp = z
else if (x <= 4.2d+122) 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 <= -6.9e+165) {
tmp = z;
} else if (x <= 4.2e+122) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6.9e+165: tmp = z elif x <= 4.2e+122: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6.9e+165) tmp = z; elseif (x <= 4.2e+122) 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 <= -6.9e+165) tmp = z; elseif (x <= 4.2e+122) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6.9e+165], z, If[LessEqual[x, 4.2e+122], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.9 \cdot 10^{+165}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+122}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -6.90000000000000006e165 or 4.20000000000000032e122 < x Initial program 57.7%
Taylor expanded in x around inf 54.9%
if -6.90000000000000006e165 < x < 4.20000000000000032e122Initial program 67.6%
Taylor expanded in y around inf 66.2%
Final simplification62.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6e+79) z (if (<= x 4e+45) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6e+79) {
tmp = z;
} else if (x <= 4e+45) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-6d+79)) then
tmp = z
else if (x <= 4d+45) then
tmp = a
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6e+79) {
tmp = z;
} else if (x <= 4e+45) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6e+79: tmp = z elif x <= 4e+45: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6e+79) tmp = z; elseif (x <= 4e+45) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6e+79) tmp = z; elseif (x <= 4e+45) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6e+79], z, If[LessEqual[x, 4e+45], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+79}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+45}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -5.99999999999999948e79 or 3.9999999999999997e45 < x Initial program 59.5%
Taylor expanded in x around inf 49.1%
if -5.99999999999999948e79 < x < 3.9999999999999997e45Initial program 68.2%
Taylor expanded in t around inf 45.2%
Final simplification46.8%
(FPCore (x y z t a b) :precision binary64 (+ z a))
double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = z + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return z + a;
}
def code(x, y, z, t, a, b): return z + a
function code(x, y, z, t, a, b) return Float64(z + a) end
function tmp = code(x, y, z, t, a, b) tmp = z + a; end
code[x_, y_, z_, t_, a_, b_] := N[(z + a), $MachinePrecision]
\begin{array}{l}
\\
z + a
\end{array}
Initial program 64.7%
Taylor expanded in a around 0 76.4%
associate--l+76.4%
+-commutative76.4%
+-commutative76.4%
+-commutative76.4%
div-sub76.4%
+-commutative76.4%
*-commutative76.4%
+-commutative76.4%
Simplified76.4%
Taylor expanded in x around inf 64.2%
Taylor expanded in y around inf 52.3%
Final simplification52.3%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 64.7%
Taylor expanded in t around inf 32.8%
Final simplification32.8%
(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 2023318
(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)))