
(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 (fma a (- (log1p (- z)) b) (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(a, (log1p(-z) - b), (y * (log(z) - t))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(a, Float64(log1p(Float64(-z)) - b), Float64(y * Float64(log(z) - t))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision] + N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(a, \mathsf{log1p}\left(-z\right) - b, y \cdot \left(\log z - t\right)\right)}
\end{array}
Initial program 96.5%
+-commutative96.5%
fma-def96.9%
sub-neg96.9%
log1p-def100.0%
Simplified100.0%
Final simplification100.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 96.5%
Final simplification96.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.85e-17) (not (<= y 2.5e-20))) (* x (pow (/ z (exp t)) y)) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.85e-17) || !(y <= 2.5e-20)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x * exp((a * (-z - b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.85d-17)) .or. (.not. (y <= 2.5d-20))) then
tmp = x * ((z / exp(t)) ** y)
else
tmp = x * exp((a * (-z - b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.85e-17) || !(y <= 2.5e-20)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.85e-17) or not (y <= 2.5e-20): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.85e-17) || !(y <= 2.5e-20)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.85e-17) || ~((y <= 2.5e-20))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.85e-17], N[Not[LessEqual[y, 2.5e-20]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-17} \lor \neg \left(y \leq 2.5 \cdot 10^{-20}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -1.8499999999999999e-17 or 2.4999999999999999e-20 < y Initial program 97.8%
Taylor expanded in a around 0 94.1%
exp-prod94.1%
exp-diff94.1%
*-rgt-identity94.1%
exp-to-pow94.1%
unpow194.1%
Simplified94.1%
if -1.8499999999999999e-17 < y < 2.4999999999999999e-20Initial program 95.2%
Taylor expanded in y around 0 85.2%
sub-neg85.2%
neg-mul-185.2%
log1p-def90.0%
neg-mul-190.0%
Simplified90.0%
Taylor expanded in z around 0 90.0%
associate-*r*90.0%
associate-*r*90.0%
distribute-lft-out90.0%
neg-mul-190.0%
Simplified90.0%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -1.56e-19)
t_1
(if (<= y 1.8e-206)
(* x (- 1.0 (* a b)))
(if (<= y 2.2e-138)
(* x (pow (- z) a))
(if (<= y 3.8e-20)
(- x (* a (/ (* x (- (* b b) (* z z))) (- b z))))
t_1))))))
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 <= -1.56e-19) {
tmp = t_1;
} else if (y <= 1.8e-206) {
tmp = x * (1.0 - (a * b));
} else if (y <= 2.2e-138) {
tmp = x * pow(-z, a);
} else if (y <= 3.8e-20) {
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)));
} else {
tmp = t_1;
}
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 <= (-1.56d-19)) then
tmp = t_1
else if (y <= 1.8d-206) then
tmp = x * (1.0d0 - (a * b))
else if (y <= 2.2d-138) then
tmp = x * (-z ** a)
else if (y <= 3.8d-20) then
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)))
else
tmp = t_1
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 <= -1.56e-19) {
tmp = t_1;
} else if (y <= 1.8e-206) {
tmp = x * (1.0 - (a * b));
} else if (y <= 2.2e-138) {
tmp = x * Math.pow(-z, a);
} else if (y <= 3.8e-20) {
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -1.56e-19: tmp = t_1 elif y <= 1.8e-206: tmp = x * (1.0 - (a * b)) elif y <= 2.2e-138: tmp = x * math.pow(-z, a) elif y <= 3.8e-20: tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -1.56e-19) tmp = t_1; elseif (y <= 1.8e-206) tmp = Float64(x * Float64(1.0 - Float64(a * b))); elseif (y <= 2.2e-138) tmp = Float64(x * (Float64(-z) ^ a)); elseif (y <= 3.8e-20) tmp = Float64(x - Float64(a * Float64(Float64(x * Float64(Float64(b * b) - Float64(z * z))) / Float64(b - z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -1.56e-19) tmp = t_1; elseif (y <= 1.8e-206) tmp = x * (1.0 - (a * b)); elseif (y <= 2.2e-138) tmp = x * (-z ^ a); elseif (y <= 3.8e-20) tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z))); else tmp = t_1; 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, -1.56e-19], t$95$1, If[LessEqual[y, 1.8e-206], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e-138], N[(x * N[Power[(-z), a], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-20], N[(x - N[(a * N[(N[(x * N[(N[(b * b), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.56 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-206}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-138}:\\
\;\;\;\;x \cdot {\left(-z\right)}^{a}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-20}:\\
\;\;\;\;x - a \cdot \frac{x \cdot \left(b \cdot b - z \cdot z\right)}{b - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.56000000000000003e-19 or 3.7999999999999998e-20 < y Initial program 97.8%
Taylor expanded in a around 0 93.4%
exp-prod93.4%
exp-diff93.4%
*-rgt-identity93.4%
exp-to-pow93.4%
unpow193.4%
Simplified93.4%
Taylor expanded in t around 0 69.3%
if -1.56000000000000003e-19 < y < 1.79999999999999997e-206Initial program 94.0%
Taylor expanded in b around inf 81.5%
mul-1-neg81.5%
*-commutative81.5%
distribute-rgt-neg-in81.5%
Simplified81.5%
Taylor expanded in b around 0 55.3%
+-commutative55.3%
mul-1-neg55.3%
unsub-neg55.3%
Simplified55.3%
Taylor expanded in x around 0 57.8%
if 1.79999999999999997e-206 < y < 2.1999999999999999e-138Initial program 99.8%
Taylor expanded in y around 0 91.6%
sub-neg91.6%
neg-mul-191.6%
log1p-def91.6%
neg-mul-191.6%
Simplified91.6%
Taylor expanded in b around 0 19.8%
Taylor expanded in z around inf 0.0%
exp-prod0.0%
+-commutative0.0%
exp-sum0.0%
rem-exp-log58.6%
mul-1-neg58.6%
log-rec58.6%
remove-double-neg58.6%
rem-exp-log58.6%
neg-mul-158.6%
Simplified58.6%
if 2.1999999999999999e-138 < y < 3.7999999999999998e-20Initial program 96.5%
Taylor expanded in y around 0 89.3%
sub-neg89.3%
neg-mul-189.3%
log1p-def92.8%
neg-mul-192.8%
Simplified92.8%
Taylor expanded in z around 0 92.8%
associate-*r*92.8%
associate-*r*92.8%
distribute-lft-out92.8%
neg-mul-192.8%
Simplified92.8%
Taylor expanded in a around 0 55.0%
+-commutative55.0%
mul-1-neg55.0%
unsub-neg55.0%
*-commutative55.0%
+-commutative55.0%
Simplified55.0%
flip-+61.5%
associate-*l/61.5%
Applied egg-rr61.5%
Final simplification64.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.55e-16) (not (<= y 0.33))) (* x (pow z y)) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e-16) || !(y <= 0.33)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * (-z - b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.55d-16)) .or. (.not. (y <= 0.33d0))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * (-z - b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e-16) || !(y <= 0.33)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.55e-16) or not (y <= 0.33): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.55e-16) || !(y <= 0.33)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.55e-16) || ~((y <= 0.33))) tmp = x * (z ^ y); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.55e-16], N[Not[LessEqual[y, 0.33]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-16} \lor \neg \left(y \leq 0.33\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -1.55e-16 or 0.330000000000000016 < y Initial program 97.7%
Taylor expanded in a around 0 94.6%
exp-prod94.6%
exp-diff94.6%
*-rgt-identity94.6%
exp-to-pow94.6%
unpow194.6%
Simplified94.6%
Taylor expanded in t around 0 70.9%
if -1.55e-16 < y < 0.330000000000000016Initial program 95.4%
Taylor expanded in y around 0 83.8%
sub-neg83.8%
neg-mul-183.8%
log1p-def88.4%
neg-mul-188.4%
Simplified88.4%
Taylor expanded in z around 0 88.4%
associate-*r*88.4%
associate-*r*88.4%
distribute-lft-out88.4%
neg-mul-188.4%
Simplified88.4%
Final simplification79.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.55e-7) (* x (pow (- z (* z t)) y)) (if (<= y 0.033) (* x (exp (* a (- (- z) b)))) (* x (pow z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.55e-7) {
tmp = x * pow((z - (z * t)), y);
} else if (y <= 0.033) {
tmp = x * exp((a * (-z - 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 (y <= (-1.55d-7)) then
tmp = x * ((z - (z * t)) ** y)
else if (y <= 0.033d0) then
tmp = x * exp((a * (-z - 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 (y <= -1.55e-7) {
tmp = x * Math.pow((z - (z * t)), y);
} else if (y <= 0.033) {
tmp = x * Math.exp((a * (-z - b)));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.55e-7: tmp = x * math.pow((z - (z * t)), y) elif y <= 0.033: tmp = x * math.exp((a * (-z - b))) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.55e-7) tmp = Float64(x * (Float64(z - Float64(z * t)) ^ y)); elseif (y <= 0.033) tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - 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 (y <= -1.55e-7) tmp = x * ((z - (z * t)) ^ y); elseif (y <= 0.033) tmp = x * exp((a * (-z - b))); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.55e-7], N[(x * N[Power[N[(z - N[(z * t), $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.033], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{-7}:\\
\;\;\;\;x \cdot {\left(z - z \cdot t\right)}^{y}\\
\mathbf{elif}\;y \leq 0.033:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if y < -1.55e-7Initial program 96.9%
Taylor expanded in a around 0 96.9%
exp-prod96.9%
exp-diff96.9%
*-rgt-identity96.9%
exp-to-pow96.9%
unpow196.9%
Simplified96.9%
Taylor expanded in t around 0 72.3%
+-commutative72.3%
mul-1-neg72.3%
unsub-neg72.3%
*-commutative72.3%
Simplified72.3%
if -1.55e-7 < y < 0.033000000000000002Initial program 95.4%
Taylor expanded in y around 0 83.2%
sub-neg83.2%
neg-mul-183.2%
log1p-def87.8%
neg-mul-187.8%
Simplified87.8%
Taylor expanded in z around 0 87.8%
associate-*r*87.8%
associate-*r*87.8%
distribute-lft-out87.8%
neg-mul-187.8%
Simplified87.8%
if 0.033000000000000002 < y Initial program 98.4%
Taylor expanded in a around 0 92.2%
exp-prod92.1%
exp-diff92.1%
*-rgt-identity92.1%
exp-to-pow92.2%
unpow192.2%
Simplified92.2%
Taylor expanded in t around 0 73.7%
Final simplification80.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.75e-19) (not (<= y 0.35))) (* 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 <= -1.75e-19) || !(y <= 0.35)) {
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 <= (-1.75d-19)) .or. (.not. (y <= 0.35d0))) 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 <= -1.75e-19) || !(y <= 0.35)) {
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 <= -1.75e-19) or not (y <= 0.35): 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 <= -1.75e-19) || !(y <= 0.35)) 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 <= -1.75e-19) || ~((y <= 0.35))) 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, -1.75e-19], N[Not[LessEqual[y, 0.35]], $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 -1.75 \cdot 10^{-19} \lor \neg \left(y \leq 0.35\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.75000000000000008e-19 or 0.34999999999999998 < y Initial program 97.7%
Taylor expanded in a around 0 93.9%
exp-prod93.9%
exp-diff93.9%
*-rgt-identity93.9%
exp-to-pow93.9%
unpow193.9%
Simplified93.9%
Taylor expanded in t around 0 70.4%
if -1.75000000000000008e-19 < y < 0.34999999999999998Initial program 95.3%
Taylor expanded in b around inf 82.9%
mul-1-neg82.9%
*-commutative82.9%
distribute-rgt-neg-in82.9%
Simplified82.9%
Final simplification76.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.75e-19) (not (<= y 2.5e-20))) (* x (pow z y)) (- x (* a (/ (* x (- (* b b) (* z z))) (- b z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.75e-19) || !(y <= 2.5e-20)) {
tmp = x * pow(z, y);
} else {
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)));
}
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.75d-19)) .or. (.not. (y <= 2.5d-20))) then
tmp = x * (z ** y)
else
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)))
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.75e-19) || !(y <= 2.5e-20)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.75e-19) or not (y <= 2.5e-20): tmp = x * math.pow(z, y) else: tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.75e-19) || !(y <= 2.5e-20)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x - Float64(a * Float64(Float64(x * Float64(Float64(b * b) - Float64(z * z))) / Float64(b - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.75e-19) || ~((y <= 2.5e-20))) tmp = x * (z ^ y); else tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.75e-19], N[Not[LessEqual[y, 2.5e-20]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(N[(x * N[(N[(b * b), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-19} \lor \neg \left(y \leq 2.5 \cdot 10^{-20}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{x \cdot \left(b \cdot b - z \cdot z\right)}{b - z}\\
\end{array}
\end{array}
if y < -1.75000000000000008e-19 or 2.4999999999999999e-20 < y Initial program 97.8%
Taylor expanded in a around 0 93.4%
exp-prod93.4%
exp-diff93.4%
*-rgt-identity93.4%
exp-to-pow93.4%
unpow193.4%
Simplified93.4%
Taylor expanded in t around 0 69.3%
if -1.75000000000000008e-19 < y < 2.4999999999999999e-20Initial program 95.2%
Taylor expanded in y around 0 85.1%
sub-neg85.1%
neg-mul-185.1%
log1p-def89.9%
neg-mul-189.9%
Simplified89.9%
Taylor expanded in z around 0 89.9%
associate-*r*89.9%
associate-*r*89.9%
distribute-lft-out89.9%
neg-mul-189.9%
Simplified89.9%
Taylor expanded in a around 0 51.0%
+-commutative51.0%
mul-1-neg51.0%
unsub-neg51.0%
*-commutative51.0%
+-commutative51.0%
Simplified51.0%
flip-+53.2%
associate-*l/53.1%
Applied egg-rr53.1%
Final simplification61.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.3e-7) (- x (* a (/ (* x (- (* b b) (* z z))) (- b z)))) (* a (* x (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.3e-7) {
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)));
} else {
tmp = a * (x * -z);
}
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.3d-7) then
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)))
else
tmp = a * (x * -z)
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.3e-7) {
tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z)));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.3e-7: tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z))) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.3e-7) tmp = Float64(x - Float64(a * Float64(Float64(x * Float64(Float64(b * b) - Float64(z * z))) / Float64(b - z)))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.3e-7) tmp = x - (a * ((x * ((b * b) - (z * z))) / (b - z))); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.3e-7], N[(x - N[(a * N[(N[(x * N[(N[(b * b), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-7}:\\
\;\;\;\;x - a \cdot \frac{x \cdot \left(b \cdot b - z \cdot z\right)}{b - z}\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < 2.29999999999999995e-7Initial program 95.9%
Taylor expanded in y around 0 66.6%
sub-neg66.6%
neg-mul-166.6%
log1p-def71.2%
neg-mul-171.2%
Simplified71.2%
Taylor expanded in z around 0 71.2%
associate-*r*71.2%
associate-*r*71.2%
distribute-lft-out71.2%
neg-mul-171.2%
Simplified71.2%
Taylor expanded in a around 0 37.4%
+-commutative37.4%
mul-1-neg37.4%
unsub-neg37.4%
*-commutative37.4%
+-commutative37.4%
Simplified37.4%
flip-+40.7%
associate-*l/41.1%
Applied egg-rr41.1%
if 2.29999999999999995e-7 < y Initial program 98.4%
Taylor expanded in y around 0 34.3%
sub-neg34.3%
neg-mul-134.3%
log1p-def34.3%
neg-mul-134.3%
Simplified34.3%
Taylor expanded in z around 0 34.3%
associate-*r*34.3%
associate-*r*34.3%
distribute-lft-out34.3%
neg-mul-134.3%
Simplified34.3%
Taylor expanded in a around 0 7.6%
+-commutative7.6%
mul-1-neg7.6%
unsub-neg7.6%
*-commutative7.6%
+-commutative7.6%
Simplified7.6%
Taylor expanded in z around inf 39.0%
mul-1-neg39.0%
*-commutative39.0%
distribute-rgt-neg-in39.0%
Simplified39.0%
Final simplification40.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -9.8e+48) (* x (- 1.0 (* y t))) (if (<= y 2.25e-7) (- x (* a (* x (+ z b)))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.8e+48) {
tmp = x * (1.0 - (y * t));
} else if (y <= 2.25e-7) {
tmp = x - (a * (x * (z + b)));
} else {
tmp = a * (x * -z);
}
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.8d+48)) then
tmp = x * (1.0d0 - (y * t))
else if (y <= 2.25d-7) then
tmp = x - (a * (x * (z + b)))
else
tmp = a * (x * -z)
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.8e+48) {
tmp = x * (1.0 - (y * t));
} else if (y <= 2.25e-7) {
tmp = x - (a * (x * (z + b)));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9.8e+48: tmp = x * (1.0 - (y * t)) elif y <= 2.25e-7: tmp = x - (a * (x * (z + b))) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9.8e+48) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (y <= 2.25e-7) tmp = Float64(x - Float64(a * Float64(x * Float64(z + b)))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -9.8e+48) tmp = x * (1.0 - (y * t)); elseif (y <= 2.25e-7) tmp = x - (a * (x * (z + b))); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.8e+48], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.25e-7], N[(x - N[(a * N[(x * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.8 \cdot 10^{+48}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-7}:\\
\;\;\;\;x - a \cdot \left(x \cdot \left(z + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -9.80000000000000059e48Initial program 98.1%
Taylor expanded in t around inf 61.3%
mul-1-neg61.3%
distribute-rgt-neg-out61.3%
Simplified61.3%
Taylor expanded in y around 0 17.5%
+-commutative17.5%
mul-1-neg17.5%
unsub-neg17.5%
Simplified17.5%
Taylor expanded in x around 0 20.8%
if -9.80000000000000059e48 < y < 2.2499999999999999e-7Initial program 95.0%
Taylor expanded in y around 0 80.3%
sub-neg80.3%
neg-mul-180.3%
log1p-def85.3%
neg-mul-185.3%
Simplified85.3%
Taylor expanded in z around 0 85.3%
associate-*r*85.3%
associate-*r*85.3%
distribute-lft-out85.3%
neg-mul-185.3%
Simplified85.3%
Taylor expanded in a around 0 48.2%
+-commutative48.2%
mul-1-neg48.2%
unsub-neg48.2%
*-commutative48.2%
+-commutative48.2%
Simplified48.2%
if 2.2499999999999999e-7 < y Initial program 98.4%
Taylor expanded in y around 0 34.3%
sub-neg34.3%
neg-mul-134.3%
log1p-def34.3%
neg-mul-134.3%
Simplified34.3%
Taylor expanded in z around 0 34.3%
associate-*r*34.3%
associate-*r*34.3%
distribute-lft-out34.3%
neg-mul-134.3%
Simplified34.3%
Taylor expanded in a around 0 7.6%
+-commutative7.6%
mul-1-neg7.6%
unsub-neg7.6%
*-commutative7.6%
+-commutative7.6%
Simplified7.6%
Taylor expanded in z around inf 39.0%
mul-1-neg39.0%
*-commutative39.0%
distribute-rgt-neg-in39.0%
Simplified39.0%
Final simplification40.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -470000.0) (not (<= y 5.8e-8))) (* a (* x (- z))) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -470000.0) || !(y <= 5.8e-8)) {
tmp = a * (x * -z);
} 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 <= (-470000.0d0)) .or. (.not. (y <= 5.8d-8))) then
tmp = a * (x * -z)
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 <= -470000.0) || !(y <= 5.8e-8)) {
tmp = a * (x * -z);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -470000.0) or not (y <= 5.8e-8): tmp = a * (x * -z) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -470000.0) || !(y <= 5.8e-8)) tmp = Float64(a * Float64(x * Float64(-z))); 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 <= -470000.0) || ~((y <= 5.8e-8))) tmp = a * (x * -z); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -470000.0], N[Not[LessEqual[y, 5.8e-8]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -470000 \lor \neg \left(y \leq 5.8 \cdot 10^{-8}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if y < -4.7e5 or 5.8000000000000003e-8 < y Initial program 97.6%
Taylor expanded in y around 0 34.0%
sub-neg34.0%
neg-mul-134.0%
log1p-def36.3%
neg-mul-136.3%
Simplified36.3%
Taylor expanded in z around 0 36.3%
associate-*r*36.3%
associate-*r*36.3%
distribute-lft-out36.3%
neg-mul-136.3%
Simplified36.3%
Taylor expanded in a around 0 9.6%
+-commutative9.6%
mul-1-neg9.6%
unsub-neg9.6%
*-commutative9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in z around inf 30.4%
mul-1-neg30.4%
*-commutative30.4%
distribute-rgt-neg-in30.4%
Simplified30.4%
if -4.7e5 < y < 5.8000000000000003e-8Initial program 95.5%
Taylor expanded in b around inf 80.6%
mul-1-neg80.6%
*-commutative80.6%
distribute-rgt-neg-in80.6%
Simplified80.6%
Taylor expanded in b around 0 48.5%
+-commutative48.5%
mul-1-neg48.5%
unsub-neg48.5%
Simplified48.5%
Taylor expanded in x around 0 49.3%
Final simplification40.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.1e+50) (* x (- 1.0 (* y t))) (if (<= y 5.5e-8) (* x (- 1.0 (* a b))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.1e+50) {
tmp = x * (1.0 - (y * t));
} else if (y <= 5.5e-8) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -z);
}
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.1d+50)) then
tmp = x * (1.0d0 - (y * t))
else if (y <= 5.5d-8) then
tmp = x * (1.0d0 - (a * b))
else
tmp = a * (x * -z)
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.1e+50) {
tmp = x * (1.0 - (y * t));
} else if (y <= 5.5e-8) {
tmp = x * (1.0 - (a * b));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.1e+50: tmp = x * (1.0 - (y * t)) elif y <= 5.5e-8: tmp = x * (1.0 - (a * b)) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.1e+50) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (y <= 5.5e-8) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.1e+50) tmp = x * (1.0 - (y * t)); elseif (y <= 5.5e-8) tmp = x * (1.0 - (a * b)); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.1e+50], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-8], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+50}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -3.10000000000000003e50Initial program 98.1%
Taylor expanded in t around inf 61.3%
mul-1-neg61.3%
distribute-rgt-neg-out61.3%
Simplified61.3%
Taylor expanded in y around 0 17.5%
+-commutative17.5%
mul-1-neg17.5%
unsub-neg17.5%
Simplified17.5%
Taylor expanded in x around 0 20.8%
if -3.10000000000000003e50 < y < 5.5000000000000003e-8Initial program 95.0%
Taylor expanded in b around inf 78.9%
mul-1-neg78.9%
*-commutative78.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
Taylor expanded in b around 0 47.3%
+-commutative47.3%
mul-1-neg47.3%
unsub-neg47.3%
Simplified47.3%
Taylor expanded in x around 0 48.1%
if 5.5000000000000003e-8 < y Initial program 98.4%
Taylor expanded in y around 0 34.3%
sub-neg34.3%
neg-mul-134.3%
log1p-def34.3%
neg-mul-134.3%
Simplified34.3%
Taylor expanded in z around 0 34.3%
associate-*r*34.3%
associate-*r*34.3%
distribute-lft-out34.3%
neg-mul-134.3%
Simplified34.3%
Taylor expanded in a around 0 7.6%
+-commutative7.6%
mul-1-neg7.6%
unsub-neg7.6%
*-commutative7.6%
+-commutative7.6%
Simplified7.6%
Taylor expanded in z around inf 39.0%
mul-1-neg39.0%
*-commutative39.0%
distribute-rgt-neg-in39.0%
Simplified39.0%
Final simplification40.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.6e-47) (not (<= y 2.5e-61))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.6e-47) || !(y <= 2.5e-61)) {
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 <= (-2.6d-47)) .or. (.not. (y <= 2.5d-61))) 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 <= -2.6e-47) || !(y <= 2.5e-61)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.6e-47) or not (y <= 2.5e-61): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.6e-47) || !(y <= 2.5e-61)) 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 <= -2.6e-47) || ~((y <= 2.5e-61))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.6e-47], N[Not[LessEqual[y, 2.5e-61]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-47} \lor \neg \left(y \leq 2.5 \cdot 10^{-61}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.6e-47 or 2.4999999999999999e-61 < y Initial program 97.9%
Taylor expanded in b around inf 38.0%
mul-1-neg38.0%
*-commutative38.0%
distribute-rgt-neg-in38.0%
Simplified38.0%
Taylor expanded in b around 0 14.0%
+-commutative14.0%
mul-1-neg14.0%
unsub-neg14.0%
Simplified14.0%
Taylor expanded in a around inf 20.6%
mul-1-neg20.6%
distribute-rgt-neg-in20.6%
distribute-rgt-neg-in20.6%
Simplified20.6%
if -2.6e-47 < y < 2.4999999999999999e-61Initial program 94.7%
Taylor expanded in b around inf 83.8%
mul-1-neg83.8%
*-commutative83.8%
distribute-rgt-neg-in83.8%
Simplified83.8%
Taylor expanded in b around 0 40.9%
Final simplification29.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.7e-56) (not (<= y 4.4e-8))) (* a (* x (- z))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e-56) || !(y <= 4.4e-8)) {
tmp = a * (x * -z);
} 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.7d-56)) .or. (.not. (y <= 4.4d-8))) then
tmp = a * (x * -z)
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.7e-56) || !(y <= 4.4e-8)) {
tmp = a * (x * -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.7e-56) or not (y <= 4.4e-8): tmp = a * (x * -z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.7e-56) || !(y <= 4.4e-8)) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.7e-56) || ~((y <= 4.4e-8))) tmp = a * (x * -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.7e-56], N[Not[LessEqual[y, 4.4e-8]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-56} \lor \neg \left(y \leq 4.4 \cdot 10^{-8}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.69999999999999991e-56 or 4.3999999999999997e-8 < y Initial program 97.8%
Taylor expanded in y around 0 36.0%
sub-neg36.0%
neg-mul-136.0%
log1p-def38.1%
neg-mul-138.1%
Simplified38.1%
Taylor expanded in z around 0 38.1%
associate-*r*38.1%
associate-*r*38.1%
distribute-lft-out38.1%
neg-mul-138.1%
Simplified38.1%
Taylor expanded in a around 0 10.7%
+-commutative10.7%
mul-1-neg10.7%
unsub-neg10.7%
*-commutative10.7%
+-commutative10.7%
Simplified10.7%
Taylor expanded in z around inf 28.9%
mul-1-neg28.9%
*-commutative28.9%
distribute-rgt-neg-in28.9%
Simplified28.9%
if -1.69999999999999991e-56 < y < 4.3999999999999997e-8Initial program 95.0%
Taylor expanded in b around inf 83.4%
mul-1-neg83.4%
*-commutative83.4%
distribute-rgt-neg-in83.4%
Simplified83.4%
Taylor expanded in b around 0 40.6%
Final simplification34.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8.8e-46) (* a (* x (- b))) (if (<= y 0.36) x (* b (* x (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.8e-46) {
tmp = a * (x * -b);
} else if (y <= 0.36) {
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 <= (-8.8d-46)) then
tmp = a * (x * -b)
else if (y <= 0.36d0) 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 <= -8.8e-46) {
tmp = a * (x * -b);
} else if (y <= 0.36) {
tmp = x;
} else {
tmp = b * (x * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8.8e-46: tmp = a * (x * -b) elif y <= 0.36: tmp = x else: tmp = b * (x * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8.8e-46) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 0.36) 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 <= -8.8e-46) tmp = a * (x * -b); elseif (y <= 0.36) tmp = x; else tmp = b * (x * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.8e-46], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.36], x, N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.8 \cdot 10^{-46}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 0.36:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -8.8000000000000004e-46Initial program 97.2%
Taylor expanded in b around inf 36.6%
mul-1-neg36.6%
*-commutative36.6%
distribute-rgt-neg-in36.6%
Simplified36.6%
Taylor expanded in b around 0 13.7%
+-commutative13.7%
mul-1-neg13.7%
unsub-neg13.7%
Simplified13.7%
Taylor expanded in a around inf 19.3%
mul-1-neg19.3%
distribute-rgt-neg-in19.3%
distribute-rgt-neg-in19.3%
Simplified19.3%
if -8.8000000000000004e-46 < y < 0.35999999999999999Initial program 95.2%
Taylor expanded in b around inf 82.4%
mul-1-neg82.4%
*-commutative82.4%
distribute-rgt-neg-in82.4%
Simplified82.4%
Taylor expanded in b around 0 39.5%
if 0.35999999999999999 < y Initial program 98.4%
Taylor expanded in b around inf 34.2%
mul-1-neg34.2%
*-commutative34.2%
distribute-rgt-neg-in34.2%
Simplified34.2%
Taylor expanded in b around 0 7.8%
+-commutative7.8%
mul-1-neg7.8%
unsub-neg7.8%
Simplified7.8%
Taylor expanded in a around inf 20.6%
mul-1-neg20.6%
*-commutative20.6%
associate-*r*22.2%
distribute-rgt-neg-in22.2%
*-commutative22.2%
Simplified22.2%
Final simplification29.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.3e-46) (* a (* x (- b))) (if (<= y 0.36) x (- (* x (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.3e-46) {
tmp = a * (x * -b);
} else if (y <= 0.36) {
tmp = x;
} else {
tmp = -(x * (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 <= (-4.3d-46)) then
tmp = a * (x * -b)
else if (y <= 0.36d0) then
tmp = x
else
tmp = -(x * (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 <= -4.3e-46) {
tmp = a * (x * -b);
} else if (y <= 0.36) {
tmp = x;
} else {
tmp = -(x * (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.3e-46: tmp = a * (x * -b) elif y <= 0.36: tmp = x else: tmp = -(x * (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.3e-46) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 0.36) tmp = x; else tmp = Float64(-Float64(x * Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.3e-46) tmp = a * (x * -b); elseif (y <= 0.36) tmp = x; else tmp = -(x * (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.3e-46], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.36], x, (-N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{-46}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 0.36:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-x \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if y < -4.30000000000000035e-46Initial program 97.2%
Taylor expanded in b around inf 36.6%
mul-1-neg36.6%
*-commutative36.6%
distribute-rgt-neg-in36.6%
Simplified36.6%
Taylor expanded in b around 0 13.7%
+-commutative13.7%
mul-1-neg13.7%
unsub-neg13.7%
Simplified13.7%
Taylor expanded in a around inf 19.3%
mul-1-neg19.3%
distribute-rgt-neg-in19.3%
distribute-rgt-neg-in19.3%
Simplified19.3%
if -4.30000000000000035e-46 < y < 0.35999999999999999Initial program 95.2%
Taylor expanded in b around inf 82.4%
mul-1-neg82.4%
*-commutative82.4%
distribute-rgt-neg-in82.4%
Simplified82.4%
Taylor expanded in b around 0 39.5%
if 0.35999999999999999 < y Initial program 98.4%
Taylor expanded in b around inf 34.2%
mul-1-neg34.2%
*-commutative34.2%
distribute-rgt-neg-in34.2%
Simplified34.2%
Taylor expanded in b around 0 7.8%
+-commutative7.8%
mul-1-neg7.8%
unsub-neg7.8%
Simplified7.8%
Taylor expanded in a around inf 20.6%
mul-1-neg20.6%
distribute-rgt-neg-in20.6%
distribute-rgt-neg-in20.6%
Simplified20.6%
Taylor expanded in a around 0 20.6%
associate-*r*20.6%
neg-mul-120.6%
associate-*r*25.1%
*-commutative25.1%
*-commutative25.1%
Simplified25.1%
Final simplification30.4%
(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 b around inf 58.1%
mul-1-neg58.1%
*-commutative58.1%
distribute-rgt-neg-in58.1%
Simplified58.1%
Taylor expanded in b around 0 21.1%
Final simplification21.1%
herbie shell --seed 2023257
(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))))))