
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* 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.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b 3.6e+74) (* x (pow E (* y (- (log z) t)))) (* x (exp (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 3.6e+74) {
tmp = x * pow(((double) M_E), (y * (log(z) - t)));
} else {
tmp = x * exp((a * (log((1.0 - z)) - b)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 3.6e+74) {
tmp = x * Math.pow(Math.E, (y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (Math.log((1.0 - z)) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 3.6e+74: tmp = x * math.pow(math.e, (y * (math.log(z) - t))) else: tmp = x * math.exp((a * (math.log((1.0 - z)) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 3.6e+74) tmp = Float64(x * (exp(1) ^ Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(log(Float64(1.0 - z)) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 3.6e+74) tmp = x * (2.71828182845904523536 ^ (y * (log(z) - t))); else tmp = x * exp((a * (log((1.0 - z)) - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 3.6e+74], N[(x * N[Power[E, N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.6 \cdot 10^{+74}:\\
\;\;\;\;x \cdot {e}^{\left(y \cdot \left(\log z - t\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if b < 3.59999999999999988e74Initial program 95.7%
Taylor expanded in a around 0 74.2%
*-un-lft-identity74.2%
exp-prod74.2%
exp-1-e74.2%
Applied egg-rr74.2%
if 3.59999999999999988e74 < b Initial program 100.0%
Taylor expanded in y around 0 88.4%
Final simplification77.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -8.2e+63) (* x (exp (* a (- (- b) z)))) (* x (pow E (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.2e+63) {
tmp = x * exp((a * (-b - z)));
} else {
tmp = x * pow(((double) M_E), (y * (log(z) - t)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8.2e+63) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = x * Math.pow(Math.E, (y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -8.2e+63: tmp = x * math.exp((a * (-b - z))) else: tmp = x * math.pow(math.e, (y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8.2e+63) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = Float64(x * (exp(1) ^ 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 <= -8.2e+63) tmp = x * exp((a * (-b - z))); else tmp = x * (2.71828182845904523536 ^ (y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8.2e+63], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[E, N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{+63}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {e}^{\left(y \cdot \left(\log z - t\right)\right)}\\
\end{array}
\end{array}
if a < -8.19999999999999985e63Initial program 87.3%
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 y around 0 81.8%
mul-1-neg81.8%
+-commutative81.8%
distribute-lft-neg-in81.8%
+-commutative81.8%
Simplified81.8%
if -8.19999999999999985e63 < a Initial program 98.9%
Taylor expanded in a around 0 77.6%
*-un-lft-identity77.6%
exp-prod77.6%
exp-1-e77.6%
Applied egg-rr77.6%
Final simplification78.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -7e+62) (* x (exp (* a (- (- b) z)))) (* x (exp (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -7e+62) {
tmp = x * exp((a * (-b - z)));
} 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 <= (-7d+62)) then
tmp = x * exp((a * (-b - z)))
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 <= -7e+62) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -7e+62: tmp = x * math.exp((a * (-b - z))) 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 <= -7e+62) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); 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 <= -7e+62) tmp = x * exp((a * (-b - z))); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -7e+62], N[(x * N[Exp[N[(a * N[((-b) - z), $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 -7 \cdot 10^{+62}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if a < -6.99999999999999967e62Initial program 87.3%
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 y around 0 81.8%
mul-1-neg81.8%
+-commutative81.8%
distribute-lft-neg-in81.8%
+-commutative81.8%
Simplified81.8%
if -6.99999999999999967e62 < a Initial program 98.9%
Taylor expanded in a around 0 77.6%
Final simplification78.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.8e+60) (* x (exp (* a (- b)))) (* x (pow E (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.8e+60) {
tmp = x * exp((a * -b));
} else {
tmp = x * pow(((double) M_E), (y * -t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.8e+60) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.pow(Math.E, (y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.8e+60: tmp = x * math.exp((a * -b)) else: tmp = x * math.pow(math.e, (y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.8e+60) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * (exp(1) ^ Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.8e+60) tmp = x * exp((a * -b)); else tmp = x * (2.71828182845904523536 ^ (y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.8e+60], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[E, N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{+60}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {e}^{\left(y \cdot \left(-t\right)\right)}\\
\end{array}
\end{array}
if y < 1.79999999999999984e60Initial program 95.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 70.8%
associate-*r*70.8%
mul-1-neg70.8%
Simplified70.8%
if 1.79999999999999984e60 < y Initial program 100.0%
Taylor expanded in a around 0 96.5%
*-un-lft-identity96.5%
exp-prod96.5%
exp-1-e96.5%
Applied egg-rr96.5%
Taylor expanded in t around inf 59.2%
mul-1-neg59.2%
distribute-lft-neg-out59.2%
*-commutative59.2%
Simplified59.2%
Final simplification68.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.7e+60) (* x (exp (* a (- b)))) (* x (exp (* y (- t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.7e+60) {
tmp = x * exp((a * -b));
} else {
tmp = x * exp((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 (y <= 2.7d+60) then
tmp = x * exp((a * -b))
else
tmp = x * exp((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 (y <= 2.7e+60) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.7e+60: tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.7e+60) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.7e+60) tmp = x * exp((a * -b)); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.7e+60], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{+60}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if y < 2.6999999999999999e60Initial program 95.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 70.8%
associate-*r*70.8%
mul-1-neg70.8%
Simplified70.8%
if 2.6999999999999999e60 < y Initial 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 t around inf 59.2%
associate-*r*59.2%
neg-mul-159.2%
Simplified59.2%
Final simplification68.2%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5800.0) (- x (* t (* x y))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5800.0) {
tmp = x - (t * (x * 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 <= (-5800.0d0)) then
tmp = x - (t * (x * 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 <= -5800.0) {
tmp = x - (t * (x * y));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5800.0: tmp = x - (t * (x * y)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5800.0) tmp = Float64(x - Float64(t * Float64(x * 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 <= -5800.0) tmp = x - (t * (x * y)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5800.0], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5800:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -5800Initial program 93.7%
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 t around inf 72.9%
associate-*r*72.9%
neg-mul-172.9%
Simplified72.9%
Taylor expanded in t around 0 30.0%
mul-1-neg30.0%
unsub-neg30.0%
Simplified30.0%
if -5800 < t Initial program 97.4%
Taylor expanded in a around 0 68.3%
Taylor expanded in t around 0 63.9%
*-commutative63.9%
Simplified63.9%
Final simplification55.8%
(FPCore (x y z t a b) :precision binary64 (* x (exp (* a (- (- b) z)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp((a * (-b - z)));
}
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 - z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp((a * (-b - z)));
}
def code(x, y, z, t, a, b): return x * math.exp((a * (-b - z)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp((a * (-b - z))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}
\end{array}
Initial program 96.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 63.8%
mul-1-neg63.8%
+-commutative63.8%
distribute-lft-neg-in63.8%
+-commutative63.8%
Simplified63.8%
Final simplification63.8%
(FPCore (x y z t a b) :precision binary64 (* x (exp (* a (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp((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((a * -b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp((a * -b));
}
def code(x, y, z, t, a, b): return x * math.exp((a * -b))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(a * Float64(-b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp((a * -b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{a \cdot \left(-b\right)}
\end{array}
Initial program 96.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 60.0%
associate-*r*60.0%
mul-1-neg60.0%
Simplified60.0%
Final simplification60.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x 5.9e-162) (* a (* x (- b))) (* x (- 1.0 (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 5.9e-162) {
tmp = a * (x * -b);
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 5.9d-162) then
tmp = a * (x * -b)
else
tmp = x * (1.0d0 - (a * (z + b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 5.9e-162) {
tmp = a * (x * -b);
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 5.9e-162: tmp = a * (x * -b) else: tmp = x * (1.0 - (a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 5.9e-162) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 5.9e-162) tmp = a * (x * -b); else tmp = x * (1.0 - (a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 5.9e-162], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.9 \cdot 10^{-162}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
if x < 5.89999999999999959e-162Initial program 96.4%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 61.4%
associate-*r*61.4%
mul-1-neg61.4%
Simplified61.4%
Taylor expanded in a around 0 26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in a around inf 23.5%
neg-mul-123.5%
distribute-lft-neg-in23.5%
Simplified23.5%
if 5.89999999999999959e-162 < x Initial program 96.7%
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 y around 0 60.5%
mul-1-neg60.5%
+-commutative60.5%
distribute-lft-neg-in60.5%
+-commutative60.5%
Simplified60.5%
Taylor expanded in a around 0 32.1%
mul-1-neg32.1%
unsub-neg32.1%
Simplified32.1%
Final simplification26.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x 2.8e-166) (* a (* x (- b))) (- x (* (+ z b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.8e-166) {
tmp = a * (x * -b);
} else {
tmp = x - ((z + b) * (x * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 2.8d-166) then
tmp = a * (x * -b)
else
tmp = x - ((z + b) * (x * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 2.8e-166) {
tmp = a * (x * -b);
} else {
tmp = x - ((z + b) * (x * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 2.8e-166: tmp = a * (x * -b) else: tmp = x - ((z + b) * (x * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 2.8e-166) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = Float64(x - Float64(Float64(z + b) * Float64(x * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 2.8e-166) tmp = a * (x * -b); else tmp = x - ((z + b) * (x * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 2.8e-166], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z + b), $MachinePrecision] * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8 \cdot 10^{-166}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if x < 2.7999999999999999e-166Initial program 96.4%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 61.4%
associate-*r*61.4%
mul-1-neg61.4%
Simplified61.4%
Taylor expanded in a around 0 26.2%
mul-1-neg26.2%
unsub-neg26.2%
Simplified26.2%
Taylor expanded in a around inf 23.5%
neg-mul-123.5%
distribute-lft-neg-in23.5%
Simplified23.5%
if 2.7999999999999999e-166 < x Initial program 96.7%
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 y around 0 60.5%
mul-1-neg60.5%
+-commutative60.5%
distribute-lft-neg-in60.5%
+-commutative60.5%
Simplified60.5%
Taylor expanded in a around 0 29.8%
mul-1-neg29.8%
unsub-neg29.8%
associate-*r*31.0%
*-commutative31.0%
Simplified31.0%
Final simplification26.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6.4e+53) (* x (- 1.0 (* a b))) (- x (* t (* x y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.4e+53) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x - (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 (y <= 6.4d+53) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x - (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 (y <= 6.4e+53) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x - (t * (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6.4e+53: tmp = x * (1.0 - (a * b)) else: tmp = x - (t * (x * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.4e+53) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x - Float64(t * Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 6.4e+53) tmp = x * (1.0 - (a * b)); else tmp = x - (t * (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.4e+53], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.4 \cdot 10^{+53}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if y < 6.4e53Initial program 95.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 71.0%
associate-*r*71.0%
mul-1-neg71.0%
Simplified71.0%
Taylor expanded in a around 0 35.1%
mul-1-neg35.1%
unsub-neg35.1%
Simplified35.1%
if 6.4e53 < y Initial 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 t around inf 58.9%
associate-*r*58.9%
neg-mul-158.9%
Simplified58.9%
Taylor expanded in t around 0 16.3%
mul-1-neg16.3%
unsub-neg16.3%
Simplified16.3%
Final simplification30.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 3.3e-28) x (* a (* x (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 3.3e-28) {
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 <= 3.3d-28) 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 <= 3.3e-28) {
tmp = x;
} else {
tmp = a * (x * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 3.3e-28: tmp = x else: tmp = a * (x * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 3.3e-28) 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 <= 3.3e-28) tmp = x; else tmp = a * (x * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 3.3e-28], x, N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-28}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < 3.3000000000000002e-28Initial program 95.0%
Taylor expanded in a around 0 62.8%
Taylor expanded in y around 0 25.4%
if 3.3000000000000002e-28 < y Initial 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 38.7%
associate-*r*38.7%
mul-1-neg38.7%
Simplified38.7%
Taylor expanded in a around 0 11.2%
mul-1-neg11.2%
unsub-neg11.2%
Simplified11.2%
Taylor expanded in a around inf 29.8%
neg-mul-129.8%
distribute-lft-neg-in29.8%
Simplified29.8%
Final simplification26.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 9.4e-35) x (* b (* x (- a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 9.4e-35) {
tmp = x;
} else {
tmp = b * (x * -a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 9.4d-35) then
tmp = x
else
tmp = b * (x * -a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 9.4e-35) {
tmp = x;
} else {
tmp = b * (x * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 9.4e-35: tmp = x else: tmp = b * (x * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 9.4e-35) tmp = x; else tmp = Float64(b * Float64(x * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 9.4e-35) tmp = x; else tmp = b * (x * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 9.4e-35], x, N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.4 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < 9.4e-35Initial program 95.0%
Taylor expanded in a around 0 62.8%
Taylor expanded in y around 0 25.4%
if 9.4e-35 < y Initial 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 38.7%
associate-*r*38.7%
mul-1-neg38.7%
Simplified38.7%
Taylor expanded in a around 0 11.2%
mul-1-neg11.2%
unsub-neg11.2%
Simplified11.2%
Taylor expanded in a around inf 29.8%
neg-mul-129.8%
*-commutative29.8%
associate-*r*33.5%
distribute-rgt-neg-in33.5%
Simplified33.5%
Final simplification27.9%
(FPCore (x y z t a b) :precision binary64 (* x (- 1.0 (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
return x * (1.0 - (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 * (1.0d0 - (a * b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * (1.0 - (a * b));
}
def code(x, y, z, t, a, b): return x * (1.0 - (a * b))
function code(x, y, z, t, a, b) return Float64(x * Float64(1.0 - Float64(a * b))) end
function tmp = code(x, y, z, t, a, b) tmp = x * (1.0 - (a * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - a \cdot b\right)
\end{array}
Initial program 96.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 60.0%
associate-*r*60.0%
mul-1-neg60.0%
Simplified60.0%
Taylor expanded in a around 0 28.2%
mul-1-neg28.2%
unsub-neg28.2%
Simplified28.2%
Final simplification28.2%
(FPCore (x y z t a b) :precision binary64 (- x (* x (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
return x - (x * (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 - (x * (a * b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x - (x * (a * b));
}
def code(x, y, z, t, a, b): return x - (x * (a * b))
function code(x, y, z, t, a, b) return Float64(x - Float64(x * Float64(a * b))) end
function tmp = code(x, y, z, t, a, b) tmp = x - (x * (a * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - x \cdot \left(a \cdot b\right)
\end{array}
Initial program 96.5%
Taylor expanded in z around 0 99.9%
associate-*r*99.9%
associate-*r*99.9%
distribute-lft-out99.9%
mul-1-neg99.9%
Simplified99.9%
Taylor expanded in b around inf 60.0%
associate-*r*60.0%
mul-1-neg60.0%
Simplified60.0%
Taylor expanded in a around 0 26.7%
mul-1-neg26.7%
unsub-neg26.7%
associate-*r*28.2%
Simplified28.2%
Final simplification28.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 96.5%
Taylor expanded in a around 0 69.4%
Taylor expanded in y around 0 19.1%
Final simplification19.1%
herbie shell --seed 2024066
(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))))))