
(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 13 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 95.7%
fma-def95.7%
sub-neg95.7%
log1p-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3e-17) (not (<= y 3.6e-10))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3e-17) || !(y <= 3.6e-10)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (log((1.0 - 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) :: tmp
if ((y <= (-3d-17)) .or. (.not. (y <= 3.6d-10))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (log((1.0d0 - 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 tmp;
if ((y <= -3e-17) || !(y <= 3.6e-10)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (Math.log((1.0 - z)) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3e-17) or not (y <= 3.6e-10): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (math.log((1.0 - z)) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3e-17) || !(y <= 3.6e-10)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(log(Float64(1.0 - z)) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3e-17) || ~((y <= 3.6e-10))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (log((1.0 - z)) - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3e-17], N[Not[LessEqual[y, 3.6e-10]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{-17} \lor \neg \left(y \leq 3.6 \cdot 10^{-10}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if y < -3.00000000000000006e-17 or 3.6e-10 < y Initial program 98.5%
Taylor expanded in y around inf 92.8%
if -3.00000000000000006e-17 < y < 3.6e-10Initial program 92.6%
Taylor expanded in y around 0 83.8%
Final simplification88.6%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * (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 * (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 * (z + b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * (z + b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * (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[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Initial program 95.7%
Taylor expanded in z around 0 99.2%
mul-1-neg99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.35e-16) (not (<= y 1.5e-9))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.35e-16) || !(y <= 1.5e-9)) {
tmp = x * exp((y * (log(z) - t)));
} 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 <= (-1.35d-16)) .or. (.not. (y <= 1.5d-9))) then
tmp = x * exp((y * (log(z) - t)))
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 <= -1.35e-16) || !(y <= 1.5e-9)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.35e-16) or not (y <= 1.5e-9): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.35e-16) || !(y <= 1.5e-9)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); 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 <= -1.35e-16) || ~((y <= 1.5e-9))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.35e-16], N[Not[LessEqual[y, 1.5e-9]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-16} \lor \neg \left(y \leq 1.5 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.35e-16 or 1.49999999999999999e-9 < y Initial program 98.5%
Taylor expanded in y around inf 92.8%
if -1.35e-16 < y < 1.49999999999999999e-9Initial program 92.6%
Taylor expanded in b around inf 83.7%
mul-1-neg83.7%
distribute-rgt-neg-out83.7%
Simplified83.7%
Final simplification88.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* t (- y))))) (t_2 (* x (pow z y))))
(if (<= y -1.32e+168)
t_2
(if (<= y -8e+123)
t_1
(if (<= y -1.45e+54)
t_2
(if (<= y -4.2e-17)
t_1
(if (<= y 3.1) (* x (exp (* a (- b)))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((t * -y));
double t_2 = x * pow(z, y);
double tmp;
if (y <= -1.32e+168) {
tmp = t_2;
} else if (y <= -8e+123) {
tmp = t_1;
} else if (y <= -1.45e+54) {
tmp = t_2;
} else if (y <= -4.2e-17) {
tmp = t_1;
} else if (y <= 3.1) {
tmp = x * exp((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 = x * exp((t * -y))
t_2 = x * (z ** y)
if (y <= (-1.32d+168)) then
tmp = t_2
else if (y <= (-8d+123)) then
tmp = t_1
else if (y <= (-1.45d+54)) then
tmp = t_2
else if (y <= (-4.2d-17)) then
tmp = t_1
else if (y <= 3.1d0) then
tmp = x * exp((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 = x * Math.exp((t * -y));
double t_2 = x * Math.pow(z, y);
double tmp;
if (y <= -1.32e+168) {
tmp = t_2;
} else if (y <= -8e+123) {
tmp = t_1;
} else if (y <= -1.45e+54) {
tmp = t_2;
} else if (y <= -4.2e-17) {
tmp = t_1;
} else if (y <= 3.1) {
tmp = x * Math.exp((a * -b));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((t * -y)) t_2 = x * math.pow(z, y) tmp = 0 if y <= -1.32e+168: tmp = t_2 elif y <= -8e+123: tmp = t_1 elif y <= -1.45e+54: tmp = t_2 elif y <= -4.2e-17: tmp = t_1 elif y <= 3.1: tmp = x * math.exp((a * -b)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(t * Float64(-y)))) t_2 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -1.32e+168) tmp = t_2; elseif (y <= -8e+123) tmp = t_1; elseif (y <= -1.45e+54) tmp = t_2; elseif (y <= -4.2e-17) tmp = t_1; elseif (y <= 3.1) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp((t * -y)); t_2 = x * (z ^ y); tmp = 0.0; if (y <= -1.32e+168) tmp = t_2; elseif (y <= -8e+123) tmp = t_1; elseif (y <= -1.45e+54) tmp = t_2; elseif (y <= -4.2e-17) tmp = t_1; elseif (y <= 3.1) tmp = x * exp((a * -b)); 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[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.32e+168], t$95$2, If[LessEqual[y, -8e+123], t$95$1, If[LessEqual[y, -1.45e+54], t$95$2, If[LessEqual[y, -4.2e-17], t$95$1, If[LessEqual[y, 3.1], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{t \cdot \left(-y\right)}\\
t_2 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{+168}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{+54}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.1:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.32000000000000007e168 or -7.99999999999999982e123 < y < -1.4499999999999999e54 or 3.10000000000000009 < y Initial program 98.1%
Taylor expanded in y around inf 93.5%
Taylor expanded in t around 0 75.9%
if -1.32000000000000007e168 < y < -7.99999999999999982e123 or -1.4499999999999999e54 < y < -4.19999999999999984e-17Initial program 100.0%
Taylor expanded in t around inf 84.7%
mul-1-neg84.7%
distribute-lft-neg-out84.7%
*-commutative84.7%
Simplified84.7%
if -4.19999999999999984e-17 < y < 3.10000000000000009Initial program 92.9%
Taylor expanded in b around inf 82.7%
mul-1-neg82.7%
distribute-rgt-neg-out82.7%
Simplified82.7%
Final simplification80.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -320000000000.0) (not (<= y 1.78))) (* 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 <= -320000000000.0) || !(y <= 1.78)) {
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 <= (-320000000000.0d0)) .or. (.not. (y <= 1.78d0))) 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 <= -320000000000.0) || !(y <= 1.78)) {
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 <= -320000000000.0) or not (y <= 1.78): 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 <= -320000000000.0) || !(y <= 1.78)) 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 <= -320000000000.0) || ~((y <= 1.78))) 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, -320000000000.0], N[Not[LessEqual[y, 1.78]], $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 -320000000000 \lor \neg \left(y \leq 1.78\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -3.2e11 or 1.78000000000000003 < y Initial program 98.4%
Taylor expanded in y around inf 94.5%
Taylor expanded in t around 0 72.4%
if -3.2e11 < y < 1.78000000000000003Initial program 93.2%
Taylor expanded in b around inf 80.5%
mul-1-neg80.5%
distribute-rgt-neg-out80.5%
Simplified80.5%
Final simplification76.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.8e+131) (* a (* x (- b))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.8e+131) {
tmp = a * (x * -b);
} 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 <= (-2.8d+131)) then
tmp = a * (x * -b)
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 <= -2.8e+131) {
tmp = a * (x * -b);
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.8e+131: tmp = a * (x * -b) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.8e+131) tmp = Float64(a * Float64(x * Float64(-b))); 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 <= -2.8e+131) tmp = a * (x * -b); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.8e+131], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+131}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -2.8000000000000001e131Initial program 95.0%
Taylor expanded in b around inf 37.1%
mul-1-neg37.1%
distribute-rgt-neg-out37.1%
Simplified37.1%
Taylor expanded in a around 0 8.1%
mul-1-neg8.1%
unsub-neg8.1%
Simplified8.1%
Taylor expanded in a around inf 25.0%
associate-*r*24.9%
*-commutative24.9%
mul-1-neg24.9%
distribute-lft-neg-in24.9%
Simplified24.9%
distribute-lft-neg-out24.9%
*-commutative24.9%
associate-*l*25.0%
Applied egg-rr25.0%
if -2.8000000000000001e131 < t Initial program 95.9%
Taylor expanded in y around inf 71.5%
Taylor expanded in t around 0 61.7%
Final simplification55.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.7e+201) (* x (* t (- y))) (if (or (<= y -4.2e-111) (not (<= y 1.1e-50))) (* a (* x (- b))) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.7e+201) {
tmp = x * (t * -y);
} else if ((y <= -4.2e-111) || !(y <= 1.1e-50)) {
tmp = a * (x * -b);
} 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 <= (-3.7d+201)) then
tmp = x * (t * -y)
else if ((y <= (-4.2d-111)) .or. (.not. (y <= 1.1d-50))) then
tmp = a * (x * -b)
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 <= -3.7e+201) {
tmp = x * (t * -y);
} else if ((y <= -4.2e-111) || !(y <= 1.1e-50)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.7e+201: tmp = x * (t * -y) elif (y <= -4.2e-111) or not (y <= 1.1e-50): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.7e+201) tmp = Float64(x * Float64(t * Float64(-y))); elseif ((y <= -4.2e-111) || !(y <= 1.1e-50)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.7e+201) tmp = x * (t * -y); elseif ((y <= -4.2e-111) || ~((y <= 1.1e-50))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.7e+201], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -4.2e-111], N[Not[LessEqual[y, 1.1e-50]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+201}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-111} \lor \neg \left(y \leq 1.1 \cdot 10^{-50}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.6999999999999999e201Initial program 100.0%
Taylor expanded in t around inf 76.7%
mul-1-neg76.7%
distribute-lft-neg-out76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in y around 0 34.8%
*-commutative34.8%
mul-1-neg34.8%
unsub-neg34.8%
Simplified34.8%
Taylor expanded in y around inf 25.5%
mul-1-neg25.5%
*-commutative25.5%
associate-*l*34.6%
distribute-rgt-neg-out34.6%
distribute-lft-neg-in34.6%
*-commutative34.6%
Simplified34.6%
if -3.6999999999999999e201 < y < -4.1999999999999997e-111 or 1.0999999999999999e-50 < y Initial program 96.3%
Taylor expanded in b around inf 37.4%
mul-1-neg37.4%
distribute-rgt-neg-out37.4%
Simplified37.4%
Taylor expanded in a around 0 11.4%
mul-1-neg11.4%
unsub-neg11.4%
Simplified11.4%
Taylor expanded in a around inf 23.8%
associate-*r*25.0%
*-commutative25.0%
mul-1-neg25.0%
distribute-lft-neg-in25.0%
Simplified25.0%
distribute-lft-neg-out25.0%
*-commutative25.0%
associate-*l*23.8%
Applied egg-rr23.8%
if -4.1999999999999997e-111 < y < 1.0999999999999999e-50Initial program 94.0%
Taylor expanded in b around inf 87.1%
mul-1-neg87.1%
distribute-rgt-neg-out87.1%
Simplified87.1%
Taylor expanded in a around 0 40.8%
Final simplification31.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -9.5e-107) (* x (* a (- b))) (if (<= y 1.15e-50) (* x (- 1.0 (* a b))) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.5e-107) {
tmp = x * (a * -b);
} else if (y <= 1.15e-50) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -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 <= (-9.5d-107)) then
tmp = x * (a * -b)
else if (y <= 1.15d-50) then
tmp = x * (1.0d0 - (a * b))
else
tmp = a * (x * -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 <= -9.5e-107) {
tmp = x * (a * -b);
} else if (y <= 1.15e-50) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9.5e-107: tmp = x * (a * -b) elif y <= 1.15e-50: tmp = x * (1.0 - (a * b)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9.5e-107) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 1.15e-50) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -9.5e-107) tmp = x * (a * -b); elseif (y <= 1.15e-50) tmp = x * (1.0 - (a * b)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.5e-107], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-50], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-107}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-50}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -9.4999999999999999e-107Initial program 98.7%
Taylor expanded in b around inf 31.1%
mul-1-neg31.1%
distribute-rgt-neg-out31.1%
Simplified31.1%
Taylor expanded in a around 0 13.5%
mul-1-neg13.5%
unsub-neg13.5%
Simplified13.5%
Taylor expanded in a around inf 17.8%
associate-*r*26.1%
*-commutative26.1%
mul-1-neg26.1%
distribute-lft-neg-in26.1%
Simplified26.1%
if -9.4999999999999999e-107 < y < 1.1500000000000001e-50Initial program 94.0%
Taylor expanded in b around inf 87.1%
mul-1-neg87.1%
distribute-rgt-neg-out87.1%
Simplified87.1%
Taylor expanded in a around 0 49.8%
mul-1-neg49.8%
unsub-neg49.8%
Simplified49.8%
if 1.1500000000000001e-50 < y Initial program 94.9%
Taylor expanded in b around inf 38.4%
mul-1-neg38.4%
distribute-rgt-neg-out38.4%
Simplified38.4%
Taylor expanded in a around 0 9.5%
mul-1-neg9.5%
unsub-neg9.5%
Simplified9.5%
Taylor expanded in a around inf 25.7%
associate-*r*21.7%
*-commutative21.7%
mul-1-neg21.7%
distribute-lft-neg-in21.7%
Simplified21.7%
distribute-lft-neg-out21.7%
*-commutative21.7%
associate-*l*25.7%
Applied egg-rr25.7%
Final simplification35.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.3e-106) (* (* x (* a b)) -3.0) (if (<= y 1.15e-50) (* x (- 1.0 (* a b))) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.3e-106) {
tmp = (x * (a * b)) * -3.0;
} else if (y <= 1.15e-50) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -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.3d-106)) then
tmp = (x * (a * b)) * (-3.0d0)
else if (y <= 1.15d-50) then
tmp = x * (1.0d0 - (a * b))
else
tmp = a * (x * -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.3e-106) {
tmp = (x * (a * b)) * -3.0;
} else if (y <= 1.15e-50) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.3e-106: tmp = (x * (a * b)) * -3.0 elif y <= 1.15e-50: tmp = x * (1.0 - (a * b)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.3e-106) tmp = Float64(Float64(x * Float64(a * b)) * -3.0); elseif (y <= 1.15e-50) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.3e-106) tmp = (x * (a * b)) * -3.0; elseif (y <= 1.15e-50) tmp = x * (1.0 - (a * b)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.3e-106], N[(N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision] * -3.0), $MachinePrecision], If[LessEqual[y, 1.15e-50], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-106}:\\
\;\;\;\;\left(x \cdot \left(a \cdot b\right)\right) \cdot -3\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-50}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -1.3e-106Initial program 98.7%
Taylor expanded in b around inf 31.1%
mul-1-neg31.1%
distribute-rgt-neg-out31.1%
Simplified31.1%
Taylor expanded in a around 0 13.5%
mul-1-neg13.5%
unsub-neg13.5%
Simplified13.5%
Taylor expanded in a around inf 17.8%
associate-*r*26.1%
*-commutative26.1%
mul-1-neg26.1%
distribute-lft-neg-in26.1%
Simplified26.1%
*-rgt-identity26.1%
associate-*r*26.1%
distribute-lft-neg-out26.1%
distribute-lft-neg-in26.1%
distribute-rgt-neg-in26.1%
metadata-eval26.1%
metadata-eval26.1%
distribute-rgt-out--16.0%
*-un-lft-identity16.0%
*-un-lft-identity16.0%
cancel-sign-sub-inv16.0%
Applied egg-rr15.1%
*-rgt-identity15.1%
distribute-rgt-out15.1%
associate-*r*15.1%
associate-*r*12.7%
metadata-eval12.7%
associate-*l*12.7%
metadata-eval12.7%
distribute-lft-out17.8%
associate-*r*26.1%
*-commutative26.1%
metadata-eval26.1%
Simplified26.1%
if -1.3e-106 < y < 1.1500000000000001e-50Initial program 94.0%
Taylor expanded in b around inf 87.1%
mul-1-neg87.1%
distribute-rgt-neg-out87.1%
Simplified87.1%
Taylor expanded in a around 0 49.8%
mul-1-neg49.8%
unsub-neg49.8%
Simplified49.8%
if 1.1500000000000001e-50 < y Initial program 94.9%
Taylor expanded in b around inf 38.4%
mul-1-neg38.4%
distribute-rgt-neg-out38.4%
Simplified38.4%
Taylor expanded in a around 0 9.5%
mul-1-neg9.5%
unsub-neg9.5%
Simplified9.5%
Taylor expanded in a around inf 25.7%
associate-*r*21.7%
*-commutative21.7%
mul-1-neg21.7%
distribute-lft-neg-in21.7%
Simplified21.7%
distribute-lft-neg-out21.7%
*-commutative21.7%
associate-*l*25.7%
Applied egg-rr25.7%
Final simplification35.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.7e-109) (not (<= y 1.05e-50))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.7e-109) || !(y <= 1.05e-50)) {
tmp = a * (x * -b);
} 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 <= (-3.7d-109)) .or. (.not. (y <= 1.05d-50))) then
tmp = a * (x * -b)
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 <= -3.7e-109) || !(y <= 1.05e-50)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.7e-109) or not (y <= 1.05e-50): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.7e-109) || !(y <= 1.05e-50)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.7e-109) || ~((y <= 1.05e-50))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.7e-109], N[Not[LessEqual[y, 1.05e-50]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{-109} \lor \neg \left(y \leq 1.05 \cdot 10^{-50}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.69999999999999981e-109 or 1.05e-50 < y Initial program 96.8%
Taylor expanded in b around inf 34.7%
mul-1-neg34.7%
distribute-rgt-neg-out34.7%
Simplified34.7%
Taylor expanded in a around 0 11.5%
mul-1-neg11.5%
unsub-neg11.5%
Simplified11.5%
Taylor expanded in a around inf 21.7%
associate-*r*24.0%
*-commutative24.0%
mul-1-neg24.0%
distribute-lft-neg-in24.0%
Simplified24.0%
distribute-lft-neg-out24.0%
*-commutative24.0%
associate-*l*21.7%
Applied egg-rr21.7%
if -3.69999999999999981e-109 < y < 1.05e-50Initial program 94.0%
Taylor expanded in b around inf 87.1%
mul-1-neg87.1%
distribute-rgt-neg-out87.1%
Simplified87.1%
Taylor expanded in a around 0 40.8%
Final simplification29.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.7e-112) (* x (* a (- b))) (if (<= y 1.3e-52) x (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.7e-112) {
tmp = x * (a * -b);
} else if (y <= 1.3e-52) {
tmp = x;
} else {
tmp = a * (x * -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 <= (-2.7d-112)) then
tmp = x * (a * -b)
else if (y <= 1.3d-52) then
tmp = x
else
tmp = a * (x * -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 <= -2.7e-112) {
tmp = x * (a * -b);
} else if (y <= 1.3e-52) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.7e-112: tmp = x * (a * -b) elif y <= 1.3e-52: tmp = x else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.7e-112) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 1.3e-52) tmp = x; else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.7e-112) tmp = x * (a * -b); elseif (y <= 1.3e-52) tmp = x; else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.7e-112], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-52], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-112}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -2.7000000000000001e-112Initial program 98.7%
Taylor expanded in b around inf 31.1%
mul-1-neg31.1%
distribute-rgt-neg-out31.1%
Simplified31.1%
Taylor expanded in a around 0 13.5%
mul-1-neg13.5%
unsub-neg13.5%
Simplified13.5%
Taylor expanded in a around inf 17.8%
associate-*r*26.1%
*-commutative26.1%
mul-1-neg26.1%
distribute-lft-neg-in26.1%
Simplified26.1%
if -2.7000000000000001e-112 < y < 1.2999999999999999e-52Initial program 94.0%
Taylor expanded in b around inf 87.1%
mul-1-neg87.1%
distribute-rgt-neg-out87.1%
Simplified87.1%
Taylor expanded in a around 0 40.8%
if 1.2999999999999999e-52 < y Initial program 94.9%
Taylor expanded in b around inf 38.4%
mul-1-neg38.4%
distribute-rgt-neg-out38.4%
Simplified38.4%
Taylor expanded in a around 0 9.5%
mul-1-neg9.5%
unsub-neg9.5%
Simplified9.5%
Taylor expanded in a around inf 25.7%
associate-*r*21.7%
*-commutative21.7%
mul-1-neg21.7%
distribute-lft-neg-in21.7%
Simplified21.7%
distribute-lft-neg-out21.7%
*-commutative21.7%
associate-*l*25.7%
Applied egg-rr25.7%
Final simplification31.7%
(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 95.7%
Taylor expanded in b around inf 55.0%
mul-1-neg55.0%
distribute-rgt-neg-out55.0%
Simplified55.0%
Taylor expanded in a around 0 18.5%
Final simplification18.5%
herbie shell --seed 2023301
(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))))))