
(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 (+ y (+ x t)))
(t_2 (+ (+ y x) t))
(t_3 (/ y t_2))
(t_4 (/ (+ y x) t_2)))
(if (<= z -5.2e+187)
(* z t_4)
(if (<= z 2.2e+67)
(* a (+ (/ t t_2) (- (+ t_3 (* t_4 (/ z a))) (* b (/ y (* t_2 a))))))
(*
z
(+
(/ x t_1)
(- (+ t_3 (* a (/ (+ y t) (* z t_2)))) (* (/ b t_1) (/ y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (y + x) + t;
double t_3 = y / t_2;
double t_4 = (y + x) / t_2;
double tmp;
if (z <= -5.2e+187) {
tmp = z * t_4;
} else if (z <= 2.2e+67) {
tmp = a * ((t / t_2) + ((t_3 + (t_4 * (z / a))) - (b * (y / (t_2 * a)))));
} else {
tmp = z * ((x / t_1) + ((t_3 + (a * ((y + t) / (z * t_2)))) - ((b / t_1) * (y / z))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (y + x) + t
t_3 = y / t_2
t_4 = (y + x) / t_2
if (z <= (-5.2d+187)) then
tmp = z * t_4
else if (z <= 2.2d+67) then
tmp = a * ((t / t_2) + ((t_3 + (t_4 * (z / a))) - (b * (y / (t_2 * a)))))
else
tmp = z * ((x / t_1) + ((t_3 + (a * ((y + t) / (z * t_2)))) - ((b / t_1) * (y / z))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (y + x) + t;
double t_3 = y / t_2;
double t_4 = (y + x) / t_2;
double tmp;
if (z <= -5.2e+187) {
tmp = z * t_4;
} else if (z <= 2.2e+67) {
tmp = a * ((t / t_2) + ((t_3 + (t_4 * (z / a))) - (b * (y / (t_2 * a)))));
} else {
tmp = z * ((x / t_1) + ((t_3 + (a * ((y + t) / (z * t_2)))) - ((b / t_1) * (y / z))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (y + x) + t t_3 = y / t_2 t_4 = (y + x) / t_2 tmp = 0 if z <= -5.2e+187: tmp = z * t_4 elif z <= 2.2e+67: tmp = a * ((t / t_2) + ((t_3 + (t_4 * (z / a))) - (b * (y / (t_2 * a))))) else: tmp = z * ((x / t_1) + ((t_3 + (a * ((y + t) / (z * t_2)))) - ((b / t_1) * (y / z)))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(y + x) + t) t_3 = Float64(y / t_2) t_4 = Float64(Float64(y + x) / t_2) tmp = 0.0 if (z <= -5.2e+187) tmp = Float64(z * t_4); elseif (z <= 2.2e+67) tmp = Float64(a * Float64(Float64(t / t_2) + Float64(Float64(t_3 + Float64(t_4 * Float64(z / a))) - Float64(b * Float64(y / Float64(t_2 * a)))))); else tmp = Float64(z * Float64(Float64(x / t_1) + Float64(Float64(t_3 + Float64(a * Float64(Float64(y + t) / Float64(z * t_2)))) - Float64(Float64(b / t_1) * Float64(y / z))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (y + x) + t; t_3 = y / t_2; t_4 = (y + x) / t_2; tmp = 0.0; if (z <= -5.2e+187) tmp = z * t_4; elseif (z <= 2.2e+67) tmp = a * ((t / t_2) + ((t_3 + (t_4 * (z / a))) - (b * (y / (t_2 * a))))); else tmp = z * ((x / t_1) + ((t_3 + (a * ((y + t) / (z * t_2)))) - ((b / t_1) * (y / z)))); 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[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$3 = N[(y / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y + x), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[z, -5.2e+187], N[(z * t$95$4), $MachinePrecision], If[LessEqual[z, 2.2e+67], N[(a * N[(N[(t / t$95$2), $MachinePrecision] + N[(N[(t$95$3 + N[(t$95$4 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(t$95$2 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x / t$95$1), $MachinePrecision] + N[(N[(t$95$3 + N[(a * N[(N[(y + t), $MachinePrecision] / N[(z * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b / t$95$1), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(y + x\right) + t\\
t_3 := \frac{y}{t\_2}\\
t_4 := \frac{y + x}{t\_2}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+187}:\\
\;\;\;\;z \cdot t\_4\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+67}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_2} + \left(\left(t\_3 + t\_4 \cdot \frac{z}{a}\right) - b \cdot \frac{y}{t\_2 \cdot a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{x}{t\_1} + \left(\left(t\_3 + a \cdot \frac{y + t}{z \cdot t\_2}\right) - \frac{b}{t\_1} \cdot \frac{y}{z}\right)\right)\\
\end{array}
\end{array}
if z < -5.1999999999999997e187Initial program 32.1%
Taylor expanded in z around inf 28.8%
associate-/l*92.6%
+-commutative92.6%
+-commutative92.6%
Simplified92.6%
if -5.1999999999999997e187 < z < 2.2e67Initial program 65.5%
Taylor expanded in a around inf 77.1%
associate--l+77.1%
+-commutative77.1%
+-commutative77.1%
times-frac82.5%
+-commutative82.5%
+-commutative82.5%
associate-/l*90.3%
+-commutative90.3%
Simplified90.3%
if 2.2e67 < z Initial program 38.8%
Taylor expanded in z around inf 66.8%
associate--l+66.8%
associate-+r+66.8%
+-commutative66.8%
associate-/l*77.3%
fma-define77.3%
associate-+r+77.3%
associate-+r+77.3%
Simplified92.4%
fma-undefine92.4%
associate-+r+92.4%
+-commutative92.4%
associate-+r+92.4%
+-commutative92.4%
Applied egg-rr92.4%
Final simplification90.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* a (+ y t)) (* z (+ y x))) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+290))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (y + x))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+290)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((a * (y + t)) + (z * (y + x))) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+290)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((a * (y + t)) + (z * (y + x))) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+290): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * Float64(y + x))) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+290)) 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 * (y + t)) + (z * (y + x))) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+290))) tmp = (z + a) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+290]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(a \cdot \left(y + t\right) + z \cdot \left(y + x\right)\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+290}\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.00000000000000006e290 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.6%
Taylor expanded in y around inf 69.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000006e290Initial program 99.1%
Final simplification86.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)) (t_2 (/ (+ y x) t_1)))
(if (or (<= z -2.3e+190) (not (<= z 4.2e+214)))
(* z t_2)
(*
a
(+ (/ t t_1) (- (+ (/ y t_1) (* t_2 (/ z a))) (* b (/ y (* t_1 a)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = (y + x) / t_1;
double tmp;
if ((z <= -2.3e+190) || !(z <= 4.2e+214)) {
tmp = z * t_2;
} else {
tmp = a * ((t / t_1) + (((y / t_1) + (t_2 * (z / a))) - (b * (y / (t_1 * a)))));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y + x) + t
t_2 = (y + x) / t_1
if ((z <= (-2.3d+190)) .or. (.not. (z <= 4.2d+214))) then
tmp = z * t_2
else
tmp = a * ((t / t_1) + (((y / t_1) + (t_2 * (z / a))) - (b * (y / (t_1 * 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 = (y + x) + t;
double t_2 = (y + x) / t_1;
double tmp;
if ((z <= -2.3e+190) || !(z <= 4.2e+214)) {
tmp = z * t_2;
} else {
tmp = a * ((t / t_1) + (((y / t_1) + (t_2 * (z / a))) - (b * (y / (t_1 * a)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (y + x) + t t_2 = (y + x) / t_1 tmp = 0 if (z <= -2.3e+190) or not (z <= 4.2e+214): tmp = z * t_2 else: tmp = a * ((t / t_1) + (((y / t_1) + (t_2 * (z / a))) - (b * (y / (t_1 * a))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(Float64(y + x) / t_1) tmp = 0.0 if ((z <= -2.3e+190) || !(z <= 4.2e+214)) tmp = Float64(z * t_2); else tmp = Float64(a * Float64(Float64(t / t_1) + Float64(Float64(Float64(y / t_1) + Float64(t_2 * Float64(z / a))) - Float64(b * Float64(y / Float64(t_1 * a)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (y + x) + t; t_2 = (y + x) / t_1; tmp = 0.0; if ((z <= -2.3e+190) || ~((z <= 4.2e+214))) tmp = z * t_2; else tmp = a * ((t / t_1) + (((y / t_1) + (t_2 * (z / a))) - (b * (y / (t_1 * a))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[z, -2.3e+190], N[Not[LessEqual[z, 4.2e+214]], $MachinePrecision]], N[(z * t$95$2), $MachinePrecision], N[(a * N[(N[(t / t$95$1), $MachinePrecision] + N[(N[(N[(y / t$95$1), $MachinePrecision] + N[(t$95$2 * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(t$95$1 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \frac{y + x}{t\_1}\\
\mathbf{if}\;z \leq -2.3 \cdot 10^{+190} \lor \neg \left(z \leq 4.2 \cdot 10^{+214}\right):\\
\;\;\;\;z \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\frac{t}{t\_1} + \left(\left(\frac{y}{t\_1} + t\_2 \cdot \frac{z}{a}\right) - b \cdot \frac{y}{t\_1 \cdot a}\right)\right)\\
\end{array}
\end{array}
if z < -2.3e190 or 4.2000000000000001e214 < z Initial program 27.3%
Taylor expanded in z around inf 25.7%
associate-/l*95.3%
+-commutative95.3%
+-commutative95.3%
Simplified95.3%
if -2.3e190 < z < 4.2000000000000001e214Initial program 63.2%
Taylor expanded in a around inf 74.4%
associate--l+74.4%
+-commutative74.4%
+-commutative74.4%
times-frac82.3%
+-commutative82.3%
+-commutative82.3%
associate-/l*89.5%
+-commutative89.5%
Simplified89.5%
Final simplification90.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (/ (+ y t) (+ y (+ x t))))) (t_2 (- (+ z a) b)))
(if (<= y -1.2e-26)
t_2
(if (<= y -1.3e-43)
t_1
(if (<= y -9e-99)
(+ z a)
(if (<= y 3.1e-250)
(/ (+ (* z x) (* t a)) (+ x t))
(if (<= y 3.9e-100)
(+ z a)
(if (<= y 1.25e-17)
(* z (/ (+ y x) (+ (+ y x) t)))
(if (<= y 1.2e+69) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * ((y + t) / (y + (x + t)));
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.2e-26) {
tmp = t_2;
} else if (y <= -1.3e-43) {
tmp = t_1;
} else if (y <= -9e-99) {
tmp = z + a;
} else if (y <= 3.1e-250) {
tmp = ((z * x) + (t * a)) / (x + t);
} else if (y <= 3.9e-100) {
tmp = z + a;
} else if (y <= 1.25e-17) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 1.2e+69) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * ((y + t) / (y + (x + t)))
t_2 = (z + a) - b
if (y <= (-1.2d-26)) then
tmp = t_2
else if (y <= (-1.3d-43)) then
tmp = t_1
else if (y <= (-9d-99)) then
tmp = z + a
else if (y <= 3.1d-250) then
tmp = ((z * x) + (t * a)) / (x + t)
else if (y <= 3.9d-100) then
tmp = z + a
else if (y <= 1.25d-17) then
tmp = z * ((y + x) / ((y + x) + t))
else if (y <= 1.2d+69) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * ((y + t) / (y + (x + t)));
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.2e-26) {
tmp = t_2;
} else if (y <= -1.3e-43) {
tmp = t_1;
} else if (y <= -9e-99) {
tmp = z + a;
} else if (y <= 3.1e-250) {
tmp = ((z * x) + (t * a)) / (x + t);
} else if (y <= 3.9e-100) {
tmp = z + a;
} else if (y <= 1.25e-17) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 1.2e+69) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * ((y + t) / (y + (x + t))) t_2 = (z + a) - b tmp = 0 if y <= -1.2e-26: tmp = t_2 elif y <= -1.3e-43: tmp = t_1 elif y <= -9e-99: tmp = z + a elif y <= 3.1e-250: tmp = ((z * x) + (t * a)) / (x + t) elif y <= 3.9e-100: tmp = z + a elif y <= 1.25e-17: tmp = z * ((y + x) / ((y + x) + t)) elif y <= 1.2e+69: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.2e-26) tmp = t_2; elseif (y <= -1.3e-43) tmp = t_1; elseif (y <= -9e-99) tmp = Float64(z + a); elseif (y <= 3.1e-250) tmp = Float64(Float64(Float64(z * x) + Float64(t * a)) / Float64(x + t)); elseif (y <= 3.9e-100) tmp = Float64(z + a); elseif (y <= 1.25e-17) tmp = Float64(z * Float64(Float64(y + x) / Float64(Float64(y + x) + t))); elseif (y <= 1.2e+69) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * ((y + t) / (y + (x + t))); t_2 = (z + a) - b; tmp = 0.0; if (y <= -1.2e-26) tmp = t_2; elseif (y <= -1.3e-43) tmp = t_1; elseif (y <= -9e-99) tmp = z + a; elseif (y <= 3.1e-250) tmp = ((z * x) + (t * a)) / (x + t); elseif (y <= 3.9e-100) tmp = z + a; elseif (y <= 1.25e-17) tmp = z * ((y + x) / ((y + x) + t)); elseif (y <= 1.2e+69) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.2e-26], t$95$2, If[LessEqual[y, -1.3e-43], t$95$1, If[LessEqual[y, -9e-99], N[(z + a), $MachinePrecision], If[LessEqual[y, 3.1e-250], N[(N[(N[(z * x), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-100], N[(z + a), $MachinePrecision], If[LessEqual[y, 1.25e-17], N[(z * N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+69], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{y + t}{y + \left(x + t\right)}\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{-26}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-99}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-250}:\\
\;\;\;\;\frac{z \cdot x + t \cdot a}{x + t}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-100}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-17}:\\
\;\;\;\;z \cdot \frac{y + x}{\left(y + x\right) + t}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.2e-26 or 1.2000000000000001e69 < y Initial program 45.1%
Taylor expanded in y around inf 70.4%
if -1.2e-26 < y < -1.3e-43 or 1.25e-17 < y < 1.2000000000000001e69Initial program 64.0%
Taylor expanded in a around inf 44.3%
associate-/l*75.9%
associate-+r+75.9%
Simplified75.9%
if -1.3e-43 < y < -9.0000000000000006e-99 or 3.1000000000000001e-250 < y < 3.89999999999999977e-100Initial program 62.7%
Taylor expanded in b around 0 58.4%
Taylor expanded in y around inf 74.8%
if -9.0000000000000006e-99 < y < 3.1000000000000001e-250Initial program 74.8%
Taylor expanded in y around 0 61.0%
if 3.89999999999999977e-100 < y < 1.25e-17Initial program 72.1%
Taylor expanded in z around inf 55.1%
associate-/l*77.3%
+-commutative77.3%
+-commutative77.3%
Simplified77.3%
Final simplification70.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t))) (t_2 (+ y (+ x t))) (t_3 (- (+ z a) b)))
(if (<= y -1.55e+17)
t_3
(if (<= y 1.6e-249)
(/ (+ t_1 (* z x)) t_2)
(if (<= y 1.6e-100)
(+ z a)
(if (<= y 9.5e-17)
(* z (/ (+ y x) (+ (+ y x) t)))
(if (<= y 3e+63) (/ (- t_1 (* y b)) t_2) t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (z + a) - b;
double tmp;
if (y <= -1.55e+17) {
tmp = t_3;
} else if (y <= 1.6e-249) {
tmp = (t_1 + (z * x)) / t_2;
} else if (y <= 1.6e-100) {
tmp = z + a;
} else if (y <= 9.5e-17) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 3e+63) {
tmp = (t_1 - (y * b)) / t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a * (y + t)
t_2 = y + (x + t)
t_3 = (z + a) - b
if (y <= (-1.55d+17)) then
tmp = t_3
else if (y <= 1.6d-249) then
tmp = (t_1 + (z * x)) / t_2
else if (y <= 1.6d-100) then
tmp = z + a
else if (y <= 9.5d-17) then
tmp = z * ((y + x) / ((y + x) + t))
else if (y <= 3d+63) then
tmp = (t_1 - (y * b)) / t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = y + (x + t);
double t_3 = (z + a) - b;
double tmp;
if (y <= -1.55e+17) {
tmp = t_3;
} else if (y <= 1.6e-249) {
tmp = (t_1 + (z * x)) / t_2;
} else if (y <= 1.6e-100) {
tmp = z + a;
} else if (y <= 9.5e-17) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 3e+63) {
tmp = (t_1 - (y * b)) / t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = y + (x + t) t_3 = (z + a) - b tmp = 0 if y <= -1.55e+17: tmp = t_3 elif y <= 1.6e-249: tmp = (t_1 + (z * x)) / t_2 elif y <= 1.6e-100: tmp = z + a elif y <= 9.5e-17: tmp = z * ((y + x) / ((y + x) + t)) elif y <= 3e+63: tmp = (t_1 - (y * b)) / t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(y + Float64(x + t)) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.55e+17) tmp = t_3; elseif (y <= 1.6e-249) tmp = Float64(Float64(t_1 + Float64(z * x)) / t_2); elseif (y <= 1.6e-100) tmp = Float64(z + a); elseif (y <= 9.5e-17) tmp = Float64(z * Float64(Float64(y + x) / Float64(Float64(y + x) + t))); elseif (y <= 3e+63) tmp = Float64(Float64(t_1 - Float64(y * b)) / t_2); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = y + (x + t); t_3 = (z + a) - b; tmp = 0.0; if (y <= -1.55e+17) tmp = t_3; elseif (y <= 1.6e-249) tmp = (t_1 + (z * x)) / t_2; elseif (y <= 1.6e-100) tmp = z + a; elseif (y <= 9.5e-17) tmp = z * ((y + x) / ((y + x) + t)); elseif (y <= 3e+63) tmp = (t_1 - (y * b)) / t_2; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.55e+17], t$95$3, If[LessEqual[y, 1.6e-249], N[(N[(t$95$1 + N[(z * x), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[y, 1.6e-100], N[(z + a), $MachinePrecision], If[LessEqual[y, 9.5e-17], N[(z * N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+63], N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := y + \left(x + t\right)\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+17}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-249}:\\
\;\;\;\;\frac{t\_1 + z \cdot x}{t\_2}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-100}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-17}:\\
\;\;\;\;z \cdot \frac{y + x}{\left(y + x\right) + t}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+63}:\\
\;\;\;\;\frac{t\_1 - y \cdot b}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -1.55e17 or 2.99999999999999999e63 < y Initial program 42.1%
Taylor expanded in y around inf 71.5%
if -1.55e17 < y < 1.6000000000000001e-249Initial program 74.4%
Taylor expanded in b around 0 65.8%
Taylor expanded in x around inf 64.5%
if 1.6000000000000001e-249 < y < 1.60000000000000008e-100Initial program 59.0%
Taylor expanded in b around 0 56.3%
Taylor expanded in y around inf 78.0%
if 1.60000000000000008e-100 < y < 9.50000000000000029e-17Initial program 72.1%
Taylor expanded in z around inf 55.1%
associate-/l*77.3%
+-commutative77.3%
+-commutative77.3%
Simplified77.3%
if 9.50000000000000029e-17 < y < 2.99999999999999999e63Initial program 76.1%
Taylor expanded in z around 0 69.9%
*-commutative69.9%
Simplified69.9%
Final simplification70.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ y t))) (t_2 (- (+ z a) b)) (t_3 (+ y (+ x t))))
(if (<= y -7.2e+58)
t_2
(if (<= y 6.2e-250)
(/ (+ t_1 (* z (+ y x))) t_3)
(if (<= y 3.9e-100)
(+ z a)
(if (<= y 9e-18)
(* z (/ (+ y x) (+ (+ y x) t)))
(if (<= y 3.1e+63) (/ (- t_1 (* y b)) t_3) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = (z + a) - b;
double t_3 = y + (x + t);
double tmp;
if (y <= -7.2e+58) {
tmp = t_2;
} else if (y <= 6.2e-250) {
tmp = (t_1 + (z * (y + x))) / t_3;
} else if (y <= 3.9e-100) {
tmp = z + a;
} else if (y <= 9e-18) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 3.1e+63) {
tmp = (t_1 - (y * b)) / t_3;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = a * (y + t)
t_2 = (z + a) - b
t_3 = y + (x + t)
if (y <= (-7.2d+58)) then
tmp = t_2
else if (y <= 6.2d-250) then
tmp = (t_1 + (z * (y + x))) / t_3
else if (y <= 3.9d-100) then
tmp = z + a
else if (y <= 9d-18) then
tmp = z * ((y + x) / ((y + x) + t))
else if (y <= 3.1d+63) then
tmp = (t_1 - (y * b)) / t_3
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (y + t);
double t_2 = (z + a) - b;
double t_3 = y + (x + t);
double tmp;
if (y <= -7.2e+58) {
tmp = t_2;
} else if (y <= 6.2e-250) {
tmp = (t_1 + (z * (y + x))) / t_3;
} else if (y <= 3.9e-100) {
tmp = z + a;
} else if (y <= 9e-18) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 3.1e+63) {
tmp = (t_1 - (y * b)) / t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (y + t) t_2 = (z + a) - b t_3 = y + (x + t) tmp = 0 if y <= -7.2e+58: tmp = t_2 elif y <= 6.2e-250: tmp = (t_1 + (z * (y + x))) / t_3 elif y <= 3.9e-100: tmp = z + a elif y <= 9e-18: tmp = z * ((y + x) / ((y + x) + t)) elif y <= 3.1e+63: tmp = (t_1 - (y * b)) / t_3 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(y + t)) t_2 = Float64(Float64(z + a) - b) t_3 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -7.2e+58) tmp = t_2; elseif (y <= 6.2e-250) tmp = Float64(Float64(t_1 + Float64(z * Float64(y + x))) / t_3); elseif (y <= 3.9e-100) tmp = Float64(z + a); elseif (y <= 9e-18) tmp = Float64(z * Float64(Float64(y + x) / Float64(Float64(y + x) + t))); elseif (y <= 3.1e+63) tmp = Float64(Float64(t_1 - Float64(y * b)) / t_3); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (y + t); t_2 = (z + a) - b; t_3 = y + (x + t); tmp = 0.0; if (y <= -7.2e+58) tmp = t_2; elseif (y <= 6.2e-250) tmp = (t_1 + (z * (y + x))) / t_3; elseif (y <= 3.9e-100) tmp = z + a; elseif (y <= 9e-18) tmp = z * ((y + x) / ((y + x) + t)); elseif (y <= 3.1e+63) tmp = (t_1 - (y * b)) / t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$3 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e+58], t$95$2, If[LessEqual[y, 6.2e-250], N[(N[(t$95$1 + N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[y, 3.9e-100], N[(z + a), $MachinePrecision], If[LessEqual[y, 9e-18], N[(z * N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e+63], N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(y + t\right)\\
t_2 := \left(z + a\right) - b\\
t_3 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-250}:\\
\;\;\;\;\frac{t\_1 + z \cdot \left(y + x\right)}{t\_3}\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-100}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-18}:\\
\;\;\;\;z \cdot \frac{y + x}{\left(y + x\right) + t}\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+63}:\\
\;\;\;\;\frac{t\_1 - y \cdot b}{t\_3}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -7.19999999999999993e58 or 3.1000000000000001e63 < y Initial program 39.6%
Taylor expanded in y around inf 73.7%
if -7.19999999999999993e58 < y < 6.2000000000000002e-250Initial program 74.7%
Taylor expanded in b around 0 63.8%
if 6.2000000000000002e-250 < y < 3.89999999999999977e-100Initial program 59.0%
Taylor expanded in b around 0 56.3%
Taylor expanded in y around inf 78.0%
if 3.89999999999999977e-100 < y < 8.99999999999999987e-18Initial program 72.1%
Taylor expanded in z around inf 55.1%
associate-/l*77.3%
+-commutative77.3%
+-commutative77.3%
Simplified77.3%
if 8.99999999999999987e-18 < y < 3.1000000000000001e63Initial program 76.1%
Taylor expanded in z around 0 69.9%
*-commutative69.9%
Simplified69.9%
Final simplification71.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) b)))
(if (<= y -6.2e+17)
t_2
(if (<= y 7e-250)
(/ (+ (* a (+ y t)) (* z x)) t_1)
(if (<= y 4e-100)
(+ z a)
(if (<= y 7.4e-16)
(* z (/ (+ y x) (+ (+ y x) t)))
(if (<= y 8.6e+68) (* a (/ (+ y t) 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 <= -6.2e+17) {
tmp = t_2;
} else if (y <= 7e-250) {
tmp = ((a * (y + t)) + (z * x)) / t_1;
} else if (y <= 4e-100) {
tmp = z + a;
} else if (y <= 7.4e-16) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 8.6e+68) {
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 = y + (x + t)
t_2 = (z + a) - b
if (y <= (-6.2d+17)) then
tmp = t_2
else if (y <= 7d-250) then
tmp = ((a * (y + t)) + (z * x)) / t_1
else if (y <= 4d-100) then
tmp = z + a
else if (y <= 7.4d-16) then
tmp = z * ((y + x) / ((y + x) + t))
else if (y <= 8.6d+68) 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 = y + (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -6.2e+17) {
tmp = t_2;
} else if (y <= 7e-250) {
tmp = ((a * (y + t)) + (z * x)) / t_1;
} else if (y <= 4e-100) {
tmp = z + a;
} else if (y <= 7.4e-16) {
tmp = z * ((y + x) / ((y + x) + t));
} else if (y <= 8.6e+68) {
tmp = a * ((y + t) / 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 <= -6.2e+17: tmp = t_2 elif y <= 7e-250: tmp = ((a * (y + t)) + (z * x)) / t_1 elif y <= 4e-100: tmp = z + a elif y <= 7.4e-16: tmp = z * ((y + x) / ((y + x) + t)) elif y <= 8.6e+68: tmp = a * ((y + t) / 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 <= -6.2e+17) tmp = t_2; elseif (y <= 7e-250) tmp = Float64(Float64(Float64(a * Float64(y + t)) + Float64(z * x)) / t_1); elseif (y <= 4e-100) tmp = Float64(z + a); elseif (y <= 7.4e-16) tmp = Float64(z * Float64(Float64(y + x) / Float64(Float64(y + x) + t))); elseif (y <= 8.6e+68) 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 = y + (x + t); t_2 = (z + a) - b; tmp = 0.0; if (y <= -6.2e+17) tmp = t_2; elseif (y <= 7e-250) tmp = ((a * (y + t)) + (z * x)) / t_1; elseif (y <= 4e-100) tmp = z + a; elseif (y <= 7.4e-16) tmp = z * ((y + x) / ((y + x) + t)); elseif (y <= 8.6e+68) 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[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.2e+17], t$95$2, If[LessEqual[y, 7e-250], N[(N[(N[(a * N[(y + t), $MachinePrecision]), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 4e-100], N[(z + a), $MachinePrecision], If[LessEqual[y, 7.4e-16], N[(z * N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.6e+68], N[(a * N[(N[(y + t), $MachinePrecision] / t$95$1), $MachinePrecision]), $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 -6.2 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-250}:\\
\;\;\;\;\frac{a \cdot \left(y + t\right) + z \cdot x}{t\_1}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{-100}:\\
\;\;\;\;z + a\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-16}:\\
\;\;\;\;z \cdot \frac{y + x}{\left(y + x\right) + t}\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+68}:\\
\;\;\;\;a \cdot \frac{y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -6.2e17 or 8.6000000000000002e68 < y Initial program 42.8%
Taylor expanded in y around inf 71.8%
if -6.2e17 < y < 6.9999999999999998e-250Initial program 74.4%
Taylor expanded in b around 0 65.8%
Taylor expanded in x around inf 64.5%
if 6.9999999999999998e-250 < y < 4.0000000000000001e-100Initial program 59.0%
Taylor expanded in b around 0 56.3%
Taylor expanded in y around inf 78.0%
if 4.0000000000000001e-100 < y < 7.3999999999999999e-16Initial program 72.1%
Taylor expanded in z around inf 55.1%
associate-/l*77.3%
+-commutative77.3%
+-commutative77.3%
Simplified77.3%
if 7.3999999999999999e-16 < y < 8.6000000000000002e68Initial program 68.4%
Taylor expanded in a around inf 41.7%
associate-/l*67.9%
associate-+r+67.9%
Simplified67.9%
Final simplification70.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.7e+81) a (if (<= t 7.5e-60) z (if (<= t 1.35e+25) a (if (<= t 2.2e+84) z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.7e+81) {
tmp = a;
} else if (t <= 7.5e-60) {
tmp = z;
} else if (t <= 1.35e+25) {
tmp = a;
} else if (t <= 2.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 <= (-3.7d+81)) then
tmp = a
else if (t <= 7.5d-60) then
tmp = z
else if (t <= 1.35d+25) then
tmp = a
else if (t <= 2.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 <= -3.7e+81) {
tmp = a;
} else if (t <= 7.5e-60) {
tmp = z;
} else if (t <= 1.35e+25) {
tmp = a;
} else if (t <= 2.2e+84) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.7e+81: tmp = a elif t <= 7.5e-60: tmp = z elif t <= 1.35e+25: tmp = a elif t <= 2.2e+84: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.7e+81) tmp = a; elseif (t <= 7.5e-60) tmp = z; elseif (t <= 1.35e+25) tmp = a; elseif (t <= 2.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 <= -3.7e+81) tmp = a; elseif (t <= 7.5e-60) tmp = z; elseif (t <= 1.35e+25) tmp = a; elseif (t <= 2.2e+84) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.7e+81], a, If[LessEqual[t, 7.5e-60], z, If[LessEqual[t, 1.35e+25], a, If[LessEqual[t, 2.2e+84], z, a]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+81}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-60}:\\
\;\;\;\;z\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+25}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+84}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -3.7000000000000001e81 or 7.5000000000000002e-60 < t < 1.35e25 or 2.1999999999999998e84 < t Initial program 51.4%
Taylor expanded in t around inf 51.7%
if -3.7000000000000001e81 < t < 7.5000000000000002e-60 or 1.35e25 < t < 2.1999999999999998e84Initial program 62.0%
Taylor expanded in x around inf 53.1%
Final simplification52.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.5e+75) a (if (<= t 8.5e-66) z (if (<= t 7000000.0) (- b) (if (<= t 2.65e+85) z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.5e+75) {
tmp = a;
} else if (t <= 8.5e-66) {
tmp = z;
} else if (t <= 7000000.0) {
tmp = -b;
} else if (t <= 2.65e+85) {
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 <= (-3.5d+75)) then
tmp = a
else if (t <= 8.5d-66) then
tmp = z
else if (t <= 7000000.0d0) then
tmp = -b
else if (t <= 2.65d+85) 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 <= -3.5e+75) {
tmp = a;
} else if (t <= 8.5e-66) {
tmp = z;
} else if (t <= 7000000.0) {
tmp = -b;
} else if (t <= 2.65e+85) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.5e+75: tmp = a elif t <= 8.5e-66: tmp = z elif t <= 7000000.0: tmp = -b elif t <= 2.65e+85: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.5e+75) tmp = a; elseif (t <= 8.5e-66) tmp = z; elseif (t <= 7000000.0) tmp = Float64(-b); elseif (t <= 2.65e+85) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.5e+75) tmp = a; elseif (t <= 8.5e-66) tmp = z; elseif (t <= 7000000.0) tmp = -b; elseif (t <= 2.65e+85) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.5e+75], a, If[LessEqual[t, 8.5e-66], z, If[LessEqual[t, 7000000.0], (-b), If[LessEqual[t, 2.65e+85], z, a]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+75}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-66}:\\
\;\;\;\;z\\
\mathbf{elif}\;t \leq 7000000:\\
\;\;\;\;-b\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{+85}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < -3.4999999999999998e75 or 2.65e85 < t Initial program 46.6%
Taylor expanded in t around inf 55.5%
if -3.4999999999999998e75 < t < 8.49999999999999966e-66 or 7e6 < t < 2.65e85Initial program 62.8%
Taylor expanded in x around inf 51.9%
if 8.49999999999999966e-66 < t < 7e6Initial program 72.8%
Taylor expanded in b around inf 33.8%
mul-1-neg33.8%
associate-/l*54.1%
distribute-rgt-neg-in54.1%
mul-1-neg54.1%
associate-*r/54.1%
neg-mul-154.1%
associate-+r+54.1%
Simplified54.1%
Taylor expanded in y around inf 40.0%
mul-1-neg40.0%
Simplified40.0%
Final simplification52.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7.2e+138) (* a (/ t (+ (+ y x) t))) (if (<= t 7.8e+79) (- (+ z a) b) (* a (/ (+ y t) (+ y (+ x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.2e+138) {
tmp = a * (t / ((y + x) + t));
} else if (t <= 7.8e+79) {
tmp = (z + a) - b;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-7.2d+138)) then
tmp = a * (t / ((y + x) + t))
else if (t <= 7.8d+79) then
tmp = (z + a) - b
else
tmp = a * ((y + t) / (y + (x + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7.2e+138) {
tmp = a * (t / ((y + x) + t));
} else if (t <= 7.8e+79) {
tmp = (z + a) - b;
} else {
tmp = a * ((y + t) / (y + (x + t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -7.2e+138: tmp = a * (t / ((y + x) + t)) elif t <= 7.8e+79: tmp = (z + a) - b else: tmp = a * ((y + t) / (y + (x + t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7.2e+138) tmp = Float64(a * Float64(t / Float64(Float64(y + x) + t))); elseif (t <= 7.8e+79) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(Float64(y + t) / Float64(y + Float64(x + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -7.2e+138) tmp = a * (t / ((y + x) + t)); elseif (t <= 7.8e+79) tmp = (z + a) - b; else tmp = a * ((y + t) / (y + (x + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7.2e+138], N[(a * N[(t / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.8e+79], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(N[(y + t), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{+138}:\\
\;\;\;\;a \cdot \frac{t}{\left(y + x\right) + t}\\
\mathbf{elif}\;t \leq 7.8 \cdot 10^{+79}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{y + t}{y + \left(x + t\right)}\\
\end{array}
\end{array}
if t < -7.2000000000000002e138Initial program 45.9%
Taylor expanded in t around inf 21.8%
associate-/l*64.6%
+-commutative64.6%
associate-+r+64.6%
+-commutative64.6%
Applied egg-rr64.6%
if -7.2000000000000002e138 < t < 7.7999999999999994e79Initial program 62.4%
Taylor expanded in y around inf 66.1%
if 7.7999999999999994e79 < t Initial program 49.3%
Taylor expanded in a around inf 31.1%
associate-/l*55.9%
associate-+r+55.9%
Simplified55.9%
Final simplification63.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.12e+160) (not (<= t 3.5e+83))) (* a (/ t (+ x t))) (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.12e+160) || !(t <= 3.5e+83)) {
tmp = a * (t / (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.12d+160)) .or. (.not. (t <= 3.5d+83))) then
tmp = a * (t / (x + t))
else
tmp = (z + a) - b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.12e+160) || !(t <= 3.5e+83)) {
tmp = a * (t / (x + t));
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.12e+160) or not (t <= 3.5e+83): tmp = a * (t / (x + t)) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.12e+160) || !(t <= 3.5e+83)) tmp = Float64(a * Float64(t / Float64(x + t))); 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 ((t <= -1.12e+160) || ~((t <= 3.5e+83))) tmp = a * (t / (x + t)); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.12e+160], N[Not[LessEqual[t, 3.5e+83]], $MachinePrecision]], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.12 \cdot 10^{+160} \lor \neg \left(t \leq 3.5 \cdot 10^{+83}\right):\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -1.12e160 or 3.49999999999999977e83 < t Initial program 46.6%
Taylor expanded in t around inf 25.0%
associate-/l*53.4%
+-commutative53.4%
associate-+r+53.4%
+-commutative53.4%
Applied egg-rr53.4%
Taylor expanded in y around 0 26.2%
associate-/l*57.5%
+-commutative57.5%
Simplified57.5%
if -1.12e160 < t < 3.49999999999999977e83Initial program 62.7%
Taylor expanded in y around inf 66.3%
Final simplification63.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.05e+139) (* a (/ t (+ (+ y x) t))) (if (<= t 7.5e+82) (- (+ z a) b) (* a (/ t (+ x t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.05e+139) {
tmp = a * (t / ((y + x) + t));
} else if (t <= 7.5e+82) {
tmp = (z + a) - b;
} else {
tmp = a * (t / (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 (t <= (-2.05d+139)) then
tmp = a * (t / ((y + x) + t))
else if (t <= 7.5d+82) then
tmp = (z + a) - b
else
tmp = a * (t / (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 (t <= -2.05e+139) {
tmp = a * (t / ((y + x) + t));
} else if (t <= 7.5e+82) {
tmp = (z + a) - b;
} else {
tmp = a * (t / (x + t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.05e+139: tmp = a * (t / ((y + x) + t)) elif t <= 7.5e+82: tmp = (z + a) - b else: tmp = a * (t / (x + t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.05e+139) tmp = Float64(a * Float64(t / Float64(Float64(y + x) + t))); elseif (t <= 7.5e+82) tmp = Float64(Float64(z + a) - b); else tmp = Float64(a * Float64(t / Float64(x + t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.05e+139) tmp = a * (t / ((y + x) + t)); elseif (t <= 7.5e+82) tmp = (z + a) - b; else tmp = a * (t / (x + t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.05e+139], N[(a * N[(t / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.5e+82], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(t / N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.05 \cdot 10^{+139}:\\
\;\;\;\;a \cdot \frac{t}{\left(y + x\right) + t}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+82}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t}{x + t}\\
\end{array}
\end{array}
if t < -2.0500000000000001e139Initial program 45.9%
Taylor expanded in t around inf 21.8%
associate-/l*64.6%
+-commutative64.6%
associate-+r+64.6%
+-commutative64.6%
Applied egg-rr64.6%
if -2.0500000000000001e139 < t < 7.4999999999999999e82Initial program 62.4%
Taylor expanded in y around inf 66.1%
if 7.4999999999999999e82 < t Initial program 49.3%
Taylor expanded in t around inf 29.2%
associate-/l*47.6%
+-commutative47.6%
associate-+r+47.6%
+-commutative47.6%
Applied egg-rr47.6%
Taylor expanded in y around 0 31.1%
associate-/l*54.2%
+-commutative54.2%
Simplified54.2%
Final simplification63.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t -9e+159) a (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -9e+159) {
tmp = a;
} 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 (t <= (-9d+159)) then
tmp = a
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 (t <= -9e+159) {
tmp = a;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -9e+159: tmp = a else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -9e+159) tmp = a; 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 (t <= -9e+159) tmp = a; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -9e+159], a, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+159}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -9.00000000000000053e159Initial program 42.0%
Taylor expanded in t around inf 59.7%
if -9.00000000000000053e159 < t Initial program 59.6%
Taylor expanded in y around inf 61.1%
Final simplification61.0%
(FPCore (x y z t a b) :precision binary64 (if (<= b 8e+235) (+ z a) (- b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 8e+235) {
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 <= 8d+235) 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 <= 8e+235) {
tmp = z + a;
} else {
tmp = -b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 8e+235: tmp = z + a else: tmp = -b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 8e+235) 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 <= 8e+235) tmp = z + a; else tmp = -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 8e+235], N[(z + a), $MachinePrecision], (-b)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8 \cdot 10^{+235}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;-b\\
\end{array}
\end{array}
if b < 8.0000000000000004e235Initial program 58.9%
Taylor expanded in b around 0 48.4%
Taylor expanded in y around inf 58.8%
if 8.0000000000000004e235 < b Initial program 28.9%
Taylor expanded in b around inf 23.3%
mul-1-neg23.3%
associate-/l*76.7%
distribute-rgt-neg-in76.7%
mul-1-neg76.7%
associate-*r/76.7%
neg-mul-176.7%
associate-+r+76.7%
Simplified76.7%
Taylor expanded in y around inf 48.9%
mul-1-neg48.9%
Simplified48.9%
Final simplification58.3%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 57.4%
Taylor expanded in t around inf 33.6%
Final simplification33.6%
(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 2024067
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
:alt
(if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) -3.5813117084150564e+153) (- (+ z a) b) (if (< (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)) 1.2285964308315609e+82) (/ 1.0 (/ (+ (+ x t) y) (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)))) (- (+ z a) b)))
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))