
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ x y) y))
(t_2 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t))))
(t_3 (/ (pow (+ x y) 2.0) y)))
(if (<= t_2 -5e+278)
(- (+ z a) b)
(if (<= t_2 1e+263)
t_2
(+
(- z (/ b t_1))
(fma
t
(- (/ a (+ x y)) (- (+ (/ z (+ x y)) (/ a t_3)) (/ b t_3)))
(/ a t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + y) / y;
double t_2 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double t_3 = pow((x + y), 2.0) / y;
double tmp;
if (t_2 <= -5e+278) {
tmp = (z + a) - b;
} else if (t_2 <= 1e+263) {
tmp = t_2;
} else {
tmp = (z - (b / t_1)) + fma(t, ((a / (x + y)) - (((z / (x + y)) + (a / t_3)) - (b / t_3))), (a / t_1));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + y) / y) t_2 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) t_3 = Float64((Float64(x + y) ^ 2.0) / y) tmp = 0.0 if (t_2 <= -5e+278) tmp = Float64(Float64(z + a) - b); elseif (t_2 <= 1e+263) tmp = t_2; else tmp = Float64(Float64(z - Float64(b / t_1)) + fma(t, Float64(Float64(a / Float64(x + y)) - Float64(Float64(Float64(z / Float64(x + y)) + Float64(a / t_3)) - Float64(b / t_3))), Float64(a / t_1))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[N[(x + y), $MachinePrecision], 2.0], $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+278], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], If[LessEqual[t$95$2, 1e+263], t$95$2, N[(N[(z - N[(b / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[(a / N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(z / N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(a / t$95$3), $MachinePrecision]), $MachinePrecision] - N[(b / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + y}{y}\\
t_2 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
t_3 := \frac{{\left(x + y\right)}^{2}}{y}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+278}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{elif}\;t_2 \leq 10^{+263}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(z - \frac{b}{t_1}\right) + \mathsf{fma}\left(t, \frac{a}{x + y} - \left(\left(\frac{z}{x + y} + \frac{a}{t_3}\right) - \frac{b}{t_3}\right), \frac{a}{t_1}\right)\\
\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)) < -5.00000000000000029e278Initial program 8.5%
Taylor expanded in y around inf 78.7%
if -5.00000000000000029e278 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000002e263Initial program 99.6%
if 1.00000000000000002e263 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 8.0%
associate--l+8.0%
fma-def8.9%
fma-neg9.3%
+-commutative9.3%
distribute-rgt-neg-out9.3%
associate-+l+9.3%
+-commutative9.3%
Simplified9.3%
Taylor expanded in t around 0 29.9%
associate-+r+29.9%
mul-1-neg29.9%
unsub-neg29.9%
associate-/l*30.0%
+-commutative30.0%
fma-def30.0%
Simplified83.5%
Final simplification92.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ (- (+ (* z (+ x y)) (* (+ y t) a)) (* y b)) (+ y (+ x t))))) (if (or (<= t_1 -5e+278) (not (<= t_1 5e+269))) (- (+ z a) b) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -5e+278) || !(t_1 <= 5e+269)) {
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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t))
if ((t_1 <= (-5d+278)) .or. (.not. (t_1 <= 5d+269))) 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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t));
double tmp;
if ((t_1 <= -5e+278) || !(t_1 <= 5e+269)) {
tmp = (z + a) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t)) tmp = 0 if (t_1 <= -5e+278) or not (t_1 <= 5e+269): tmp = (z + a) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(z * Float64(x + y)) + Float64(Float64(y + t) * a)) - Float64(y * b)) / Float64(y + Float64(x + t))) tmp = 0.0 if ((t_1 <= -5e+278) || !(t_1 <= 5e+269)) 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 = (((z * (x + y)) + ((y + t) * a)) - (y * b)) / (y + (x + t)); tmp = 0.0; if ((t_1 <= -5e+278) || ~((t_1 <= 5e+269))) 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[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+278], N[Not[LessEqual[t$95$1, 5e+269]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z \cdot \left(x + y\right) + \left(y + t\right) \cdot a\right) - y \cdot b}{y + \left(x + t\right)}\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+278} \lor \neg \left(t_1 \leq 5 \cdot 10^{+269}\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)) < -5.00000000000000029e278 or 5.0000000000000002e269 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.4%
Taylor expanded in y around inf 78.9%
if -5.00000000000000029e278 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 5.0000000000000002e269Initial program 99.6%
Final simplification91.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ (- (* z (+ x y)) (* y b)) t_1)))
(if (<= y -3.3e-8)
(* (+ a (- z b)) (/ y t_1))
(if (<= y -1.6e-138)
t_2
(if (<= y 2.3e-198)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 1.2e-153)
(- a (/ (* y b) t))
(if (<= y 3.8e-126)
(/ (- (* (+ y t) a) (* y b)) t_1)
(if (or (<= y 9e-16) (not (<= y 6600000000000.0)))
(- (+ z a) b)
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 * (x + y)) - (y * b)) / t_1;
double tmp;
if (y <= -3.3e-8) {
tmp = (a + (z - b)) * (y / t_1);
} else if (y <= -1.6e-138) {
tmp = t_2;
} else if (y <= 2.3e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.2e-153) {
tmp = a - ((y * b) / t);
} else if (y <= 3.8e-126) {
tmp = (((y + t) * a) - (y * b)) / t_1;
} else if ((y <= 9e-16) || !(y <= 6600000000000.0)) {
tmp = (z + a) - b;
} 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 * (x + y)) - (y * b)) / t_1
if (y <= (-3.3d-8)) then
tmp = (a + (z - b)) * (y / t_1)
else if (y <= (-1.6d-138)) then
tmp = t_2
else if (y <= 2.3d-198) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 1.2d-153) then
tmp = a - ((y * b) / t)
else if (y <= 3.8d-126) then
tmp = (((y + t) * a) - (y * b)) / t_1
else if ((y <= 9d-16) .or. (.not. (y <= 6600000000000.0d0))) then
tmp = (z + a) - b
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 * (x + y)) - (y * b)) / t_1;
double tmp;
if (y <= -3.3e-8) {
tmp = (a + (z - b)) * (y / t_1);
} else if (y <= -1.6e-138) {
tmp = t_2;
} else if (y <= 2.3e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.2e-153) {
tmp = a - ((y * b) / t);
} else if (y <= 3.8e-126) {
tmp = (((y + t) * a) - (y * b)) / t_1;
} else if ((y <= 9e-16) || !(y <= 6600000000000.0)) {
tmp = (z + a) - b;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = ((z * (x + y)) - (y * b)) / t_1 tmp = 0 if y <= -3.3e-8: tmp = (a + (z - b)) * (y / t_1) elif y <= -1.6e-138: tmp = t_2 elif y <= 2.3e-198: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 1.2e-153: tmp = a - ((y * b) / t) elif y <= 3.8e-126: tmp = (((y + t) * a) - (y * b)) / t_1 elif (y <= 9e-16) or not (y <= 6600000000000.0): tmp = (z + a) - b 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(Float64(z * Float64(x + y)) - Float64(y * b)) / t_1) tmp = 0.0 if (y <= -3.3e-8) tmp = Float64(Float64(a + Float64(z - b)) * Float64(y / t_1)); elseif (y <= -1.6e-138) tmp = t_2; elseif (y <= 2.3e-198) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 1.2e-153) tmp = Float64(a - Float64(Float64(y * b) / t)); elseif (y <= 3.8e-126) tmp = Float64(Float64(Float64(Float64(y + t) * a) - Float64(y * b)) / t_1); elseif ((y <= 9e-16) || !(y <= 6600000000000.0)) tmp = Float64(Float64(z + a) - b); 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 * (x + y)) - (y * b)) / t_1; tmp = 0.0; if (y <= -3.3e-8) tmp = (a + (z - b)) * (y / t_1); elseif (y <= -1.6e-138) tmp = t_2; elseif (y <= 2.3e-198) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 1.2e-153) tmp = a - ((y * b) / t); elseif (y <= 3.8e-126) tmp = (((y + t) * a) - (y * b)) / t_1; elseif ((y <= 9e-16) || ~((y <= 6600000000000.0))) tmp = (z + a) - b; 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[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[y, -3.3e-8], N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.6e-138], t$95$2, If[LessEqual[y, 2.3e-198], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-153], N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-126], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[Or[LessEqual[y, 9e-16], N[Not[LessEqual[y, 6600000000000.0]], $MachinePrecision]], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{z \cdot \left(x + y\right) - y \cdot b}{t_1}\\
\mathbf{if}\;y \leq -3.3 \cdot 10^{-8}:\\
\;\;\;\;\left(a + \left(z - b\right)\right) \cdot \frac{y}{t_1}\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-138}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-198}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-153}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-126}:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-16} \lor \neg \left(y \leq 6600000000000\right):\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -3.29999999999999977e-8Initial program 52.1%
Taylor expanded in y around inf 45.0%
associate--l+45.0%
Simplified45.0%
expm1-log1p-u24.1%
expm1-udef18.6%
associate-/l*39.2%
+-commutative39.2%
Applied egg-rr39.2%
expm1-def44.5%
expm1-log1p83.6%
associate-/r/84.0%
associate-+r+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+r+84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
if -3.29999999999999977e-8 < y < -1.60000000000000005e-138 or 9.0000000000000003e-16 < y < 6.6e12Initial program 86.1%
Taylor expanded in a around 0 75.0%
+-commutative75.0%
*-commutative75.0%
Simplified75.0%
if -1.60000000000000005e-138 < y < 2.30000000000000013e-198Initial program 80.4%
Taylor expanded in y around 0 72.3%
if 2.30000000000000013e-198 < y < 1.2000000000000001e-153Initial program 53.0%
associate--l+53.0%
fma-def53.0%
fma-neg53.0%
+-commutative53.0%
distribute-rgt-neg-out53.0%
associate-+l+53.0%
+-commutative53.0%
Simplified53.0%
Taylor expanded in t around inf 83.1%
associate-+r+83.1%
associate-+r+83.1%
mul-1-neg83.1%
unsub-neg83.1%
associate-/l*83.3%
associate-/l*83.3%
associate-/l*83.3%
+-commutative83.3%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 99.7%
if 1.2000000000000001e-153 < y < 3.7999999999999999e-126Initial program 99.4%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
Simplified80.9%
if 3.7999999999999999e-126 < y < 9.0000000000000003e-16 or 6.6e12 < y Initial program 46.0%
Taylor expanded in y around inf 80.8%
Final simplification78.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ y t_1)) (t_3 (* (+ a (- z b)) t_2)))
(if (<= y -6.5e-8)
t_3
(if (<= y -1.1e-142)
(/ (- (* z (+ x y)) (* y b)) t_1)
(if (<= y 4.6e-198)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 2.15e-152)
(- a (/ (* y b) t))
(if (<= y 6.9e-128)
(/ (- (* (+ y t) a) (* y b)) t_1)
(if (<= y 5.1e+78) (+ z (* a (+ t_2 (/ t t_1)))) t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = y / t_1;
double t_3 = (a + (z - b)) * t_2;
double tmp;
if (y <= -6.5e-8) {
tmp = t_3;
} else if (y <= -1.1e-142) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (y <= 4.6e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.15e-152) {
tmp = a - ((y * b) / t);
} else if (y <= 6.9e-128) {
tmp = (((y + t) * a) - (y * b)) / t_1;
} else if (y <= 5.1e+78) {
tmp = z + (a * (t_2 + (t / t_1)));
} 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 = y + (x + t)
t_2 = y / t_1
t_3 = (a + (z - b)) * t_2
if (y <= (-6.5d-8)) then
tmp = t_3
else if (y <= (-1.1d-142)) then
tmp = ((z * (x + y)) - (y * b)) / t_1
else if (y <= 4.6d-198) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 2.15d-152) then
tmp = a - ((y * b) / t)
else if (y <= 6.9d-128) then
tmp = (((y + t) * a) - (y * b)) / t_1
else if (y <= 5.1d+78) then
tmp = z + (a * (t_2 + (t / t_1)))
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 = y + (x + t);
double t_2 = y / t_1;
double t_3 = (a + (z - b)) * t_2;
double tmp;
if (y <= -6.5e-8) {
tmp = t_3;
} else if (y <= -1.1e-142) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (y <= 4.6e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.15e-152) {
tmp = a - ((y * b) / t);
} else if (y <= 6.9e-128) {
tmp = (((y + t) * a) - (y * b)) / t_1;
} else if (y <= 5.1e+78) {
tmp = z + (a * (t_2 + (t / t_1)));
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = y / t_1 t_3 = (a + (z - b)) * t_2 tmp = 0 if y <= -6.5e-8: tmp = t_3 elif y <= -1.1e-142: tmp = ((z * (x + y)) - (y * b)) / t_1 elif y <= 4.6e-198: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 2.15e-152: tmp = a - ((y * b) / t) elif y <= 6.9e-128: tmp = (((y + t) * a) - (y * b)) / t_1 elif y <= 5.1e+78: tmp = z + (a * (t_2 + (t / t_1))) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(y / t_1) t_3 = Float64(Float64(a + Float64(z - b)) * t_2) tmp = 0.0 if (y <= -6.5e-8) tmp = t_3; elseif (y <= -1.1e-142) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / t_1); elseif (y <= 4.6e-198) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 2.15e-152) tmp = Float64(a - Float64(Float64(y * b) / t)); elseif (y <= 6.9e-128) tmp = Float64(Float64(Float64(Float64(y + t) * a) - Float64(y * b)) / t_1); elseif (y <= 5.1e+78) tmp = Float64(z + Float64(a * Float64(t_2 + Float64(t / t_1)))); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = y / t_1; t_3 = (a + (z - b)) * t_2; tmp = 0.0; if (y <= -6.5e-8) tmp = t_3; elseif (y <= -1.1e-142) tmp = ((z * (x + y)) - (y * b)) / t_1; elseif (y <= 4.6e-198) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 2.15e-152) tmp = a - ((y * b) / t); elseif (y <= 6.9e-128) tmp = (((y + t) * a) - (y * b)) / t_1; elseif (y <= 5.1e+78) tmp = z + (a * (t_2 + (t / t_1))); else tmp = t_3; 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[(y / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[y, -6.5e-8], t$95$3, If[LessEqual[y, -1.1e-142], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 4.6e-198], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.15e-152], N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.9e-128], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 5.1e+78], N[(z + N[(a * N[(t$95$2 + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{y}{t_1}\\
t_3 := \left(a + \left(z - b\right)\right) \cdot t_2\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{-8}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-142}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-198}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-152}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\mathbf{elif}\;y \leq 6.9 \cdot 10^{-128}:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+78}:\\
\;\;\;\;z + a \cdot \left(t_2 + \frac{t}{t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -6.49999999999999997e-8 or 5.10000000000000031e78 < y Initial program 45.9%
Taylor expanded in y around inf 41.2%
associate--l+41.2%
Simplified41.2%
expm1-log1p-u23.1%
expm1-udef15.3%
associate-/l*37.5%
+-commutative37.5%
Applied egg-rr37.5%
expm1-def44.2%
expm1-log1p87.7%
associate-/r/88.8%
associate-+r+88.8%
+-commutative88.8%
+-commutative88.8%
associate-+r+88.8%
+-commutative88.8%
+-commutative88.8%
Simplified88.8%
if -6.49999999999999997e-8 < y < -1.10000000000000008e-142Initial program 85.1%
Taylor expanded in a around 0 73.9%
+-commutative73.9%
*-commutative73.9%
Simplified73.9%
if -1.10000000000000008e-142 < y < 4.60000000000000027e-198Initial program 80.4%
Taylor expanded in y around 0 72.3%
if 4.60000000000000027e-198 < y < 2.1499999999999999e-152Initial program 53.0%
associate--l+53.0%
fma-def53.0%
fma-neg53.0%
+-commutative53.0%
distribute-rgt-neg-out53.0%
associate-+l+53.0%
+-commutative53.0%
Simplified53.0%
Taylor expanded in t around inf 83.1%
associate-+r+83.1%
associate-+r+83.1%
mul-1-neg83.1%
unsub-neg83.1%
associate-/l*83.3%
associate-/l*83.3%
associate-/l*83.3%
+-commutative83.3%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 99.7%
if 2.1499999999999999e-152 < y < 6.8999999999999997e-128Initial program 99.4%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
Simplified80.9%
if 6.8999999999999997e-128 < y < 5.10000000000000031e78Initial program 64.1%
Taylor expanded in a around 0 86.4%
associate--l+86.4%
+-commutative86.4%
associate-+r+86.4%
associate-+r+86.4%
div-sub86.4%
+-commutative86.4%
*-commutative86.4%
associate-+r+86.4%
Simplified86.4%
Taylor expanded in x around inf 70.1%
Final simplification79.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (* (+ y t) a)))
(if (<= y -3.6e-9)
(* (+ a (- z b)) (/ y t_1))
(if (<= y -4.7e-140)
(/ (- (* z (+ x y)) (* y b)) t_1)
(if (<= y 1.55e-198)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 9.5e-154)
(- a (/ (* y b) t))
(if (<= y 5.5e-128)
(/ (- t_2 (* y b)) t_1)
(if (<= y 2.6e-92)
(/ (- (+ t_2 (* y z)) (* y b)) (+ y t))
(- (+ z a) b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (y + t) * a;
double tmp;
if (y <= -3.6e-9) {
tmp = (a + (z - b)) * (y / t_1);
} else if (y <= -4.7e-140) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (y <= 1.55e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 9.5e-154) {
tmp = a - ((y * b) / t);
} else if (y <= 5.5e-128) {
tmp = (t_2 - (y * b)) / t_1;
} else if (y <= 2.6e-92) {
tmp = ((t_2 + (y * z)) - (y * b)) / (y + 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (y + t) * a
if (y <= (-3.6d-9)) then
tmp = (a + (z - b)) * (y / t_1)
else if (y <= (-4.7d-140)) then
tmp = ((z * (x + y)) - (y * b)) / t_1
else if (y <= 1.55d-198) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 9.5d-154) then
tmp = a - ((y * b) / t)
else if (y <= 5.5d-128) then
tmp = (t_2 - (y * b)) / t_1
else if (y <= 2.6d-92) then
tmp = ((t_2 + (y * z)) - (y * b)) / (y + 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 t_1 = y + (x + t);
double t_2 = (y + t) * a;
double tmp;
if (y <= -3.6e-9) {
tmp = (a + (z - b)) * (y / t_1);
} else if (y <= -4.7e-140) {
tmp = ((z * (x + y)) - (y * b)) / t_1;
} else if (y <= 1.55e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 9.5e-154) {
tmp = a - ((y * b) / t);
} else if (y <= 5.5e-128) {
tmp = (t_2 - (y * b)) / t_1;
} else if (y <= 2.6e-92) {
tmp = ((t_2 + (y * z)) - (y * b)) / (y + t);
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (y + t) * a tmp = 0 if y <= -3.6e-9: tmp = (a + (z - b)) * (y / t_1) elif y <= -4.7e-140: tmp = ((z * (x + y)) - (y * b)) / t_1 elif y <= 1.55e-198: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 9.5e-154: tmp = a - ((y * b) / t) elif y <= 5.5e-128: tmp = (t_2 - (y * b)) / t_1 elif y <= 2.6e-92: tmp = ((t_2 + (y * z)) - (y * b)) / (y + t) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(y + t) * a) tmp = 0.0 if (y <= -3.6e-9) tmp = Float64(Float64(a + Float64(z - b)) * Float64(y / t_1)); elseif (y <= -4.7e-140) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(y * b)) / t_1); elseif (y <= 1.55e-198) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 9.5e-154) tmp = Float64(a - Float64(Float64(y * b) / t)); elseif (y <= 5.5e-128) tmp = Float64(Float64(t_2 - Float64(y * b)) / t_1); elseif (y <= 2.6e-92) tmp = Float64(Float64(Float64(t_2 + Float64(y * z)) - Float64(y * b)) / Float64(y + t)); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (y + t) * a; tmp = 0.0; if (y <= -3.6e-9) tmp = (a + (z - b)) * (y / t_1); elseif (y <= -4.7e-140) tmp = ((z * (x + y)) - (y * b)) / t_1; elseif (y <= 1.55e-198) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 9.5e-154) tmp = a - ((y * b) / t); elseif (y <= 5.5e-128) tmp = (t_2 - (y * b)) / t_1; elseif (y <= 2.6e-92) tmp = ((t_2 + (y * z)) - (y * b)) / (y + t); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[y, -3.6e-9], N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.7e-140], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 1.55e-198], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e-154], N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-128], N[(N[(t$95$2 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 2.6e-92], N[(N[(N[(t$95$2 + N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(y + t), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(y + t\right) \cdot a\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;\left(a + \left(z - b\right)\right) \cdot \frac{y}{t_1}\\
\mathbf{elif}\;y \leq -4.7 \cdot 10^{-140}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-198}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-154}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-128}:\\
\;\;\;\;\frac{t_2 - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-92}:\\
\;\;\;\;\frac{\left(t_2 + y \cdot z\right) - y \cdot b}{y + t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if y < -3.6e-9Initial program 52.1%
Taylor expanded in y around inf 45.0%
associate--l+45.0%
Simplified45.0%
expm1-log1p-u24.1%
expm1-udef18.6%
associate-/l*39.2%
+-commutative39.2%
Applied egg-rr39.2%
expm1-def44.5%
expm1-log1p83.6%
associate-/r/84.0%
associate-+r+84.0%
+-commutative84.0%
+-commutative84.0%
associate-+r+84.0%
+-commutative84.0%
+-commutative84.0%
Simplified84.0%
if -3.6e-9 < y < -4.70000000000000046e-140Initial program 85.1%
Taylor expanded in a around 0 73.9%
+-commutative73.9%
*-commutative73.9%
Simplified73.9%
if -4.70000000000000046e-140 < y < 1.5499999999999999e-198Initial program 80.4%
Taylor expanded in y around 0 72.3%
if 1.5499999999999999e-198 < y < 9.50000000000000057e-154Initial program 53.0%
associate--l+53.0%
fma-def53.0%
fma-neg53.0%
+-commutative53.0%
distribute-rgt-neg-out53.0%
associate-+l+53.0%
+-commutative53.0%
Simplified53.0%
Taylor expanded in t around inf 83.1%
associate-+r+83.1%
associate-+r+83.1%
mul-1-neg83.1%
unsub-neg83.1%
associate-/l*83.3%
associate-/l*83.3%
associate-/l*83.3%
+-commutative83.3%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 99.7%
if 9.50000000000000057e-154 < y < 5.5000000000000004e-128Initial program 99.4%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
Simplified80.9%
if 5.5000000000000004e-128 < y < 2.6e-92Initial program 78.6%
Taylor expanded in x around 0 78.8%
if 2.6e-92 < y Initial program 47.2%
Taylor expanded in y around inf 79.7%
Final simplification78.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))))
(if (<= y -1.85e-138)
(* (+ a (- z b)) (/ y t_1))
(if (<= y 3.4e-198)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 1.8e-154)
(- a (/ (* y b) t))
(if (<= y 3.45e-127)
(/ (- (* (+ y t) a) (* y b)) t_1)
(if (<= y 2.85e-120)
z
(if (<= y 2.4e-92) (- a (/ (* y (- b z)) t)) (- (+ z a) b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double tmp;
if (y <= -1.85e-138) {
tmp = (a + (z - b)) * (y / t_1);
} else if (y <= 3.4e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.8e-154) {
tmp = a - ((y * b) / t);
} else if (y <= 3.45e-127) {
tmp = (((y + t) * a) - (y * b)) / t_1;
} else if (y <= 2.85e-120) {
tmp = z;
} else if (y <= 2.4e-92) {
tmp = a - ((y * (b - z)) / 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) :: t_1
real(8) :: tmp
t_1 = y + (x + t)
if (y <= (-1.85d-138)) then
tmp = (a + (z - b)) * (y / t_1)
else if (y <= 3.4d-198) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 1.8d-154) then
tmp = a - ((y * b) / t)
else if (y <= 3.45d-127) then
tmp = (((y + t) * a) - (y * b)) / t_1
else if (y <= 2.85d-120) then
tmp = z
else if (y <= 2.4d-92) then
tmp = a - ((y * (b - z)) / 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 t_1 = y + (x + t);
double tmp;
if (y <= -1.85e-138) {
tmp = (a + (z - b)) * (y / t_1);
} else if (y <= 3.4e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.8e-154) {
tmp = a - ((y * b) / t);
} else if (y <= 3.45e-127) {
tmp = (((y + t) * a) - (y * b)) / t_1;
} else if (y <= 2.85e-120) {
tmp = z;
} else if (y <= 2.4e-92) {
tmp = a - ((y * (b - z)) / t);
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) tmp = 0 if y <= -1.85e-138: tmp = (a + (z - b)) * (y / t_1) elif y <= 3.4e-198: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 1.8e-154: tmp = a - ((y * b) / t) elif y <= 3.45e-127: tmp = (((y + t) * a) - (y * b)) / t_1 elif y <= 2.85e-120: tmp = z elif y <= 2.4e-92: tmp = a - ((y * (b - z)) / t) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) tmp = 0.0 if (y <= -1.85e-138) tmp = Float64(Float64(a + Float64(z - b)) * Float64(y / t_1)); elseif (y <= 3.4e-198) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 1.8e-154) tmp = Float64(a - Float64(Float64(y * b) / t)); elseif (y <= 3.45e-127) tmp = Float64(Float64(Float64(Float64(y + t) * a) - Float64(y * b)) / t_1); elseif (y <= 2.85e-120) tmp = z; elseif (y <= 2.4e-92) tmp = Float64(a - Float64(Float64(y * Float64(b - z)) / t)); else tmp = Float64(Float64(z + a) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); tmp = 0.0; if (y <= -1.85e-138) tmp = (a + (z - b)) * (y / t_1); elseif (y <= 3.4e-198) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 1.8e-154) tmp = a - ((y * b) / t); elseif (y <= 3.45e-127) tmp = (((y + t) * a) - (y * b)) / t_1; elseif (y <= 2.85e-120) tmp = z; elseif (y <= 2.4e-92) tmp = a - ((y * (b - z)) / t); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e-138], N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-198], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-154], N[(a - N[(N[(y * b), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.45e-127], N[(N[(N[(N[(y + t), $MachinePrecision] * a), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y, 2.85e-120], z, If[LessEqual[y, 2.4e-92], N[(a - N[(N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{-138}:\\
\;\;\;\;\left(a + \left(z - b\right)\right) \cdot \frac{y}{t_1}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-198}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-154}:\\
\;\;\;\;a - \frac{y \cdot b}{t}\\
\mathbf{elif}\;y \leq 3.45 \cdot 10^{-127}:\\
\;\;\;\;\frac{\left(y + t\right) \cdot a - y \cdot b}{t_1}\\
\mathbf{elif}\;y \leq 2.85 \cdot 10^{-120}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-92}:\\
\;\;\;\;a - \frac{y \cdot \left(b - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if y < -1.84999999999999995e-138Initial program 62.1%
Taylor expanded in y around inf 46.7%
associate--l+46.7%
Simplified46.7%
expm1-log1p-u27.0%
expm1-udef19.8%
associate-/l*33.6%
+-commutative33.6%
Applied egg-rr33.6%
expm1-def40.7%
expm1-log1p72.0%
associate-/r/74.0%
associate-+r+74.0%
+-commutative74.0%
+-commutative74.0%
associate-+r+74.0%
+-commutative74.0%
+-commutative74.0%
Simplified74.0%
if -1.84999999999999995e-138 < y < 3.3999999999999998e-198Initial program 80.4%
Taylor expanded in y around 0 72.3%
if 3.3999999999999998e-198 < y < 1.8000000000000001e-154Initial program 53.0%
associate--l+53.0%
fma-def53.0%
fma-neg53.0%
+-commutative53.0%
distribute-rgt-neg-out53.0%
associate-+l+53.0%
+-commutative53.0%
Simplified53.0%
Taylor expanded in t around inf 83.1%
associate-+r+83.1%
associate-+r+83.1%
mul-1-neg83.1%
unsub-neg83.1%
associate-/l*83.3%
associate-/l*83.3%
associate-/l*83.3%
+-commutative83.3%
associate-/l*100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 99.7%
if 1.8000000000000001e-154 < y < 3.45000000000000008e-127Initial program 99.4%
Taylor expanded in z around 0 80.9%
*-commutative80.9%
Simplified80.9%
if 3.45000000000000008e-127 < y < 2.85000000000000015e-120Initial program 68.3%
Taylor expanded in x around inf 75.6%
if 2.85000000000000015e-120 < y < 2.4000000000000001e-92Initial program 83.8%
associate--l+83.8%
fma-def83.8%
fma-neg83.8%
+-commutative83.8%
distribute-rgt-neg-out83.8%
associate-+l+83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in t around inf 84.4%
associate-+r+84.4%
associate-+r+84.4%
mul-1-neg84.4%
unsub-neg84.4%
associate-/l*84.2%
associate-/l*84.2%
associate-/l*84.2%
+-commutative84.2%
associate-/l*84.2%
+-commutative84.2%
Simplified84.2%
Taylor expanded in x around 0 83.4%
Taylor expanded in b around 0 83.4%
mul-1-neg83.4%
associate-/l*67.8%
+-commutative67.8%
associate-/l*83.4%
sub-neg83.4%
*-commutative83.4%
div-sub83.4%
distribute-lft-out--83.4%
Simplified83.4%
if 2.4000000000000001e-92 < y Initial program 47.2%
Taylor expanded in y around inf 79.7%
Final simplification76.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (/ z (/ t_1 (+ x y)))) (t_3 (- (+ z a) b)))
(if (<= y -6.1e-59)
t_3
(if (<= y -5.5e-253)
t_2
(if (<= y -5.8e-269)
(/ a (/ t_1 (+ y t)))
(if (<= y 1.5e-210)
t_2
(if (<= y 2.3e-92) (- a (/ (* y (- b z)) t)) t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = z / (t_1 / (x + y));
double t_3 = (z + a) - b;
double tmp;
if (y <= -6.1e-59) {
tmp = t_3;
} else if (y <= -5.5e-253) {
tmp = t_2;
} else if (y <= -5.8e-269) {
tmp = a / (t_1 / (y + t));
} else if (y <= 1.5e-210) {
tmp = t_2;
} else if (y <= 2.3e-92) {
tmp = a - ((y * (b - z)) / t);
} 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 = y + (x + t)
t_2 = z / (t_1 / (x + y))
t_3 = (z + a) - b
if (y <= (-6.1d-59)) then
tmp = t_3
else if (y <= (-5.5d-253)) then
tmp = t_2
else if (y <= (-5.8d-269)) then
tmp = a / (t_1 / (y + t))
else if (y <= 1.5d-210) then
tmp = t_2
else if (y <= 2.3d-92) then
tmp = a - ((y * (b - z)) / t)
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 = y + (x + t);
double t_2 = z / (t_1 / (x + y));
double t_3 = (z + a) - b;
double tmp;
if (y <= -6.1e-59) {
tmp = t_3;
} else if (y <= -5.5e-253) {
tmp = t_2;
} else if (y <= -5.8e-269) {
tmp = a / (t_1 / (y + t));
} else if (y <= 1.5e-210) {
tmp = t_2;
} else if (y <= 2.3e-92) {
tmp = a - ((y * (b - z)) / t);
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = z / (t_1 / (x + y)) t_3 = (z + a) - b tmp = 0 if y <= -6.1e-59: tmp = t_3 elif y <= -5.5e-253: tmp = t_2 elif y <= -5.8e-269: tmp = a / (t_1 / (y + t)) elif y <= 1.5e-210: tmp = t_2 elif y <= 2.3e-92: tmp = a - ((y * (b - z)) / t) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(z / Float64(t_1 / Float64(x + y))) t_3 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -6.1e-59) tmp = t_3; elseif (y <= -5.5e-253) tmp = t_2; elseif (y <= -5.8e-269) tmp = Float64(a / Float64(t_1 / Float64(y + t))); elseif (y <= 1.5e-210) tmp = t_2; elseif (y <= 2.3e-92) tmp = Float64(a - Float64(Float64(y * Float64(b - z)) / t)); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = z / (t_1 / (x + y)); t_3 = (z + a) - b; tmp = 0.0; if (y <= -6.1e-59) tmp = t_3; elseif (y <= -5.5e-253) tmp = t_2; elseif (y <= -5.8e-269) tmp = a / (t_1 / (y + t)); elseif (y <= 1.5e-210) tmp = t_2; elseif (y <= 2.3e-92) tmp = a - ((y * (b - z)) / t); else tmp = t_3; 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[(z / N[(t$95$1 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.1e-59], t$95$3, If[LessEqual[y, -5.5e-253], t$95$2, If[LessEqual[y, -5.8e-269], N[(a / N[(t$95$1 / N[(y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-210], t$95$2, If[LessEqual[y, 2.3e-92], N[(a - N[(N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \frac{z}{\frac{t_1}{x + y}}\\
t_3 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -6.1 \cdot 10^{-59}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-253}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{-269}:\\
\;\;\;\;\frac{a}{\frac{t_1}{y + t}}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-210}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-92}:\\
\;\;\;\;a - \frac{y \cdot \left(b - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if y < -6.0999999999999996e-59 or 2.30000000000000016e-92 < y Initial program 51.5%
Taylor expanded in y around inf 76.0%
if -6.0999999999999996e-59 < y < -5.49999999999999974e-253 or -5.8000000000000002e-269 < y < 1.5000000000000001e-210Initial program 80.3%
Taylor expanded in z around inf 40.3%
associate-/l*53.7%
associate-+r+53.7%
+-commutative53.7%
Simplified53.7%
if -5.49999999999999974e-253 < y < -5.8000000000000002e-269Initial program 83.9%
Taylor expanded in a around inf 83.9%
associate-/l*99.7%
associate-+r+99.7%
Simplified99.7%
if 1.5000000000000001e-210 < y < 2.30000000000000016e-92Initial program 80.8%
associate--l+80.8%
fma-def80.8%
fma-neg80.8%
+-commutative80.8%
distribute-rgt-neg-out80.8%
associate-+l+80.8%
+-commutative80.8%
Simplified80.8%
Taylor expanded in t around inf 57.2%
associate-+r+57.2%
associate-+r+57.2%
mul-1-neg57.2%
unsub-neg57.2%
associate-/l*57.2%
associate-/l*57.2%
associate-/l*57.2%
+-commutative57.2%
associate-/l*61.2%
+-commutative61.2%
Simplified61.2%
Taylor expanded in x around 0 61.7%
Taylor expanded in b around 0 61.7%
mul-1-neg61.7%
associate-/l*58.0%
+-commutative58.0%
associate-/l*61.7%
sub-neg61.7%
*-commutative61.7%
div-sub61.7%
distribute-lft-out--61.7%
Simplified61.7%
Final simplification68.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (+ x t))) (t_2 (- (+ z a) b)))
(if (<= y -1.9e+85)
(* (+ a (- z b)) (/ y t_1))
(if (<= y 12500000000000.0)
(/ (+ (* t a) (+ (* x z) (* y t_2))) t_1)
t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.9e+85) {
tmp = (a + (z - b)) * (y / t_1);
} else if (y <= 12500000000000.0) {
tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + (x + t)
t_2 = (z + a) - b
if (y <= (-1.9d+85)) then
tmp = (a + (z - b)) * (y / t_1)
else if (y <= 12500000000000.0d0) then
tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (x + t);
double t_2 = (z + a) - b;
double tmp;
if (y <= -1.9e+85) {
tmp = (a + (z - b)) * (y / t_1);
} else if (y <= 12500000000000.0) {
tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (x + t) t_2 = (z + a) - b tmp = 0 if y <= -1.9e+85: tmp = (a + (z - b)) * (y / t_1) elif y <= 12500000000000.0: tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(x + t)) t_2 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -1.9e+85) tmp = Float64(Float64(a + Float64(z - b)) * Float64(y / t_1)); elseif (y <= 12500000000000.0) tmp = Float64(Float64(Float64(t * a) + Float64(Float64(x * z) + Float64(y * t_2))) / t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (x + t); t_2 = (z + a) - b; tmp = 0.0; if (y <= -1.9e+85) tmp = (a + (z - b)) * (y / t_1); elseif (y <= 12500000000000.0) tmp = ((t * a) + ((x * z) + (y * t_2))) / t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.9e+85], N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 12500000000000.0], N[(N[(N[(t * a), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] + N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + \left(x + t\right)\\
t_2 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+85}:\\
\;\;\;\;\left(a + \left(z - b\right)\right) \cdot \frac{y}{t_1}\\
\mathbf{elif}\;y \leq 12500000000000:\\
\;\;\;\;\frac{t \cdot a + \left(x \cdot z + y \cdot t_2\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.89999999999999996e85Initial program 36.3%
Taylor expanded in y around inf 32.4%
associate--l+32.4%
Simplified32.4%
expm1-log1p-u19.6%
expm1-udef14.6%
associate-/l*44.4%
+-commutative44.4%
Applied egg-rr44.4%
expm1-def49.3%
expm1-log1p90.0%
associate-/r/90.2%
associate-+r+90.2%
+-commutative90.2%
+-commutative90.2%
associate-+r+90.2%
+-commutative90.2%
+-commutative90.2%
Simplified90.2%
if -1.89999999999999996e85 < y < 1.25e13Initial program 80.2%
Taylor expanded in y around 0 80.2%
if 1.25e13 < y Initial program 37.1%
Taylor expanded in y around inf 86.2%
Final simplification83.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)) (t_2 (- a (/ (* y (- b z)) t))))
(if (<= t -1.6e+162)
t_2
(if (<= t -1.9e+78)
t_1
(if (<= t -2.5e+27)
t_2
(if (<= t 1.95e+229) t_1 (/ z (/ t (+ x y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a - ((y * (b - z)) / t);
double tmp;
if (t <= -1.6e+162) {
tmp = t_2;
} else if (t <= -1.9e+78) {
tmp = t_1;
} else if (t <= -2.5e+27) {
tmp = t_2;
} else if (t <= 1.95e+229) {
tmp = t_1;
} else {
tmp = z / (t / (x + y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z + a) - b
t_2 = a - ((y * (b - z)) / t)
if (t <= (-1.6d+162)) then
tmp = t_2
else if (t <= (-1.9d+78)) then
tmp = t_1
else if (t <= (-2.5d+27)) then
tmp = t_2
else if (t <= 1.95d+229) then
tmp = t_1
else
tmp = z / (t / (x + y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double t_2 = a - ((y * (b - z)) / t);
double tmp;
if (t <= -1.6e+162) {
tmp = t_2;
} else if (t <= -1.9e+78) {
tmp = t_1;
} else if (t <= -2.5e+27) {
tmp = t_2;
} else if (t <= 1.95e+229) {
tmp = t_1;
} else {
tmp = z / (t / (x + y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b t_2 = a - ((y * (b - z)) / t) tmp = 0 if t <= -1.6e+162: tmp = t_2 elif t <= -1.9e+78: tmp = t_1 elif t <= -2.5e+27: tmp = t_2 elif t <= 1.95e+229: tmp = t_1 else: tmp = z / (t / (x + y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) t_2 = Float64(a - Float64(Float64(y * Float64(b - z)) / t)) tmp = 0.0 if (t <= -1.6e+162) tmp = t_2; elseif (t <= -1.9e+78) tmp = t_1; elseif (t <= -2.5e+27) tmp = t_2; elseif (t <= 1.95e+229) tmp = t_1; else tmp = Float64(z / Float64(t / Float64(x + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; t_2 = a - ((y * (b - z)) / t); tmp = 0.0; if (t <= -1.6e+162) tmp = t_2; elseif (t <= -1.9e+78) tmp = t_1; elseif (t <= -2.5e+27) tmp = t_2; elseif (t <= 1.95e+229) tmp = t_1; else tmp = z / (t / (x + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(a - N[(N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e+162], t$95$2, If[LessEqual[t, -1.9e+78], t$95$1, If[LessEqual[t, -2.5e+27], t$95$2, If[LessEqual[t, 1.95e+229], t$95$1, N[(z / N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
t_2 := a - \frac{y \cdot \left(b - z\right)}{t}\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+162}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.5 \cdot 10^{+27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+229}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{x + y}}\\
\end{array}
\end{array}
if t < -1.6000000000000001e162 or -1.9e78 < t < -2.4999999999999999e27Initial program 57.0%
associate--l+57.0%
fma-def56.9%
fma-neg56.9%
+-commutative56.9%
distribute-rgt-neg-out56.9%
associate-+l+56.9%
+-commutative56.9%
Simplified56.9%
Taylor expanded in t around inf 69.4%
associate-+r+69.4%
associate-+r+69.4%
mul-1-neg69.4%
unsub-neg69.4%
associate-/l*71.7%
associate-/l*71.7%
associate-/l*73.4%
+-commutative73.4%
associate-/l*83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in x around 0 71.2%
Taylor expanded in b around 0 71.2%
mul-1-neg71.2%
associate-/l*69.7%
+-commutative69.7%
associate-/l*71.2%
sub-neg71.2%
*-commutative71.2%
div-sub71.2%
distribute-lft-out--71.2%
Simplified71.2%
if -1.6000000000000001e162 < t < -1.9e78 or -2.4999999999999999e27 < t < 1.9499999999999999e229Initial program 67.1%
Taylor expanded in y around inf 63.7%
if 1.9499999999999999e229 < t Initial program 35.6%
associate--l+35.6%
fma-def36.2%
fma-neg36.2%
+-commutative36.2%
distribute-rgt-neg-out36.2%
associate-+l+36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in t around inf 18.7%
associate-+r+18.7%
associate-+r+18.7%
mul-1-neg18.7%
unsub-neg18.7%
associate-/l*18.7%
associate-/l*18.7%
associate-/l*58.5%
+-commutative58.5%
associate-/l*66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in z around -inf 11.9%
associate-/l*51.7%
+-commutative51.7%
Simplified51.7%
Final simplification64.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z a) b)))
(if (<= y -9.5e-57)
t_1
(if (<= y 4.6e-198)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 2.05e-92) (- a (/ (* y (- b z)) t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -9.5e-57) {
tmp = t_1;
} else if (y <= 4.6e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.05e-92) {
tmp = a - ((y * (b - z)) / t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z + a) - b
if (y <= (-9.5d-57)) then
tmp = t_1
else if (y <= 4.6d-198) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 2.05d-92) then
tmp = a - ((y * (b - z)) / t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + a) - b;
double tmp;
if (y <= -9.5e-57) {
tmp = t_1;
} else if (y <= 4.6e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 2.05e-92) {
tmp = a - ((y * (b - z)) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z + a) - b tmp = 0 if y <= -9.5e-57: tmp = t_1 elif y <= 4.6e-198: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 2.05e-92: tmp = a - ((y * (b - z)) / t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + a) - b) tmp = 0.0 if (y <= -9.5e-57) tmp = t_1; elseif (y <= 4.6e-198) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 2.05e-92) tmp = Float64(a - Float64(Float64(y * Float64(b - z)) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z + a) - b; tmp = 0.0; if (y <= -9.5e-57) tmp = t_1; elseif (y <= 4.6e-198) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 2.05e-92) tmp = a - ((y * (b - z)) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -9.5e-57], t$95$1, If[LessEqual[y, 4.6e-198], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.05e-92], N[(a - N[(N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + a\right) - b\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{-57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-198}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-92}:\\
\;\;\;\;a - \frac{y \cdot \left(b - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -9.5000000000000005e-57 or 2.0500000000000001e-92 < y Initial program 51.2%
Taylor expanded in y around inf 76.2%
if -9.5000000000000005e-57 < y < 4.60000000000000027e-198Initial program 81.9%
Taylor expanded in y around 0 66.9%
if 4.60000000000000027e-198 < y < 2.0500000000000001e-92Initial program 76.1%
associate--l+76.1%
fma-def76.1%
fma-neg76.1%
+-commutative76.1%
distribute-rgt-neg-out76.1%
associate-+l+76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in t around inf 56.2%
associate-+r+56.2%
associate-+r+56.2%
mul-1-neg56.2%
unsub-neg56.2%
associate-/l*56.2%
associate-/l*56.2%
associate-/l*56.2%
+-commutative56.2%
associate-/l*61.2%
+-commutative61.2%
Simplified61.2%
Taylor expanded in x around 0 61.2%
Taylor expanded in b around 0 61.2%
mul-1-neg61.2%
associate-/l*56.5%
+-commutative56.5%
associate-/l*61.2%
sub-neg61.2%
*-commutative61.2%
div-sub61.2%
distribute-lft-out--61.2%
Simplified61.2%
Final simplification71.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.85e-138)
(* (+ a (- z b)) (/ y (+ y (+ x t))))
(if (<= y 3.4e-198)
(/ (+ (* t a) (* x z)) (+ x t))
(if (<= y 1.7e-92) (- a (/ (* y (- b z)) t)) (- (+ z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.85e-138) {
tmp = (a + (z - b)) * (y / (y + (x + t)));
} else if (y <= 3.4e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.7e-92) {
tmp = a - ((y * (b - z)) / 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 (y <= (-1.85d-138)) then
tmp = (a + (z - b)) * (y / (y + (x + t)))
else if (y <= 3.4d-198) then
tmp = ((t * a) + (x * z)) / (x + t)
else if (y <= 1.7d-92) then
tmp = a - ((y * (b - z)) / 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 (y <= -1.85e-138) {
tmp = (a + (z - b)) * (y / (y + (x + t)));
} else if (y <= 3.4e-198) {
tmp = ((t * a) + (x * z)) / (x + t);
} else if (y <= 1.7e-92) {
tmp = a - ((y * (b - z)) / t);
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.85e-138: tmp = (a + (z - b)) * (y / (y + (x + t))) elif y <= 3.4e-198: tmp = ((t * a) + (x * z)) / (x + t) elif y <= 1.7e-92: tmp = a - ((y * (b - z)) / t) else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.85e-138) tmp = Float64(Float64(a + Float64(z - b)) * Float64(y / Float64(y + Float64(x + t)))); elseif (y <= 3.4e-198) tmp = Float64(Float64(Float64(t * a) + Float64(x * z)) / Float64(x + t)); elseif (y <= 1.7e-92) tmp = Float64(a - Float64(Float64(y * Float64(b - z)) / 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 (y <= -1.85e-138) tmp = (a + (z - b)) * (y / (y + (x + t))); elseif (y <= 3.4e-198) tmp = ((t * a) + (x * z)) / (x + t); elseif (y <= 1.7e-92) tmp = a - ((y * (b - z)) / t); else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.85e-138], N[(N[(a + N[(z - b), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + N[(x + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-198], N[(N[(N[(t * a), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(x + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e-92], N[(a - N[(N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-138}:\\
\;\;\;\;\left(a + \left(z - b\right)\right) \cdot \frac{y}{y + \left(x + t\right)}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-198}:\\
\;\;\;\;\frac{t \cdot a + x \cdot z}{x + t}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-92}:\\
\;\;\;\;a - \frac{y \cdot \left(b - z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if y < -1.84999999999999995e-138Initial program 62.1%
Taylor expanded in y around inf 46.7%
associate--l+46.7%
Simplified46.7%
expm1-log1p-u27.0%
expm1-udef19.8%
associate-/l*33.6%
+-commutative33.6%
Applied egg-rr33.6%
expm1-def40.7%
expm1-log1p72.0%
associate-/r/74.0%
associate-+r+74.0%
+-commutative74.0%
+-commutative74.0%
associate-+r+74.0%
+-commutative74.0%
+-commutative74.0%
Simplified74.0%
if -1.84999999999999995e-138 < y < 3.3999999999999998e-198Initial program 80.4%
Taylor expanded in y around 0 72.3%
if 3.3999999999999998e-198 < y < 1.7000000000000001e-92Initial program 76.1%
associate--l+76.1%
fma-def76.1%
fma-neg76.1%
+-commutative76.1%
distribute-rgt-neg-out76.1%
associate-+l+76.1%
+-commutative76.1%
Simplified76.1%
Taylor expanded in t around inf 56.2%
associate-+r+56.2%
associate-+r+56.2%
mul-1-neg56.2%
unsub-neg56.2%
associate-/l*56.2%
associate-/l*56.2%
associate-/l*56.2%
+-commutative56.2%
associate-/l*61.2%
+-commutative61.2%
Simplified61.2%
Taylor expanded in x around 0 61.2%
Taylor expanded in b around 0 61.2%
mul-1-neg61.2%
associate-/l*56.5%
+-commutative56.5%
associate-/l*61.2%
sub-neg61.2%
*-commutative61.2%
div-sub61.2%
distribute-lft-out--61.2%
Simplified61.2%
if 1.7000000000000001e-92 < y Initial program 47.2%
Taylor expanded in y around inf 79.7%
Final simplification74.2%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.62e+162) a (if (<= t 1.7e+229) (- (+ z a) b) (* (+ x y) (/ z t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.62e+162) {
tmp = a;
} else if (t <= 1.7e+229) {
tmp = (z + a) - b;
} else {
tmp = (x + y) * (z / 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 <= (-1.62d+162)) then
tmp = a
else if (t <= 1.7d+229) then
tmp = (z + a) - b
else
tmp = (x + y) * (z / 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 <= -1.62e+162) {
tmp = a;
} else if (t <= 1.7e+229) {
tmp = (z + a) - b;
} else {
tmp = (x + y) * (z / t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.62e+162: tmp = a elif t <= 1.7e+229: tmp = (z + a) - b else: tmp = (x + y) * (z / t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.62e+162) tmp = a; elseif (t <= 1.7e+229) tmp = Float64(Float64(z + a) - b); else tmp = Float64(Float64(x + y) * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.62e+162) tmp = a; elseif (t <= 1.7e+229) tmp = (z + a) - b; else tmp = (x + y) * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.62e+162], a, If[LessEqual[t, 1.7e+229], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(N[(x + y), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.62 \cdot 10^{+162}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+229}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) \cdot \frac{z}{t}\\
\end{array}
\end{array}
if t < -1.62000000000000005e162Initial program 46.4%
Taylor expanded in t around inf 66.9%
if -1.62000000000000005e162 < t < 1.7e229Initial program 68.0%
Taylor expanded in y around inf 61.4%
if 1.7e229 < t Initial program 35.6%
associate--l+35.6%
fma-def36.2%
fma-neg36.2%
+-commutative36.2%
distribute-rgt-neg-out36.2%
associate-+l+36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in t around inf 18.7%
associate-+r+18.7%
associate-+r+18.7%
mul-1-neg18.7%
unsub-neg18.7%
associate-/l*18.7%
associate-/l*18.7%
associate-/l*58.5%
+-commutative58.5%
associate-/l*66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in z around -inf 11.9%
associate-/l*51.7%
+-commutative51.7%
Simplified51.7%
associate-/r/51.1%
Applied egg-rr51.1%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.2e+162) a (if (<= t 1.06e+229) (- (+ z a) b) (/ z (/ t (+ x y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e+162) {
tmp = a;
} else if (t <= 1.06e+229) {
tmp = (z + a) - b;
} else {
tmp = z / (t / (x + y));
}
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.2d+162)) then
tmp = a
else if (t <= 1.06d+229) then
tmp = (z + a) - b
else
tmp = z / (t / (x + y))
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.2e+162) {
tmp = a;
} else if (t <= 1.06e+229) {
tmp = (z + a) - b;
} else {
tmp = z / (t / (x + y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.2e+162: tmp = a elif t <= 1.06e+229: tmp = (z + a) - b else: tmp = z / (t / (x + y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.2e+162) tmp = a; elseif (t <= 1.06e+229) tmp = Float64(Float64(z + a) - b); else tmp = Float64(z / Float64(t / Float64(x + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.2e+162) tmp = a; elseif (t <= 1.06e+229) tmp = (z + a) - b; else tmp = z / (t / (x + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.2e+162], a, If[LessEqual[t, 1.06e+229], N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision], N[(z / N[(t / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+162}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 1.06 \cdot 10^{+229}:\\
\;\;\;\;\left(z + a\right) - b\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{x + y}}\\
\end{array}
\end{array}
if t < -3.2000000000000001e162Initial program 46.4%
Taylor expanded in t around inf 66.9%
if -3.2000000000000001e162 < t < 1.06e229Initial program 68.0%
Taylor expanded in y around inf 61.4%
if 1.06e229 < t Initial program 35.6%
associate--l+35.6%
fma-def36.2%
fma-neg36.2%
+-commutative36.2%
distribute-rgt-neg-out36.2%
associate-+l+36.2%
+-commutative36.2%
Simplified36.2%
Taylor expanded in t around inf 18.7%
associate-+r+18.7%
associate-+r+18.7%
mul-1-neg18.7%
unsub-neg18.7%
associate-/l*18.7%
associate-/l*18.7%
associate-/l*58.5%
+-commutative58.5%
associate-/l*66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in z around -inf 11.9%
associate-/l*51.7%
+-commutative51.7%
Simplified51.7%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -7.2e-61) a (if (<= a 2.9e+118) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -7.2e-61) {
tmp = a;
} else if (a <= 2.9e+118) {
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 (a <= (-7.2d-61)) then
tmp = a
else if (a <= 2.9d+118) 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 (a <= -7.2e-61) {
tmp = a;
} else if (a <= 2.9e+118) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -7.2e-61: tmp = a elif a <= 2.9e+118: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -7.2e-61) tmp = a; elseif (a <= 2.9e+118) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -7.2e-61) tmp = a; elseif (a <= 2.9e+118) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -7.2e-61], a, If[LessEqual[a, 2.9e+118], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{-61}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{+118}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -7.20000000000000028e-61 or 2.90000000000000016e118 < a Initial program 49.9%
Taylor expanded in t around inf 57.8%
if -7.20000000000000028e-61 < a < 2.90000000000000016e118Initial program 74.8%
Taylor expanded in x around inf 39.1%
Final simplification47.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.7e+162) a (- (+ z a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.7e+162) {
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 <= (-2.7d+162)) 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 <= -2.7e+162) {
tmp = a;
} else {
tmp = (z + a) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.7e+162: tmp = a else: tmp = (z + a) - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.7e+162) 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 <= -2.7e+162) tmp = a; else tmp = (z + a) - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.7e+162], a, N[(N[(z + a), $MachinePrecision] - b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+162}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;\left(z + a\right) - b\\
\end{array}
\end{array}
if t < -2.7000000000000002e162Initial program 46.4%
Taylor expanded in t around inf 66.9%
if -2.7000000000000002e162 < t Initial program 66.2%
Taylor expanded in y around inf 58.6%
Final simplification59.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 63.9%
Taylor expanded in t around inf 31.4%
Final simplification31.4%
(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 2024026
(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)))