
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ y t) a)) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+196))) (- (+ 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 <= -((double) INFINITY)) || !(t_1 <= 1e+196)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+196)) {
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 <= -math.inf) or not (t_1 <= 1e+196): 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 <= Float64(-Inf)) || !(t_1 <= 1e+196)) 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 <= -Inf) || ~((t_1 <= 1e+196))) 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, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+196]], $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 -\infty \lor \neg \left(t\_1 \leq 10^{+196}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 9.9999999999999995e195 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.5%
Taylor expanded in y around inf 77.5%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.9999999999999995e195Initial program 99.1%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) b)) (t_3 (* z (/ (+ x y) t_1))))
(if (<= y -6e-12)
t_2
(if (<= y -8.3e-227)
(* a (/ (+ y t) t_1))
(if (<= y -6.9e-282)
t_3
(if (<= y 1.25e-253)
(* a (/ t (+ x t)))
(if (<= y 7.9e-29) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - b;
double t_3 = z * ((x + y) / t_1);
double tmp;
if (y <= -6e-12) {
tmp = t_2;
} else if (y <= -8.3e-227) {
tmp = a * ((y + t) / t_1);
} else if (y <= -6.9e-282) {
tmp = t_3;
} else if (y <= 1.25e-253) {
tmp = a * (t / (x + t));
} else if (y <= 7.9e-29) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (z + a) - b
t_3 = z * ((x + y) / t_1)
if (y <= (-6d-12)) then
tmp = t_2
else if (y <= (-8.3d-227)) then
tmp = a * ((y + t) / t_1)
else if (y <= (-6.9d-282)) then
tmp = t_3
else if (y <= 1.25d-253) then
tmp = a * (t / (x + t))
else if (y <= 7.9d-29) then
tmp = t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - b;
double t_3 = z * ((x + y) / t_1);
double tmp;
if (y <= -6e-12) {
tmp = t_2;
} else if (y <= -8.3e-227) {
tmp = a * ((y + t) / t_1);
} else if (y <= -6.9e-282) {
tmp = t_3;
} else if (y <= 1.25e-253) {
tmp = a * (t / (x + t));
} else if (y <= 7.9e-29) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - b t_3 = z * ((x + y) / t_1) tmp = 0 if y <= -6e-12: tmp = t_2 elif y <= -8.3e-227: tmp = a * ((y + t) / t_1) elif y <= -6.9e-282: tmp = t_3 elif y <= 1.25e-253: tmp = a * (t / (x + t)) elif y <= 7.9e-29: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(z + a) - b) t_3 = Float64(z * Float64(Float64(x + y) / t_1)) tmp = 0.0 if (y <= -6e-12) tmp = t_2; elseif (y <= -8.3e-227) tmp = Float64(a * Float64(Float64(y + t) / t_1)); elseif (y <= -6.9e-282) tmp = t_3; elseif (y <= 1.25e-253) tmp = Float64(a * Float64(t / Float64(x + t))); elseif (y <= 7.9e-29) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (z + a) - b; t_3 = z * ((x + y) / t_1); tmp = 0.0; if (y <= -6e-12) tmp = t_2; elseif (y <= -8.3e-227) tmp = a * ((y + t) / t_1); elseif (y <= -6.9e-282) tmp = t_3; elseif (y <= 1.25e-253) tmp = a * (t / (x + t)); elseif (y <= 7.9e-29) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e-12], t$95$2, If[LessEqual[y, -8.3e-227], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6.9e-282], t$95$3, If[LessEqual[y, 1.25e-253], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.9e-29], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - b\\
t_3 := z \cdot \frac{x + y}{t\_1}\\
\mathbf{if}\;y \leq -6 \cdot 10^{-12}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -8.3 \cdot 10^{-227}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\
\mathbf{elif}\;y \leq -6.9 \cdot 10^{-282}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-253}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{elif}\;y \leq 7.9 \cdot 10^{-29}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -6.0000000000000003e-12 or 7.9000000000000001e-29 < y Initial program 37.0%
Taylor expanded in y around inf 78.4%
if -6.0000000000000003e-12 < y < -8.2999999999999996e-227Initial program 85.1%
Taylor expanded in a around inf 51.9%
associate-/l*59.2%
+-commutative59.2%
associate-+r+59.2%
+-commutative59.2%
associate-+l+59.2%
Simplified59.2%
if -8.2999999999999996e-227 < y < -6.89999999999999967e-282 or 1.24999999999999993e-253 < y < 7.9000000000000001e-29Initial program 79.7%
Taylor expanded in z around inf 54.3%
associate-/l*62.3%
+-commutative62.3%
+-commutative62.3%
associate-+r+62.3%
+-commutative62.3%
associate-+l+62.3%
Simplified62.3%
if -6.89999999999999967e-282 < y < 1.24999999999999993e-253Initial program 81.6%
Taylor expanded in z around 0 63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in y around 0 57.2%
associate-/l*61.7%
+-commutative61.7%
Simplified61.7%
Final simplification69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (* a (/ (+ y t) (+ y (+ x t))))))
(if (<= t -2.7e+91)
t_2
(if (<= t 1.05e-303)
t_1
(if (<= t 1.4e-21)
(* a (+ (/ y (+ x y)) (/ z a)))
(if (<= t 4.2e+42) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * ((y + t) / (y + (x + t)));
double tmp;
if (t <= -2.7e+91) {
tmp = t_2;
} else if (t <= 1.05e-303) {
tmp = t_1;
} else if (t <= 1.4e-21) {
tmp = a * ((y / (x + y)) + (z / a));
} else if (t <= 4.2e+42) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = a * ((y + t) / (y + (x + t)))
if (t <= (-2.7d+91)) then
tmp = t_2
else if (t <= 1.05d-303) then
tmp = t_1
else if (t <= 1.4d-21) then
tmp = a * ((y / (x + y)) + (z / a))
else if (t <= 4.2d+42) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * ((y + t) / (y + (x + t)));
double tmp;
if (t <= -2.7e+91) {
tmp = t_2;
} else if (t <= 1.05e-303) {
tmp = t_1;
} else if (t <= 1.4e-21) {
tmp = a * ((y / (x + y)) + (z / a));
} else if (t <= 4.2e+42) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = a * ((y + t) / (y + (x + t))) tmp = 0 if t <= -2.7e+91: tmp = t_2 elif t <= 1.05e-303: tmp = t_1 elif t <= 1.4e-21: tmp = a * ((y / (x + y)) + (z / a)) elif t <= 4.2e+42: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))) tmp = 0.0 if (t <= -2.7e+91) tmp = t_2; elseif (t <= 1.05e-303) tmp = t_1; elseif (t <= 1.4e-21) tmp = Float64(a * Float64(Float64(y / Float64(x + y)) + Float64(z / a))); elseif (t <= 4.2e+42) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = a * ((y + t) / (y + (x + t))); tmp = 0.0; if (t <= -2.7e+91) tmp = t_2; elseif (t <= 1.05e-303) tmp = t_1; elseif (t <= 1.4e-21) tmp = a * ((y / (x + y)) + (z / a)); elseif (t <= 4.2e+42) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+91], t$95$2, If[LessEqual[t, 1.05e-303], t$95$1, If[LessEqual[t, 1.4e-21], N[(a * N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e+42], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+91}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-21}:\\
\;\;\;\;a \cdot \left(\frac{y}{x + y} + \frac{z}{a}\right)\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.7e91 or 4.19999999999999991e42 < t Initial program 52.9%
Taylor expanded in a around inf 32.0%
associate-/l*62.2%
+-commutative62.2%
associate-+r+62.2%
+-commutative62.2%
associate-+l+62.2%
Simplified62.2%
if -2.7e91 < t < 1.05e-303 or 1.40000000000000002e-21 < t < 4.19999999999999991e42Initial program 60.6%
Taylor expanded in y around inf 70.5%
if 1.05e-303 < t < 1.40000000000000002e-21Initial program 68.0%
Taylor expanded in a around inf 59.5%
associate--l+59.5%
+-commutative59.5%
+-commutative59.5%
associate-/l*68.9%
+-commutative68.9%
+-commutative68.9%
*-commutative68.9%
+-commutative68.9%
Simplified68.9%
Taylor expanded in b around 0 54.5%
associate-/l*64.0%
associate-/r*67.0%
Simplified67.0%
Taylor expanded in t around 0 66.0%
+-commutative66.0%
Simplified66.0%
Final simplification66.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (* a (/ t (+ x t)))))
(if (<= t -2.7e+91)
t_2
(if (<= t -1.9e-306)
t_1
(if (<= t 4.6e-123) z (if (<= t 4.4e+42) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * (t / (x + t));
double tmp;
if (t <= -2.7e+91) {
tmp = t_2;
} else if (t <= -1.9e-306) {
tmp = t_1;
} else if (t <= 4.6e-123) {
tmp = z;
} else if (t <= 4.4e+42) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = a * (t / (x + t))
if (t <= (-2.7d+91)) then
tmp = t_2
else if (t <= (-1.9d-306)) then
tmp = t_1
else if (t <= 4.6d-123) then
tmp = z
else if (t <= 4.4d+42) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a * (t / (x + t));
double tmp;
if (t <= -2.7e+91) {
tmp = t_2;
} else if (t <= -1.9e-306) {
tmp = t_1;
} else if (t <= 4.6e-123) {
tmp = z;
} else if (t <= 4.4e+42) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = a * (t / (x + t)) tmp = 0 if t <= -2.7e+91: tmp = t_2 elif t <= -1.9e-306: tmp = t_1 elif t <= 4.6e-123: tmp = z elif t <= 4.4e+42: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(a * Float64(t / Float64(x + t))) tmp = 0.0 if (t <= -2.7e+91) tmp = t_2; elseif (t <= -1.9e-306) tmp = t_1; elseif (t <= 4.6e-123) tmp = z; elseif (t <= 4.4e+42) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = a * (t / (x + t)); tmp = 0.0; if (t <= -2.7e+91) tmp = t_2; elseif (t <= -1.9e-306) tmp = t_1; elseif (t <= 4.6e-123) tmp = z; elseif (t <= 4.4e+42) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.7e+91], t$95$2, If[LessEqual[t, -1.9e-306], t$95$1, If[LessEqual[t, 4.6e-123], z, If[LessEqual[t, 4.4e+42], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := a \cdot \frac{t}{x + t}\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+91}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-306}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-123}:\\
\;\;\;\;z\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.7e91 or 4.4000000000000003e42 < t Initial program 52.9%
Taylor expanded in z around 0 37.9%
*-commutative37.9%
Simplified37.9%
Taylor expanded in y around 0 33.8%
associate-/l*61.0%
+-commutative61.0%
Simplified61.0%
if -2.7e91 < t < -1.9e-306 or 4.59999999999999973e-123 < t < 4.4000000000000003e42Initial program 61.1%
Taylor expanded in y around inf 68.1%
if -1.9e-306 < t < 4.59999999999999973e-123Initial program 70.9%
Taylor expanded in x around inf 65.3%
Final simplification65.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= t -2.7e+91)
(* a (/ t (+ x t)))
(if (<= t -8.8e-307)
t_1
(if (<= t 8e-120) z (if (<= t 1.3e+183) t_1 (- a (/ (* y b) t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -2.7e+91) {
tmp = a * (t / (x + t));
} else if (t <= -8.8e-307) {
tmp = t_1;
} else if (t <= 8e-120) {
tmp = z;
} else if (t <= 1.3e+183) {
tmp = t_1;
} else {
tmp = a - ((y * b) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (t <= (-2.7d+91)) then
tmp = a * (t / (x + t))
else if (t <= (-8.8d-307)) then
tmp = t_1
else if (t <= 8d-120) then
tmp = z
else if (t <= 1.3d+183) then
tmp = t_1
else
tmp = a - ((y * b) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -2.7e+91) {
tmp = a * (t / (x + t));
} else if (t <= -8.8e-307) {
tmp = t_1;
} else if (t <= 8e-120) {
tmp = z;
} else if (t <= 1.3e+183) {
tmp = t_1;
} else {
tmp = a - ((y * b) / t);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if t <= -2.7e+91: tmp = a * (t / (x + t)) elif t <= -8.8e-307: tmp = t_1 elif t <= 8e-120: tmp = z elif t <= 1.3e+183: tmp = t_1 else: tmp = a - ((y * b) / t) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (t <= -2.7e+91) tmp = Float64(a * Float64(t / Float64(x + t))); elseif (t <= -8.8e-307) tmp = t_1; elseif (t <= 8e-120) tmp = z; elseif (t <= 1.3e+183) tmp = t_1; else tmp = Float64(a - Float64(Float64(y * b) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (t <= -2.7e+91) tmp = a * (t / (x + t)); elseif (t <= -8.8e-307) tmp = t_1; elseif (t <= 8e-120) tmp = z; elseif (t <= 1.3e+183) tmp = t_1; else tmp = a - ((y * b) / t); 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[t, -2.7e+91], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -8.8e-307], t$95$1, If[LessEqual[t, 8e-120], z, If[LessEqual[t, 1.3e+183], t$95$1, N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;t \leq -2.7 \cdot 10^{+91}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{elif}\;t \leq -8.8 \cdot 10^{-307}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-120}:\\
\;\;\;\;z\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+183}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\end{array}
\end{array}
if t < -2.7e91Initial program 53.5%
Taylor expanded in z around 0 37.2%
*-commutative37.2%
Simplified37.2%
Taylor expanded in y around 0 35.4%
associate-/l*65.3%
+-commutative65.3%
Simplified65.3%
if -2.7e91 < t < -8.8e-307 or 7.99999999999999983e-120 < t < 1.3e183Initial program 61.7%
Taylor expanded in y around inf 63.2%
if -8.8e-307 < t < 7.99999999999999983e-120Initial program 70.9%
Taylor expanded in x around inf 65.3%
if 1.3e183 < t Initial program 41.2%
Taylor expanded in t around inf 62.9%
associate-/l*63.2%
associate-/l*70.9%
+-commutative70.9%
associate-/l*81.8%
+-commutative81.8%
associate-/l*85.4%
Simplified85.4%
Taylor expanded in x around 0 70.7%
Taylor expanded in z around 0 73.9%
Final simplification65.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= t -6.3e+87)
(* a (/ t (+ x t)))
(if (<= t 3.5e-296)
t_1
(if (<= t 4.2e-22)
(* a (+ (/ y (+ x y)) (/ z a)))
(if (<= t 1.35e+183) t_1 (- a (/ (* y b) t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -6.3e+87) {
tmp = a * (t / (x + t));
} else if (t <= 3.5e-296) {
tmp = t_1;
} else if (t <= 4.2e-22) {
tmp = a * ((y / (x + y)) + (z / a));
} else if (t <= 1.35e+183) {
tmp = t_1;
} else {
tmp = a - ((y * b) / t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (t <= (-6.3d+87)) then
tmp = a * (t / (x + t))
else if (t <= 3.5d-296) then
tmp = t_1
else if (t <= 4.2d-22) then
tmp = a * ((y / (x + y)) + (z / a))
else if (t <= 1.35d+183) then
tmp = t_1
else
tmp = a - ((y * b) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -6.3e+87) {
tmp = a * (t / (x + t));
} else if (t <= 3.5e-296) {
tmp = t_1;
} else if (t <= 4.2e-22) {
tmp = a * ((y / (x + y)) + (z / a));
} else if (t <= 1.35e+183) {
tmp = t_1;
} else {
tmp = a - ((y * b) / t);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if t <= -6.3e+87: tmp = a * (t / (x + t)) elif t <= 3.5e-296: tmp = t_1 elif t <= 4.2e-22: tmp = a * ((y / (x + y)) + (z / a)) elif t <= 1.35e+183: tmp = t_1 else: tmp = a - ((y * b) / t) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (t <= -6.3e+87) tmp = Float64(a * Float64(t / Float64(x + t))); elseif (t <= 3.5e-296) tmp = t_1; elseif (t <= 4.2e-22) tmp = Float64(a * Float64(Float64(y / Float64(x + y)) + Float64(z / a))); elseif (t <= 1.35e+183) tmp = t_1; else tmp = Float64(a - Float64(Float64(y * b) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (t <= -6.3e+87) tmp = a * (t / (x + t)); elseif (t <= 3.5e-296) tmp = t_1; elseif (t <= 4.2e-22) tmp = a * ((y / (x + y)) + (z / a)); elseif (t <= 1.35e+183) tmp = t_1; else tmp = a - ((y * b) / t); 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[t, -6.3e+87], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-296], t$95$1, If[LessEqual[t, 4.2e-22], N[(a * N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e+183], t$95$1, N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;t \leq -6.3 \cdot 10^{+87}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;a \cdot \left(\frac{y}{x + y} + \frac{z}{a}\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+183}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\end{array}
\end{array}
if t < -6.3e87Initial program 53.5%
Taylor expanded in z around 0 37.2%
*-commutative37.2%
Simplified37.2%
Taylor expanded in y around 0 35.4%
associate-/l*65.3%
+-commutative65.3%
Simplified65.3%
if -6.3e87 < t < 3.4999999999999999e-296 or 4.20000000000000016e-22 < t < 1.34999999999999991e183Initial program 61.4%
Taylor expanded in y around inf 64.2%
if 3.4999999999999999e-296 < t < 4.20000000000000016e-22Initial program 68.0%
Taylor expanded in a around inf 59.5%
associate--l+59.5%
+-commutative59.5%
+-commutative59.5%
associate-/l*68.9%
+-commutative68.9%
+-commutative68.9%
*-commutative68.9%
+-commutative68.9%
Simplified68.9%
Taylor expanded in b around 0 54.5%
associate-/l*64.0%
associate-/r*67.0%
Simplified67.0%
Taylor expanded in t around 0 66.0%
+-commutative66.0%
Simplified66.0%
if 1.34999999999999991e183 < t Initial program 41.2%
Taylor expanded in t around inf 62.9%
associate-/l*63.2%
associate-/l*70.9%
+-commutative70.9%
associate-/l*81.8%
+-commutative81.8%
associate-/l*85.4%
Simplified85.4%
Taylor expanded in x around 0 70.7%
Taylor expanded in z around 0 73.9%
Final simplification65.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.35e-10) (not (<= y 115.0))) (- (+ z a) b) (/ (+ (* (+ x y) z) (* (+ y t) a)) (+ y (+ x t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.35e-10) || !(y <= 115.0)) {
tmp = (z + a) - b;
} else {
tmp = (((x + y) * z) + ((y + t) * a)) / (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 ((y <= (-1.35d-10)) .or. (.not. (y <= 115.0d0))) then
tmp = (z + a) - b
else
tmp = (((x + y) * z) + ((y + t) * a)) / (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 ((y <= -1.35e-10) || !(y <= 115.0)) {
tmp = (z + a) - b;
} else {
tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.35e-10) or not (y <= 115.0): tmp = (z + a) - b else: tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.35e-10) || !(y <= 115.0)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(y + t) * a)) / Float64(y + Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.35e-10) || ~((y <= 115.0))) tmp = (z + a) - b; else tmp = (((x + y) * z) + ((y + t) * a)) / (y + (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.35e-10], N[Not[LessEqual[y, 115.0]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-10} \lor \neg \left(y \leq 115\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + \left(y + t\right) \cdot a}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if y < -1.35e-10 or 115 < y Initial program 34.9%
Taylor expanded in y around inf 79.6%
if -1.35e-10 < y < 115Initial program 81.2%
Taylor expanded in b around 0 75.7%
Final simplification77.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -2.45e+123)
z
(if (or (<= x 7.8e+65) (and (not (<= x 5.2e+156)) (<= x 1e+179)))
(- (+ z a) b)
z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.45e+123) {
tmp = z;
} else if ((x <= 7.8e+65) || (!(x <= 5.2e+156) && (x <= 1e+179))) {
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 <= (-2.45d+123)) then
tmp = z
else if ((x <= 7.8d+65) .or. (.not. (x <= 5.2d+156)) .and. (x <= 1d+179)) 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 <= -2.45e+123) {
tmp = z;
} else if ((x <= 7.8e+65) || (!(x <= 5.2e+156) && (x <= 1e+179))) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.45e+123: tmp = z elif (x <= 7.8e+65) or (not (x <= 5.2e+156) and (x <= 1e+179)): tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.45e+123) tmp = z; elseif ((x <= 7.8e+65) || (!(x <= 5.2e+156) && (x <= 1e+179))) 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 <= -2.45e+123) tmp = z; elseif ((x <= 7.8e+65) || (~((x <= 5.2e+156)) && (x <= 1e+179))) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.45e+123], z, If[Or[LessEqual[x, 7.8e+65], And[N[Not[LessEqual[x, 5.2e+156]], $MachinePrecision], LessEqual[x, 1e+179]]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+123}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+65} \lor \neg \left(x \leq 5.2 \cdot 10^{+156}\right) \land x \leq 10^{+179}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -2.44999999999999988e123 or 7.7999999999999996e65 < x < 5.20000000000000037e156 or 9.9999999999999998e178 < x Initial program 53.5%
Taylor expanded in x around inf 60.6%
if -2.44999999999999988e123 < x < 7.7999999999999996e65 or 5.20000000000000037e156 < x < 9.9999999999999998e178Initial program 62.2%
Taylor expanded in y around inf 66.1%
Final simplification64.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.6e-26) (not (<= y 1.8e-26))) (- (+ z a) b) (/ (+ (* t a) (* x z)) (+ x t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.6e-26) || !(y <= 1.8e-26)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.6d-26)) .or. (.not. (y <= 1.8d-26))) then
tmp = (z + a) - b
else
tmp = ((t * a) + (x * z)) / (x + t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.6e-26) || !(y <= 1.8e-26)) {
tmp = (z + a) - b;
} else {
tmp = ((t * a) + (x * z)) / (x + t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.6e-26) or not (y <= 1.8e-26): tmp = (z + a) - b else: tmp = ((t * a) + (x * z)) / (x + t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.6e-26) || !(y <= 1.8e-26)) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.6e-26) || ~((y <= 1.8e-26))) tmp = (z + a) - b; else tmp = ((t * a) + (x * z)) / (x + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.6e-26], N[Not[LessEqual[y, 1.8e-26]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-26} \lor \neg \left(y \leq 1.8 \cdot 10^{-26}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\end{array}
\end{array}
if y < -2.6000000000000001e-26 or 1.8000000000000001e-26 < y Initial program 36.8%
Taylor expanded in y around inf 78.5%
if -2.6000000000000001e-26 < y < 1.8000000000000001e-26Initial program 82.2%
Taylor expanded in y around 0 70.5%
Final simplification74.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -108000000.0) z (if (<= z 1.2e+14) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -108000000.0) {
tmp = z;
} else if (z <= 1.2e+14) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-108000000.0d0)) then
tmp = z
else if (z <= 1.2d+14) then
tmp = a - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -108000000.0) {
tmp = z;
} else if (z <= 1.2e+14) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -108000000.0: tmp = z elif z <= 1.2e+14: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -108000000.0) tmp = z; elseif (z <= 1.2e+14) tmp = Float64(a - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -108000000.0) tmp = z; elseif (z <= 1.2e+14) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -108000000.0], z, If[LessEqual[z, 1.2e+14], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -108000000:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -1.08e8 or 1.2e14 < z Initial program 46.7%
Taylor expanded in x around inf 56.2%
if -1.08e8 < z < 1.2e14Initial program 71.3%
Taylor expanded in z around 0 52.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in y around inf 48.9%
Final simplification52.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2250000.0) z (if (<= z 4.6e+14) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2250000.0) {
tmp = z;
} else if (z <= 4.6e+14) {
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 <= (-2250000.0d0)) then
tmp = z
else if (z <= 4.6d+14) 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 <= -2250000.0) {
tmp = z;
} else if (z <= 4.6e+14) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2250000.0: tmp = z elif z <= 4.6e+14: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2250000.0) tmp = z; elseif (z <= 4.6e+14) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2250000.0) tmp = z; elseif (z <= 4.6e+14) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2250000.0], z, If[LessEqual[z, 4.6e+14], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2250000:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+14}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -2.25e6 or 4.6e14 < z Initial program 46.7%
Taylor expanded in x around inf 56.2%
if -2.25e6 < z < 4.6e14Initial program 71.3%
Taylor expanded in t around inf 47.1%
Final simplification51.5%
(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 59.5%
Taylor expanded in t around inf 33.5%
Final simplification33.5%
(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 2024078
(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)))