
(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 14 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 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define99.5%
Simplified99.5%
Final simplification99.5%
(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 97.3%
Final simplification97.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.8e-61) (not (<= a 4.6e-52))) (* x (exp (- (* a (- b)) (* y t)))) (* x (exp (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.8e-61) || !(a <= 4.6e-52)) {
tmp = x * exp(((a * -b) - (y * t)));
} else {
tmp = x * exp((y * (log(z) - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-4.8d-61)) .or. (.not. (a <= 4.6d-52))) then
tmp = x * exp(((a * -b) - (y * t)))
else
tmp = x * exp((y * (log(z) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.8e-61) || !(a <= 4.6e-52)) {
tmp = x * Math.exp(((a * -b) - (y * t)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.8e-61) or not (a <= 4.6e-52): tmp = x * math.exp(((a * -b) - (y * t))) else: tmp = x * math.exp((y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.8e-61) || !(a <= 4.6e-52)) tmp = Float64(x * exp(Float64(Float64(a * Float64(-b)) - Float64(y * t)))); else tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.8e-61) || ~((a <= 4.6e-52))) tmp = x * exp(((a * -b) - (y * t))); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.8e-61], N[Not[LessEqual[a, 4.6e-52]], $MachinePrecision]], N[(x * N[Exp[N[(N[(a * (-b)), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-61} \lor \neg \left(a \leq 4.6 \cdot 10^{-52}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right) - y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if a < -4.8000000000000002e-61 or 4.59999999999999989e-52 < a Initial program 95.4%
Taylor expanded in z around 0 94.1%
Taylor expanded in t around inf 88.1%
mul-1-neg88.1%
Simplified88.1%
Taylor expanded in a around 0 88.1%
distribute-lft-out88.1%
*-commutative88.1%
Simplified88.1%
if -4.8000000000000002e-61 < a < 4.59999999999999989e-52Initial program 99.8%
Taylor expanded in y around inf 96.0%
Final simplification91.4%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * 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 * 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 * b)));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * b)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * 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 * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}
\end{array}
Initial program 97.3%
Taylor expanded in z around 0 96.5%
Final simplification96.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.00027) (not (<= y 500000.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 <= -0.00027) || !(y <= 500000.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 <= (-0.00027d0)) .or. (.not. (y <= 500000.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 <= -0.00027) || !(y <= 500000.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 <= -0.00027) or not (y <= 500000.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 <= -0.00027) || !(y <= 500000.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 <= -0.00027) || ~((y <= 500000.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, -0.00027], N[Not[LessEqual[y, 500000.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 -0.00027 \lor \neg \left(y \leq 500000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot \left(z + b\right)}\\
\end{array}
\end{array}
if y < -2.70000000000000003e-4 or 5e5 < y Initial program 99.2%
Taylor expanded in y around inf 87.9%
Taylor expanded in t around 0 72.0%
if -2.70000000000000003e-4 < y < 5e5Initial program 95.2%
Taylor expanded in y around 0 80.3%
sub-neg80.3%
log1p-define85.7%
Simplified85.7%
Taylor expanded in z around 0 85.7%
associate-*r*85.7%
associate-*r*85.7%
distribute-lft-out85.7%
mul-1-neg85.7%
Simplified85.7%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1450000.0) (not (<= t 1.6e-127))) (* x (exp (* y (- t)))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1450000.0) || !(t <= 1.6e-127)) {
tmp = x * exp((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 <= (-1450000.0d0)) .or. (.not. (t <= 1.6d-127))) then
tmp = x * exp((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 <= -1450000.0) || !(t <= 1.6e-127)) {
tmp = x * Math.exp((y * -t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1450000.0) or not (t <= 1.6e-127): tmp = x * math.exp((y * -t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1450000.0) || !(t <= 1.6e-127)) tmp = Float64(x * exp(Float64(y * Float64(-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 <= -1450000.0) || ~((t <= 1.6e-127))) tmp = x * exp((y * -t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1450000.0], N[Not[LessEqual[t, 1.6e-127]], $MachinePrecision]], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1450000 \lor \neg \left(t \leq 1.6 \cdot 10^{-127}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.45e6 or 1.60000000000000009e-127 < t Initial program 99.2%
Taylor expanded in t around inf 81.5%
mul-1-neg81.5%
distribute-lft-neg-out81.5%
*-commutative81.5%
Simplified81.5%
if -1.45e6 < t < 1.60000000000000009e-127Initial program 94.7%
Taylor expanded in y around inf 66.0%
Taylor expanded in t around 0 66.0%
Final simplification74.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.00027) (not (<= y 225000.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 <= -0.00027) || !(y <= 225000.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 <= (-0.00027d0)) .or. (.not. (y <= 225000.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 <= -0.00027) || !(y <= 225000.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 <= -0.00027) or not (y <= 225000.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 <= -0.00027) || !(y <= 225000.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 <= -0.00027) || ~((y <= 225000.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, -0.00027], N[Not[LessEqual[y, 225000.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 -0.00027 \lor \neg \left(y \leq 225000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -2.70000000000000003e-4 or 225000 < y Initial program 99.2%
Taylor expanded in y around inf 87.9%
Taylor expanded in t around 0 72.0%
if -2.70000000000000003e-4 < y < 225000Initial program 95.2%
Taylor expanded in b around inf 79.6%
associate-*r*79.6%
mul-1-neg79.6%
Simplified79.6%
Final simplification75.7%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* a (- b)) (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((a * -b) - (y * t)));
}
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 * -b) - (y * t)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((a * -b) - (y * t)));
}
def code(x, y, z, t, a, b): return x * math.exp(((a * -b) - (y * t)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(a * Float64(-b)) - Float64(y * t)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((a * -b) - (y * t))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(a * (-b)), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{a \cdot \left(-b\right) - y \cdot t}
\end{array}
Initial program 97.3%
Taylor expanded in z around 0 96.5%
Taylor expanded in t around inf 83.2%
mul-1-neg83.2%
Simplified83.2%
Taylor expanded in a around 0 83.2%
distribute-lft-out83.2%
*-commutative83.2%
Simplified83.2%
Final simplification83.2%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5.2e+70) (* x (- 1.0 (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5.2e+70) {
tmp = x * (1.0 - (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 <= (-5.2d+70)) then
tmp = x * (1.0d0 - (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 <= -5.2e+70) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5.2e+70: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5.2e+70) tmp = Float64(x * Float64(1.0 - 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 <= -5.2e+70) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5.2e+70], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+70}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -5.2000000000000001e70Initial program 97.2%
Taylor expanded in t around inf 94.6%
mul-1-neg94.6%
distribute-lft-neg-out94.6%
*-commutative94.6%
Simplified94.6%
Taylor expanded in y around 0 35.1%
mul-1-neg35.1%
unsub-neg35.1%
*-commutative35.1%
Simplified35.1%
if -5.2000000000000001e70 < t Initial program 97.3%
Taylor expanded in y around inf 71.7%
Taylor expanded in t around 0 63.3%
Final simplification59.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.6e-20) (not (<= y 920000000000.0))) (* t (* x (- y))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.6e-20) || !(y <= 920000000000.0)) {
tmp = t * (x * -y);
} 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.6d-20)) .or. (.not. (y <= 920000000000.0d0))) then
tmp = t * (x * -y)
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.6e-20) || !(y <= 920000000000.0)) {
tmp = t * (x * -y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.6e-20) or not (y <= 920000000000.0): tmp = t * (x * -y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.6e-20) || !(y <= 920000000000.0)) tmp = Float64(t * Float64(x * Float64(-y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.6e-20) || ~((y <= 920000000000.0))) tmp = t * (x * -y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.6e-20], N[Not[LessEqual[y, 920000000000.0]], $MachinePrecision]], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-20} \lor \neg \left(y \leq 920000000000\right):\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.59999999999999985e-20 or 9.2e11 < y Initial program 99.2%
Taylor expanded in t around inf 59.9%
mul-1-neg59.9%
distribute-lft-neg-out59.9%
*-commutative59.9%
Simplified59.9%
Taylor expanded in y around 0 17.2%
mul-1-neg17.2%
unsub-neg17.2%
*-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 17.2%
associate-*r*17.2%
mul-1-neg17.2%
*-commutative17.2%
Simplified17.2%
if -1.59999999999999985e-20 < y < 9.2e11Initial program 95.1%
Taylor expanded in t around inf 61.3%
mul-1-neg61.3%
distribute-lft-neg-out61.3%
*-commutative61.3%
Simplified61.3%
Taylor expanded in y around 0 38.1%
Final simplification27.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a 72000000000.0) (* x (- 1.0 (* z a))) (* t (* x (- y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 72000000000.0) {
tmp = x * (1.0 - (z * a));
} else {
tmp = t * (x * -y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= 72000000000.0d0) then
tmp = x * (1.0d0 - (z * a))
else
tmp = t * (x * -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 72000000000.0) {
tmp = x * (1.0 - (z * a));
} else {
tmp = t * (x * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 72000000000.0: tmp = x * (1.0 - (z * a)) else: tmp = t * (x * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 72000000000.0) tmp = Float64(x * Float64(1.0 - Float64(z * a))); else tmp = Float64(t * Float64(x * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 72000000000.0) tmp = x * (1.0 - (z * a)); else tmp = t * (x * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 72000000000.0], N[(x * N[(1.0 - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 72000000000:\\
\;\;\;\;x \cdot \left(1 - z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if a < 7.2e10Initial program 99.9%
Taylor expanded in y around 0 56.4%
sub-neg56.4%
log1p-define55.9%
Simplified55.9%
Taylor expanded in b around 0 26.1%
Taylor expanded in z around 0 26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
if 7.2e10 < a Initial program 88.8%
Taylor expanded in t around inf 46.0%
mul-1-neg46.0%
distribute-lft-neg-out46.0%
*-commutative46.0%
Simplified46.0%
Taylor expanded in y around 0 20.7%
mul-1-neg20.7%
unsub-neg20.7%
*-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 25.5%
associate-*r*25.5%
mul-1-neg25.5%
*-commutative25.5%
Simplified25.5%
Final simplification26.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.25e+173) (- x (* z (* x a))) (* x (- 1.0 (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.25e+173) {
tmp = x - (z * (x * a));
} else {
tmp = x * (1.0 - (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 (a <= (-2.25d+173)) then
tmp = x - (z * (x * a))
else
tmp = x * (1.0d0 - (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 (a <= -2.25e+173) {
tmp = x - (z * (x * a));
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.25e+173: tmp = x - (z * (x * a)) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.25e+173) tmp = Float64(x - Float64(z * Float64(x * a))); else tmp = Float64(x * Float64(1.0 - Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.25e+173) tmp = x - (z * (x * a)); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.25e+173], N[(x - N[(z * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.25 \cdot 10^{+173}:\\
\;\;\;\;x - z \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if a < -2.2500000000000001e173Initial program 100.0%
Taylor expanded in y around 0 89.6%
sub-neg89.6%
log1p-define86.1%
Simplified86.1%
Taylor expanded in b around 0 10.6%
Taylor expanded in z around 0 14.6%
mul-1-neg14.6%
unsub-neg14.6%
associate-*r*34.4%
Simplified34.4%
if -2.2500000000000001e173 < a Initial program 96.9%
Taylor expanded in t around inf 62.5%
mul-1-neg62.5%
distribute-lft-neg-out62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in y around 0 31.0%
mul-1-neg31.0%
unsub-neg31.0%
*-commutative31.0%
Simplified31.0%
Final simplification31.4%
(FPCore (x y z t a b) :precision binary64 (* x (- 1.0 (* y t))))
double code(double x, double y, double z, double t, double a, double b) {
return x * (1.0 - (y * t));
}
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 * (1.0d0 - (y * t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * (1.0 - (y * t));
}
def code(x, y, z, t, a, b): return x * (1.0 - (y * t))
function code(x, y, z, t, a, b) return Float64(x * Float64(1.0 - Float64(y * t))) end
function tmp = code(x, y, z, t, a, b) tmp = x * (1.0 - (y * t)); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - y \cdot t\right)
\end{array}
Initial program 97.3%
Taylor expanded in t around inf 60.6%
mul-1-neg60.6%
distribute-lft-neg-out60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in y around 0 28.0%
mul-1-neg28.0%
unsub-neg28.0%
*-commutative28.0%
Simplified28.0%
Final simplification28.0%
(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 97.3%
Taylor expanded in t around inf 60.6%
mul-1-neg60.6%
distribute-lft-neg-out60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in y around 0 20.4%
Final simplification20.4%
herbie shell --seed 2024071
(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))))))