
(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.6%
fma-def98.4%
sub-neg98.4%
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 97.6%
Final simplification97.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -8.8e+102) (not (<= b 6.5e+113))) (* x (exp (* a (- b)))) (* x (/ (exp (+ (* y (- (log z) t)) 1.0)) E))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -8.8e+102) || !(b <= 6.5e+113)) {
tmp = x * exp((a * -b));
} else {
tmp = x * (exp(((y * (log(z) - t)) + 1.0)) / ((double) M_E));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -8.8e+102) || !(b <= 6.5e+113)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * (Math.exp(((y * (Math.log(z) - t)) + 1.0)) / Math.E);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -8.8e+102) or not (b <= 6.5e+113): tmp = x * math.exp((a * -b)) else: tmp = x * (math.exp(((y * (math.log(z) - t)) + 1.0)) / math.e) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -8.8e+102) || !(b <= 6.5e+113)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * Float64(exp(Float64(Float64(y * Float64(log(z) - t)) + 1.0)) / exp(1))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -8.8e+102) || ~((b <= 6.5e+113))) tmp = x * exp((a * -b)); else tmp = x * (exp(((y * (log(z) - t)) + 1.0)) / 2.71828182845904523536); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -8.8e+102], N[Not[LessEqual[b, 6.5e+113]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+102} \lor \neg \left(b \leq 6.5 \cdot 10^{+113}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{e^{y \cdot \left(\log z - t\right) + 1}}{e}\\
\end{array}
\end{array}
if b < -8.8000000000000003e102 or 6.5000000000000001e113 < b Initial program 96.5%
Taylor expanded in b around inf 87.4%
mul-1-neg87.4%
distribute-rgt-neg-out87.4%
Simplified87.4%
if -8.8000000000000003e102 < b < 6.5000000000000001e113Initial program 98.2%
Taylor expanded in y around inf 86.8%
expm1-log1p-u58.2%
expm1-def58.2%
exp-diff58.2%
log1p-udef58.2%
rem-exp-log86.9%
+-commutative86.9%
Applied egg-rr86.9%
Final simplification87.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -8.6e+102) (not (<= b 4.5e+114))) (* x (exp (* a (- b)))) (* x (exp (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -8.6e+102) || !(b <= 4.5e+114)) {
tmp = x * exp((a * -b));
} 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 ((b <= (-8.6d+102)) .or. (.not. (b <= 4.5d+114))) then
tmp = x * exp((a * -b))
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 ((b <= -8.6e+102) || !(b <= 4.5e+114)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -8.6e+102) or not (b <= 4.5e+114): tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -8.6e+102) || !(b <= 4.5e+114)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); 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 ((b <= -8.6e+102) || ~((b <= 4.5e+114))) tmp = x * exp((a * -b)); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -8.6e+102], N[Not[LessEqual[b, 4.5e+114]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $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}\;b \leq -8.6 \cdot 10^{+102} \lor \neg \left(b \leq 4.5 \cdot 10^{+114}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if b < -8.6000000000000002e102 or 4.5000000000000001e114 < b Initial program 96.5%
Taylor expanded in b around inf 87.4%
mul-1-neg87.4%
distribute-rgt-neg-out87.4%
Simplified87.4%
if -8.6000000000000002e102 < b < 4.5000000000000001e114Initial program 98.2%
Taylor expanded in y around inf 86.8%
Final simplification87.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -3.3e+69) (not (<= t 520000000.0))) (* x (exp (* t (- y)))) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -3.3e+69) || !(t <= 520000000.0)) {
tmp = x * exp((t * -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 ((t <= (-3.3d+69)) .or. (.not. (t <= 520000000.0d0))) then
tmp = x * exp((t * -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 ((t <= -3.3e+69) || !(t <= 520000000.0)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -3.3e+69) or not (t <= 520000000.0): tmp = x * math.exp((t * -y)) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -3.3e+69) || !(t <= 520000000.0)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -3.3e+69) || ~((t <= 520000000.0))) tmp = x * exp((t * -y)); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.3e+69], N[Not[LessEqual[t, 520000000.0]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+69} \lor \neg \left(t \leq 520000000\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if t < -3.2999999999999999e69 or 5.2e8 < t Initial program 95.7%
Taylor expanded in t around inf 87.9%
mul-1-neg87.9%
*-commutative87.9%
Simplified87.9%
if -3.2999999999999999e69 < t < 5.2e8Initial program 99.0%
Taylor expanded in y around 0 74.4%
sub-neg74.4%
sub-neg74.4%
neg-mul-174.4%
log1p-def76.0%
neg-mul-176.0%
sub-neg76.0%
Simplified76.0%
Taylor expanded in z around 0 76.0%
associate-*r*76.0%
associate-*r*76.0%
distribute-lft-out76.0%
mul-1-neg76.0%
Simplified76.0%
Final simplification81.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.05e+18) (not (<= t 8e-71))) (* 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 <= -2.05e+18) || !(t <= 8e-71)) {
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 <= (-2.05d+18)) .or. (.not. (t <= 8d-71))) 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 <= -2.05e+18) || !(t <= 8e-71)) {
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 <= -2.05e+18) or not (t <= 8e-71): 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 <= -2.05e+18) || !(t <= 8e-71)) 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 <= -2.05e+18) || ~((t <= 8e-71))) 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, -2.05e+18], N[Not[LessEqual[t, 8e-71]], $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 -2.05 \cdot 10^{+18} \lor \neg \left(t \leq 8 \cdot 10^{-71}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -2.05e18 or 7.9999999999999993e-71 < t Initial program 95.8%
Taylor expanded in t around inf 80.6%
mul-1-neg80.6%
*-commutative80.6%
Simplified80.6%
if -2.05e18 < t < 7.9999999999999993e-71Initial program 100.0%
Taylor expanded in y around inf 67.1%
Taylor expanded in t around 0 67.1%
Final simplification74.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.8e+42) (not (<= t 360000000.0))) (* x (exp (* t (- y)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.8e+42) || !(t <= 360000000.0)) {
tmp = x * exp((t * -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 ((t <= (-1.8d+42)) .or. (.not. (t <= 360000000.0d0))) then
tmp = x * exp((t * -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 ((t <= -1.8e+42) || !(t <= 360000000.0)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.8e+42) or not (t <= 360000000.0): tmp = x * math.exp((t * -y)) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.8e+42) || !(t <= 360000000.0)) tmp = Float64(x * exp(Float64(t * Float64(-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 ((t <= -1.8e+42) || ~((t <= 360000000.0))) tmp = x * exp((t * -y)); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.8e+42], N[Not[LessEqual[t, 360000000.0]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+42} \lor \neg \left(t \leq 360000000\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if t < -1.8e42 or 3.6e8 < t Initial program 95.2%
Taylor expanded in t around inf 86.2%
mul-1-neg86.2%
*-commutative86.2%
Simplified86.2%
if -1.8e42 < t < 3.6e8Initial program 99.7%
Taylor expanded in b around inf 74.3%
mul-1-neg74.3%
distribute-rgt-neg-out74.3%
Simplified74.3%
Final simplification79.8%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4.1e+18) (* 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 <= -4.1e+18) {
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 <= (-4.1d+18)) 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 <= -4.1e+18) {
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 <= -4.1e+18: 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 <= -4.1e+18) 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 <= -4.1e+18) 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, -4.1e+18], 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 -4.1 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -4.1e18Initial program 97.5%
Taylor expanded in t around inf 84.1%
mul-1-neg84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in y around 0 41.2%
neg-mul-141.2%
distribute-rgt-neg-in41.2%
Simplified41.2%
if -4.1e18 < t Initial program 97.6%
Taylor expanded in y around inf 72.1%
Taylor expanded in t around 0 65.7%
Final simplification60.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.5e+149) (* x (* t (- y))) (if (<= y 5.56e-13) (+ x (* t (* x y))) (* y (* x (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.5e+149) {
tmp = x * (t * -y);
} else if (y <= 5.56e-13) {
tmp = x + (t * (x * y));
} else {
tmp = y * (x * -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 (y <= (-2.5d+149)) then
tmp = x * (t * -y)
else if (y <= 5.56d-13) then
tmp = x + (t * (x * y))
else
tmp = y * (x * -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 (y <= -2.5e+149) {
tmp = x * (t * -y);
} else if (y <= 5.56e-13) {
tmp = x + (t * (x * y));
} else {
tmp = y * (x * -t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.5e+149: tmp = x * (t * -y) elif y <= 5.56e-13: tmp = x + (t * (x * y)) else: tmp = y * (x * -t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.5e+149) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 5.56e-13) tmp = Float64(x + Float64(t * Float64(x * y))); else tmp = Float64(y * Float64(x * Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.5e+149) tmp = x * (t * -y); elseif (y <= 5.56e-13) tmp = x + (t * (x * y)); else tmp = y * (x * -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.5e+149], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.56e-13], N[(x + N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+149}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 5.56 \cdot 10^{-13}:\\
\;\;\;\;x + t \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if y < -2.49999999999999995e149Initial program 100.0%
Taylor expanded in t around inf 78.3%
mul-1-neg78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y around 0 38.5%
mul-1-neg38.5%
unsub-neg38.5%
Simplified38.5%
Taylor expanded in t around inf 38.3%
*-commutative38.3%
associate-*r*38.3%
neg-mul-138.3%
distribute-rgt-neg-in38.3%
associate-*l*41.1%
distribute-lft-neg-in41.1%
distribute-rgt-neg-in41.1%
Simplified41.1%
if -2.49999999999999995e149 < y < 5.55999999999999953e-13Initial program 98.6%
Taylor expanded in t around inf 60.6%
mul-1-neg60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in y around 0 37.0%
mul-1-neg37.0%
unsub-neg37.0%
Simplified37.0%
cancel-sign-sub-inv37.0%
*-commutative37.0%
associate-*r*37.2%
distribute-lft-neg-in37.2%
distribute-rgt-neg-out37.2%
distribute-rgt1-in37.2%
*-commutative37.2%
fma-def37.2%
add-sqr-sqrt17.9%
sqrt-unprod36.5%
sqr-neg36.5%
sqrt-unprod19.0%
add-sqr-sqrt35.8%
Applied egg-rr35.8%
Taylor expanded in y around 0 37.0%
if 5.55999999999999953e-13 < y Initial program 94.1%
Taylor expanded in t around inf 58.8%
mul-1-neg58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in y around 0 16.0%
mul-1-neg16.0%
unsub-neg16.0%
Simplified16.0%
Taylor expanded in t around inf 18.5%
mul-1-neg18.5%
associate-*r*24.1%
*-commutative24.1%
distribute-rgt-neg-in24.1%
Simplified24.1%
Final simplification34.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.4e+149) (not (<= y 5.56e-13))) (* x (* t (- y))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.4e+149) || !(y <= 5.56e-13)) {
tmp = x * (t * -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 <= (-2.4d+149)) .or. (.not. (y <= 5.56d-13))) then
tmp = x * (t * -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 <= -2.4e+149) || !(y <= 5.56e-13)) {
tmp = x * (t * -y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.4e+149) or not (y <= 5.56e-13): tmp = x * (t * -y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.4e+149) || !(y <= 5.56e-13)) tmp = Float64(x * Float64(t * Float64(-y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.4e+149) || ~((y <= 5.56e-13))) tmp = x * (t * -y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.4e+149], N[Not[LessEqual[y, 5.56e-13]], $MachinePrecision]], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+149} \lor \neg \left(y \leq 5.56 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.40000000000000012e149 or 5.55999999999999953e-13 < y Initial program 96.2%
Taylor expanded in t around inf 65.5%
mul-1-neg65.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in y around 0 23.8%
mul-1-neg23.8%
unsub-neg23.8%
Simplified23.8%
Taylor expanded in t around inf 25.4%
*-commutative25.4%
associate-*r*25.4%
neg-mul-125.4%
distribute-rgt-neg-in25.4%
associate-*l*29.0%
distribute-lft-neg-in29.0%
distribute-rgt-neg-in29.0%
Simplified29.0%
if -2.40000000000000012e149 < y < 5.55999999999999953e-13Initial program 98.6%
Taylor expanded in y around inf 67.9%
Taylor expanded in y around 0 36.3%
Final simplification33.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.4e+149) (* x (* t (- y))) (if (<= y 5.56e-13) x (* y (* x (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.4e+149) {
tmp = x * (t * -y);
} else if (y <= 5.56e-13) {
tmp = x;
} else {
tmp = y * (x * -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 (y <= (-2.4d+149)) then
tmp = x * (t * -y)
else if (y <= 5.56d-13) then
tmp = x
else
tmp = y * (x * -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 (y <= -2.4e+149) {
tmp = x * (t * -y);
} else if (y <= 5.56e-13) {
tmp = x;
} else {
tmp = y * (x * -t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.4e+149: tmp = x * (t * -y) elif y <= 5.56e-13: tmp = x else: tmp = y * (x * -t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.4e+149) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 5.56e-13) tmp = x; else tmp = Float64(y * Float64(x * Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.4e+149) tmp = x * (t * -y); elseif (y <= 5.56e-13) tmp = x; else tmp = y * (x * -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.4e+149], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.56e-13], x, N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+149}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 5.56 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if y < -2.40000000000000012e149Initial program 100.0%
Taylor expanded in t around inf 78.3%
mul-1-neg78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y around 0 38.5%
mul-1-neg38.5%
unsub-neg38.5%
Simplified38.5%
Taylor expanded in t around inf 38.3%
*-commutative38.3%
associate-*r*38.3%
neg-mul-138.3%
distribute-rgt-neg-in38.3%
associate-*l*41.1%
distribute-lft-neg-in41.1%
distribute-rgt-neg-in41.1%
Simplified41.1%
if -2.40000000000000012e149 < y < 5.55999999999999953e-13Initial program 98.6%
Taylor expanded in y around inf 67.9%
Taylor expanded in y around 0 36.3%
if 5.55999999999999953e-13 < y Initial program 94.1%
Taylor expanded in t around inf 58.8%
mul-1-neg58.8%
*-commutative58.8%
Simplified58.8%
Taylor expanded in y around 0 16.0%
mul-1-neg16.0%
unsub-neg16.0%
Simplified16.0%
Taylor expanded in t around inf 18.5%
mul-1-neg18.5%
associate-*r*24.1%
*-commutative24.1%
distribute-rgt-neg-in24.1%
Simplified24.1%
Final simplification33.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 14500000000000.0) (- x (* t (* x y))) (* y (* x (- t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 14500000000000.0) {
tmp = x - (t * (x * y));
} else {
tmp = y * (x * -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 (y <= 14500000000000.0d0) then
tmp = x - (t * (x * y))
else
tmp = y * (x * -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 (y <= 14500000000000.0) {
tmp = x - (t * (x * y));
} else {
tmp = y * (x * -t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 14500000000000.0: tmp = x - (t * (x * y)) else: tmp = y * (x * -t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 14500000000000.0) tmp = Float64(x - Float64(t * Float64(x * y))); else tmp = Float64(y * Float64(x * Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 14500000000000.0) tmp = x - (t * (x * y)); else tmp = y * (x * -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 14500000000000.0], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * (-t)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 14500000000000:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \left(-t\right)\right)\\
\end{array}
\end{array}
if y < 1.45e13Initial program 98.9%
Taylor expanded in t around inf 62.6%
mul-1-neg62.6%
*-commutative62.6%
Simplified62.6%
Taylor expanded in y around 0 36.8%
mul-1-neg36.8%
unsub-neg36.8%
Simplified36.8%
if 1.45e13 < y Initial program 93.6%
Taylor expanded in t around inf 62.4%
mul-1-neg62.4%
*-commutative62.4%
Simplified62.4%
Taylor expanded in y around 0 15.5%
mul-1-neg15.5%
unsub-neg15.5%
Simplified15.5%
Taylor expanded in t around inf 18.5%
mul-1-neg18.5%
associate-*r*24.6%
*-commutative24.6%
distribute-rgt-neg-in24.6%
Simplified24.6%
Final simplification33.9%
(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.6%
Taylor expanded in t around inf 62.6%
mul-1-neg62.6%
*-commutative62.6%
Simplified62.6%
Taylor expanded in y around 0 33.2%
neg-mul-133.2%
distribute-rgt-neg-in33.2%
Simplified33.2%
Final simplification33.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.6%
Taylor expanded in y around inf 74.9%
Taylor expanded in y around 0 23.1%
Final simplification23.1%
herbie shell --seed 2024010
(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))))))