
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_2)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 4e+290)))
(- (+ a (* z (+ (/ x t_1) (/ y t_1)))) (* y (/ b (+ x (+ y t)))))
(/ (+ (* t a) (+ (* x z) (* y (- (+ z a) b)))) 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 = y + (x + t);
double t_3 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 4e+290)) {
tmp = (a + (z * ((x / t_1) + (y / t_1)))) - (y * (b / (x + (y + t))));
} else {
tmp = ((t * a) + ((x * z) + (y * ((z + a) - b)))) / t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double t_2 = y + (x + t);
double t_3 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 4e+290)) {
tmp = (a + (z * ((x / t_1) + (y / t_1)))) - (y * (b / (x + (y + t))));
} else {
tmp = ((t * a) + ((x * z) + (y * ((z + a) - b)))) / t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + t t_2 = y + (x + t) t_3 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_2 tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 4e+290): tmp = (a + (z * ((x / t_1) + (y / t_1)))) - (y * (b / (x + (y + t)))) else: tmp = ((t * a) + ((x * z) + (y * ((z + a) - b)))) / t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_2) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 4e+290)) tmp = Float64(Float64(a + Float64(z * Float64(Float64(x / t_1) + Float64(y / t_1)))) - Float64(y * Float64(b / Float64(x + Float64(y + t))))); else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * Float64(Float64(z + a) - b)))) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) + t; t_2 = y + (x + t); t_3 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_2; tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 4e+290))) tmp = (a + (z * ((x / t_1) + (y / t_1)))) - (y * (b / (x + (y + t)))); else tmp = ((t * a) + ((x * z) + (y * ((z + a) - b)))) / t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 4e+290]], $MachinePrecision]], N[(N[(a + N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b / N[(x + N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty \lor \neg \left(t\_3 \leq 4 \cdot 10^{+290}\right):\\
\;\;\;\;\left(a + z \cdot \left(\frac{x}{t\_1} + \frac{y}{t\_1}\right)\right) - y \cdot \frac{b}{x + \left(y + t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot \left(\left(z + a\right) - b\right)\right)}{t\_2}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.00000000000000025e290 < (/.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 z around 0 37.2%
associate-/l*53.3%
add-sqr-sqrt26.5%
sqrt-unprod31.5%
sqr-neg31.5%
sqrt-unprod18.3%
add-sqr-sqrt38.1%
associate-+r+38.1%
clear-num38.1%
inv-pow38.1%
associate-+r+38.1%
+-commutative38.1%
add-sqr-sqrt18.3%
sqrt-unprod31.5%
sqr-neg31.5%
sqrt-unprod26.5%
add-sqr-sqrt53.2%
Applied egg-rr53.2%
Taylor expanded in b around 0 37.2%
associate-/l*53.3%
+-commutative53.3%
associate-/r/53.3%
associate-+r+53.3%
+-commutative53.3%
Simplified53.3%
Taylor expanded in t around inf 92.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)) < 4.00000000000000025e290Initial program 99.1%
Taylor expanded in y around 0 99.1%
Final simplification96.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x y) t))
(t_2 (+ y (+ x t)))
(t_3 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_2)))
(if (or (<= t_3 (- INFINITY)) (not (<= t_3 5e+295)))
(+ (/ a (/ t_1 (+ y t))) (* (+ x y) (/ z t_1)))
(/ (+ (* t a) (+ (* x z) (* y (- (+ z a) b)))) 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 = y + (x + t);
double t_3 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -((double) INFINITY)) || !(t_3 <= 5e+295)) {
tmp = (a / (t_1 / (y + t))) + ((x + y) * (z / t_1));
} else {
tmp = ((t * a) + ((x * z) + (y * ((z + a) - b)))) / t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) + t;
double t_2 = y + (x + t);
double t_3 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_2;
double tmp;
if ((t_3 <= -Double.POSITIVE_INFINITY) || !(t_3 <= 5e+295)) {
tmp = (a / (t_1 / (y + t))) + ((x + y) * (z / t_1));
} else {
tmp = ((t * a) + ((x * z) + (y * ((z + a) - b)))) / t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + y) + t t_2 = y + (x + t) t_3 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_2 tmp = 0 if (t_3 <= -math.inf) or not (t_3 <= 5e+295): tmp = (a / (t_1 / (y + t))) + ((x + y) * (z / t_1)) else: tmp = ((t * a) + ((x * z) + (y * ((z + a) - b)))) / t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) + t) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_2) tmp = 0.0 if ((t_3 <= Float64(-Inf)) || !(t_3 <= 5e+295)) tmp = Float64(Float64(a / Float64(t_1 / Float64(y + t))) + Float64(Float64(x + y) * Float64(z / t_1))); else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * Float64(Float64(z + a) - b)))) / t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x + y) + t; t_2 = y + (x + t); t_3 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_2; tmp = 0.0; if ((t_3 <= -Inf) || ~((t_3 <= 5e+295))) tmp = (a / (t_1 / (y + t))) + ((x + y) * (z / t_1)); else tmp = ((t * a) + ((x * z) + (y * ((z + a) - b)))) / t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[Or[LessEqual[t$95$3, (-Infinity)], N[Not[LessEqual[t$95$3, 5e+295]], $MachinePrecision]], N[(N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + y\right) + t\\
t_2 := y + \left(x + t\right)\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty \lor \neg \left(t\_3 \leq 5 \cdot 10^{+295}\right):\\
\;\;\;\;\frac{a}{\frac{t\_1}{y + t}} + \left(x + y\right) \cdot \frac{z}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot \left(\left(z + a\right) - b\right)\right)}{t\_2}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 4.99999999999999991e295 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.7%
Taylor expanded in b around 0 5.2%
Taylor expanded in a around inf 5.2%
associate-/l*36.9%
+-commutative36.9%
+-commutative36.9%
+-commutative36.9%
associate-/l*81.1%
+-commutative81.1%
+-commutative81.1%
associate-/r/81.1%
+-commutative81.1%
+-commutative81.1%
+-commutative81.1%
Simplified81.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)) < 4.99999999999999991e295Initial program 99.1%
Taylor expanded in y around 0 99.2%
Final simplification91.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t)))
(t_2 (/ (- (+ (* (+ x y) z) (* a (+ y t))) (* y b)) t_1))
(t_3 (- (+ z a) b)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 4e+290)))
t_3
(/ (+ (* t a) (+ (* x z) (* y t_3))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 4e+290)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1;
}
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 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1;
double t_3 = (z + a) - b;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 4e+290)) {
tmp = t_3;
} else {
tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1 t_3 = (z + a) - b tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 4e+290): tmp = t_3 else: tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) - Float64(y * b)) / t_1) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 4e+290)) tmp = t_3; else tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * t_3))) / t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = ((((x + y) * z) + (a * (y + t))) - (y * b)) / t_1; t_3 = (z + a) - b; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 4e+290))) tmp = t_3; else tmp = ((t * a) + ((x * z) + (y * t_3))) / t_1; 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[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 4e+290]], $MachinePrecision]], t$95$3, N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + a \cdot \left(y + t\right)\right) - y \cdot b}{t\_1}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 4 \cdot 10^{+290}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot t\_3\right)}{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 4.00000000000000025e290 < (/.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.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000025e290Initial program 99.1%
Taylor expanded in y around 0 99.1%
Final simplification87.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ (* y (- a b)) (+ x y)))) (t_2 (- (+ z a) b)))
(if (<= y -1.15e+135)
t_2
(if (<= y -1.45e-124)
t_1
(if (<= y 1.55e-150)
(/ (+ (+ (* t a) (* y a)) (* (+ x y) z)) (+ y (+ x t)))
(if (<= y 1.8e+78) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.15e+135) {
tmp = t_2;
} else if (y <= -1.45e-124) {
tmp = t_1;
} else if (y <= 1.55e-150) {
tmp = (((t * a) + (y * a)) + ((x + y) * z)) / (y + (x + t));
} else if (y <= 1.8e+78) {
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 + ((y * (a - b)) / (x + y))
t_2 = (z + a) - b
if (y <= (-1.15d+135)) then
tmp = t_2
else if (y <= (-1.45d-124)) then
tmp = t_1
else if (y <= 1.55d-150) then
tmp = (((t * a) + (y * a)) + ((x + y) * z)) / (y + (x + t))
else if (y <= 1.8d+78) 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 + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.15e+135) {
tmp = t_2;
} else if (y <= -1.45e-124) {
tmp = t_1;
} else if (y <= 1.55e-150) {
tmp = (((t * a) + (y * a)) + ((x + y) * z)) / (y + (x + t));
} else if (y <= 1.8e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + ((y * (a - b)) / (x + y)) t_2 = (z + a) - b tmp = 0 if y <= -1.15e+135: tmp = t_2 elif y <= -1.45e-124: tmp = t_1 elif y <= 1.55e-150: tmp = (((t * a) + (y * a)) + ((x + y) * z)) / (y + (x + t)) elif y <= 1.8e+78: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.15e+135) tmp = t_2; elseif (y <= -1.45e-124) tmp = t_1; elseif (y <= 1.55e-150) tmp = Float64(Float64(Float64(Float64(t * a) + Float64(y * a)) + Float64(Float64(x + y) * z)) / Float64(y + Float64(x + t))); elseif (y <= 1.8e+78) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + ((y * (a - b)) / (x + y)); t_2 = (z + a) - b; tmp = 0.0; if (y <= -1.15e+135) tmp = t_2; elseif (y <= -1.45e-124) tmp = t_1; elseif (y <= 1.55e-150) tmp = (((t * a) + (y * a)) + ((x + y) * z)) / (y + (x + t)); elseif (y <= 1.8e+78) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.15e+135], t$95$2, If[LessEqual[y, -1.45e-124], t$95$1, If[LessEqual[y, 1.55e-150], N[(N[(N[(N[(t * a), $MachinePrecision] + N[(y * a), $MachinePrecision]), $MachinePrecision] + N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+78], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{y \cdot \left(a - b\right)}{x + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.15 \cdot 10^{+135}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-150}:\\
\;\;\;\;\frac{\left(t \cdot a + y \cdot a\right) + \left(x + y\right) \cdot z}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.1500000000000001e135 or 1.8000000000000001e78 < y Initial program 31.6%
Taylor expanded in y around inf 79.1%
if -1.1500000000000001e135 < y < -1.4500000000000001e-124 or 1.54999999999999999e-150 < y < 1.8000000000000001e78Initial program 72.8%
Taylor expanded in t around 0 57.4%
associate--l+57.4%
cancel-sign-sub-inv57.4%
*-commutative57.4%
*-commutative57.4%
+-commutative57.4%
associate-+r+57.4%
*-commutative57.4%
distribute-rgt-in57.4%
sub-neg57.4%
*-commutative57.4%
+-commutative57.4%
+-commutative57.4%
Simplified57.4%
Taylor expanded in z around 0 68.3%
if -1.4500000000000001e-124 < y < 1.54999999999999999e-150Initial program 78.7%
Taylor expanded in b around 0 68.7%
distribute-rgt-in68.7%
Applied egg-rr68.7%
Final simplification71.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ (* y (- a b)) (+ x y)))) (t_2 (- (+ z a) b)))
(if (<= y -3.1e+134)
t_2
(if (<= y -1.9e-125)
t_1
(if (<= y 3.9e-152)
(/ (+ (* (+ x y) z) (* a (+ y t))) (+ y (+ x t)))
(if (<= y 1.55e+78) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (y <= -3.1e+134) {
tmp = t_2;
} else if (y <= -1.9e-125) {
tmp = t_1;
} else if (y <= 3.9e-152) {
tmp = (((x + y) * z) + (a * (y + t))) / (y + (x + t));
} else if (y <= 1.55e+78) {
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 + ((y * (a - b)) / (x + y))
t_2 = (z + a) - b
if (y <= (-3.1d+134)) then
tmp = t_2
else if (y <= (-1.9d-125)) then
tmp = t_1
else if (y <= 3.9d-152) then
tmp = (((x + y) * z) + (a * (y + t))) / (y + (x + t))
else if (y <= 1.55d+78) 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 + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (y <= -3.1e+134) {
tmp = t_2;
} else if (y <= -1.9e-125) {
tmp = t_1;
} else if (y <= 3.9e-152) {
tmp = (((x + y) * z) + (a * (y + t))) / (y + (x + t));
} else if (y <= 1.55e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + ((y * (a - b)) / (x + y)) t_2 = (z + a) - b tmp = 0 if y <= -3.1e+134: tmp = t_2 elif y <= -1.9e-125: tmp = t_1 elif y <= 3.9e-152: tmp = (((x + y) * z) + (a * (y + t))) / (y + (x + t)) elif y <= 1.55e+78: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -3.1e+134) tmp = t_2; elseif (y <= -1.9e-125) tmp = t_1; elseif (y <= 3.9e-152) tmp = Float64(Float64(Float64(Float64(x + y) * z) + Float64(a * Float64(y + t))) / Float64(y + Float64(x + t))); elseif (y <= 1.55e+78) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + ((y * (a - b)) / (x + y)); t_2 = (z + a) - b; tmp = 0.0; if (y <= -3.1e+134) tmp = t_2; elseif (y <= -1.9e-125) tmp = t_1; elseif (y <= 3.9e-152) tmp = (((x + y) * z) + (a * (y + t))) / (y + (x + t)); elseif (y <= 1.55e+78) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3.1e+134], t$95$2, If[LessEqual[y, -1.9e-125], t$95$1, If[LessEqual[y, 3.9e-152], N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e+78], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{y \cdot \left(a - b\right)}{x + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+134}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{-125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-152}:\\
\;\;\;\;\frac{\left(x + y\right) \cdot z + a \cdot \left(y + t\right)}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -3.09999999999999982e134 or 1.55e78 < y Initial program 31.6%
Taylor expanded in y around inf 79.1%
if -3.09999999999999982e134 < y < -1.9000000000000001e-125 or 3.9000000000000004e-152 < y < 1.55e78Initial program 72.8%
Taylor expanded in t around 0 57.4%
associate--l+57.4%
cancel-sign-sub-inv57.4%
*-commutative57.4%
*-commutative57.4%
+-commutative57.4%
associate-+r+57.4%
*-commutative57.4%
distribute-rgt-in57.4%
sub-neg57.4%
*-commutative57.4%
+-commutative57.4%
+-commutative57.4%
Simplified57.4%
Taylor expanded in z around 0 68.3%
if -1.9000000000000001e-125 < y < 3.9000000000000004e-152Initial program 78.7%
Taylor expanded in b around 0 68.7%
Final simplification71.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ z (/ (* y (- a b)) (+ x y)))) (t_2 (- (+ z a) b)))
(if (<= y -5.8e+136)
t_2
(if (<= y -6.5e-127)
t_1
(if (<= y 9.5e-158)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 1.65e+78) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (y <= -5.8e+136) {
tmp = t_2;
} else if (y <= -6.5e-127) {
tmp = t_1;
} else if (y <= 9.5e-158) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.65e+78) {
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 + ((y * (a - b)) / (x + y))
t_2 = (z + a) - b
if (y <= (-5.8d+136)) then
tmp = t_2
else if (y <= (-6.5d-127)) then
tmp = t_1
else if (y <= 9.5d-158) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 1.65d+78) 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 + ((y * (a - b)) / (x + y));
double t_2 = (z + a) - b;
double tmp;
if (y <= -5.8e+136) {
tmp = t_2;
} else if (y <= -6.5e-127) {
tmp = t_1;
} else if (y <= 9.5e-158) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.65e+78) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + ((y * (a - b)) / (x + y)) t_2 = (z + a) - b tmp = 0 if y <= -5.8e+136: tmp = t_2 elif y <= -6.5e-127: tmp = t_1 elif y <= 9.5e-158: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 1.65e+78: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -5.8e+136) tmp = t_2; elseif (y <= -6.5e-127) tmp = t_1; elseif (y <= 9.5e-158) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 1.65e+78) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + ((y * (a - b)) / (x + y)); t_2 = (z + a) - b; tmp = 0.0; if (y <= -5.8e+136) tmp = t_2; elseif (y <= -6.5e-127) tmp = t_1; elseif (y <= 9.5e-158) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 1.65e+78) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -5.8e+136], t$95$2, If[LessEqual[y, -6.5e-127], t$95$1, If[LessEqual[y, 9.5e-158], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+78], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \frac{y \cdot \left(a - b\right)}{x + y}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+136}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-158}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -5.79999999999999949e136 or 1.65e78 < y Initial program 31.6%
Taylor expanded in y around inf 79.1%
if -5.79999999999999949e136 < y < -6.49999999999999998e-127 or 9.50000000000000051e-158 < y < 1.65e78Initial program 72.8%
Taylor expanded in t around 0 57.4%
associate--l+57.4%
cancel-sign-sub-inv57.4%
*-commutative57.4%
*-commutative57.4%
+-commutative57.4%
associate-+r+57.4%
*-commutative57.4%
distribute-rgt-in57.4%
sub-neg57.4%
*-commutative57.4%
+-commutative57.4%
+-commutative57.4%
Simplified57.4%
Taylor expanded in z around 0 68.3%
if -6.49999999999999998e-127 < y < 9.50000000000000051e-158Initial program 78.7%
Taylor expanded in y around 0 61.7%
Final simplification69.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (/ a (+ (/ x t) 1.0))))
(if (<= t -2e+64)
t_2
(if (<= t 1.25e-184)
t_1
(if (<= t 1.3e-130)
(- z (/ (* z t) x))
(if (<= t 1.22e+202) 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 / ((x / t) + 1.0);
double tmp;
if (t <= -2e+64) {
tmp = t_2;
} else if (t <= 1.25e-184) {
tmp = t_1;
} else if (t <= 1.3e-130) {
tmp = z - ((z * t) / x);
} else if (t <= 1.22e+202) {
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 / ((x / t) + 1.0d0)
if (t <= (-2d+64)) then
tmp = t_2
else if (t <= 1.25d-184) then
tmp = t_1
else if (t <= 1.3d-130) then
tmp = z - ((z * t) / x)
else if (t <= 1.22d+202) 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 / ((x / t) + 1.0);
double tmp;
if (t <= -2e+64) {
tmp = t_2;
} else if (t <= 1.25e-184) {
tmp = t_1;
} else if (t <= 1.3e-130) {
tmp = z - ((z * t) / x);
} else if (t <= 1.22e+202) {
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 / ((x / t) + 1.0) tmp = 0 if t <= -2e+64: tmp = t_2 elif t <= 1.25e-184: tmp = t_1 elif t <= 1.3e-130: tmp = z - ((z * t) / x) elif t <= 1.22e+202: 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(x / t) + 1.0)) tmp = 0.0 if (t <= -2e+64) tmp = t_2; elseif (t <= 1.25e-184) tmp = t_1; elseif (t <= 1.3e-130) tmp = Float64(z - Float64(Float64(z * t) / x)); elseif (t <= 1.22e+202) 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 / ((x / t) + 1.0); tmp = 0.0; if (t <= -2e+64) tmp = t_2; elseif (t <= 1.25e-184) tmp = t_1; elseif (t <= 1.3e-130) tmp = z - ((z * t) / x); elseif (t <= 1.22e+202) 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[(x / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+64], t$95$2, If[LessEqual[t, 1.25e-184], t$95$1, If[LessEqual[t, 1.3e-130], N[(z - N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.22e+202], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := \frac{a}{\frac{x}{t} + 1}\\
\mathbf{if}\;t \leq -2 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-130}:\\
\;\;\;\;z - \frac{z \cdot t}{x}\\
\mathbf{elif}\;t \leq 1.22 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.00000000000000004e64 or 1.22e202 < t Initial program 45.4%
Taylor expanded in a around inf 33.8%
associate-/l*68.2%
associate-+r+68.2%
Simplified68.2%
Taylor expanded in t around inf 68.2%
if -2.00000000000000004e64 < t < 1.25000000000000001e-184 or 1.3e-130 < t < 1.22e202Initial program 64.9%
Taylor expanded in y around inf 56.9%
if 1.25000000000000001e-184 < t < 1.3e-130Initial program 76.5%
Taylor expanded in z around inf 57.6%
+-commutative57.6%
Simplified57.6%
Taylor expanded in t around 0 69.3%
mul-1-neg69.3%
unsub-neg69.3%
associate-/l*63.1%
+-commutative63.1%
Simplified63.1%
Taylor expanded in y around 0 69.3%
Final simplification60.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (/ a (+ (/ x t) 1.0))))
(if (<= t -5.6e+63)
t_2
(if (<= t 1.08e-184)
t_1
(if (<= t 2.5e-124)
(* z (- 1.0 (/ t (+ x y))))
(if (<= t 1.22e+202) 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 / ((x / t) + 1.0);
double tmp;
if (t <= -5.6e+63) {
tmp = t_2;
} else if (t <= 1.08e-184) {
tmp = t_1;
} else if (t <= 2.5e-124) {
tmp = z * (1.0 - (t / (x + y)));
} else if (t <= 1.22e+202) {
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 / ((x / t) + 1.0d0)
if (t <= (-5.6d+63)) then
tmp = t_2
else if (t <= 1.08d-184) then
tmp = t_1
else if (t <= 2.5d-124) then
tmp = z * (1.0d0 - (t / (x + y)))
else if (t <= 1.22d+202) 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 / ((x / t) + 1.0);
double tmp;
if (t <= -5.6e+63) {
tmp = t_2;
} else if (t <= 1.08e-184) {
tmp = t_1;
} else if (t <= 2.5e-124) {
tmp = z * (1.0 - (t / (x + y)));
} else if (t <= 1.22e+202) {
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 / ((x / t) + 1.0) tmp = 0 if t <= -5.6e+63: tmp = t_2 elif t <= 1.08e-184: tmp = t_1 elif t <= 2.5e-124: tmp = z * (1.0 - (t / (x + y))) elif t <= 1.22e+202: 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(x / t) + 1.0)) tmp = 0.0 if (t <= -5.6e+63) tmp = t_2; elseif (t <= 1.08e-184) tmp = t_1; elseif (t <= 2.5e-124) tmp = Float64(z * Float64(1.0 - Float64(t / Float64(x + y)))); elseif (t <= 1.22e+202) 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 / ((x / t) + 1.0); tmp = 0.0; if (t <= -5.6e+63) tmp = t_2; elseif (t <= 1.08e-184) tmp = t_1; elseif (t <= 2.5e-124) tmp = z * (1.0 - (t / (x + y))); elseif (t <= 1.22e+202) 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[(x / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+63], t$95$2, If[LessEqual[t, 1.08e-184], t$95$1, If[LessEqual[t, 2.5e-124], N[(z * N[(1.0 - N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.22e+202], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := \frac{a}{\frac{x}{t} + 1}\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.08 \cdot 10^{-184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-124}:\\
\;\;\;\;z \cdot \left(1 - \frac{t}{x + y}\right)\\
\mathbf{elif}\;t \leq 1.22 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -5.59999999999999974e63 or 1.22e202 < t Initial program 45.4%
Taylor expanded in a around inf 33.8%
associate-/l*68.2%
associate-+r+68.2%
Simplified68.2%
Taylor expanded in t around inf 68.2%
if -5.59999999999999974e63 < t < 1.07999999999999995e-184 or 2.5000000000000001e-124 < t < 1.22e202Initial program 64.8%
Taylor expanded in y around inf 57.3%
if 1.07999999999999995e-184 < t < 2.5000000000000001e-124Initial program 75.5%
Taylor expanded in z around inf 49.3%
+-commutative49.3%
Simplified49.3%
Taylor expanded in t around 0 64.1%
mul-1-neg64.1%
unsub-neg64.1%
associate-/l*58.8%
+-commutative58.8%
Simplified58.8%
Taylor expanded in z around 0 64.1%
+-commutative64.1%
Simplified64.1%
Final simplification60.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= t -5.6e+77)
a
(if (<= t 2.8e-184)
t_1
(if (<= t 2.35e-124) z (if (<= t 4.2e+203) t_1 a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -5.6e+77) {
tmp = a;
} else if (t <= 2.8e-184) {
tmp = t_1;
} else if (t <= 2.35e-124) {
tmp = z;
} else if (t <= 4.2e+203) {
tmp = t_1;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (t <= (-5.6d+77)) then
tmp = a
else if (t <= 2.8d-184) then
tmp = t_1
else if (t <= 2.35d-124) then
tmp = z
else if (t <= 4.2d+203) then
tmp = t_1
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -5.6e+77) {
tmp = a;
} else if (t <= 2.8e-184) {
tmp = t_1;
} else if (t <= 2.35e-124) {
tmp = z;
} else if (t <= 4.2e+203) {
tmp = t_1;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if t <= -5.6e+77: tmp = a elif t <= 2.8e-184: tmp = t_1 elif t <= 2.35e-124: tmp = z elif t <= 4.2e+203: tmp = t_1 else: tmp = a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (t <= -5.6e+77) tmp = a; elseif (t <= 2.8e-184) tmp = t_1; elseif (t <= 2.35e-124) tmp = z; elseif (t <= 4.2e+203) tmp = t_1; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (t <= -5.6e+77) tmp = a; elseif (t <= 2.8e-184) tmp = t_1; elseif (t <= 2.35e-124) tmp = z; elseif (t <= 4.2e+203) tmp = t_1; else tmp = a; 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, -5.6e+77], a, If[LessEqual[t, 2.8e-184], t$95$1, If[LessEqual[t, 2.35e-124], z, If[LessEqual[t, 4.2e+203], t$95$1, a]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+77}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-124}:\\
\;\;\;\;z\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -5.60000000000000001e77 or 4.19999999999999967e203 < t Initial program 45.0%
Taylor expanded in t around inf 65.9%
if -5.60000000000000001e77 < t < 2.7999999999999998e-184 or 2.35000000000000002e-124 < t < 4.19999999999999967e203Initial program 64.5%
Taylor expanded in y around inf 56.9%
if 2.7999999999999998e-184 < t < 2.35000000000000002e-124Initial program 75.5%
Taylor expanded in x around inf 62.7%
Final simplification59.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= t -3.9e+78)
a
(if (<= t 1.95e-184)
t_1
(if (<= t 1.5e-130) (- z (/ (* z t) x)) (if (<= t 3.6e+204) t_1 a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -3.9e+78) {
tmp = a;
} else if (t <= 1.95e-184) {
tmp = t_1;
} else if (t <= 1.5e-130) {
tmp = z - ((z * t) / x);
} else if (t <= 3.6e+204) {
tmp = t_1;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (t <= (-3.9d+78)) then
tmp = a
else if (t <= 1.95d-184) then
tmp = t_1
else if (t <= 1.5d-130) then
tmp = z - ((z * t) / x)
else if (t <= 3.6d+204) then
tmp = t_1
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (t <= -3.9e+78) {
tmp = a;
} else if (t <= 1.95e-184) {
tmp = t_1;
} else if (t <= 1.5e-130) {
tmp = z - ((z * t) / x);
} else if (t <= 3.6e+204) {
tmp = t_1;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if t <= -3.9e+78: tmp = a elif t <= 1.95e-184: tmp = t_1 elif t <= 1.5e-130: tmp = z - ((z * t) / x) elif t <= 3.6e+204: tmp = t_1 else: tmp = a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (t <= -3.9e+78) tmp = a; elseif (t <= 1.95e-184) tmp = t_1; elseif (t <= 1.5e-130) tmp = Float64(z - Float64(Float64(z * t) / x)); elseif (t <= 3.6e+204) tmp = t_1; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (t <= -3.9e+78) tmp = a; elseif (t <= 1.95e-184) tmp = t_1; elseif (t <= 1.5e-130) tmp = z - ((z * t) / x); elseif (t <= 3.6e+204) tmp = t_1; else tmp = a; 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, -3.9e+78], a, If[LessEqual[t, 1.95e-184], t$95$1, If[LessEqual[t, 1.5e-130], N[(z - N[(N[(z * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e+204], t$95$1, a]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{+78}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-130}:\\
\;\;\;\;z - \frac{z \cdot t}{x}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -3.9000000000000004e78 or 3.6000000000000002e204 < t Initial program 45.0%
Taylor expanded in t around inf 65.9%
if -3.9000000000000004e78 < t < 1.94999999999999997e-184 or 1.49999999999999993e-130 < t < 3.6000000000000002e204Initial program 64.6%
Taylor expanded in y around inf 56.6%
if 1.94999999999999997e-184 < t < 1.49999999999999993e-130Initial program 76.5%
Taylor expanded in z around inf 57.6%
+-commutative57.6%
Simplified57.6%
Taylor expanded in t around 0 69.3%
mul-1-neg69.3%
unsub-neg69.3%
associate-/l*63.1%
+-commutative63.1%
Simplified63.1%
Taylor expanded in y around 0 69.3%
Final simplification59.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ a (+ (/ x t) 1.0))))
(if (<= t -3.8e+79)
t_1
(if (<= t 27500.0)
(+ z (/ (* y (- a b)) (+ x y)))
(if (<= t 9.5e+201) (- (+ z a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / ((x / t) + 1.0);
double tmp;
if (t <= -3.8e+79) {
tmp = t_1;
} else if (t <= 27500.0) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (t <= 9.5e+201) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a / ((x / t) + 1.0d0)
if (t <= (-3.8d+79)) then
tmp = t_1
else if (t <= 27500.0d0) then
tmp = z + ((y * (a - b)) / (x + y))
else if (t <= 9.5d+201) then
tmp = (z + a) - b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / ((x / t) + 1.0);
double tmp;
if (t <= -3.8e+79) {
tmp = t_1;
} else if (t <= 27500.0) {
tmp = z + ((y * (a - b)) / (x + y));
} else if (t <= 9.5e+201) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / ((x / t) + 1.0) tmp = 0 if t <= -3.8e+79: tmp = t_1 elif t <= 27500.0: tmp = z + ((y * (a - b)) / (x + y)) elif t <= 9.5e+201: tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(Float64(x / t) + 1.0)) tmp = 0.0 if (t <= -3.8e+79) tmp = t_1; elseif (t <= 27500.0) tmp = Float64(z + Float64(Float64(y * Float64(a - b)) / Float64(x + y))); elseif (t <= 9.5e+201) 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 = a / ((x / t) + 1.0); tmp = 0.0; if (t <= -3.8e+79) tmp = t_1; elseif (t <= 27500.0) tmp = z + ((y * (a - b)) / (x + y)); elseif (t <= 9.5e+201) 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[(a / N[(N[(x / t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.8e+79], t$95$1, If[LessEqual[t, 27500.0], N[(z + N[(N[(y * N[(a - b), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+201], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{\frac{x}{t} + 1}\\
\mathbf{if}\;t \leq -3.8 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 27500:\\
\;\;\;\;z + \frac{y \cdot \left(a - b\right)}{x + y}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+201}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.8000000000000002e79 or 9.5000000000000002e201 < t Initial program 44.2%
Taylor expanded in a around inf 32.1%
associate-/l*68.3%
associate-+r+68.3%
Simplified68.3%
Taylor expanded in t around inf 68.3%
if -3.8000000000000002e79 < t < 27500Initial program 68.7%
Taylor expanded in t around 0 57.1%
associate--l+57.1%
cancel-sign-sub-inv57.1%
*-commutative57.1%
*-commutative57.1%
+-commutative57.1%
associate-+r+57.1%
*-commutative57.1%
distribute-rgt-in57.1%
sub-neg57.1%
*-commutative57.1%
+-commutative57.1%
+-commutative57.1%
Simplified57.1%
Taylor expanded in z around 0 71.8%
if 27500 < t < 9.5000000000000002e201Initial program 56.0%
Taylor expanded in y around inf 55.8%
Final simplification68.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -6e+36) (not (<= x 1.12e+136))) (+ z (/ y (/ x (- a b)))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -6e+36) || !(x <= 1.12e+136)) {
tmp = z + (y / (x / (a - b)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x <= (-6d+36)) .or. (.not. (x <= 1.12d+136))) then
tmp = z + (y / (x / (a - b)))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -6e+36) || !(x <= 1.12e+136)) {
tmp = z + (y / (x / (a - b)));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -6e+36) or not (x <= 1.12e+136): tmp = z + (y / (x / (a - b))) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -6e+36) || !(x <= 1.12e+136)) tmp = Float64(z + Float64(y / Float64(x / Float64(a - b)))); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -6e+36) || ~((x <= 1.12e+136))) tmp = z + (y / (x / (a - b))); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -6e+36], N[Not[LessEqual[x, 1.12e+136]], $MachinePrecision]], N[(z + N[(y / N[(x / N[(a - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+36} \lor \neg \left(x \leq 1.12 \cdot 10^{+136}\right):\\
\;\;\;\;z + \frac{y}{\frac{x}{a - b}}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if x < -6e36 or 1.12000000000000001e136 < x Initial program 59.9%
Taylor expanded in t around 0 50.3%
associate--l+50.3%
cancel-sign-sub-inv50.3%
*-commutative50.3%
*-commutative50.3%
+-commutative50.3%
associate-+r+50.3%
*-commutative50.3%
distribute-rgt-in50.3%
sub-neg50.3%
*-commutative50.3%
+-commutative50.3%
+-commutative50.3%
Simplified50.3%
Taylor expanded in x around inf 62.7%
associate-/l*67.2%
Simplified67.2%
if -6e36 < x < 1.12000000000000001e136Initial program 62.0%
Taylor expanded in y around inf 62.8%
Final simplification64.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.4e+68) a (if (<= t 3.2e+84) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.4e+68) {
tmp = a;
} else if (t <= 3.2e+84) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.4d+68)) then
tmp = a
else if (t <= 3.2d+84) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.4e+68) {
tmp = a;
} else if (t <= 3.2e+84) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.4e+68: tmp = a elif t <= 3.2e+84: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.4e+68) tmp = a; elseif (t <= 3.2e+84) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.4e+68) tmp = a; elseif (t <= 3.2e+84) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.4e+68], a, If[LessEqual[t, 3.2e+84], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+68}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+84}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -1.4e68 or 3.2000000000000001e84 < t Initial program 46.9%
Taylor expanded in t around inf 57.2%
if -1.4e68 < t < 3.2000000000000001e84Initial program 67.8%
Taylor expanded in x around inf 45.0%
Final simplification48.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b 1.55e+274) (+ z a) (- b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 1.55e+274) {
tmp = z + a;
} else {
tmp = -b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 1.55d+274) then
tmp = z + a
else
tmp = -b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 1.55e+274) {
tmp = z + a;
} else {
tmp = -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 1.55e+274: tmp = z + a else: tmp = -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 1.55e+274) tmp = Float64(z + a); else tmp = Float64(-b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 1.55e+274) tmp = z + a; else tmp = -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 1.55e+274], N[(z + a), $MachinePrecision], (-b)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.55 \cdot 10^{+274}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;-b\\
\end{array}
\end{array}
if b < 1.55e274Initial program 62.5%
Taylor expanded in b around 0 48.2%
Taylor expanded in y around inf 50.3%
if 1.55e274 < b Initial program 36.6%
Taylor expanded in b around inf 37.3%
mul-1-neg37.3%
associate-/l*84.8%
distribute-neg-frac84.8%
associate-+r+84.8%
Simplified84.8%
Taylor expanded in y around inf 55.3%
mul-1-neg55.3%
Simplified55.3%
Final simplification50.6%
(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 61.2%
Taylor expanded in t around inf 28.5%
Final simplification28.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 2024034
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:herbie-target
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))