
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ y t) a))
(t_2 (/ (- (+ t_1 (* (+ x y) z)) (* y b)) (+ y (+ x t))))
(t_3 (+ x (+ y t))))
(if (<= t_2 (- INFINITY))
(*
(- (fma z (/ (+ x y) (* t_3 b)) (* (/ (+ y t) t_3) (/ a b))) (/ y t_3))
b)
(if (<= t_2 2e+285)
(/ (- (fma (+ x y) z t_1) (* y b)) t_3)
(- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + t) * a;
double t_2 = ((t_1 + ((x + y) * z)) - (y * b)) / (y + (x + t));
double t_3 = x + (y + t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (fma(z, ((x + y) / (t_3 * b)), (((y + t) / t_3) * (a / b))) - (y / t_3)) * b;
} else if (t_2 <= 2e+285) {
tmp = (fma((x + y), z, t_1) - (y * b)) / t_3;
} else {
tmp = (z + a) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + t) * a) t_2 = Float64(Float64(Float64(t_1 + Float64(Float64(x + y) * z)) - Float64(y * b)) / Float64(y + Float64(x + t))) t_3 = Float64(x + Float64(y + t)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(fma(z, Float64(Float64(x + y) / Float64(t_3 * b)), Float64(Float64(Float64(y + t) / t_3) * Float64(a / b))) - Float64(y / t_3)) * b); elseif (t_2 <= 2e+285) tmp = Float64(Float64(fma(Float64(x + y), z, t_1) - Float64(y * b)) / t_3); else tmp = Float64(Float64(z + a) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(z * N[(N[(x + y), $MachinePrecision] / N[(t$95$3 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] / t$95$3), $MachinePrecision] * N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / t$95$3), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t$95$2, 2e+285], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) \cdot a\\
t_2 := \frac{\left(t\_1 + \left(x + y\right) \cdot z\right) - y \cdot b}{y + \left(x + t\right)}\\
t_3 := x + \left(y + t\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(\mathsf{fma}\left(z, \frac{x + y}{t\_3 \cdot b}, \frac{y + t}{t\_3} \cdot \frac{a}{b}\right) - \frac{y}{t\_3}\right) \cdot b\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+285}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_1\right) - y \cdot b}{t\_3}\\
\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.7%
Taylor expanded in b around inf 21.2%
+-commutative21.2%
mul-1-neg21.2%
unsub-neg21.2%
Simplified69.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e285Initial program 99.6%
fma-define99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
Simplified99.6%
if 2e285 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.6%
Taylor expanded in y around inf 70.5%
Final simplification89.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (* (+ y t) a))
(t_3 (/ (- (+ t_2 (* (+ x y) z)) (* y b)) t_1)))
(if (<= t_3 (- INFINITY))
(- (* a (/ (+ y t) t_1)) (* (/ y t_1) b))
(if (<= t_3 2e+285)
(/ (- (fma (+ x y) z t_2) (* y b)) (+ x (+ y t)))
(- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (y + t) * a;
double t_3 = ((t_2 + ((x + y) * z)) - (y * b)) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b);
} else if (t_3 <= 2e+285) {
tmp = (fma((x + y), z, t_2) - (y * b)) / (x + (y + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(y + t) * a) t_3 = Float64(Float64(Float64(t_2 + Float64(Float64(x + y) * z)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(a * Float64(Float64(y + t) / t_1)) - Float64(Float64(y / t_1) * b)); elseif (t_3 <= 2e+285) tmp = Float64(Float64(fma(Float64(x + y), z, t_2) - Float64(y * b)) / 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[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(y / t$95$1), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+285], N[(N[(N[(N[(x + y), $MachinePrecision] * z + t$95$2), $MachinePrecision] - N[(y * b), $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 := y + \left(x + t\right)\\
t_2 := \left(y + t\right) \cdot a\\
t_3 := \frac{\left(t\_2 + \left(x + y\right) \cdot z\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1} - \frac{y}{t\_1} \cdot b\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+285}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x + y, z, t\_2\right) - y \cdot b}{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.7%
Taylor expanded in z around -inf 34.6%
mul-1-neg34.6%
distribute-rgt-neg-in34.6%
mul-1-neg34.6%
unsub-neg34.6%
Simplified34.6%
div-inv34.6%
+-commutative34.6%
associate-+l+34.6%
+-commutative34.6%
Applied egg-rr34.6%
sub-neg34.6%
+-commutative34.6%
neg-mul-134.6%
sub-neg34.6%
neg-mul-134.6%
+-commutative34.6%
Simplified34.6%
Taylor expanded in z around 0 5.2%
associate-/l*47.3%
associate-+r+47.3%
+-commutative47.3%
associate-/l*68.1%
associate-+r+68.1%
+-commutative68.1%
Simplified68.1%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e285Initial program 99.6%
fma-define99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
Simplified99.6%
if 2e285 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.6%
Taylor expanded in y around inf 70.5%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ y t) a) (* (+ x y) z)) (* y b)) t_1)))
(if (<= t_2 (- INFINITY))
(- (* a (/ (+ y t) t_1)) (* (/ y t_1) b))
(if (<= t_2 2e+285) t_2 (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b);
} else if (t_2 <= 2e+285) {
tmp = t_2;
} 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 = y + (x + t);
double t_2 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / t_1;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b);
} else if (t_2 <= 2e+285) {
tmp = t_2;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / t_1 tmp = 0 if t_2 <= -math.inf: tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b) elif t_2 <= 2e+285: tmp = t_2 else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(Float64(y + t) * a) + Float64(Float64(x + y) * z)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(a * Float64(Float64(y + t) / t_1)) - Float64(Float64(y / t_1) * b)); elseif (t_2 <= 2e+285) tmp = t_2; else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = ((((y + t) * a) + ((x + y) * z)) - (y * b)) / t_1; tmp = 0.0; if (t_2 <= -Inf) tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b); elseif (t_2 <= 2e+285) tmp = t_2; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(y / t$95$1), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+285], t$95$2, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(\left(y + t\right) \cdot a + \left(x + y\right) \cdot z\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1} - \frac{y}{t\_1} \cdot b\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+285}:\\
\;\;\;\;t\_2\\
\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.7%
Taylor expanded in z around -inf 34.6%
mul-1-neg34.6%
distribute-rgt-neg-in34.6%
mul-1-neg34.6%
unsub-neg34.6%
Simplified34.6%
div-inv34.6%
+-commutative34.6%
associate-+l+34.6%
+-commutative34.6%
Applied egg-rr34.6%
sub-neg34.6%
+-commutative34.6%
neg-mul-134.6%
sub-neg34.6%
neg-mul-134.6%
+-commutative34.6%
Simplified34.6%
Taylor expanded in z around 0 5.2%
associate-/l*47.3%
associate-+r+47.3%
+-commutative47.3%
associate-/l*68.1%
associate-+r+68.1%
+-commutative68.1%
Simplified68.1%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2e285Initial program 99.6%
if 2e285 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.6%
Taylor expanded in y around inf 70.5%
Final simplification89.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -3.2e+14)
t_1
(if (<= y 2.8e-123)
(/ (- (+ (* t a) (* x z)) (* y b)) (+ x (+ y t)))
(if (<= y 3.1e-60)
(* z (+ (/ a z) (* (+ x y) (/ 1.0 (+ y (+ x t))))))
(if (<= y 4.1e+48)
(* z (- 1.0 (/ (* y (- b a)) (* (+ x y) z))))
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 <= -3.2e+14) {
tmp = t_1;
} else if (y <= 2.8e-123) {
tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t));
} else if (y <= 3.1e-60) {
tmp = z * ((a / z) + ((x + y) * (1.0 / (y + (x + t)))));
} else if (y <= 4.1e+48) {
tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z)));
} 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 <= (-3.2d+14)) then
tmp = t_1
else if (y <= 2.8d-123) then
tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t))
else if (y <= 3.1d-60) then
tmp = z * ((a / z) + ((x + y) * (1.0d0 / (y + (x + t)))))
else if (y <= 4.1d+48) then
tmp = z * (1.0d0 - ((y * (b - a)) / ((x + y) * z)))
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 <= -3.2e+14) {
tmp = t_1;
} else if (y <= 2.8e-123) {
tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t));
} else if (y <= 3.1e-60) {
tmp = z * ((a / z) + ((x + y) * (1.0 / (y + (x + t)))));
} else if (y <= 4.1e+48) {
tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -3.2e+14: tmp = t_1 elif y <= 2.8e-123: tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t)) elif y <= 3.1e-60: tmp = z * ((a / z) + ((x + y) * (1.0 / (y + (x + t))))) elif y <= 4.1e+48: tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z))) 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 <= -3.2e+14) tmp = t_1; elseif (y <= 2.8e-123) tmp = Float64(Float64(Float64(Float64(t * a) + Float64(x * z)) - Float64(y * b)) / Float64(x + Float64(y + t))); elseif (y <= 3.1e-60) tmp = Float64(z * Float64(Float64(a / z) + Float64(Float64(x + y) * Float64(1.0 / Float64(y + Float64(x + t)))))); elseif (y <= 4.1e+48) tmp = Float64(z * Float64(1.0 - Float64(Float64(y * Float64(b - a)) / Float64(Float64(x + y) * z)))); 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 <= -3.2e+14) tmp = t_1; elseif (y <= 2.8e-123) tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t)); elseif (y <= 3.1e-60) tmp = z * ((a / z) + ((x + y) * (1.0 / (y + (x + t))))); elseif (y <= 4.1e+48) tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z))); 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, -3.2e+14], t$95$1, If[LessEqual[y, 2.8e-123], N[(N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e-60], N[(z * N[(N[(a / z), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * N[(1.0 / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+48], N[(z * N[(1.0 - N[(N[(y * N[(b - a), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-123}:\\
\;\;\;\;\frac{\left(t \cdot a + x \cdot z\right) - y \cdot b}{x + \left(y + t\right)}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-60}:\\
\;\;\;\;z \cdot \left(\frac{a}{z} + \left(x + y\right) \cdot \frac{1}{y + \left(x + t\right)}\right)\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+48}:\\
\;\;\;\;z \cdot \left(1 - \frac{y \cdot \left(b - a\right)}{\left(x + y\right) \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2e14 or 4.1000000000000003e48 < y Initial program 43.5%
Taylor expanded in y around inf 75.0%
if -3.2e14 < y < 2.7999999999999999e-123Initial program 87.3%
fma-define87.3%
+-commutative87.3%
associate-+l+87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in y around 0 75.5%
if 2.7999999999999999e-123 < y < 3.09999999999999988e-60Initial program 70.3%
Taylor expanded in z around -inf 94.8%
mul-1-neg94.8%
distribute-rgt-neg-in94.8%
mul-1-neg94.8%
unsub-neg94.8%
Simplified94.8%
div-inv94.7%
+-commutative94.7%
associate-+l+94.7%
+-commutative94.7%
Applied egg-rr94.7%
sub-neg94.7%
+-commutative94.7%
neg-mul-194.7%
sub-neg94.7%
neg-mul-194.7%
+-commutative94.7%
Simplified94.7%
Taylor expanded in t around inf 84.4%
if 3.09999999999999988e-60 < y < 4.1000000000000003e48Initial program 72.1%
Taylor expanded in z around -inf 84.0%
mul-1-neg84.0%
distribute-rgt-neg-in84.0%
mul-1-neg84.0%
unsub-neg84.0%
Simplified84.0%
Taylor expanded in t around 0 74.1%
associate--l+74.1%
div-sub74.1%
distribute-rgt-out--74.1%
+-commutative74.1%
Simplified74.1%
Final simplification75.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ x y) z)) (t_2 (- (+ z a) b)))
(if (<= y -1.06e+15)
t_2
(if (<= y -2.1e-160)
(/ (- t_1 (* y b)) (+ y (+ x t)))
(if (<= y 6.4e-161)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 7e+48) (* z (- 1.0 (/ (* y (- b a)) t_1))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) * z;
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.06e+15) {
tmp = t_2;
} else if (y <= -2.1e-160) {
tmp = (t_1 - (y * b)) / (y + (x + t));
} else if (y <= 6.4e-161) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 7e+48) {
tmp = z * (1.0 - ((y * (b - a)) / 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 = (x + y) * z
t_2 = (z + a) - b
if (y <= (-1.06d+15)) then
tmp = t_2
else if (y <= (-2.1d-160)) then
tmp = (t_1 - (y * b)) / (y + (x + t))
else if (y <= 6.4d-161) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 7d+48) then
tmp = z * (1.0d0 - ((y * (b - a)) / 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 = (x + y) * z;
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.06e+15) {
tmp = t_2;
} else if (y <= -2.1e-160) {
tmp = (t_1 - (y * b)) / (y + (x + t));
} else if (y <= 6.4e-161) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 7e+48) {
tmp = z * (1.0 - ((y * (b - a)) / t_1));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) * z t_2 = (z + a) - b tmp = 0 if y <= -1.06e+15: tmp = t_2 elif y <= -2.1e-160: tmp = (t_1 - (y * b)) / (y + (x + t)) elif y <= 6.4e-161: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 7e+48: tmp = z * (1.0 - ((y * (b - a)) / t_1)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) * z) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.06e+15) tmp = t_2; elseif (y <= -2.1e-160) tmp = Float64(Float64(t_1 - Float64(y * b)) / Float64(y + Float64(x + t))); elseif (y <= 6.4e-161) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 7e+48) tmp = Float64(z * Float64(1.0 - Float64(Float64(y * Float64(b - a)) / t_1))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) * z; t_2 = (z + a) - b; tmp = 0.0; if (y <= -1.06e+15) tmp = t_2; elseif (y <= -2.1e-160) tmp = (t_1 - (y * b)) / (y + (x + t)); elseif (y <= 6.4e-161) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 7e+48) tmp = z * (1.0 - ((y * (b - a)) / t_1)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.06e+15], t$95$2, If[LessEqual[y, -2.1e-160], N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e-161], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+48], N[(z * N[(1.0 - N[(N[(y * N[(b - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) \cdot z\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.06 \cdot 10^{+15}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-160}:\\
\;\;\;\;\frac{t\_1 - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-161}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+48}:\\
\;\;\;\;z \cdot \left(1 - \frac{y \cdot \left(b - a\right)}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.06e15 or 6.9999999999999995e48 < y Initial program 43.5%
Taylor expanded in y around inf 75.0%
if -1.06e15 < y < -2.1e-160Initial program 86.2%
Taylor expanded in a around 0 66.0%
+-commutative66.0%
*-commutative66.0%
Simplified66.0%
if -2.1e-160 < y < 6.39999999999999971e-161Initial program 87.7%
Taylor expanded in y around 0 73.0%
if 6.39999999999999971e-161 < y < 6.9999999999999995e48Initial program 74.4%
Taylor expanded in z around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
Taylor expanded in t around 0 67.6%
associate--l+67.6%
div-sub67.6%
distribute-rgt-out--67.6%
+-commutative67.6%
Simplified67.6%
Final simplification71.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -1.45e-23)
t_1
(if (<= y -1.4e-128)
(/ (+ (* t a) (* y t_1)) (+ y t))
(if (<= y 5.8e-161)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 6e+48)
(* z (- 1.0 (/ (* y (- b a)) (* (+ x y) z))))
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.45e-23) {
tmp = t_1;
} else if (y <= -1.4e-128) {
tmp = ((t * a) + (y * t_1)) / (y + t);
} else if (y <= 5.8e-161) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 6e+48) {
tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z)));
} 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.45d-23)) then
tmp = t_1
else if (y <= (-1.4d-128)) then
tmp = ((t * a) + (y * t_1)) / (y + t)
else if (y <= 5.8d-161) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 6d+48) then
tmp = z * (1.0d0 - ((y * (b - a)) / ((x + y) * z)))
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.45e-23) {
tmp = t_1;
} else if (y <= -1.4e-128) {
tmp = ((t * a) + (y * t_1)) / (y + t);
} else if (y <= 5.8e-161) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 6e+48) {
tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -1.45e-23: tmp = t_1 elif y <= -1.4e-128: tmp = ((t * a) + (y * t_1)) / (y + t) elif y <= 5.8e-161: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 6e+48: tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z))) 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.45e-23) tmp = t_1; elseif (y <= -1.4e-128) tmp = Float64(Float64(Float64(t * a) + Float64(y * t_1)) / Float64(y + t)); elseif (y <= 5.8e-161) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 6e+48) tmp = Float64(z * Float64(1.0 - Float64(Float64(y * Float64(b - a)) / Float64(Float64(x + y) * z)))); 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.45e-23) tmp = t_1; elseif (y <= -1.4e-128) tmp = ((t * a) + (y * t_1)) / (y + t); elseif (y <= 5.8e-161) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 6e+48) tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z))); 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.45e-23], t$95$1, If[LessEqual[y, -1.4e-128], N[(N[(N[(t * a), $MachinePrecision] + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-161], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+48], N[(z * N[(1.0 - N[(N[(y * N[(b - a), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-128}:\\
\;\;\;\;\frac{t \cdot a + y \cdot t\_1}{y + t}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-161}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+48}:\\
\;\;\;\;z \cdot \left(1 - \frac{y \cdot \left(b - a\right)}{\left(x + y\right) \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.4500000000000001e-23 or 5.9999999999999999e48 < y Initial program 44.8%
Taylor expanded in y around inf 73.3%
if -1.4500000000000001e-23 < y < -1.3999999999999999e-128Initial program 86.5%
Taylor expanded in y around 0 86.4%
Taylor expanded in x around 0 67.5%
if -1.3999999999999999e-128 < y < 5.8e-161Initial program 87.9%
Taylor expanded in y around 0 69.9%
if 5.8e-161 < y < 5.9999999999999999e48Initial program 74.4%
Taylor expanded in z around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
Taylor expanded in t around 0 67.6%
associate--l+67.6%
div-sub67.6%
distribute-rgt-out--67.6%
+-commutative67.6%
Simplified67.6%
Final simplification70.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (or (<= z -5.2e+87) (not (<= z 0.0047)))
(* z (+ (/ a z) (* (+ x y) (/ 1.0 t_1))))
(- (* a (/ (+ y t) t_1)) (* (/ y t_1) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((z <= -5.2e+87) || !(z <= 0.0047)) {
tmp = z * ((a / z) + ((x + y) * (1.0 / t_1)));
} else {
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (x + t)
if ((z <= (-5.2d+87)) .or. (.not. (z <= 0.0047d0))) then
tmp = z * ((a / z) + ((x + y) * (1.0d0 / t_1)))
else
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if ((z <= -5.2e+87) || !(z <= 0.0047)) {
tmp = z * ((a / z) + ((x + y) * (1.0 / t_1)));
} else {
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if (z <= -5.2e+87) or not (z <= 0.0047): tmp = z * ((a / z) + ((x + y) * (1.0 / t_1))) else: tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if ((z <= -5.2e+87) || !(z <= 0.0047)) tmp = Float64(z * Float64(Float64(a / z) + Float64(Float64(x + y) * Float64(1.0 / t_1)))); else tmp = Float64(Float64(a * Float64(Float64(y + t) / t_1)) - Float64(Float64(y / t_1) * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if ((z <= -5.2e+87) || ~((z <= 0.0047))) tmp = z * ((a / z) + ((x + y) * (1.0 / t_1))); else tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -5.2e+87], N[Not[LessEqual[z, 0.0047]], $MachinePrecision]], N[(z * N[(N[(a / z), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(y / t$95$1), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+87} \lor \neg \left(z \leq 0.0047\right):\\
\;\;\;\;z \cdot \left(\frac{a}{z} + \left(x + y\right) \cdot \frac{1}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1} - \frac{y}{t\_1} \cdot b\\
\end{array}
\end{array}
if z < -5.19999999999999997e87 or 0.00470000000000000018 < z Initial program 59.9%
Taylor expanded in z around -inf 82.5%
mul-1-neg82.5%
distribute-rgt-neg-in82.5%
mul-1-neg82.5%
unsub-neg82.5%
Simplified82.5%
div-inv82.4%
+-commutative82.4%
associate-+l+82.4%
+-commutative82.4%
Applied egg-rr82.4%
sub-neg82.4%
+-commutative82.4%
neg-mul-182.4%
sub-neg82.4%
neg-mul-182.4%
+-commutative82.4%
Simplified82.4%
Taylor expanded in t around inf 81.2%
if -5.19999999999999997e87 < z < 0.00470000000000000018Initial program 74.3%
Taylor expanded in z around -inf 66.4%
mul-1-neg66.4%
distribute-rgt-neg-in66.4%
mul-1-neg66.4%
unsub-neg66.4%
Simplified66.4%
div-inv66.4%
+-commutative66.4%
associate-+l+66.4%
+-commutative66.4%
Applied egg-rr66.4%
sub-neg66.4%
+-commutative66.4%
neg-mul-166.4%
sub-neg66.4%
neg-mul-166.4%
+-commutative66.4%
Simplified66.4%
Taylor expanded in z around 0 52.4%
associate-/l*68.3%
associate-+r+68.3%
+-commutative68.3%
associate-/l*73.6%
associate-+r+73.6%
+-commutative73.6%
Simplified73.6%
Final simplification76.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) b)))
(if (<= y -8.8e+105)
(- (* a (/ (+ y t) t_1)) (* (/ y t_1) b))
(if (<= y 4.5e+48) (/ (+ (* t a) (+ (* x z) (* y t_2))) t_1) 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 tmp;
if (y <= -8.8e+105) {
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b);
} else if (y <= 4.5e+48) {
tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (z + a) - b
if (y <= (-8.8d+105)) then
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b)
else if (y <= 4.5d+48) then
tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -8.8e+105) {
tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b);
} else if (y <= 4.5e+48) {
tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - b tmp = 0 if y <= -8.8e+105: tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b) elif y <= 4.5e+48: tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1 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) tmp = 0.0 if (y <= -8.8e+105) tmp = Float64(Float64(a * Float64(Float64(y + t) / t_1)) - Float64(Float64(y / t_1) * b)); elseif (y <= 4.5e+48) tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * t_2))) / t_1); 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; tmp = 0.0; if (y <= -8.8e+105) tmp = (a * ((y + t) / t_1)) - ((y / t_1) * b); elseif (y <= 4.5e+48) tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -8.8e+105], N[(N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[(y / t$95$1), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+48], N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -8.8 \cdot 10^{+105}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1} - \frac{y}{t\_1} \cdot b\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+48}:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot t\_2\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.80000000000000027e105Initial program 31.9%
Taylor expanded in z around -inf 34.9%
mul-1-neg34.9%
distribute-rgt-neg-in34.9%
mul-1-neg34.9%
unsub-neg34.9%
Simplified34.9%
div-inv34.8%
+-commutative34.8%
associate-+l+34.8%
+-commutative34.8%
Applied egg-rr34.8%
sub-neg34.8%
+-commutative34.8%
neg-mul-134.8%
sub-neg34.8%
neg-mul-134.8%
+-commutative34.8%
Simplified34.8%
Taylor expanded in z around 0 26.7%
associate-/l*48.3%
associate-+r+48.3%
+-commutative48.3%
associate-/l*83.2%
associate-+r+83.2%
+-commutative83.2%
Simplified83.2%
if -8.80000000000000027e105 < y < 4.49999999999999995e48Initial program 80.7%
Taylor expanded in y around 0 80.7%
if 4.49999999999999995e48 < y Initial program 47.9%
Taylor expanded in y around inf 80.5%
Final simplification81.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -4.8e-6)
t_1
(if (<= y 2.3e-63)
(/ (- (+ (* t a) (* x z)) (* y b)) (+ x (+ y t)))
(if (<= y 1.85e+48)
(* z (- 1.0 (/ (* y (- b a)) (* (+ x y) z))))
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 <= -4.8e-6) {
tmp = t_1;
} else if (y <= 2.3e-63) {
tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t));
} else if (y <= 1.85e+48) {
tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z)));
} 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 <= (-4.8d-6)) then
tmp = t_1
else if (y <= 2.3d-63) then
tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t))
else if (y <= 1.85d+48) then
tmp = z * (1.0d0 - ((y * (b - a)) / ((x + y) * z)))
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 <= -4.8e-6) {
tmp = t_1;
} else if (y <= 2.3e-63) {
tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t));
} else if (y <= 1.85e+48) {
tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -4.8e-6: tmp = t_1 elif y <= 2.3e-63: tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t)) elif y <= 1.85e+48: tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z))) 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 <= -4.8e-6) tmp = t_1; elseif (y <= 2.3e-63) tmp = Float64(Float64(Float64(Float64(t * a) + Float64(x * z)) - Float64(y * b)) / Float64(x + Float64(y + t))); elseif (y <= 1.85e+48) tmp = Float64(z * Float64(1.0 - Float64(Float64(y * Float64(b - a)) / Float64(Float64(x + y) * z)))); 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 <= -4.8e-6) tmp = t_1; elseif (y <= 2.3e-63) tmp = (((t * a) + (x * z)) - (y * b)) / (x + (y + t)); elseif (y <= 1.85e+48) tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z))); 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, -4.8e-6], t$95$1, If[LessEqual[y, 2.3e-63], N[(N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+48], N[(z * N[(1.0 - N[(N[(y * N[(b - a), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{\left(t \cdot a + x \cdot z\right) - y \cdot b}{x + \left(y + t\right)}\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+48}:\\
\;\;\;\;z \cdot \left(1 - \frac{y \cdot \left(b - a\right)}{\left(x + y\right) \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.7999999999999998e-6 or 1.85e48 < y Initial program 43.5%
Taylor expanded in y around inf 75.0%
if -4.7999999999999998e-6 < y < 2.3e-63Initial program 85.4%
fma-define85.4%
+-commutative85.4%
associate-+l+85.4%
+-commutative85.4%
Simplified85.4%
Taylor expanded in y around 0 73.8%
if 2.3e-63 < y < 1.85e48Initial program 70.5%
Taylor expanded in z around -inf 85.2%
mul-1-neg85.2%
distribute-rgt-neg-in85.2%
mul-1-neg85.2%
unsub-neg85.2%
Simplified85.2%
Taylor expanded in t around 0 72.4%
associate--l+72.4%
div-sub72.4%
distribute-rgt-out--72.4%
+-commutative72.4%
Simplified72.4%
Final simplification74.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ x y) z)) (t_2 (- (+ z a) b)))
(if (<= y -2.7e+19)
t_2
(if (<= y 2.4e-41)
(/ (+ (* (+ y t) a) t_1) (+ (+ x y) t))
(if (<= y 3.7e+48) (* z (- 1.0 (/ (* y (- b a)) t_1))) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) * z;
double t_2 = (z + a) - b;
double tmp;
if (y <= -2.7e+19) {
tmp = t_2;
} else if (y <= 2.4e-41) {
tmp = (((y + t) * a) + t_1) / ((x + y) + t);
} else if (y <= 3.7e+48) {
tmp = z * (1.0 - ((y * (b - a)) / 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 = (x + y) * z
t_2 = (z + a) - b
if (y <= (-2.7d+19)) then
tmp = t_2
else if (y <= 2.4d-41) then
tmp = (((y + t) * a) + t_1) / ((x + y) + t)
else if (y <= 3.7d+48) then
tmp = z * (1.0d0 - ((y * (b - a)) / 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 = (x + y) * z;
double t_2 = (z + a) - b;
double tmp;
if (y <= -2.7e+19) {
tmp = t_2;
} else if (y <= 2.4e-41) {
tmp = (((y + t) * a) + t_1) / ((x + y) + t);
} else if (y <= 3.7e+48) {
tmp = z * (1.0 - ((y * (b - a)) / t_1));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) * z t_2 = (z + a) - b tmp = 0 if y <= -2.7e+19: tmp = t_2 elif y <= 2.4e-41: tmp = (((y + t) * a) + t_1) / ((x + y) + t) elif y <= 3.7e+48: tmp = z * (1.0 - ((y * (b - a)) / t_1)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) * z) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -2.7e+19) tmp = t_2; elseif (y <= 2.4e-41) tmp = Float64(Float64(Float64(Float64(y + t) * a) + t_1) / Float64(Float64(x + y) + t)); elseif (y <= 3.7e+48) tmp = Float64(z * Float64(1.0 - Float64(Float64(y * Float64(b - a)) / t_1))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) * z; t_2 = (z + a) - b; tmp = 0.0; if (y <= -2.7e+19) tmp = t_2; elseif (y <= 2.4e-41) tmp = (((y + t) * a) + t_1) / ((x + y) + t); elseif (y <= 3.7e+48) tmp = z * (1.0 - ((y * (b - a)) / t_1)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -2.7e+19], t$95$2, If[LessEqual[y, 2.4e-41], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] + t$95$1), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e+48], N[(z * N[(1.0 - N[(N[(y * N[(b - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) \cdot z\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-41}:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a + t\_1}{\left(x + y\right) + t}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+48}:\\
\;\;\;\;z \cdot \left(1 - \frac{y \cdot \left(b - a\right)}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.7e19 or 3.6999999999999999e48 < y Initial program 42.9%
Taylor expanded in y around inf 74.8%
if -2.7e19 < y < 2.40000000000000022e-41Initial program 84.0%
Taylor expanded in b around 0 70.3%
if 2.40000000000000022e-41 < y < 3.6999999999999999e48Initial program 77.2%
Taylor expanded in z around -inf 90.8%
mul-1-neg90.8%
distribute-rgt-neg-in90.8%
mul-1-neg90.8%
unsub-neg90.8%
Simplified90.8%
Taylor expanded in t around 0 79.8%
associate--l+79.8%
div-sub79.8%
distribute-rgt-out--79.8%
+-commutative79.8%
Simplified79.8%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -9.7e+17)
t_1
(if (<= y 7e-161)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 3.8e+48)
(* z (- 1.0 (/ (* y (- b a)) (* (+ x y) z))))
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 <= -9.7e+17) {
tmp = t_1;
} else if (y <= 7e-161) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 3.8e+48) {
tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z)));
} 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 <= (-9.7d+17)) then
tmp = t_1
else if (y <= 7d-161) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 3.8d+48) then
tmp = z * (1.0d0 - ((y * (b - a)) / ((x + y) * z)))
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 <= -9.7e+17) {
tmp = t_1;
} else if (y <= 7e-161) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 3.8e+48) {
tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -9.7e+17: tmp = t_1 elif y <= 7e-161: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 3.8e+48: tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z))) 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 <= -9.7e+17) tmp = t_1; elseif (y <= 7e-161) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 3.8e+48) tmp = Float64(z * Float64(1.0 - Float64(Float64(y * Float64(b - a)) / Float64(Float64(x + y) * z)))); 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 <= -9.7e+17) tmp = t_1; elseif (y <= 7e-161) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 3.8e+48) tmp = z * (1.0 - ((y * (b - a)) / ((x + y) * z))); 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, -9.7e+17], t$95$1, If[LessEqual[y, 7e-161], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+48], N[(z * N[(1.0 - N[(N[(y * N[(b - a), $MachinePrecision]), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -9.7 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-161}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+48}:\\
\;\;\;\;z \cdot \left(1 - \frac{y \cdot \left(b - a\right)}{\left(x + y\right) \cdot z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.7e17 or 3.8e48 < y Initial program 42.9%
Taylor expanded in y around inf 74.8%
if -9.7e17 < y < 7.00000000000000039e-161Initial program 87.2%
Taylor expanded in y around 0 63.0%
if 7.00000000000000039e-161 < y < 3.8e48Initial program 74.4%
Taylor expanded in z around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
mul-1-neg88.8%
unsub-neg88.8%
Simplified88.8%
Taylor expanded in t around 0 67.6%
associate--l+67.6%
div-sub67.6%
distribute-rgt-out--67.6%
+-commutative67.6%
Simplified67.6%
Final simplification68.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (+ y t))) (t_2 (* z (/ (+ x y) t_1))))
(if (<= z -4.6e+114)
t_2
(if (<= z -2.9e-148)
(- (+ z a) b)
(if (<= z 4.6e-5) (* a (/ (+ y t) t_1)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y + t);
double t_2 = z * ((x + y) / t_1);
double tmp;
if (z <= -4.6e+114) {
tmp = t_2;
} else if (z <= -2.9e-148) {
tmp = (z + a) - b;
} else if (z <= 4.6e-5) {
tmp = a * ((y + t) / 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 = x + (y + t)
t_2 = z * ((x + y) / t_1)
if (z <= (-4.6d+114)) then
tmp = t_2
else if (z <= (-2.9d-148)) then
tmp = (z + a) - b
else if (z <= 4.6d-5) then
tmp = a * ((y + t) / 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 = x + (y + t);
double t_2 = z * ((x + y) / t_1);
double tmp;
if (z <= -4.6e+114) {
tmp = t_2;
} else if (z <= -2.9e-148) {
tmp = (z + a) - b;
} else if (z <= 4.6e-5) {
tmp = a * ((y + t) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y + t) t_2 = z * ((x + y) / t_1) tmp = 0 if z <= -4.6e+114: tmp = t_2 elif z <= -2.9e-148: tmp = (z + a) - b elif z <= 4.6e-5: tmp = a * ((y + t) / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y + t)) t_2 = Float64(z * Float64(Float64(x + y) / t_1)) tmp = 0.0 if (z <= -4.6e+114) tmp = t_2; elseif (z <= -2.9e-148) tmp = Float64(Float64(z + a) - b); elseif (z <= 4.6e-5) tmp = Float64(a * Float64(Float64(y + t) / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y + t); t_2 = z * ((x + y) / t_1); tmp = 0.0; if (z <= -4.6e+114) tmp = t_2; elseif (z <= -2.9e-148) tmp = (z + a) - b; elseif (z <= 4.6e-5) tmp = a * ((y + t) / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+114], t$95$2, If[LessEqual[z, -2.9e-148], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[z, 4.6e-5], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y + t\right)\\
t_2 := z \cdot \frac{x + y}{t\_1}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+114}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-148}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.6000000000000001e114 or 4.6e-5 < z Initial program 56.3%
Taylor expanded in z around inf 46.6%
associate-/l*78.0%
+-commutative78.0%
+-commutative78.0%
associate-+r+78.0%
Simplified78.0%
if -4.6000000000000001e114 < z < -2.8999999999999998e-148Initial program 78.8%
Taylor expanded in y around inf 56.8%
if -2.8999999999999998e-148 < z < 4.6e-5Initial program 74.5%
Taylor expanded in a around inf 34.8%
associate-/l*54.2%
+-commutative54.2%
+-commutative54.2%
associate-+r+54.2%
Simplified54.2%
Final simplification64.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.5e+15) (not (<= y 5.2e-51))) (- (+ 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 <= -1.5e+15) || !(y <= 5.2e-51)) {
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 <= (-1.5d+15)) .or. (.not. (y <= 5.2d-51))) 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 <= -1.5e+15) || !(y <= 5.2e-51)) {
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 <= -1.5e+15) or not (y <= 5.2e-51): 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 <= -1.5e+15) || !(y <= 5.2e-51)) 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 <= -1.5e+15) || ~((y <= 5.2e-51))) 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, -1.5e+15], N[Not[LessEqual[y, 5.2e-51]], $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 -1.5 \cdot 10^{+15} \lor \neg \left(y \leq 5.2 \cdot 10^{-51}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\end{array}
\end{array}
if y < -1.5e15 or 5.2e-51 < y Initial program 48.3%
Taylor expanded in y around inf 70.8%
if -1.5e15 < y < 5.2e-51Initial program 85.1%
Taylor expanded in y around 0 61.8%
Final simplification66.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x -9.2e+59) z (if (<= x 2e+120) (- (+ z a) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.2e+59) {
tmp = z;
} else if (x <= 2e+120) {
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 <= (-9.2d+59)) then
tmp = z
else if (x <= 2d+120) 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 <= -9.2e+59) {
tmp = z;
} else if (x <= 2e+120) {
tmp = (z + a) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.2e+59: tmp = z elif x <= 2e+120: tmp = (z + a) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.2e+59) tmp = z; elseif (x <= 2e+120) 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 <= -9.2e+59) tmp = z; elseif (x <= 2e+120) tmp = (z + a) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.2e+59], z, If[LessEqual[x, 2e+120], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+59}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+120}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -9.20000000000000032e59 or 2e120 < x Initial program 61.5%
Taylor expanded in x around inf 56.8%
if -9.20000000000000032e59 < x < 2e120Initial program 72.1%
Taylor expanded in y around inf 60.8%
Final simplification59.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -0.0112) z (if (<= x 5.4e-80) a z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -0.0112) {
tmp = z;
} else if (x <= 5.4e-80) {
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 <= (-0.0112d0)) then
tmp = z
else if (x <= 5.4d-80) 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 <= -0.0112) {
tmp = z;
} else if (x <= 5.4e-80) {
tmp = a;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -0.0112: tmp = z elif x <= 5.4e-80: tmp = a else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -0.0112) tmp = z; elseif (x <= 5.4e-80) tmp = a; else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -0.0112) tmp = z; elseif (x <= 5.4e-80) tmp = a; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -0.0112], z, If[LessEqual[x, 5.4e-80], a, z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0112:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-80}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -0.0111999999999999999 or 5.4000000000000004e-80 < x Initial program 63.6%
Taylor expanded in x around inf 50.5%
if -0.0111999999999999999 < x < 5.4000000000000004e-80Initial program 73.9%
Taylor expanded in t around inf 43.2%
(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 68.0%
Taylor expanded in t around inf 25.3%
(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 2024160
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(! :herbie-platform default (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3581311708415056400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 12285964308315609000000000000000000000000000000000000000000000000000000000000000000) (/ 1 (/ (+ (+ 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)))