
(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 17 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.6%
fma-def95.6%
sub-neg95.6%
log1p-def99.6%
Simplified99.6%
Final simplification99.6%
(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}
Initial program 95.6%
Final simplification95.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.02e-202) (not (<= y 8.5e-143))) (* x (exp (- (* y (- (log z) t)) (* a b)))) (* x (exp (- (* a (+ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.02e-202) || !(y <= 8.5e-143)) {
tmp = x * exp(((y * (log(z) - t)) - (a * b)));
} 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) :: tmp
if ((y <= (-1.02d-202)) .or. (.not. (y <= 8.5d-143))) then
tmp = x * exp(((y * (log(z) - t)) - (a * b)))
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 tmp;
if ((y <= -1.02e-202) || !(y <= 8.5e-143)) {
tmp = x * Math.exp(((y * (Math.log(z) - t)) - (a * b)));
} else {
tmp = x * Math.exp(-(a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.02e-202) or not (y <= 8.5e-143): tmp = x * math.exp(((y * (math.log(z) - t)) - (a * b))) else: tmp = x * math.exp(-(a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.02e-202) || !(y <= 8.5e-143)) tmp = Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * b)))); 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) tmp = 0.0; if ((y <= -1.02e-202) || ~((y <= 8.5e-143))) tmp = x * exp(((y * (log(z) - t)) - (a * b))); else tmp = x * exp(-(a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.02e-202], N[Not[LessEqual[y, 8.5e-143]], $MachinePrecision]], N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[(-N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-202} \lor \neg \left(y \leq 8.5 \cdot 10^{-143}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -1.01999999999999997e-202 or 8.50000000000000072e-143 < y Initial program 99.0%
Taylor expanded in z around 0 99.0%
if -1.01999999999999997e-202 < y < 8.50000000000000072e-143Initial program 84.5%
Taylor expanded in y around 0 80.5%
sub-neg80.5%
sub-neg80.5%
neg-mul-180.5%
log1p-def96.1%
neg-mul-196.1%
sub-neg96.1%
Simplified96.1%
Taylor expanded in z around 0 96.1%
+-commutative96.1%
associate-*r*96.1%
associate-*r*96.1%
distribute-lft-out96.1%
neg-mul-196.1%
Simplified96.1%
Final simplification98.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.8e+15) (not (<= y 0.027))) (* x (exp (* y (- (log z) t)))) (* x (exp (- (* a (+ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.8e+15) || !(y <= 0.027)) {
tmp = x * exp((y * (log(z) - t)));
} 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) :: tmp
if ((y <= (-2.8d+15)) .or. (.not. (y <= 0.027d0))) then
tmp = x * exp((y * (log(z) - t)))
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 tmp;
if ((y <= -2.8e+15) || !(y <= 0.027)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp(-(a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.8e+15) or not (y <= 0.027): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp(-(a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.8e+15) || !(y <= 0.027)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); 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) tmp = 0.0; if ((y <= -2.8e+15) || ~((y <= 0.027))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp(-(a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.8e+15], N[Not[LessEqual[y, 0.027]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[(-N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{+15} \lor \neg \left(y \leq 0.027\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -2.8e15 or 0.0269999999999999997 < y Initial program 99.2%
Taylor expanded in y around inf 96.9%
if -2.8e15 < y < 0.0269999999999999997Initial program 92.0%
Taylor expanded in y around 0 83.1%
sub-neg83.1%
sub-neg83.1%
neg-mul-183.1%
log1p-def91.9%
neg-mul-191.9%
sub-neg91.9%
Simplified91.9%
Taylor expanded in z around 0 91.9%
+-commutative91.9%
associate-*r*91.9%
associate-*r*91.9%
distribute-lft-out91.9%
neg-mul-191.9%
Simplified91.9%
Final simplification94.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -4.4e+112)
(* x (pow z y))
(if (or (<= y -9.2e-204) (not (<= y 1.8e-140)))
(* x (exp (- (* t (- y)) (* a b))))
(* x (exp (- (* a (+ z b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.4e+112) {
tmp = x * pow(z, y);
} else if ((y <= -9.2e-204) || !(y <= 1.8e-140)) {
tmp = x * exp(((t * -y) - (a * b)));
} 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) :: tmp
if (y <= (-4.4d+112)) then
tmp = x * (z ** y)
else if ((y <= (-9.2d-204)) .or. (.not. (y <= 1.8d-140))) then
tmp = x * exp(((t * -y) - (a * b)))
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 tmp;
if (y <= -4.4e+112) {
tmp = x * Math.pow(z, y);
} else if ((y <= -9.2e-204) || !(y <= 1.8e-140)) {
tmp = x * Math.exp(((t * -y) - (a * b)));
} else {
tmp = x * Math.exp(-(a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.4e+112: tmp = x * math.pow(z, y) elif (y <= -9.2e-204) or not (y <= 1.8e-140): tmp = x * math.exp(((t * -y) - (a * b))) else: tmp = x * math.exp(-(a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.4e+112) tmp = Float64(x * (z ^ y)); elseif ((y <= -9.2e-204) || !(y <= 1.8e-140)) tmp = Float64(x * exp(Float64(Float64(t * Float64(-y)) - Float64(a * b)))); 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) tmp = 0.0; if (y <= -4.4e+112) tmp = x * (z ^ y); elseif ((y <= -9.2e-204) || ~((y <= 1.8e-140))) tmp = x * exp(((t * -y) - (a * b))); else tmp = x * exp(-(a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.4e+112], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -9.2e-204], N[Not[LessEqual[y, 1.8e-140]], $MachinePrecision]], N[(x * N[Exp[N[(N[(t * (-y)), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[(-N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+112}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{-204} \lor \neg \left(y \leq 1.8 \cdot 10^{-140}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right) - a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -4.3999999999999999e112Initial program 97.9%
Taylor expanded in y around inf 95.8%
Taylor expanded in t around 0 83.2%
if -4.3999999999999999e112 < y < -9.1999999999999997e-204 or 1.8e-140 < y Initial program 99.4%
Taylor expanded in z around 0 99.4%
Taylor expanded in t around inf 88.1%
neg-mul-188.1%
Simplified88.1%
if -9.1999999999999997e-204 < y < 1.8e-140Initial program 84.5%
Taylor expanded in y around 0 80.5%
sub-neg80.5%
sub-neg80.5%
neg-mul-180.5%
log1p-def96.1%
neg-mul-196.1%
sub-neg96.1%
Simplified96.1%
Taylor expanded in z around 0 96.1%
+-commutative96.1%
associate-*r*96.1%
associate-*r*96.1%
distribute-lft-out96.1%
neg-mul-196.1%
Simplified96.1%
Final simplification89.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.4e+15) (not (<= y 6900000000.0))) (* x (pow z y)) (* x (exp (- (* a (+ z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.4e+15) || !(y <= 6900000000.0)) {
tmp = x * pow(z, 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) :: tmp
if ((y <= (-3.4d+15)) .or. (.not. (y <= 6900000000.0d0))) then
tmp = x * (z ** 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 tmp;
if ((y <= -3.4e+15) || !(y <= 6900000000.0)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp(-(a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.4e+15) or not (y <= 6900000000.0): tmp = x * math.pow(z, y) else: tmp = x * math.exp(-(a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.4e+15) || !(y <= 6900000000.0)) tmp = Float64(x * (z ^ 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) tmp = 0.0; if ((y <= -3.4e+15) || ~((y <= 6900000000.0))) tmp = x * (z ^ y); else tmp = x * exp(-(a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.4e+15], N[Not[LessEqual[y, 6900000000.0]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[(-N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+15} \lor \neg \left(y \leq 6900000000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{-a \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -3.4e15 or 6.9e9 < y Initial program 99.2%
Taylor expanded in y around inf 96.9%
Taylor expanded in t around 0 79.7%
if -3.4e15 < y < 6.9e9Initial program 92.1%
Taylor expanded in y around 0 82.0%
sub-neg82.0%
sub-neg82.0%
neg-mul-182.0%
log1p-def90.5%
neg-mul-190.5%
sub-neg90.5%
Simplified90.5%
Taylor expanded in z around 0 90.5%
+-commutative90.5%
associate-*r*90.5%
associate-*r*90.5%
distribute-lft-out90.5%
neg-mul-190.5%
Simplified90.5%
Final simplification85.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -280.0) (not (<= t 4e+38))) (* x (exp (* t (- y)))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -280.0) || !(t <= 4e+38)) {
tmp = x * exp((t * -y));
} 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 <= (-280.0d0)) .or. (.not. (t <= 4d+38))) then
tmp = x * exp((t * -y))
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 <= -280.0) || !(t <= 4e+38)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -280.0) or not (t <= 4e+38): tmp = x * math.exp((t * -y)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -280.0) || !(t <= 4e+38)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); 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 <= -280.0) || ~((t <= 4e+38))) tmp = x * exp((t * -y)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -280.0], N[Not[LessEqual[t, 4e+38]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -280 \lor \neg \left(t \leq 4 \cdot 10^{+38}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -280 or 3.99999999999999991e38 < t Initial program 97.3%
Taylor expanded in t around inf 82.0%
mul-1-neg82.0%
*-commutative82.0%
Simplified82.0%
if -280 < t < 3.99999999999999991e38Initial program 94.4%
Taylor expanded in y around inf 61.1%
Taylor expanded in t around 0 61.1%
Final simplification70.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.8e+15) (not (<= y 17000000000.0))) (* 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 <= -2.8e+15) || !(y <= 17000000000.0)) {
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 <= (-2.8d+15)) .or. (.not. (y <= 17000000000.0d0))) 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 <= -2.8e+15) || !(y <= 17000000000.0)) {
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 <= -2.8e+15) or not (y <= 17000000000.0): 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 <= -2.8e+15) || !(y <= 17000000000.0)) 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 <= -2.8e+15) || ~((y <= 17000000000.0))) 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, -2.8e+15], N[Not[LessEqual[y, 17000000000.0]], $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 -2.8 \cdot 10^{+15} \lor \neg \left(y \leq 17000000000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -2.8e15 or 1.7e10 < y Initial program 99.2%
Taylor expanded in y around inf 96.9%
Taylor expanded in t around 0 79.7%
if -2.8e15 < y < 1.7e10Initial program 92.1%
Taylor expanded in b around inf 80.5%
mul-1-neg80.5%
distribute-rgt-neg-out80.5%
Simplified80.5%
Final simplification80.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.7e-49) (not (<= y 6900000000.0))) (* x (pow z y)) (* x (- 1.0 (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e-49) || !(y <= 6900000000.0)) {
tmp = x * pow(z, y);
} else {
tmp = x * (1.0 - (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) :: tmp
if ((y <= (-1.7d-49)) .or. (.not. (y <= 6900000000.0d0))) then
tmp = x * (z ** y)
else
tmp = x * (1.0d0 - (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 tmp;
if ((y <= -1.7e-49) || !(y <= 6900000000.0)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.7e-49) or not (y <= 6900000000.0): tmp = x * math.pow(z, y) else: tmp = x * (1.0 - (a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.7e-49) || !(y <= 6900000000.0)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.7e-49) || ~((y <= 6900000000.0))) tmp = x * (z ^ y); else tmp = x * (1.0 - (a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.7e-49], N[Not[LessEqual[y, 6900000000.0]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-49} \lor \neg \left(y \leq 6900000000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
if y < -1.70000000000000002e-49 or 6.9e9 < y Initial program 98.7%
Taylor expanded in y around inf 92.0%
Taylor expanded in t around 0 74.1%
if -1.70000000000000002e-49 < y < 6.9e9Initial program 91.8%
Taylor expanded in y around 0 82.0%
sub-neg82.0%
sub-neg82.0%
neg-mul-182.0%
log1p-def90.2%
neg-mul-190.2%
sub-neg90.2%
Simplified90.2%
Taylor expanded in z around 0 90.2%
+-commutative90.2%
associate-*r*90.2%
associate-*r*90.2%
distribute-lft-out90.2%
neg-mul-190.2%
Simplified90.2%
Taylor expanded in a around 0 44.8%
neg-mul-144.8%
unsub-neg44.8%
Simplified44.8%
Final simplification61.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b) (* x a))))
(if (<= b -1.45e+123)
t_1
(if (<= b 6.4e-280)
x
(if (<= b 5.5e-176)
(* x (* a (- b)))
(if (<= b 6.9e+159) (* x (* t (- y))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -b * (x * a);
double tmp;
if (b <= -1.45e+123) {
tmp = t_1;
} else if (b <= 6.4e-280) {
tmp = x;
} else if (b <= 5.5e-176) {
tmp = x * (a * -b);
} else if (b <= 6.9e+159) {
tmp = x * (t * -y);
} 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 = -b * (x * a)
if (b <= (-1.45d+123)) then
tmp = t_1
else if (b <= 6.4d-280) then
tmp = x
else if (b <= 5.5d-176) then
tmp = x * (a * -b)
else if (b <= 6.9d+159) then
tmp = x * (t * -y)
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 = -b * (x * a);
double tmp;
if (b <= -1.45e+123) {
tmp = t_1;
} else if (b <= 6.4e-280) {
tmp = x;
} else if (b <= 5.5e-176) {
tmp = x * (a * -b);
} else if (b <= 6.9e+159) {
tmp = x * (t * -y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -b * (x * a) tmp = 0 if b <= -1.45e+123: tmp = t_1 elif b <= 6.4e-280: tmp = x elif b <= 5.5e-176: tmp = x * (a * -b) elif b <= 6.9e+159: tmp = x * (t * -y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-b) * Float64(x * a)) tmp = 0.0 if (b <= -1.45e+123) tmp = t_1; elseif (b <= 6.4e-280) tmp = x; elseif (b <= 5.5e-176) tmp = Float64(x * Float64(a * Float64(-b))); elseif (b <= 6.9e+159) tmp = Float64(x * Float64(t * Float64(-y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -b * (x * a); tmp = 0.0; if (b <= -1.45e+123) tmp = t_1; elseif (b <= 6.4e-280) tmp = x; elseif (b <= 5.5e-176) tmp = x * (a * -b); elseif (b <= 6.9e+159) tmp = x * (t * -y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.45e+123], t$95$1, If[LessEqual[b, 6.4e-280], x, If[LessEqual[b, 5.5e-176], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.9e+159], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \left(x \cdot a\right)\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 6.4 \cdot 10^{-280}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{-176}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq 6.9 \cdot 10^{+159}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if b < -1.45000000000000005e123 or 6.9000000000000002e159 < b Initial program 100.0%
Taylor expanded in b around inf 72.5%
mul-1-neg72.5%
distribute-rgt-neg-out72.5%
Simplified72.5%
Taylor expanded in a around 0 27.9%
mul-1-neg27.9%
unsub-neg27.9%
associate-*r*26.7%
*-commutative26.7%
associate-*l*25.5%
Simplified25.5%
Taylor expanded in b around inf 27.1%
mul-1-neg27.1%
*-commutative27.1%
associate-*r*30.8%
distribute-rgt-neg-in30.8%
distribute-lft-neg-in30.8%
Simplified30.8%
if -1.45000000000000005e123 < b < 6.4000000000000001e-280Initial program 92.3%
Taylor expanded in t around inf 67.0%
mul-1-neg67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in y around 0 26.9%
if 6.4000000000000001e-280 < b < 5.5e-176Initial program 89.1%
Taylor expanded in b around inf 16.3%
mul-1-neg16.3%
distribute-rgt-neg-out16.3%
Simplified16.3%
Taylor expanded in a around 0 16.2%
mul-1-neg16.2%
unsub-neg16.2%
associate-*r*16.2%
*-commutative16.2%
associate-*l*15.7%
Simplified15.7%
Taylor expanded in b around inf 32.4%
mul-1-neg32.4%
*-commutative32.4%
associate-*r*32.3%
distribute-rgt-neg-in32.3%
distribute-lft-neg-in32.3%
Simplified32.3%
Taylor expanded in b around 0 32.4%
mul-1-neg32.4%
associate-*r*43.7%
*-commutative43.7%
distribute-lft-neg-in43.7%
Simplified43.7%
if 5.5e-176 < b < 6.9000000000000002e159Initial program 97.1%
Taylor expanded in t around inf 50.7%
mul-1-neg50.7%
*-commutative50.7%
Simplified50.7%
Taylor expanded in y around 0 23.0%
mul-1-neg23.0%
unsub-neg23.0%
*-commutative23.0%
Simplified23.0%
Taylor expanded in t around inf 21.3%
mul-1-neg21.3%
associate-*r*24.1%
*-commutative24.1%
associate-*r*23.8%
distribute-rgt-neg-in23.8%
distribute-rgt-neg-in23.8%
Simplified23.8%
Final simplification28.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -4.4e+120)
(* (- b) (* x a))
(if (<= b 1e-279)
x
(if (<= b 2.85e-176)
(* x (* a (- b)))
(if (<= b 4.4e+159) (* x (* t (- y))) (* a (- (* x b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.4e+120) {
tmp = -b * (x * a);
} else if (b <= 1e-279) {
tmp = x;
} else if (b <= 2.85e-176) {
tmp = x * (a * -b);
} else if (b <= 4.4e+159) {
tmp = x * (t * -y);
} 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 (b <= (-4.4d+120)) then
tmp = -b * (x * a)
else if (b <= 1d-279) then
tmp = x
else if (b <= 2.85d-176) then
tmp = x * (a * -b)
else if (b <= 4.4d+159) then
tmp = x * (t * -y)
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 (b <= -4.4e+120) {
tmp = -b * (x * a);
} else if (b <= 1e-279) {
tmp = x;
} else if (b <= 2.85e-176) {
tmp = x * (a * -b);
} else if (b <= 4.4e+159) {
tmp = x * (t * -y);
} else {
tmp = a * -(x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.4e+120: tmp = -b * (x * a) elif b <= 1e-279: tmp = x elif b <= 2.85e-176: tmp = x * (a * -b) elif b <= 4.4e+159: tmp = x * (t * -y) else: tmp = a * -(x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.4e+120) tmp = Float64(Float64(-b) * Float64(x * a)); elseif (b <= 1e-279) tmp = x; elseif (b <= 2.85e-176) tmp = Float64(x * Float64(a * Float64(-b))); elseif (b <= 4.4e+159) tmp = Float64(x * Float64(t * Float64(-y))); else tmp = Float64(a * Float64(-Float64(x * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.4e+120) tmp = -b * (x * a); elseif (b <= 1e-279) tmp = x; elseif (b <= 2.85e-176) tmp = x * (a * -b); elseif (b <= 4.4e+159) tmp = x * (t * -y); else tmp = a * -(x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.4e+120], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-279], x, If[LessEqual[b, 2.85e-176], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.4e+159], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], N[(a * (-N[(x * b), $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{+120}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\mathbf{elif}\;b \leq 10^{-279}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 2.85 \cdot 10^{-176}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{+159}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(-x \cdot b\right)\\
\end{array}
\end{array}
if b < -4.4000000000000003e120Initial program 100.0%
Taylor expanded in b around inf 63.9%
mul-1-neg63.9%
distribute-rgt-neg-out63.9%
Simplified63.9%
Taylor expanded in a around 0 24.8%
mul-1-neg24.8%
unsub-neg24.8%
associate-*r*22.9%
*-commutative22.9%
associate-*l*22.9%
Simplified22.9%
Taylor expanded in b around inf 25.5%
mul-1-neg25.5%
*-commutative25.5%
associate-*r*31.5%
distribute-rgt-neg-in31.5%
distribute-lft-neg-in31.5%
Simplified31.5%
if -4.4000000000000003e120 < b < 1.00000000000000006e-279Initial program 92.3%
Taylor expanded in t around inf 67.0%
mul-1-neg67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in y around 0 26.9%
if 1.00000000000000006e-279 < b < 2.84999999999999992e-176Initial program 89.1%
Taylor expanded in b around inf 16.3%
mul-1-neg16.3%
distribute-rgt-neg-out16.3%
Simplified16.3%
Taylor expanded in a around 0 16.2%
mul-1-neg16.2%
unsub-neg16.2%
associate-*r*16.2%
*-commutative16.2%
associate-*l*15.7%
Simplified15.7%
Taylor expanded in b around inf 32.4%
mul-1-neg32.4%
*-commutative32.4%
associate-*r*32.3%
distribute-rgt-neg-in32.3%
distribute-lft-neg-in32.3%
Simplified32.3%
Taylor expanded in b around 0 32.4%
mul-1-neg32.4%
associate-*r*43.7%
*-commutative43.7%
distribute-lft-neg-in43.7%
Simplified43.7%
if 2.84999999999999992e-176 < b < 4.3999999999999998e159Initial program 97.1%
Taylor expanded in t around inf 50.7%
mul-1-neg50.7%
*-commutative50.7%
Simplified50.7%
Taylor expanded in y around 0 23.0%
mul-1-neg23.0%
unsub-neg23.0%
*-commutative23.0%
Simplified23.0%
Taylor expanded in t around inf 21.3%
mul-1-neg21.3%
associate-*r*24.1%
*-commutative24.1%
associate-*r*23.8%
distribute-rgt-neg-in23.8%
distribute-rgt-neg-in23.8%
Simplified23.8%
if 4.3999999999999998e159 < b Initial program 100.0%
Taylor expanded in b around inf 86.5%
mul-1-neg86.5%
distribute-rgt-neg-out86.5%
Simplified86.5%
Taylor expanded in a around 0 33.0%
mul-1-neg33.0%
unsub-neg33.0%
associate-*r*32.9%
*-commutative32.9%
associate-*l*29.8%
Simplified29.8%
Taylor expanded in b around inf 29.6%
Final simplification28.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8e-32) (* x (* t (- y))) (if (<= y 3.6e+34) (* x (- 1.0 (* a (+ z b)))) (* (- b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8e-32) {
tmp = x * (t * -y);
} else if (y <= 3.6e+34) {
tmp = x * (1.0 - (a * (z + b)));
} else {
tmp = -b * (x * 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 <= (-8d-32)) then
tmp = x * (t * -y)
else if (y <= 3.6d+34) then
tmp = x * (1.0d0 - (a * (z + b)))
else
tmp = -b * (x * 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 <= -8e-32) {
tmp = x * (t * -y);
} else if (y <= 3.6e+34) {
tmp = x * (1.0 - (a * (z + b)));
} else {
tmp = -b * (x * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8e-32: tmp = x * (t * -y) elif y <= 3.6e+34: tmp = x * (1.0 - (a * (z + b))) else: tmp = -b * (x * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8e-32) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 3.6e+34) tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); else tmp = Float64(Float64(-b) * Float64(x * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -8e-32) tmp = x * (t * -y); elseif (y <= 3.6e+34) tmp = x * (1.0 - (a * (z + b))); else tmp = -b * (x * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8e-32], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+34], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-32}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < -8.00000000000000045e-32Initial program 97.6%
Taylor expanded in t around inf 61.3%
mul-1-neg61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in y around 0 24.0%
mul-1-neg24.0%
unsub-neg24.0%
*-commutative24.0%
Simplified24.0%
Taylor expanded in t around inf 26.2%
mul-1-neg26.2%
associate-*r*22.7%
*-commutative22.7%
associate-*r*26.3%
distribute-rgt-neg-in26.3%
distribute-rgt-neg-in26.3%
Simplified26.3%
if -8.00000000000000045e-32 < y < 3.6e34Initial program 92.3%
Taylor expanded in y around 0 80.0%
sub-neg80.0%
sub-neg80.0%
neg-mul-180.0%
log1p-def87.7%
neg-mul-187.7%
sub-neg87.7%
Simplified87.7%
Taylor expanded in z around 0 87.7%
+-commutative87.7%
associate-*r*87.7%
associate-*r*87.7%
distribute-lft-out87.7%
neg-mul-187.7%
Simplified87.7%
Taylor expanded in a around 0 43.6%
neg-mul-143.6%
unsub-neg43.6%
Simplified43.6%
if 3.6e34 < y Initial program 100.0%
Taylor expanded in b around inf 32.1%
mul-1-neg32.1%
distribute-rgt-neg-out32.1%
Simplified32.1%
Taylor expanded in a around 0 5.0%
mul-1-neg5.0%
unsub-neg5.0%
associate-*r*5.0%
*-commutative5.0%
associate-*l*5.1%
Simplified5.1%
Taylor expanded in b around inf 15.0%
mul-1-neg15.0%
*-commutative15.0%
associate-*r*18.4%
distribute-rgt-neg-in18.4%
distribute-lft-neg-in18.4%
Simplified18.4%
Final simplification32.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.8e-31) (* x (* t (- y))) (if (<= y 2.7e+34) (* x (- 1.0 (* a b))) (* (- b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.8e-31) {
tmp = x * (t * -y);
} else if (y <= 2.7e+34) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -b * (x * 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.8d-31)) then
tmp = x * (t * -y)
else if (y <= 2.7d+34) then
tmp = x * (1.0d0 - (a * b))
else
tmp = -b * (x * 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.8e-31) {
tmp = x * (t * -y);
} else if (y <= 2.7e+34) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -b * (x * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.8e-31: tmp = x * (t * -y) elif y <= 2.7e+34: tmp = x * (1.0 - (a * b)) else: tmp = -b * (x * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.8e-31) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 2.7e+34) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(Float64(-b) * Float64(x * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.8e-31) tmp = x * (t * -y); elseif (y <= 2.7e+34) tmp = x * (1.0 - (a * b)); else tmp = -b * (x * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.8e-31], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+34], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < -2.7999999999999999e-31Initial program 97.6%
Taylor expanded in t around inf 61.3%
mul-1-neg61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in y around 0 24.0%
mul-1-neg24.0%
unsub-neg24.0%
*-commutative24.0%
Simplified24.0%
Taylor expanded in t around inf 26.2%
mul-1-neg26.2%
associate-*r*22.7%
*-commutative22.7%
associate-*r*26.3%
distribute-rgt-neg-in26.3%
distribute-rgt-neg-in26.3%
Simplified26.3%
if -2.7999999999999999e-31 < y < 2.7e34Initial program 92.3%
Taylor expanded in b around inf 78.4%
mul-1-neg78.4%
distribute-rgt-neg-out78.4%
Simplified78.4%
Taylor expanded in a around 0 40.1%
mul-1-neg40.1%
unsub-neg40.1%
associate-*r*41.6%
*-commutative41.6%
associate-*l*39.6%
Simplified39.6%
Taylor expanded in x around 0 41.6%
if 2.7e34 < y Initial program 100.0%
Taylor expanded in b around inf 32.1%
mul-1-neg32.1%
distribute-rgt-neg-out32.1%
Simplified32.1%
Taylor expanded in a around 0 5.0%
mul-1-neg5.0%
unsub-neg5.0%
associate-*r*5.0%
*-commutative5.0%
associate-*l*5.1%
Simplified5.1%
Taylor expanded in b around inf 15.0%
mul-1-neg15.0%
*-commutative15.0%
associate-*r*18.4%
distribute-rgt-neg-in18.4%
distribute-lft-neg-in18.4%
Simplified18.4%
Final simplification31.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.85e-31) (not (<= y 3e-248))) (* (- b) (* x a)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.85e-31) || !(y <= 3e-248)) {
tmp = -b * (x * 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 <= (-1.85d-31)) .or. (.not. (y <= 3d-248))) then
tmp = -b * (x * 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 <= -1.85e-31) || !(y <= 3e-248)) {
tmp = -b * (x * a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.85e-31) or not (y <= 3e-248): tmp = -b * (x * a) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.85e-31) || !(y <= 3e-248)) tmp = Float64(Float64(-b) * Float64(x * a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.85e-31) || ~((y <= 3e-248))) tmp = -b * (x * a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.85e-31], N[Not[LessEqual[y, 3e-248]], $MachinePrecision]], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-31} \lor \neg \left(y \leq 3 \cdot 10^{-248}\right):\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.8499999999999999e-31 or 3.00000000000000014e-248 < y Initial program 97.7%
Taylor expanded in b around inf 45.6%
mul-1-neg45.6%
distribute-rgt-neg-out45.6%
Simplified45.6%
Taylor expanded in a around 0 17.0%
mul-1-neg17.0%
unsub-neg17.0%
associate-*r*16.5%
*-commutative16.5%
associate-*l*18.2%
Simplified18.2%
Taylor expanded in b around inf 17.0%
mul-1-neg17.0%
*-commutative17.0%
associate-*r*18.5%
distribute-rgt-neg-in18.5%
distribute-lft-neg-in18.5%
Simplified18.5%
if -1.8499999999999999e-31 < y < 3.00000000000000014e-248Initial program 89.3%
Taylor expanded in t around inf 49.6%
mul-1-neg49.6%
*-commutative49.6%
Simplified49.6%
Taylor expanded in y around 0 38.9%
Final simplification23.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.8e-31) (* x (* t (- y))) (if (<= y 1.8e-248) x (* (- b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.8e-31) {
tmp = x * (t * -y);
} else if (y <= 1.8e-248) {
tmp = x;
} else {
tmp = -b * (x * 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.8d-31)) then
tmp = x * (t * -y)
else if (y <= 1.8d-248) then
tmp = x
else
tmp = -b * (x * 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.8e-31) {
tmp = x * (t * -y);
} else if (y <= 1.8e-248) {
tmp = x;
} else {
tmp = -b * (x * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.8e-31: tmp = x * (t * -y) elif y <= 1.8e-248: tmp = x else: tmp = -b * (x * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.8e-31) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 1.8e-248) tmp = x; else tmp = Float64(Float64(-b) * Float64(x * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.8e-31) tmp = x * (t * -y); elseif (y <= 1.8e-248) tmp = x; else tmp = -b * (x * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.8e-31], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-248], x, N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-31}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-248}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < -2.7999999999999999e-31Initial program 97.6%
Taylor expanded in t around inf 61.3%
mul-1-neg61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in y around 0 24.0%
mul-1-neg24.0%
unsub-neg24.0%
*-commutative24.0%
Simplified24.0%
Taylor expanded in t around inf 26.2%
mul-1-neg26.2%
associate-*r*22.7%
*-commutative22.7%
associate-*r*26.3%
distribute-rgt-neg-in26.3%
distribute-rgt-neg-in26.3%
Simplified26.3%
if -2.7999999999999999e-31 < y < 1.79999999999999992e-248Initial program 89.3%
Taylor expanded in t around inf 49.6%
mul-1-neg49.6%
*-commutative49.6%
Simplified49.6%
Taylor expanded in y around 0 38.9%
if 1.79999999999999992e-248 < y Initial program 97.8%
Taylor expanded in b around inf 52.9%
mul-1-neg52.9%
distribute-rgt-neg-out52.9%
Simplified52.9%
Taylor expanded in a around 0 19.1%
mul-1-neg19.1%
unsub-neg19.1%
associate-*r*19.0%
*-commutative19.0%
associate-*l*20.4%
Simplified20.4%
Taylor expanded in b around inf 19.3%
mul-1-neg19.3%
*-commutative19.3%
associate-*r*21.0%
distribute-rgt-neg-in21.0%
distribute-lft-neg-in21.0%
Simplified21.0%
Final simplification27.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.5e+39) x (* x (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.5e+39) {
tmp = x;
} else {
tmp = x * (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.5d+39) then
tmp = x
else
tmp = x * (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.5e+39) {
tmp = x;
} else {
tmp = x * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.5e+39: tmp = x else: tmp = x * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.5e+39) tmp = x; else tmp = Float64(x * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.5e+39) tmp = x; else tmp = x * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.5e+39], x, N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < 1.5e39Initial program 94.4%
Taylor expanded in t around inf 50.8%
mul-1-neg50.8%
*-commutative50.8%
Simplified50.8%
Taylor expanded in y around 0 19.5%
if 1.5e39 < y Initial program 100.0%
Taylor expanded in b around inf 30.9%
mul-1-neg30.9%
distribute-rgt-neg-out30.9%
Simplified30.9%
Taylor expanded in a around 0 5.1%
mul-1-neg5.1%
unsub-neg5.1%
associate-*r*5.1%
*-commutative5.1%
associate-*l*5.2%
Simplified5.2%
Taylor expanded in b around inf 15.2%
mul-1-neg15.2%
*-commutative15.2%
associate-*r*18.7%
distribute-rgt-neg-in18.7%
distribute-lft-neg-in18.7%
Simplified18.7%
expm1-log1p-u18.1%
expm1-udef38.2%
*-commutative38.2%
associate-*l*38.2%
add-sqr-sqrt11.1%
sqrt-unprod31.1%
sqr-neg31.1%
sqrt-unprod25.4%
add-sqr-sqrt36.4%
Applied egg-rr36.4%
expm1-def14.5%
expm1-log1p16.8%
Simplified16.8%
Final simplification18.9%
(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.6%
Taylor expanded in t around inf 53.9%
mul-1-neg53.9%
*-commutative53.9%
Simplified53.9%
Taylor expanded in y around 0 16.1%
Final simplification16.1%
herbie shell --seed 2023335
(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))))))