
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 95.8%
fma-define96.2%
sub-neg96.2%
log1p-define100.0%
Simplified100.0%
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Initial program 95.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -0.00026) (not (<= a 13.0))) (* x (exp (* a (- (log1p (- z)) b)))) (* x (exp (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -0.00026) || !(a <= 13.0)) {
tmp = x * exp((a * (log1p(-z) - b)));
} else {
tmp = x * exp((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 <= -0.00026) || !(a <= 13.0)) {
tmp = x * Math.exp((a * (Math.log1p(-z) - b)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -0.00026) or not (a <= 13.0): tmp = x * math.exp((a * (math.log1p(-z) - 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 ((a <= -0.00026) || !(a <= 13.0)) tmp = Float64(x * exp(Float64(a * Float64(log1p(Float64(-z)) - b)))); else tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -0.00026], N[Not[LessEqual[a, 13.0]], $MachinePrecision]], N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $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 -0.00026 \lor \neg \left(a \leq 13\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if a < -2.59999999999999977e-4 or 13 < a Initial program 91.3%
Taylor expanded in y around 0 78.9%
sub-neg78.9%
mul-1-neg78.9%
log1p-define86.8%
mul-1-neg86.8%
Simplified86.8%
if -2.59999999999999977e-4 < a < 13Initial program 100.0%
Taylor expanded in y around inf 91.6%
Final simplification89.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.15e-5) (not (<= a 13.0))) (/ 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 ((a <= -1.15e-5) || !(a <= 13.0)) {
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 ((a <= (-1.15d-5)) .or. (.not. (a <= 13.0d0))) 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 ((a <= -1.15e-5) || !(a <= 13.0)) {
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 (a <= -1.15e-5) or not (a <= 13.0): 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 ((a <= -1.15e-5) || !(a <= 13.0)) tmp = Float64(x / exp(Float64(a * 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 ((a <= -1.15e-5) || ~((a <= 13.0))) 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[a, -1.15e-5], N[Not[LessEqual[a, 13.0]], $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}\;a \leq -1.15 \cdot 10^{-5} \lor \neg \left(a \leq 13\right):\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if a < -1.15e-5 or 13 < a Initial program 91.3%
Taylor expanded in b around inf 78.9%
mul-1-neg78.9%
distribute-rgt-neg-out78.9%
Simplified78.9%
Taylor expanded in a around inf 78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
exp-prod77.1%
Simplified77.1%
pow-neg77.1%
un-div-inv77.1%
Applied egg-rr77.1%
Taylor expanded in a around inf 78.9%
if -1.15e-5 < a < 13Initial program 100.0%
Taylor expanded in y around inf 91.6%
Final simplification85.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -4.5e-14)
t_1
(if (<= y 0.47)
(/ x (+ 1.0 (* a b)))
(if (or (<= y 4e+83) (not (<= y 5e+114))) t_1 (* x (- 1.0 (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * pow(z, y);
double tmp;
if (y <= -4.5e-14) {
tmp = t_1;
} else if (y <= 0.47) {
tmp = x / (1.0 + (a * b));
} else if ((y <= 4e+83) || !(y <= 5e+114)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-4.5d-14)) then
tmp = t_1
else if (y <= 0.47d0) then
tmp = x / (1.0d0 + (a * b))
else if ((y <= 4d+83) .or. (.not. (y <= 5d+114))) then
tmp = t_1
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 t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -4.5e-14) {
tmp = t_1;
} else if (y <= 0.47) {
tmp = x / (1.0 + (a * b));
} else if ((y <= 4e+83) || !(y <= 5e+114)) {
tmp = t_1;
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -4.5e-14: tmp = t_1 elif y <= 0.47: tmp = x / (1.0 + (a * b)) elif (y <= 4e+83) or not (y <= 5e+114): tmp = t_1 else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -4.5e-14) tmp = t_1; elseif (y <= 0.47) tmp = Float64(x / Float64(1.0 + Float64(a * b))); elseif ((y <= 4e+83) || !(y <= 5e+114)) tmp = t_1; else tmp = Float64(x * Float64(1.0 - Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -4.5e-14) tmp = t_1; elseif (y <= 0.47) tmp = x / (1.0 + (a * b)); elseif ((y <= 4e+83) || ~((y <= 5e+114))) tmp = t_1; else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e-14], t$95$1, If[LessEqual[y, 0.47], N[(x / N[(1.0 + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 4e+83], N[Not[LessEqual[y, 5e+114]], $MachinePrecision]], t$95$1, N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.47:\\
\;\;\;\;\frac{x}{1 + a \cdot b}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+83} \lor \neg \left(y \leq 5 \cdot 10^{+114}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if y < -4.4999999999999998e-14 or 0.46999999999999997 < y < 4.00000000000000012e83 or 5.0000000000000001e114 < y Initial program 99.2%
Taylor expanded in y around inf 90.3%
Taylor expanded in t around 0 69.3%
if -4.4999999999999998e-14 < y < 0.46999999999999997Initial program 92.2%
Taylor expanded in b around inf 78.2%
mul-1-neg78.2%
distribute-rgt-neg-out78.2%
Simplified78.2%
Taylor expanded in a around inf 78.2%
neg-mul-178.2%
distribute-rgt-neg-in78.2%
exp-prod65.6%
Simplified65.6%
pow-neg65.6%
un-div-inv65.6%
Applied egg-rr65.6%
Taylor expanded in a around 0 52.1%
if 4.00000000000000012e83 < y < 5.0000000000000001e114Initial program 100.0%
Taylor expanded in b around inf 87.8%
mul-1-neg87.8%
distribute-rgt-neg-out87.8%
Simplified87.8%
Taylor expanded in a around 0 52.0%
neg-mul-152.0%
unsub-neg52.0%
Simplified52.0%
Final simplification60.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -9.8e-89) (not (<= a 0.000114))) (/ x (exp (* a b))) (* x (exp (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9.8e-89) || !(a <= 0.000114)) {
tmp = x / exp((a * b));
} else {
tmp = x * exp((t * -y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-9.8d-89)) .or. (.not. (a <= 0.000114d0))) then
tmp = x / exp((a * b))
else
tmp = x * exp((t * -y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -9.8e-89) || !(a <= 0.000114)) {
tmp = x / Math.exp((a * b));
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -9.8e-89) or not (a <= 0.000114): tmp = x / math.exp((a * b)) else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -9.8e-89) || !(a <= 0.000114)) tmp = Float64(x / exp(Float64(a * b))); else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -9.8e-89) || ~((a <= 0.000114))) tmp = x / exp((a * b)); else tmp = x * exp((t * -y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -9.8e-89], N[Not[LessEqual[a, 0.000114]], $MachinePrecision]], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.8 \cdot 10^{-89} \lor \neg \left(a \leq 0.000114\right):\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if a < -9.8e-89 or 1.1400000000000001e-4 < a Initial program 92.2%
Taylor expanded in b around inf 76.3%
mul-1-neg76.3%
distribute-rgt-neg-out76.3%
Simplified76.3%
Taylor expanded in a around inf 76.3%
neg-mul-176.3%
distribute-rgt-neg-in76.3%
exp-prod72.0%
Simplified72.0%
pow-neg72.0%
un-div-inv72.0%
Applied egg-rr72.0%
Taylor expanded in a around inf 76.3%
if -9.8e-89 < a < 1.1400000000000001e-4Initial program 100.0%
Taylor expanded in t around inf 78.0%
mul-1-neg78.0%
distribute-lft-neg-out78.0%
*-commutative78.0%
Simplified78.0%
Final simplification77.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.016) (not (<= y 4.5e+123))) (* x (pow z y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.016) || !(y <= 4.5e+123)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * -b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-0.016d0)) .or. (.not. (y <= 4.5d+123))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * -b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.016) || !(y <= 4.5e+123)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.016) or not (y <= 4.5e+123): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.016) || !(y <= 4.5e+123)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -0.016) || ~((y <= 4.5e+123))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.016], N[Not[LessEqual[y, 4.5e+123]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.016 \lor \neg \left(y \leq 4.5 \cdot 10^{+123}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -0.016 or 4.49999999999999983e123 < y Initial program 99.0%
Taylor expanded in y around inf 93.2%
Taylor expanded in t around 0 73.7%
if -0.016 < y < 4.49999999999999983e123Initial program 93.7%
Taylor expanded in b around inf 74.0%
mul-1-neg74.0%
distribute-rgt-neg-out74.0%
Simplified74.0%
Final simplification73.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.0135) (not (<= y 3.2e+125))) (* x (pow z y)) (/ x (exp (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.0135) || !(y <= 3.2e+125)) {
tmp = x * pow(z, y);
} else {
tmp = x / exp((a * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-0.0135d0)) .or. (.not. (y <= 3.2d+125))) then
tmp = x * (z ** y)
else
tmp = x / exp((a * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.0135) || !(y <= 3.2e+125)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x / Math.exp((a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.0135) or not (y <= 3.2e+125): tmp = x * math.pow(z, y) else: tmp = x / math.exp((a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.0135) || !(y <= 3.2e+125)) 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 <= -0.0135) || ~((y <= 3.2e+125))) tmp = x * (z ^ y); else tmp = x / exp((a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.0135], N[Not[LessEqual[y, 3.2e+125]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0135 \lor \neg \left(y \leq 3.2 \cdot 10^{+125}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{a \cdot b}}\\
\end{array}
\end{array}
if y < -0.0134999999999999998 or 3.19999999999999983e125 < y Initial program 99.0%
Taylor expanded in y around inf 93.2%
Taylor expanded in t around 0 73.7%
if -0.0134999999999999998 < y < 3.19999999999999983e125Initial program 93.7%
Taylor expanded in b around inf 74.0%
mul-1-neg74.0%
distribute-rgt-neg-out74.0%
Simplified74.0%
Taylor expanded in a around inf 74.0%
neg-mul-174.0%
distribute-rgt-neg-in74.0%
exp-prod62.6%
Simplified62.6%
pow-neg62.6%
un-div-inv62.6%
Applied egg-rr62.6%
Taylor expanded in a around inf 74.0%
Final simplification73.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -7.8e-43) (* x (- 1.0 (* a b))) (if (<= b 6e+16) (* x (- 1.0 (* y t))) (* t (* x (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -7.8e-43) {
tmp = x * (1.0 - (a * b));
} else if (b <= 6e+16) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t * (x * -y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-7.8d-43)) then
tmp = x * (1.0d0 - (a * b))
else if (b <= 6d+16) then
tmp = x * (1.0d0 - (y * t))
else
tmp = t * (x * -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -7.8e-43) {
tmp = x * (1.0 - (a * b));
} else if (b <= 6e+16) {
tmp = x * (1.0 - (y * t));
} else {
tmp = t * (x * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -7.8e-43: tmp = x * (1.0 - (a * b)) elif b <= 6e+16: tmp = x * (1.0 - (y * t)) else: tmp = t * (x * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -7.8e-43) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (b <= 6e+16) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(t * Float64(x * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -7.8e-43) tmp = x * (1.0 - (a * b)); elseif (b <= 6e+16) tmp = x * (1.0 - (y * t)); else tmp = t * (x * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -7.8e-43], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e+16], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.8 \cdot 10^{-43}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+16}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if b < -7.80000000000000001e-43Initial program 98.6%
Taylor expanded in b around inf 67.1%
mul-1-neg67.1%
distribute-rgt-neg-out67.1%
Simplified67.1%
Taylor expanded in a around 0 24.9%
neg-mul-124.9%
unsub-neg24.9%
Simplified24.9%
if -7.80000000000000001e-43 < b < 6e16Initial program 91.9%
Taylor expanded in t around inf 74.7%
mul-1-neg74.7%
distribute-lft-neg-out74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in y around 0 40.6%
associate-*r*40.6%
mul-1-neg40.6%
cancel-sign-sub-inv40.6%
Simplified40.6%
if 6e16 < b Initial program 100.0%
Taylor expanded in t around inf 46.8%
mul-1-neg46.8%
distribute-lft-neg-out46.8%
*-commutative46.8%
Simplified46.8%
Taylor expanded in y around 0 17.8%
associate-*r*17.8%
mul-1-neg17.8%
cancel-sign-sub-inv17.8%
Simplified17.8%
Taylor expanded in t around inf 33.3%
mul-1-neg33.3%
distribute-rgt-neg-in33.3%
distribute-rgt-neg-in33.3%
Simplified33.3%
Final simplification34.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -5.4e+45) (* t (* x y)) (if (<= b 2.6e-45) x (* x (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.4e+45) {
tmp = t * (x * y);
} else if (b <= 2.6e-45) {
tmp = x;
} else {
tmp = x * (t * -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 (b <= (-5.4d+45)) then
tmp = t * (x * y)
else if (b <= 2.6d-45) then
tmp = x
else
tmp = x * (t * -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 (b <= -5.4e+45) {
tmp = t * (x * y);
} else if (b <= 2.6e-45) {
tmp = x;
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -5.4e+45: tmp = t * (x * y) elif b <= 2.6e-45: tmp = x else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5.4e+45) tmp = Float64(t * Float64(x * y)); elseif (b <= 2.6e-45) tmp = x; else tmp = Float64(x * Float64(t * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -5.4e+45) tmp = t * (x * y); elseif (b <= 2.6e-45) tmp = x; else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.4e+45], N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.6e-45], x, N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.4 \cdot 10^{+45}:\\
\;\;\;\;t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;b \leq 2.6 \cdot 10^{-45}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if b < -5.39999999999999968e45Initial program 97.9%
Taylor expanded in t around inf 38.2%
mul-1-neg38.2%
distribute-lft-neg-out38.2%
*-commutative38.2%
Simplified38.2%
Taylor expanded in y around 0 5.8%
associate-*r*5.8%
mul-1-neg5.8%
cancel-sign-sub-inv5.8%
Simplified5.8%
Taylor expanded in t around inf 12.5%
mul-1-neg12.5%
distribute-rgt-neg-in12.5%
distribute-rgt-neg-in12.5%
Simplified12.5%
pow112.5%
add-sqr-sqrt5.4%
sqrt-unprod16.4%
sqr-neg16.4%
sqrt-unprod7.3%
add-sqr-sqrt14.4%
Applied egg-rr14.4%
unpow114.4%
Simplified14.4%
if -5.39999999999999968e45 < b < 2.59999999999999987e-45Initial program 92.8%
Taylor expanded in t around inf 71.8%
mul-1-neg71.8%
distribute-lft-neg-out71.8%
*-commutative71.8%
Simplified71.8%
Taylor expanded in y around 0 32.4%
if 2.59999999999999987e-45 < b Initial program 100.0%
Taylor expanded in t around inf 53.6%
mul-1-neg53.6%
distribute-lft-neg-out53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in y around 0 21.0%
associate-*r*21.0%
mul-1-neg21.0%
cancel-sign-sub-inv21.0%
Simplified21.0%
Taylor expanded in t around inf 31.5%
mul-1-neg31.5%
associate-*r*29.9%
distribute-rgt-neg-in29.9%
*-commutative29.9%
associate-*r*32.5%
Simplified32.5%
(FPCore (x y z t a b) :precision binary64 (if (<= b -5.5e+45) (* t (* x y)) (if (<= b 2.1e-7) x (* t (* x (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.5e+45) {
tmp = t * (x * y);
} else if (b <= 2.1e-7) {
tmp = x;
} else {
tmp = t * (x * -y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-5.5d+45)) then
tmp = t * (x * y)
else if (b <= 2.1d-7) then
tmp = x
else
tmp = t * (x * -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.5e+45) {
tmp = t * (x * y);
} else if (b <= 2.1e-7) {
tmp = x;
} else {
tmp = t * (x * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -5.5e+45: tmp = t * (x * y) elif b <= 2.1e-7: tmp = x else: tmp = t * (x * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5.5e+45) tmp = Float64(t * Float64(x * y)); elseif (b <= 2.1e-7) tmp = x; else tmp = Float64(t * Float64(x * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -5.5e+45) tmp = t * (x * y); elseif (b <= 2.1e-7) tmp = x; else tmp = t * (x * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.5e+45], N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e-7], x, N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+45}:\\
\;\;\;\;t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-7}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if b < -5.5000000000000001e45Initial program 97.9%
Taylor expanded in t around inf 38.2%
mul-1-neg38.2%
distribute-lft-neg-out38.2%
*-commutative38.2%
Simplified38.2%
Taylor expanded in y around 0 5.8%
associate-*r*5.8%
mul-1-neg5.8%
cancel-sign-sub-inv5.8%
Simplified5.8%
Taylor expanded in t around inf 12.5%
mul-1-neg12.5%
distribute-rgt-neg-in12.5%
distribute-rgt-neg-in12.5%
Simplified12.5%
pow112.5%
add-sqr-sqrt5.4%
sqrt-unprod16.4%
sqr-neg16.4%
sqrt-unprod7.3%
add-sqr-sqrt14.4%
Applied egg-rr14.4%
unpow114.4%
Simplified14.4%
if -5.5000000000000001e45 < b < 2.1e-7Initial program 93.2%
Taylor expanded in t around inf 72.5%
mul-1-neg72.5%
distribute-lft-neg-out72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in y around 0 31.7%
if 2.1e-7 < b Initial program 100.0%
Taylor expanded in t around inf 50.1%
mul-1-neg50.1%
distribute-lft-neg-out50.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in y around 0 18.5%
associate-*r*18.5%
mul-1-neg18.5%
cancel-sign-sub-inv18.5%
Simplified18.5%
Taylor expanded in t around inf 33.1%
mul-1-neg33.1%
distribute-rgt-neg-in33.1%
distribute-rgt-neg-in33.1%
Simplified33.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.5e+45) (not (<= b 3.6e+20))) (* t (* x y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.5e+45) || !(b <= 3.6e+20)) {
tmp = t * (x * y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-5.5d+45)) .or. (.not. (b <= 3.6d+20))) then
tmp = t * (x * y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.5e+45) || !(b <= 3.6e+20)) {
tmp = t * (x * y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.5e+45) or not (b <= 3.6e+20): tmp = t * (x * y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.5e+45) || !(b <= 3.6e+20)) tmp = Float64(t * Float64(x * y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.5e+45) || ~((b <= 3.6e+20))) tmp = t * (x * y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.5e+45], N[Not[LessEqual[b, 3.6e+20]], $MachinePrecision]], N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{+45} \lor \neg \left(b \leq 3.6 \cdot 10^{+20}\right):\\
\;\;\;\;t \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if b < -5.5000000000000001e45 or 3.6e20 < b Initial program 99.1%
Taylor expanded in t around inf 42.9%
mul-1-neg42.9%
distribute-lft-neg-out42.9%
*-commutative42.9%
Simplified42.9%
Taylor expanded in y around 0 12.5%
associate-*r*12.5%
mul-1-neg12.5%
cancel-sign-sub-inv12.5%
Simplified12.5%
Taylor expanded in t around inf 24.1%
mul-1-neg24.1%
distribute-rgt-neg-in24.1%
distribute-rgt-neg-in24.1%
Simplified24.1%
pow124.1%
add-sqr-sqrt13.0%
sqrt-unprod28.2%
sqr-neg28.2%
sqrt-unprod9.2%
add-sqr-sqrt20.9%
Applied egg-rr20.9%
unpow120.9%
Simplified20.9%
if -5.5000000000000001e45 < b < 3.6e20Initial program 93.4%
Taylor expanded in t around inf 73.2%
mul-1-neg73.2%
distribute-lft-neg-out73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y around 0 31.0%
Final simplification26.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x 4.4e-60) (/ 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 (x <= 4.4e-60) {
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 (x <= 4.4d-60) 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 (x <= 4.4e-60) {
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 x <= 4.4e-60: 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 (x <= 4.4e-60) 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 (x <= 4.4e-60) 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[x, 4.4e-60], 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}\;x \leq 4.4 \cdot 10^{-60}:\\
\;\;\;\;\frac{x}{1 + a \cdot b}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if x < 4.3999999999999998e-60Initial program 95.7%
Taylor expanded in b around inf 58.3%
mul-1-neg58.3%
distribute-rgt-neg-out58.3%
Simplified58.3%
Taylor expanded in a around inf 58.3%
neg-mul-158.3%
distribute-rgt-neg-in58.3%
exp-prod52.2%
Simplified52.2%
pow-neg52.2%
un-div-inv52.2%
Applied egg-rr52.2%
Taylor expanded in a around 0 31.6%
if 4.3999999999999998e-60 < x Initial program 96.0%
Taylor expanded in t around inf 55.3%
mul-1-neg55.3%
distribute-lft-neg-out55.3%
*-commutative55.3%
Simplified55.3%
Taylor expanded in y around 0 31.9%
mul-1-neg31.9%
unsub-neg31.9%
*-commutative31.9%
Simplified31.9%
Final simplification31.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b 2.7e-45) (* x (- 1.0 (* a b))) (* x (* t (- y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 2.7e-45) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (t * -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 (b <= 2.7d-45) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (t * -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 (b <= 2.7e-45) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 2.7e-45: tmp = x * (1.0 - (a * b)) else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 2.7e-45) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(t * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 2.7e-45) tmp = x * (1.0 - (a * b)); else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 2.7e-45], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.7 \cdot 10^{-45}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if b < 2.69999999999999985e-45Initial program 94.1%
Taylor expanded in b around inf 55.5%
mul-1-neg55.5%
distribute-rgt-neg-out55.5%
Simplified55.5%
Taylor expanded in a around 0 30.3%
neg-mul-130.3%
unsub-neg30.3%
Simplified30.3%
if 2.69999999999999985e-45 < b Initial program 100.0%
Taylor expanded in t around inf 53.6%
mul-1-neg53.6%
distribute-lft-neg-out53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in y around 0 21.0%
associate-*r*21.0%
mul-1-neg21.0%
cancel-sign-sub-inv21.0%
Simplified21.0%
Taylor expanded in t around inf 31.5%
mul-1-neg31.5%
associate-*r*29.9%
distribute-rgt-neg-in29.9%
*-commutative29.9%
associate-*r*32.5%
Simplified32.5%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.8%
Taylor expanded in t around inf 60.4%
mul-1-neg60.4%
distribute-lft-neg-out60.4%
*-commutative60.4%
Simplified60.4%
Taylor expanded in y around 0 20.9%
herbie shell --seed 2024111
(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))))))