
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
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 * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
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 * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 98.0%
fma-def98.4%
sub-neg98.4%
log1p-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* a (- (log (- 1.0 z)) b)) (* y (- t (log z)))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((a * (log((1.0 - z)) - b)) - (y * (t - log(z)))));
}
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 * exp(((a * (log((1.0d0 - z)) - b)) - (y * (t - log(z)))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((a * (Math.log((1.0 - z)) - b)) - (y * (t - Math.log(z)))));
}
def code(x, y, z, t, a, b): return x * math.exp(((a * (math.log((1.0 - z)) - b)) - (y * (t - math.log(z)))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(a * Float64(log(Float64(1.0 - z)) - b)) - Float64(y * Float64(t - log(z)))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((a * (log((1.0 - z)) - b)) - (y * (t - log(z))))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] - N[(y * N[(t - N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right) - y \cdot \left(t - \log z\right)}
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (log z) t)))
(if (<= y -4e+48)
(* x (exp (* y t_1)))
(if (<= y -2.15e+21)
(* x (exp (* a (- b))))
(if (or (<= y -1.4e-55) (not (<= y 1.4e-19)))
(* x (pow (exp t_1) y))
(* x (exp (* (- a) (+ z b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = log(z) - t;
double tmp;
if (y <= -4e+48) {
tmp = x * exp((y * t_1));
} else if (y <= -2.15e+21) {
tmp = x * exp((a * -b));
} else if ((y <= -1.4e-55) || !(y <= 1.4e-19)) {
tmp = x * pow(exp(t_1), y);
} else {
tmp = x * exp((-a * (z + 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 = log(z) - t
if (y <= (-4d+48)) then
tmp = x * exp((y * t_1))
else if (y <= (-2.15d+21)) then
tmp = x * exp((a * -b))
else if ((y <= (-1.4d-55)) .or. (.not. (y <= 1.4d-19))) then
tmp = x * (exp(t_1) ** y)
else
tmp = x * exp((-a * (z + 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 = Math.log(z) - t;
double tmp;
if (y <= -4e+48) {
tmp = x * Math.exp((y * t_1));
} else if (y <= -2.15e+21) {
tmp = x * Math.exp((a * -b));
} else if ((y <= -1.4e-55) || !(y <= 1.4e-19)) {
tmp = x * Math.pow(Math.exp(t_1), y);
} else {
tmp = x * Math.exp((-a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.log(z) - t tmp = 0 if y <= -4e+48: tmp = x * math.exp((y * t_1)) elif y <= -2.15e+21: tmp = x * math.exp((a * -b)) elif (y <= -1.4e-55) or not (y <= 1.4e-19): tmp = x * math.pow(math.exp(t_1), y) else: tmp = x * math.exp((-a * (z + b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(log(z) - t) tmp = 0.0 if (y <= -4e+48) tmp = Float64(x * exp(Float64(y * t_1))); elseif (y <= -2.15e+21) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif ((y <= -1.4e-55) || !(y <= 1.4e-19)) tmp = Float64(x * (exp(t_1) ^ y)); else tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = log(z) - t; tmp = 0.0; if (y <= -4e+48) tmp = x * exp((y * t_1)); elseif (y <= -2.15e+21) tmp = x * exp((a * -b)); elseif ((y <= -1.4e-55) || ~((y <= 1.4e-19))) tmp = x * (exp(t_1) ^ y); else tmp = x * exp((-a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[y, -4e+48], N[(x * N[Exp[N[(y * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.15e+21], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -1.4e-55], N[Not[LessEqual[y, 1.4e-19]], $MachinePrecision]], N[(x * N[Power[N[Exp[t$95$1], $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z - t\\
\mathbf{if}\;y \leq -4 \cdot 10^{+48}:\\
\;\;\;\;x \cdot e^{y \cdot t_1}\\
\mathbf{elif}\;y \leq -2.15 \cdot 10^{+21}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-55} \lor \neg \left(y \leq 1.4 \cdot 10^{-19}\right):\\
\;\;\;\;x \cdot {\left(e^{t_1}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -4.00000000000000018e48Initial program 100.0%
Taylor expanded in y around inf 86.9%
if -4.00000000000000018e48 < y < -2.15e21Initial program 100.0%
Taylor expanded in b around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
neg-mul-1100.0%
Simplified100.0%
if -2.15e21 < y < -1.39999999999999992e-55 or 1.40000000000000001e-19 < y Initial program 96.8%
Taylor expanded in a around 0 89.6%
exp-prod89.6%
Simplified89.6%
if -1.39999999999999992e-55 < y < 1.40000000000000001e-19Initial program 98.1%
Taylor expanded in y around 0 88.9%
sub-neg88.9%
+-commutative88.9%
sub-neg88.9%
neg-mul-188.9%
log1p-def91.6%
neg-mul-191.6%
+-commutative91.6%
sub-neg91.6%
Simplified91.6%
Taylor expanded in z around 0 91.6%
associate-*r*91.6%
associate-*r*91.6%
distribute-lft-out91.6%
neg-mul-191.6%
Simplified91.6%
Final simplification90.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- (- z) b)))))
(t_2 (* y (- t)))
(t_3 (* x (pow z y))))
(if (<= t -9e+69)
(* x (exp t_2))
(if (<= t -1.8e-239)
t_1
(if (<= t -8.5e-288)
t_3
(if (<= t 2.6e-166)
t_1
(if (<= t 1.65e-101)
t_3
(if (<= t 6.1e+26) t_1 (* x (pow E t_2))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * (-z - b)));
double t_2 = y * -t;
double t_3 = x * pow(z, y);
double tmp;
if (t <= -9e+69) {
tmp = x * exp(t_2);
} else if (t <= -1.8e-239) {
tmp = t_1;
} else if (t <= -8.5e-288) {
tmp = t_3;
} else if (t <= 2.6e-166) {
tmp = t_1;
} else if (t <= 1.65e-101) {
tmp = t_3;
} else if (t <= 6.1e+26) {
tmp = t_1;
} else {
tmp = x * pow(((double) M_E), t_2);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * Math.exp((a * (-z - b)));
double t_2 = y * -t;
double t_3 = x * Math.pow(z, y);
double tmp;
if (t <= -9e+69) {
tmp = x * Math.exp(t_2);
} else if (t <= -1.8e-239) {
tmp = t_1;
} else if (t <= -8.5e-288) {
tmp = t_3;
} else if (t <= 2.6e-166) {
tmp = t_1;
} else if (t <= 1.65e-101) {
tmp = t_3;
} else if (t <= 6.1e+26) {
tmp = t_1;
} else {
tmp = x * Math.pow(Math.E, t_2);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * (-z - b))) t_2 = y * -t t_3 = x * math.pow(z, y) tmp = 0 if t <= -9e+69: tmp = x * math.exp(t_2) elif t <= -1.8e-239: tmp = t_1 elif t <= -8.5e-288: tmp = t_3 elif t <= 2.6e-166: tmp = t_1 elif t <= 1.65e-101: tmp = t_3 elif t <= 6.1e+26: tmp = t_1 else: tmp = x * math.pow(math.e, t_2) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))) t_2 = Float64(y * Float64(-t)) t_3 = Float64(x * (z ^ y)) tmp = 0.0 if (t <= -9e+69) tmp = Float64(x * exp(t_2)); elseif (t <= -1.8e-239) tmp = t_1; elseif (t <= -8.5e-288) tmp = t_3; elseif (t <= 2.6e-166) tmp = t_1; elseif (t <= 1.65e-101) tmp = t_3; elseif (t <= 6.1e+26) tmp = t_1; else tmp = Float64(x * (exp(1) ^ t_2)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * (-z - b))); t_2 = y * -t; t_3 = x * (z ^ y); tmp = 0.0; if (t <= -9e+69) tmp = x * exp(t_2); elseif (t <= -1.8e-239) tmp = t_1; elseif (t <= -8.5e-288) tmp = t_3; elseif (t <= 2.6e-166) tmp = t_1; elseif (t <= 1.65e-101) tmp = t_3; elseif (t <= 6.1e+26) tmp = t_1; else tmp = x * (2.71828182845904523536 ^ t_2); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-t)), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9e+69], N[(x * N[Exp[t$95$2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.8e-239], t$95$1, If[LessEqual[t, -8.5e-288], t$95$3, If[LessEqual[t, 2.6e-166], t$95$1, If[LessEqual[t, 1.65e-101], t$95$3, If[LessEqual[t, 6.1e+26], t$95$1, N[(x * N[Power[E, t$95$2], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
t_2 := y \cdot \left(-t\right)\\
t_3 := x \cdot {z}^{y}\\
\mathbf{if}\;t \leq -9 \cdot 10^{+69}:\\
\;\;\;\;x \cdot e^{t_2}\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-239}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -8.5 \cdot 10^{-288}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-101}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{+26}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot {e}^{t_2}\\
\end{array}
\end{array}
if t < -8.9999999999999999e69Initial program 97.7%
Taylor expanded in t around inf 88.6%
mul-1-neg88.6%
distribute-rgt-neg-out88.6%
Simplified88.6%
if -8.9999999999999999e69 < t < -1.8000000000000001e-239 or -8.4999999999999997e-288 < t < 2.59999999999999989e-166 or 1.64999999999999992e-101 < t < 6.1000000000000003e26Initial program 97.8%
Taylor expanded in y around 0 76.9%
sub-neg76.9%
+-commutative76.9%
sub-neg76.9%
neg-mul-176.9%
log1p-def80.5%
neg-mul-180.5%
+-commutative80.5%
sub-neg80.5%
Simplified80.5%
Taylor expanded in z around 0 80.5%
associate-*r*80.5%
associate-*r*80.5%
distribute-lft-out80.5%
neg-mul-180.5%
Simplified80.5%
if -1.8000000000000001e-239 < t < -8.4999999999999997e-288 or 2.59999999999999989e-166 < t < 1.64999999999999992e-101Initial program 100.0%
Taylor expanded in y around inf 95.8%
Taylor expanded in t around 0 95.8%
if 6.1000000000000003e26 < t Initial program 98.0%
*-un-lft-identity98.0%
exp-prod98.1%
exp-1-e98.1%
fma-def98.1%
sub-neg98.1%
sub-neg98.1%
log1p-udef99.9%
sub-neg99.9%
add-sqr-sqrt0.0%
sqrt-unprod94.6%
sqr-neg94.6%
sqrt-unprod94.6%
add-sqr-sqrt94.6%
Applied egg-rr94.6%
Taylor expanded in t around inf 85.9%
mul-1-neg85.9%
*-commutative85.9%
distribute-rgt-neg-in85.9%
Simplified85.9%
Final simplification84.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- (log z) t))))))
(if (<= y -4e+48)
t_1
(if (<= y -6.2e+21)
(* x (exp (* a (- b))))
(if (or (<= y -2e-56) (not (<= y 3.8e-22)))
t_1
(* x (exp (* (- a) (+ z b)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((y * (log(z) - t)));
double tmp;
if (y <= -4e+48) {
tmp = t_1;
} else if (y <= -6.2e+21) {
tmp = x * exp((a * -b));
} else if ((y <= -2e-56) || !(y <= 3.8e-22)) {
tmp = t_1;
} else {
tmp = x * exp((-a * (z + 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 = x * exp((y * (log(z) - t)))
if (y <= (-4d+48)) then
tmp = t_1
else if (y <= (-6.2d+21)) then
tmp = x * exp((a * -b))
else if ((y <= (-2d-56)) .or. (.not. (y <= 3.8d-22))) then
tmp = t_1
else
tmp = x * exp((-a * (z + 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 = x * Math.exp((y * (Math.log(z) - t)));
double tmp;
if (y <= -4e+48) {
tmp = t_1;
} else if (y <= -6.2e+21) {
tmp = x * Math.exp((a * -b));
} else if ((y <= -2e-56) || !(y <= 3.8e-22)) {
tmp = t_1;
} else {
tmp = x * Math.exp((-a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((y * (math.log(z) - t))) tmp = 0 if y <= -4e+48: tmp = t_1 elif y <= -6.2e+21: tmp = x * math.exp((a * -b)) elif (y <= -2e-56) or not (y <= 3.8e-22): tmp = t_1 else: tmp = x * math.exp((-a * (z + b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(y * Float64(log(z) - t)))) tmp = 0.0 if (y <= -4e+48) tmp = t_1; elseif (y <= -6.2e+21) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif ((y <= -2e-56) || !(y <= 3.8e-22)) tmp = t_1; else tmp = Float64(x * exp(Float64(Float64(-a) * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((y * (log(z) - t))); tmp = 0.0; if (y <= -4e+48) tmp = t_1; elseif (y <= -6.2e+21) tmp = x * exp((a * -b)); elseif ((y <= -2e-56) || ~((y <= 3.8e-22))) tmp = t_1; else tmp = x * exp((-a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e+48], t$95$1, If[LessEqual[y, -6.2e+21], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2e-56], N[Not[LessEqual[y, 3.8e-22]], $MachinePrecision]], t$95$1, N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{if}\;y \leq -4 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6.2 \cdot 10^{+21}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-56} \lor \neg \left(y \leq 3.8 \cdot 10^{-22}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -4.00000000000000018e48 or -6.2e21 < y < -2.0000000000000001e-56 or 3.80000000000000023e-22 < y Initial program 97.9%
Taylor expanded in y around inf 88.7%
if -4.00000000000000018e48 < y < -6.2e21Initial program 100.0%
Taylor expanded in b around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
neg-mul-1100.0%
Simplified100.0%
if -2.0000000000000001e-56 < y < 3.80000000000000023e-22Initial program 98.1%
Taylor expanded in y around 0 88.9%
sub-neg88.9%
+-commutative88.9%
sub-neg88.9%
neg-mul-188.9%
log1p-def91.6%
neg-mul-191.6%
+-commutative91.6%
sub-neg91.6%
Simplified91.6%
Taylor expanded in z around 0 91.6%
associate-*r*91.6%
associate-*r*91.6%
distribute-lft-out91.6%
neg-mul-191.6%
Simplified91.6%
Final simplification90.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* a (- (- z) b)))))
(t_2 (* x (exp (* y (- t)))))
(t_3 (* x (pow z y))))
(if (<= t -7e+68)
t_2
(if (<= t -1.7e-239)
t_1
(if (<= t -3.1e-293)
t_3
(if (<= t 8.8e-166)
t_1
(if (<= t 1.7e-101) t_3 (if (<= t 1.15e+33) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((a * (-z - b)));
double t_2 = x * exp((y * -t));
double t_3 = x * pow(z, y);
double tmp;
if (t <= -7e+68) {
tmp = t_2;
} else if (t <= -1.7e-239) {
tmp = t_1;
} else if (t <= -3.1e-293) {
tmp = t_3;
} else if (t <= 8.8e-166) {
tmp = t_1;
} else if (t <= 1.7e-101) {
tmp = t_3;
} else if (t <= 1.15e+33) {
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) :: t_3
real(8) :: tmp
t_1 = x * exp((a * (-z - b)))
t_2 = x * exp((y * -t))
t_3 = x * (z ** y)
if (t <= (-7d+68)) then
tmp = t_2
else if (t <= (-1.7d-239)) then
tmp = t_1
else if (t <= (-3.1d-293)) then
tmp = t_3
else if (t <= 8.8d-166) then
tmp = t_1
else if (t <= 1.7d-101) then
tmp = t_3
else if (t <= 1.15d+33) 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 = x * Math.exp((a * (-z - b)));
double t_2 = x * Math.exp((y * -t));
double t_3 = x * Math.pow(z, y);
double tmp;
if (t <= -7e+68) {
tmp = t_2;
} else if (t <= -1.7e-239) {
tmp = t_1;
} else if (t <= -3.1e-293) {
tmp = t_3;
} else if (t <= 8.8e-166) {
tmp = t_1;
} else if (t <= 1.7e-101) {
tmp = t_3;
} else if (t <= 1.15e+33) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((a * (-z - b))) t_2 = x * math.exp((y * -t)) t_3 = x * math.pow(z, y) tmp = 0 if t <= -7e+68: tmp = t_2 elif t <= -1.7e-239: tmp = t_1 elif t <= -3.1e-293: tmp = t_3 elif t <= 8.8e-166: tmp = t_1 elif t <= 1.7e-101: tmp = t_3 elif t <= 1.15e+33: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))) t_2 = Float64(x * exp(Float64(y * Float64(-t)))) t_3 = Float64(x * (z ^ y)) tmp = 0.0 if (t <= -7e+68) tmp = t_2; elseif (t <= -1.7e-239) tmp = t_1; elseif (t <= -3.1e-293) tmp = t_3; elseif (t <= 8.8e-166) tmp = t_1; elseif (t <= 1.7e-101) tmp = t_3; elseif (t <= 1.15e+33) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((a * (-z - b))); t_2 = x * exp((y * -t)); t_3 = x * (z ^ y); tmp = 0.0; if (t <= -7e+68) tmp = t_2; elseif (t <= -1.7e-239) tmp = t_1; elseif (t <= -3.1e-293) tmp = t_3; elseif (t <= 8.8e-166) tmp = t_1; elseif (t <= 1.7e-101) tmp = t_3; elseif (t <= 1.15e+33) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7e+68], t$95$2, If[LessEqual[t, -1.7e-239], t$95$1, If[LessEqual[t, -3.1e-293], t$95$3, If[LessEqual[t, 8.8e-166], t$95$1, If[LessEqual[t, 1.7e-101], t$95$3, If[LessEqual[t, 1.15e+33], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
t_2 := x \cdot e^{y \cdot \left(-t\right)}\\
t_3 := x \cdot {z}^{y}\\
\mathbf{if}\;t \leq -7 \cdot 10^{+68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-239}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-293}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-101}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -6.99999999999999955e68 or 1.15000000000000005e33 < t Initial program 97.9%
Taylor expanded in t around inf 87.0%
mul-1-neg87.0%
distribute-rgt-neg-out87.0%
Simplified87.0%
if -6.99999999999999955e68 < t < -1.7e-239 or -3.09999999999999983e-293 < t < 8.8000000000000005e-166 or 1.69999999999999995e-101 < t < 1.15000000000000005e33Initial program 97.8%
Taylor expanded in y around 0 76.9%
sub-neg76.9%
+-commutative76.9%
sub-neg76.9%
neg-mul-176.9%
log1p-def80.5%
neg-mul-180.5%
+-commutative80.5%
sub-neg80.5%
Simplified80.5%
Taylor expanded in z around 0 80.5%
associate-*r*80.5%
associate-*r*80.5%
distribute-lft-out80.5%
neg-mul-180.5%
Simplified80.5%
if -1.7e-239 < t < -3.09999999999999983e-293 or 8.8000000000000005e-166 < t < 1.69999999999999995e-101Initial program 100.0%
Taylor expanded in y around inf 95.8%
Taylor expanded in t around 0 95.8%
Final simplification84.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.2e+48) (not (<= y 7.2e+114))) (* x (pow z y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.2e+48) || !(y <= 7.2e+114)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((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 <= (-6.2d+48)) .or. (.not. (y <= 7.2d+114))) then
tmp = x * (z ** y)
else
tmp = x * exp((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 <= -6.2e+48) || !(y <= 7.2e+114)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.2e+48) or not (y <= 7.2e+114): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.2e+48) || !(y <= 7.2e+114)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.2e+48) || ~((y <= 7.2e+114))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.2e+48], N[Not[LessEqual[y, 7.2e+114]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+48} \lor \neg \left(y \leq 7.2 \cdot 10^{+114}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -6.20000000000000011e48 or 7.2000000000000001e114 < y Initial program 100.0%
Taylor expanded in y around inf 88.8%
Taylor expanded in t around 0 69.8%
if -6.20000000000000011e48 < y < 7.2000000000000001e114Initial program 97.0%
Taylor expanded in b around inf 77.9%
associate-*r*77.9%
*-commutative77.9%
neg-mul-177.9%
Simplified77.9%
Final simplification75.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.75e+27) (not (<= b 6.8e+68))) (* x (exp (* a (- b)))) (* x (exp (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.75e+27) || !(b <= 6.8e+68)) {
tmp = x * exp((a * -b));
} else {
tmp = x * exp((y * -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 ((b <= (-1.75d+27)) .or. (.not. (b <= 6.8d+68))) then
tmp = x * exp((a * -b))
else
tmp = x * exp((y * -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 ((b <= -1.75e+27) || !(b <= 6.8e+68)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.75e+27) or not (b <= 6.8e+68): tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.75e+27) || !(b <= 6.8e+68)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.75e+27) || ~((b <= 6.8e+68))) tmp = x * exp((a * -b)); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.75e+27], N[Not[LessEqual[b, 6.8e+68]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{+27} \lor \neg \left(b \leq 6.8 \cdot 10^{+68}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if b < -1.7500000000000001e27 or 6.8000000000000003e68 < b Initial program 99.1%
Taylor expanded in b around inf 81.3%
associate-*r*81.3%
*-commutative81.3%
neg-mul-181.3%
Simplified81.3%
if -1.7500000000000001e27 < b < 6.8000000000000003e68Initial program 97.3%
Taylor expanded in t around inf 70.8%
mul-1-neg70.8%
distribute-rgt-neg-out70.8%
Simplified70.8%
Final simplification75.3%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.2e+34) (- x (* x (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.2e+34) {
tmp = x - (x * (y * t));
} else {
tmp = x * pow(z, 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+34)) then
tmp = x - (x * (y * t))
else
tmp = x * (z ** 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+34) {
tmp = x - (x * (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.2e+34: tmp = x - (x * (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.2e+34) tmp = Float64(x - Float64(x * Float64(y * t))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.2e+34) tmp = x - (x * (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.2e+34], N[(x - N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+34}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -3.1999999999999998e34Initial program 98.1%
Taylor expanded in t around inf 81.9%
mul-1-neg81.9%
distribute-rgt-neg-out81.9%
Simplified81.9%
Taylor expanded in y around 0 34.2%
Taylor expanded in x around 0 34.2%
*-commutative34.2%
mul-1-neg34.2%
+-commutative34.2%
distribute-lft-in34.2%
*-rgt-identity34.2%
distribute-rgt-neg-in34.2%
sub-neg34.2%
Simplified34.2%
if -3.1999999999999998e34 < t Initial program 98.0%
Taylor expanded in y around inf 71.2%
Taylor expanded in t around 0 61.0%
Final simplification55.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6.2e-63) (- x (/ (* x a) (/ (- b z) (- (* b b) (* z z))))) (* x (* z (- a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e-63) {
tmp = x - ((x * a) / ((b - z) / ((b * b) - (z * z))));
} else {
tmp = x * (z * -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 (y <= 6.2d-63) then
tmp = x - ((x * a) / ((b - z) / ((b * b) - (z * z))))
else
tmp = x * (z * -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 (y <= 6.2e-63) {
tmp = x - ((x * a) / ((b - z) / ((b * b) - (z * z))));
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6.2e-63: tmp = x - ((x * a) / ((b - z) / ((b * b) - (z * z)))) else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.2e-63) tmp = Float64(x - Float64(Float64(x * a) / Float64(Float64(b - z) / Float64(Float64(b * b) - Float64(z * z))))); else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 6.2e-63) tmp = x - ((x * a) / ((b - z) / ((b * b) - (z * z)))); else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.2e-63], N[(x - N[(N[(x * a), $MachinePrecision] / N[(N[(b - z), $MachinePrecision] / N[(N[(b * b), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{-63}:\\
\;\;\;\;x - \frac{x \cdot a}{\frac{b - z}{b \cdot b - z \cdot z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < 6.19999999999999968e-63Initial program 98.8%
Taylor expanded in y around 0 72.2%
sub-neg72.2%
+-commutative72.2%
sub-neg72.2%
neg-mul-172.2%
log1p-def74.4%
neg-mul-174.4%
+-commutative74.4%
sub-neg74.4%
Simplified74.4%
Taylor expanded in z around 0 74.4%
associate-*r*74.4%
associate-*r*74.4%
distribute-lft-out74.4%
neg-mul-174.4%
Simplified74.4%
Taylor expanded in a around 0 34.9%
+-commutative34.9%
mul-1-neg34.9%
unsub-neg34.9%
associate-*r*35.4%
*-commutative35.4%
+-commutative35.4%
Simplified35.4%
*-commutative35.4%
flip-+39.5%
associate-*r/40.0%
Applied egg-rr40.0%
associate-/l*39.5%
Simplified39.5%
if 6.19999999999999968e-63 < y Initial program 96.3%
Taylor expanded in y around 0 40.6%
sub-neg40.6%
+-commutative40.6%
sub-neg40.6%
neg-mul-140.6%
log1p-def44.1%
neg-mul-144.1%
+-commutative44.1%
sub-neg44.1%
Simplified44.1%
Taylor expanded in z around 0 44.1%
associate-*r*44.1%
associate-*r*44.1%
distribute-lft-out44.1%
neg-mul-144.1%
Simplified44.1%
Taylor expanded in a around 0 8.9%
+-commutative8.9%
mul-1-neg8.9%
unsub-neg8.9%
associate-*r*8.9%
*-commutative8.9%
+-commutative8.9%
Simplified8.9%
Taylor expanded in z around inf 27.5%
mul-1-neg27.5%
associate-*r*29.7%
*-commutative29.7%
Simplified29.7%
Final simplification36.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6.2e-63) (+ x (/ (* (* x a) (- (* z z) (* b b))) (- b z))) (* x (* z (- a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e-63) {
tmp = x + (((x * a) * ((z * z) - (b * b))) / (b - z));
} else {
tmp = x * (z * -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 (y <= 6.2d-63) then
tmp = x + (((x * a) * ((z * z) - (b * b))) / (b - z))
else
tmp = x * (z * -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 (y <= 6.2e-63) {
tmp = x + (((x * a) * ((z * z) - (b * b))) / (b - z));
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6.2e-63: tmp = x + (((x * a) * ((z * z) - (b * b))) / (b - z)) else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.2e-63) tmp = Float64(x + Float64(Float64(Float64(x * a) * Float64(Float64(z * z) - Float64(b * b))) / Float64(b - z))); else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 6.2e-63) tmp = x + (((x * a) * ((z * z) - (b * b))) / (b - z)); else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.2e-63], N[(x + N[(N[(N[(x * a), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{-63}:\\
\;\;\;\;x + \frac{\left(x \cdot a\right) \cdot \left(z \cdot z - b \cdot b\right)}{b - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < 6.19999999999999968e-63Initial program 98.8%
Taylor expanded in y around 0 72.2%
sub-neg72.2%
+-commutative72.2%
sub-neg72.2%
neg-mul-172.2%
log1p-def74.4%
neg-mul-174.4%
+-commutative74.4%
sub-neg74.4%
Simplified74.4%
Taylor expanded in z around 0 74.4%
associate-*r*74.4%
associate-*r*74.4%
distribute-lft-out74.4%
neg-mul-174.4%
Simplified74.4%
Taylor expanded in a around 0 34.9%
+-commutative34.9%
mul-1-neg34.9%
unsub-neg34.9%
associate-*r*35.4%
*-commutative35.4%
+-commutative35.4%
Simplified35.4%
flip-+39.5%
associate-*l/40.0%
Applied egg-rr40.0%
if 6.19999999999999968e-63 < y Initial program 96.3%
Taylor expanded in y around 0 40.6%
sub-neg40.6%
+-commutative40.6%
sub-neg40.6%
neg-mul-140.6%
log1p-def44.1%
neg-mul-144.1%
+-commutative44.1%
sub-neg44.1%
Simplified44.1%
Taylor expanded in z around 0 44.1%
associate-*r*44.1%
associate-*r*44.1%
distribute-lft-out44.1%
neg-mul-144.1%
Simplified44.1%
Taylor expanded in a around 0 8.9%
+-commutative8.9%
mul-1-neg8.9%
unsub-neg8.9%
associate-*r*8.9%
*-commutative8.9%
+-commutative8.9%
Simplified8.9%
Taylor expanded in z around inf 27.5%
mul-1-neg27.5%
associate-*r*29.7%
*-commutative29.7%
Simplified29.7%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.0205) (not (<= y 4.7e-63))) (* x (* z (- a))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.0205) || !(y <= 4.7e-63)) {
tmp = x * (z * -a);
} else {
tmp = x;
}
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 <= (-0.0205d0)) .or. (.not. (y <= 4.7d-63))) then
tmp = x * (z * -a)
else
tmp = x
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 <= -0.0205) || !(y <= 4.7e-63)) {
tmp = x * (z * -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.0205) or not (y <= 4.7e-63): tmp = x * (z * -a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.0205) || !(y <= 4.7e-63)) tmp = Float64(x * Float64(z * Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -0.0205) || ~((y <= 4.7e-63))) tmp = x * (z * -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.0205], N[Not[LessEqual[y, 4.7e-63]], $MachinePrecision]], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0205 \lor \neg \left(y \leq 4.7 \cdot 10^{-63}\right):\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -0.0205000000000000009 or 4.7000000000000001e-63 < y Initial program 97.2%
Taylor expanded in y around 0 41.4%
sub-neg41.4%
+-commutative41.4%
sub-neg41.4%
neg-mul-141.4%
log1p-def44.8%
neg-mul-144.8%
+-commutative44.8%
sub-neg44.8%
Simplified44.8%
Taylor expanded in z around 0 44.8%
associate-*r*44.8%
associate-*r*44.8%
distribute-lft-out44.8%
neg-mul-144.8%
Simplified44.8%
Taylor expanded in a around 0 7.8%
+-commutative7.8%
mul-1-neg7.8%
unsub-neg7.8%
associate-*r*7.8%
*-commutative7.8%
+-commutative7.8%
Simplified7.8%
Taylor expanded in z around inf 20.5%
mul-1-neg20.5%
associate-*r*22.0%
*-commutative22.0%
Simplified22.0%
if -0.0205000000000000009 < y < 4.7000000000000001e-63Initial program 99.1%
Taylor expanded in b around inf 86.4%
associate-*r*86.4%
*-commutative86.4%
neg-mul-186.4%
Simplified86.4%
Taylor expanded in b around 0 44.3%
Final simplification32.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.7e-24) (* (* y t) (- x)) (if (<= y 2.3e-63) x (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.7e-24) {
tmp = (y * t) * -x;
} else if (y <= 2.3e-63) {
tmp = x;
} else {
tmp = x * (z * -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 (y <= (-2.7d-24)) then
tmp = (y * t) * -x
else if (y <= 2.3d-63) then
tmp = x
else
tmp = x * (z * -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 (y <= -2.7e-24) {
tmp = (y * t) * -x;
} else if (y <= 2.3e-63) {
tmp = x;
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.7e-24: tmp = (y * t) * -x elif y <= 2.3e-63: tmp = x else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.7e-24) tmp = Float64(Float64(y * t) * Float64(-x)); elseif (y <= 2.3e-63) tmp = x; else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.7e-24) tmp = (y * t) * -x; elseif (y <= 2.3e-63) tmp = x; else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.7e-24], N[(N[(y * t), $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[y, 2.3e-63], x, N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-24}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(-x\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -2.70000000000000007e-24Initial program 98.5%
Taylor expanded in t around inf 50.0%
mul-1-neg50.0%
distribute-rgt-neg-out50.0%
Simplified50.0%
Taylor expanded in y around 0 11.5%
Taylor expanded in y around inf 11.2%
associate-*r*11.2%
neg-mul-111.2%
Simplified11.2%
if -2.70000000000000007e-24 < y < 2.3e-63Initial program 99.0%
Taylor expanded in b around inf 88.7%
associate-*r*88.7%
*-commutative88.7%
neg-mul-188.7%
Simplified88.7%
Taylor expanded in b around 0 47.6%
if 2.3e-63 < y Initial program 96.3%
Taylor expanded in y around 0 40.6%
sub-neg40.6%
+-commutative40.6%
sub-neg40.6%
neg-mul-140.6%
log1p-def44.1%
neg-mul-144.1%
+-commutative44.1%
sub-neg44.1%
Simplified44.1%
Taylor expanded in z around 0 44.1%
associate-*r*44.1%
associate-*r*44.1%
distribute-lft-out44.1%
neg-mul-144.1%
Simplified44.1%
Taylor expanded in a around 0 8.9%
+-commutative8.9%
mul-1-neg8.9%
unsub-neg8.9%
associate-*r*8.9%
*-commutative8.9%
+-commutative8.9%
Simplified8.9%
Taylor expanded in z around inf 27.5%
mul-1-neg27.5%
associate-*r*29.7%
*-commutative29.7%
Simplified29.7%
Final simplification32.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6.2e-63) (* x (- 1.0 (* a b))) (* x (* z (- a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e-63) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (z * -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 (y <= 6.2d-63) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (z * -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 (y <= 6.2e-63) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6.2e-63: tmp = x * (1.0 - (a * b)) else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.2e-63) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 6.2e-63) tmp = x * (1.0 - (a * b)); else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.2e-63], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{-63}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < 6.19999999999999968e-63Initial program 98.8%
Taylor expanded in b around inf 71.1%
associate-*r*71.1%
*-commutative71.1%
neg-mul-171.1%
Simplified71.1%
Taylor expanded in b around 0 39.2%
mul-1-neg39.2%
unsub-neg39.2%
*-commutative39.2%
Simplified39.2%
if 6.19999999999999968e-63 < y Initial program 96.3%
Taylor expanded in y around 0 40.6%
sub-neg40.6%
+-commutative40.6%
sub-neg40.6%
neg-mul-140.6%
log1p-def44.1%
neg-mul-144.1%
+-commutative44.1%
sub-neg44.1%
Simplified44.1%
Taylor expanded in z around 0 44.1%
associate-*r*44.1%
associate-*r*44.1%
distribute-lft-out44.1%
neg-mul-144.1%
Simplified44.1%
Taylor expanded in a around 0 8.9%
+-commutative8.9%
mul-1-neg8.9%
unsub-neg8.9%
associate-*r*8.9%
*-commutative8.9%
+-commutative8.9%
Simplified8.9%
Taylor expanded in z around inf 27.5%
mul-1-neg27.5%
associate-*r*29.7%
*-commutative29.7%
Simplified29.7%
Final simplification36.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 98.0%
Taylor expanded in b around inf 61.6%
associate-*r*61.6%
*-commutative61.6%
neg-mul-161.6%
Simplified61.6%
Taylor expanded in b around 0 22.5%
Final simplification22.5%
herbie shell --seed 2023195
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
:precision binary64
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))