
(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 12 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 96.6%
fma-define97.0%
sub-neg97.0%
log1p-define100.0%
Simplified100.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.2e+63) (not (<= b 7.5e+46))) (* x (exp (- (+ (- 1.0 (* a b)) -1.0) (* 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 ((b <= -6.2e+63) || !(b <= 7.5e+46)) {
tmp = x * exp((((1.0 - (a * b)) + -1.0) - (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 ((b <= (-6.2d+63)) .or. (.not. (b <= 7.5d+46))) then
tmp = x * exp((((1.0d0 - (a * b)) + (-1.0d0)) - (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 ((b <= -6.2e+63) || !(b <= 7.5e+46)) {
tmp = x * Math.exp((((1.0 - (a * b)) + -1.0) - (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 (b <= -6.2e+63) or not (b <= 7.5e+46): tmp = x * math.exp((((1.0 - (a * b)) + -1.0) - (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 ((b <= -6.2e+63) || !(b <= 7.5e+46)) tmp = Float64(x * exp(Float64(Float64(Float64(1.0 - Float64(a * b)) + -1.0) - 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 ((b <= -6.2e+63) || ~((b <= 7.5e+46))) tmp = x * exp((((1.0 - (a * b)) + -1.0) - (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[b, -6.2e+63], N[Not[LessEqual[b, 7.5e+46]], $MachinePrecision]], N[(x * N[Exp[N[(N[(N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision] + -1.0), $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}\;b \leq -6.2 \cdot 10^{+63} \lor \neg \left(b \leq 7.5 \cdot 10^{+46}\right):\\
\;\;\;\;x \cdot e^{\left(\left(1 - a \cdot b\right) + -1\right) - y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if b < -6.2000000000000001e63 or 7.5000000000000003e46 < b Initial program 99.1%
expm1-log1p-u51.7%
expm1-undefine51.7%
sub-neg51.7%
sub-neg51.7%
log1p-undefine51.7%
sub-neg51.7%
add-sqr-sqrt0.0%
sqrt-unprod51.7%
sqr-neg51.7%
sqrt-unprod51.7%
add-sqr-sqrt51.7%
Applied egg-rr51.7%
Taylor expanded in z around 0 99.1%
mul-1-neg99.1%
unsub-neg99.1%
Simplified99.1%
Taylor expanded in t around inf 94.9%
mul-1-neg94.9%
distribute-lft-neg-out94.9%
*-commutative94.9%
Simplified94.9%
if -6.2000000000000001e63 < b < 7.5000000000000003e46Initial program 94.6%
fma-define94.6%
sub-neg94.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 89.8%
Final simplification92.1%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * (z + b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) - (a * (z + b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) - (a * (z + b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * (z + b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * (z + b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Initial program 96.6%
Taylor expanded in z around 0 99.6%
associate-*r*99.6%
associate-*r*99.6%
distribute-lft-out99.6%
mul-1-neg99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -6.5e-53) (not (<= t 2.7e-130))) (* x (exp (- (+ (- 1.0 (* a b)) -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 <= -6.5e-53) || !(t <= 2.7e-130)) {
tmp = x * exp((((1.0 - (a * b)) + -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 <= (-6.5d-53)) .or. (.not. (t <= 2.7d-130))) then
tmp = x * exp((((1.0d0 - (a * b)) + (-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 <= -6.5e-53) || !(t <= 2.7e-130)) {
tmp = x * Math.exp((((1.0 - (a * b)) + -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 <= -6.5e-53) or not (t <= 2.7e-130): tmp = x * math.exp((((1.0 - (a * b)) + -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 <= -6.5e-53) || !(t <= 2.7e-130)) tmp = Float64(x * exp(Float64(Float64(Float64(1.0 - Float64(a * b)) + -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 <= -6.5e-53) || ~((t <= 2.7e-130))) tmp = x * exp((((1.0 - (a * b)) + -1.0) - (y * t))); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -6.5e-53], N[Not[LessEqual[t, 2.7e-130]], $MachinePrecision]], N[(x * N[Exp[N[(N[(N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{-53} \lor \neg \left(t \leq 2.7 \cdot 10^{-130}\right):\\
\;\;\;\;x \cdot e^{\left(\left(1 - a \cdot b\right) + -1\right) - y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -6.4999999999999997e-53 or 2.69999999999999991e-130 < t Initial program 96.9%
expm1-log1p-u65.0%
expm1-undefine65.0%
sub-neg65.0%
sub-neg65.0%
log1p-undefine64.4%
sub-neg64.4%
add-sqr-sqrt0.0%
sqrt-unprod65.5%
sqr-neg65.5%
sqrt-unprod65.5%
add-sqr-sqrt65.5%
Applied egg-rr65.5%
Taylor expanded in z around 0 96.9%
mul-1-neg96.9%
unsub-neg96.9%
Simplified96.9%
Taylor expanded in t around inf 93.3%
mul-1-neg93.3%
distribute-lft-neg-out93.3%
*-commutative93.3%
Simplified93.3%
if -6.4999999999999997e-53 < t < 2.69999999999999991e-130Initial program 96.2%
fma-define96.2%
sub-neg96.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 76.0%
Taylor expanded in t around 0 76.0%
Final simplification87.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.5) (not (<= y 1.08e+33))) (* x (pow z y)) (/ x (exp (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5) || !(y <= 1.08e+33)) {
tmp = x * pow(z, y);
} else {
tmp = x / exp((a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6.5d0)) .or. (.not. (y <= 1.08d+33))) then
tmp = x * (z ** y)
else
tmp = x / exp((a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5) || !(y <= 1.08e+33)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x / Math.exp((a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.5) or not (y <= 1.08e+33): tmp = x * math.pow(z, y) else: tmp = x / math.exp((a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.5) || !(y <= 1.08e+33)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x / exp(Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.5) || ~((y <= 1.08e+33))) tmp = x * (z ^ y); else tmp = x / exp((a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.5], N[Not[LessEqual[y, 1.08e+33]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \lor \neg \left(y \leq 1.08 \cdot 10^{+33}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\end{array}
\end{array}
if y < -6.5 or 1.08000000000000005e33 < y Initial program 99.2%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 91.1%
Taylor expanded in t around 0 76.3%
if -6.5 < y < 1.08000000000000005e33Initial program 93.8%
expm1-log1p-u65.3%
expm1-undefine65.3%
sub-neg65.3%
sub-neg65.3%
log1p-undefine69.9%
sub-neg69.9%
add-sqr-sqrt0.0%
sqrt-unprod66.0%
sqr-neg66.0%
sqrt-unprod66.0%
add-sqr-sqrt66.0%
Applied egg-rr66.0%
Taylor expanded in z around 0 93.8%
mul-1-neg93.8%
unsub-neg93.8%
Simplified93.8%
Taylor expanded in t around inf 93.0%
mul-1-neg93.0%
distribute-lft-neg-out93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in y around 0 81.3%
exp-neg81.3%
*-commutative81.3%
exp-prod66.4%
associate-*r/66.4%
*-rgt-identity66.4%
exp-prod81.4%
*-commutative81.4%
Simplified81.4%
Final simplification78.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.2e-41) (not (<= y 7.2e-21))) (* x (pow z y)) (* x (exp (* z a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.2e-41) || !(y <= 7.2e-21)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((z * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.2d-41)) .or. (.not. (y <= 7.2d-21))) then
tmp = x * (z ** y)
else
tmp = x * exp((z * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.2e-41) || !(y <= 7.2e-21)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((z * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.2e-41) or not (y <= 7.2e-21): tmp = x * math.pow(z, y) else: tmp = x * math.exp((z * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.2e-41) || !(y <= 7.2e-21)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.2e-41) || ~((y <= 7.2e-21))) tmp = x * (z ^ y); else tmp = x * exp((z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.2e-41], N[Not[LessEqual[y, 7.2e-21]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(z * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{-41} \lor \neg \left(y \leq 7.2 \cdot 10^{-21}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{z \cdot a}\\
\end{array}
\end{array}
if y < -1.20000000000000011e-41 or 7.19999999999999979e-21 < y Initial program 99.3%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 88.6%
Taylor expanded in t around 0 73.8%
if -1.20000000000000011e-41 < y < 7.19999999999999979e-21Initial program 93.1%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in z around inf 57.4%
mul-1-neg57.4%
distribute-lft-neg-out57.4%
*-commutative57.4%
Simplified57.4%
neg-sub057.4%
sub-neg57.4%
add-sqr-sqrt30.1%
sqrt-unprod52.3%
sqr-neg52.3%
sqrt-unprod22.9%
add-sqr-sqrt51.3%
Applied egg-rr51.3%
+-lft-identity51.3%
Simplified51.3%
Final simplification64.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.85e+60) (* x (* a (- b))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.85e+60) {
tmp = x * (a * -b);
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.85d+60)) then
tmp = x * (a * -b)
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.85e+60) {
tmp = x * (a * -b);
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.85e+60: tmp = x * (a * -b) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.85e+60) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.85e+60) tmp = x * (a * -b); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.85e+60], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+60}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.84999999999999994e60Initial program 93.9%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 52.1%
mul-1-neg52.1%
distribute-lft-neg-out52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in b around 0 25.2%
neg-mul-125.2%
distribute-lft-neg-in25.2%
cancel-sign-sub-inv25.2%
Simplified25.2%
Taylor expanded in a around inf 25.4%
mul-1-neg25.4%
associate-*r*27.1%
distribute-rgt-neg-out27.1%
*-commutative27.1%
distribute-lft-neg-out27.1%
distribute-rgt-neg-out27.1%
distribute-rgt-neg-in27.1%
Simplified27.1%
if -1.84999999999999994e60 < t Initial program 97.3%
fma-define97.8%
sub-neg97.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 77.3%
Taylor expanded in t around 0 70.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.2e+81) (not (<= y 7e-12))) (* a (* x (- b))) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.2e+81) || !(y <= 7e-12)) {
tmp = a * (x * -b);
} else {
tmp = x * (1.0 - (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 <= (-3.2d+81)) .or. (.not. (y <= 7d-12))) then
tmp = a * (x * -b)
else
tmp = x * (1.0d0 - (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 <= -3.2e+81) || !(y <= 7e-12)) {
tmp = a * (x * -b);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.2e+81) or not (y <= 7e-12): tmp = a * (x * -b) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.2e+81) || !(y <= 7e-12)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = Float64(x * Float64(1.0 - Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.2e+81) || ~((y <= 7e-12))) tmp = a * (x * -b); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.2e+81], N[Not[LessEqual[y, 7e-12]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{+81} \lor \neg \left(y \leq 7 \cdot 10^{-12}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if y < -3.2e81 or 7.0000000000000001e-12 < y Initial program 99.2%
Taylor expanded in z around 0 99.2%
associate-*r*99.2%
associate-*r*99.2%
distribute-lft-out99.2%
mul-1-neg99.2%
Simplified99.2%
Taylor expanded in b around inf 40.9%
mul-1-neg40.9%
distribute-lft-neg-out40.9%
*-commutative40.9%
Simplified40.9%
Taylor expanded in b around 0 14.8%
neg-mul-114.8%
distribute-lft-neg-in14.8%
cancel-sign-sub-inv14.8%
Simplified14.8%
Taylor expanded in a around inf 30.8%
mul-1-neg30.8%
distribute-rgt-neg-in30.8%
distribute-lft-neg-in30.8%
Simplified30.8%
if -3.2e81 < y < 7.0000000000000001e-12Initial program 94.1%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 77.2%
mul-1-neg77.2%
distribute-lft-neg-out77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in b around 0 45.1%
neg-mul-145.1%
distribute-lft-neg-in45.1%
cancel-sign-sub-inv45.1%
Simplified45.1%
Final simplification38.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.45e-30) (* b (- (/ x b) (* x a))) (if (<= y 3e-15) (* x (- 1.0 (* a b))) (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.45e-30) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 3e-15) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.45d-30)) then
tmp = b * ((x / b) - (x * a))
else if (y <= 3d-15) then
tmp = x * (1.0d0 - (a * b))
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.45e-30) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 3e-15) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.45e-30: tmp = b * ((x / b) - (x * a)) elif y <= 3e-15: tmp = x * (1.0 - (a * b)) else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.45e-30) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); elseif (y <= 3e-15) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.45e-30) tmp = b * ((x / b) - (x * a)); elseif (y <= 3e-15) tmp = x * (1.0 - (a * b)); else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.45e-30], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-15], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-30}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -1.44999999999999995e-30Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 43.8%
mul-1-neg43.8%
distribute-lft-neg-out43.8%
*-commutative43.8%
Simplified43.8%
Taylor expanded in b around 0 17.9%
neg-mul-117.9%
distribute-lft-neg-in17.9%
cancel-sign-sub-inv17.9%
Simplified17.9%
Taylor expanded in b around inf 33.3%
+-commutative33.3%
mul-1-neg33.3%
sub-neg33.3%
*-commutative33.3%
Simplified33.3%
if -1.44999999999999995e-30 < y < 3e-15Initial program 93.4%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 81.0%
mul-1-neg81.0%
distribute-lft-neg-out81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in b around 0 47.5%
neg-mul-147.5%
distribute-lft-neg-in47.5%
cancel-sign-sub-inv47.5%
Simplified47.5%
if 3e-15 < y Initial program 98.6%
Taylor expanded in z around 0 98.6%
associate-*r*98.6%
associate-*r*98.6%
distribute-lft-out98.6%
mul-1-neg98.6%
Simplified98.6%
Taylor expanded in b around inf 39.1%
mul-1-neg39.1%
distribute-lft-neg-out39.1%
*-commutative39.1%
Simplified39.1%
Taylor expanded in b around 0 13.9%
neg-mul-113.9%
distribute-lft-neg-in13.9%
cancel-sign-sub-inv13.9%
Simplified13.9%
Taylor expanded in a around inf 34.1%
mul-1-neg34.1%
distribute-rgt-neg-in34.1%
distribute-lft-neg-in34.1%
Simplified34.1%
Final simplification40.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.9e-28) (not (<= y 4.6e-17))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e-28) || !(y <= 4.6e-17)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.9d-28)) .or. (.not. (y <= 4.6d-17))) then
tmp = a * (x * -b)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.9e-28) || !(y <= 4.6e-17)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.9e-28) or not (y <= 4.6e-17): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.9e-28) || !(y <= 4.6e-17)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.9e-28) || ~((y <= 4.6e-17))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.9e-28], N[Not[LessEqual[y, 4.6e-17]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-28} \lor \neg \left(y \leq 4.6 \cdot 10^{-17}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.90000000000000005e-28 or 4.60000000000000018e-17 < y Initial program 99.3%
Taylor expanded in z around 0 99.3%
associate-*r*99.3%
associate-*r*99.3%
distribute-lft-out99.3%
mul-1-neg99.3%
Simplified99.3%
Taylor expanded in b around inf 41.3%
mul-1-neg41.3%
distribute-lft-neg-out41.3%
*-commutative41.3%
Simplified41.3%
Taylor expanded in b around 0 15.8%
neg-mul-115.8%
distribute-lft-neg-in15.8%
cancel-sign-sub-inv15.8%
Simplified15.8%
Taylor expanded in a around inf 29.5%
mul-1-neg29.5%
distribute-rgt-neg-in29.5%
distribute-lft-neg-in29.5%
Simplified29.5%
if -1.90000000000000005e-28 < y < 4.60000000000000018e-17Initial program 93.4%
fma-define93.4%
sub-neg93.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 63.1%
Taylor expanded in y around 0 41.7%
Final simplification35.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.15e-28) (* x (* a (- b))) (if (<= y 2.6e-11) x (* a (* x (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.15e-28) {
tmp = x * (a * -b);
} else if (y <= 2.6e-11) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.15d-28)) then
tmp = x * (a * -b)
else if (y <= 2.6d-11) then
tmp = x
else
tmp = a * (x * -b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.15e-28) {
tmp = x * (a * -b);
} else if (y <= 2.6e-11) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.15e-28: tmp = x * (a * -b) elif y <= 2.6e-11: tmp = x else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.15e-28) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 2.6e-11) tmp = x; else tmp = Float64(a * Float64(x * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.15e-28) tmp = x * (a * -b); elseif (y <= 2.6e-11) tmp = x; else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.15e-28], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e-11], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-28}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -1.14999999999999993e-28Initial program 100.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in b around inf 43.8%
mul-1-neg43.8%
distribute-lft-neg-out43.8%
*-commutative43.8%
Simplified43.8%
Taylor expanded in b around 0 17.9%
neg-mul-117.9%
distribute-lft-neg-in17.9%
cancel-sign-sub-inv17.9%
Simplified17.9%
Taylor expanded in a around inf 24.5%
mul-1-neg24.5%
associate-*r*24.5%
distribute-rgt-neg-out24.5%
*-commutative24.5%
distribute-lft-neg-out24.5%
distribute-rgt-neg-out24.5%
distribute-rgt-neg-in24.5%
Simplified24.5%
if -1.14999999999999993e-28 < y < 2.6000000000000001e-11Initial program 93.4%
fma-define93.4%
sub-neg93.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 63.1%
Taylor expanded in y around 0 41.7%
if 2.6000000000000001e-11 < y Initial program 98.6%
Taylor expanded in z around 0 98.6%
associate-*r*98.6%
associate-*r*98.6%
distribute-lft-out98.6%
mul-1-neg98.6%
Simplified98.6%
Taylor expanded in b around inf 39.1%
mul-1-neg39.1%
distribute-lft-neg-out39.1%
*-commutative39.1%
Simplified39.1%
Taylor expanded in b around 0 13.9%
neg-mul-113.9%
distribute-lft-neg-in13.9%
cancel-sign-sub-inv13.9%
Simplified13.9%
Taylor expanded in a around inf 34.1%
mul-1-neg34.1%
distribute-rgt-neg-in34.1%
distribute-lft-neg-in34.1%
Simplified34.1%
Final simplification35.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 96.6%
fma-define97.0%
sub-neg97.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 77.2%
Taylor expanded in y around 0 21.1%
herbie shell --seed 2024139
(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))))))