
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 95.6%
fma-define96.4%
sub-neg96.4%
log1p-define99.5%
Simplified99.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -0.0064)
(* x (pow (/ z (exp t)) y))
(if (<= y 2.7e-5)
(* 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 (y <= -0.0064) {
tmp = x * pow((z / exp(t)), y);
} else if (y <= 2.7e-5) {
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 (y <= (-0.0064d0)) then
tmp = x * ((z / exp(t)) ** y)
else if (y <= 2.7d-5) 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 (y <= -0.0064) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else if (y <= 2.7e-5) {
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 y <= -0.0064: tmp = x * math.pow((z / math.exp(t)), y) elif y <= 2.7e-5: 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 (y <= -0.0064) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); elseif (y <= 2.7e-5) 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 (y <= -0.0064) tmp = x * ((z / exp(t)) ^ y); elseif (y <= 2.7e-5) 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[y, -0.0064], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-5], 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}\;y \leq -0.0064:\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-5}:\\
\;\;\;\;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 y < -0.00640000000000000031Initial program 95.2%
fma-define96.8%
sub-neg96.8%
log1p-define98.3%
Simplified98.3%
Taylor expanded in a around 0 89.1%
pow189.1%
pow-exp89.1%
pow-exp89.1%
*-commutative89.1%
exp-prod89.1%
exp-diff89.1%
add-exp-log89.2%
Applied egg-rr89.2%
unpow189.2%
Simplified89.2%
if -0.00640000000000000031 < y < 2.6999999999999999e-5Initial program 95.4%
Taylor expanded in z around 0 99.9%
+-commutative99.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 86.9%
associate-*r*86.9%
mul-1-neg86.9%
+-commutative86.9%
distribute-lft-neg-in86.9%
distribute-rgt-neg-in86.9%
Simplified86.9%
if 2.6999999999999999e-5 < y Initial program 96.7%
fma-define98.3%
sub-neg98.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 86.8%
Final simplification87.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.0038) (not (<= y 2.75e-5))) (* x (pow (/ z (exp t)) y)) (* x (exp (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.0038) || !(y <= 2.75e-5)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x * exp((a * (-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 <= (-0.0038d0)) .or. (.not. (y <= 2.75d-5))) then
tmp = x * ((z / exp(t)) ** y)
else
tmp = x * exp((a * (-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 <= -0.0038) || !(y <= 2.75e-5)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp((a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.0038) or not (y <= 2.75e-5): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp((a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.0038) || !(y <= 2.75e-5)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -0.0038) || ~((y <= 2.75e-5))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * exp((a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.0038], N[Not[LessEqual[y, 2.75e-5]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0038 \lor \neg \left(y \leq 2.75 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\end{array}
\end{array}
if y < -0.00379999999999999999 or 2.7500000000000001e-5 < y Initial program 95.9%
fma-define97.5%
sub-neg97.5%
log1p-define99.1%
Simplified99.1%
Taylor expanded in a around 0 88.0%
pow188.0%
pow-exp88.0%
pow-exp88.0%
*-commutative88.0%
exp-prod88.0%
exp-diff88.0%
add-exp-log88.1%
Applied egg-rr88.1%
unpow188.1%
Simplified88.1%
if -0.00379999999999999999 < y < 2.7500000000000001e-5Initial program 95.4%
Taylor expanded in z around 0 99.9%
+-commutative99.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 86.9%
associate-*r*86.9%
mul-1-neg86.9%
+-commutative86.9%
distribute-lft-neg-in86.9%
distribute-rgt-neg-in86.9%
Simplified86.9%
Final simplification87.5%
(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 95.6%
Taylor expanded in z around 0 98.7%
+-commutative98.7%
associate-*r*98.7%
associate-*r*98.7%
distribute-lft-out98.7%
mul-1-neg98.7%
Simplified98.7%
Final simplification98.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -6.5e+15)
(* x (pow z y))
(if (<= y 0.00043)
(* x (exp (* a (- (- b) z))))
(if (<= y 2.6e+187)
(* x (pow (/ z (+ t 1.0)) y))
(* x (exp (* t (- y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.5e+15) {
tmp = x * pow(z, y);
} else if (y <= 0.00043) {
tmp = x * exp((a * (-b - z)));
} else if (y <= 2.6e+187) {
tmp = x * pow((z / (t + 1.0)), y);
} 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 (y <= (-6.5d+15)) then
tmp = x * (z ** y)
else if (y <= 0.00043d0) then
tmp = x * exp((a * (-b - z)))
else if (y <= 2.6d+187) then
tmp = x * ((z / (t + 1.0d0)) ** y)
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 (y <= -6.5e+15) {
tmp = x * Math.pow(z, y);
} else if (y <= 0.00043) {
tmp = x * Math.exp((a * (-b - z)));
} else if (y <= 2.6e+187) {
tmp = x * Math.pow((z / (t + 1.0)), y);
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.5e+15: tmp = x * math.pow(z, y) elif y <= 0.00043: tmp = x * math.exp((a * (-b - z))) elif y <= 2.6e+187: tmp = x * math.pow((z / (t + 1.0)), y) else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.5e+15) tmp = Float64(x * (z ^ y)); elseif (y <= 0.00043) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); elseif (y <= 2.6e+187) tmp = Float64(x * (Float64(z / Float64(t + 1.0)) ^ y)); 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 (y <= -6.5e+15) tmp = x * (z ^ y); elseif (y <= 0.00043) tmp = x * exp((a * (-b - z))); elseif (y <= 2.6e+187) tmp = x * ((z / (t + 1.0)) ^ y); else tmp = x * exp((t * -y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.5e+15], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00043], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+187], N[(x * N[Power[N[(z / N[(t + 1.0), $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+15}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;y \leq 0.00043:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+187}:\\
\;\;\;\;x \cdot {\left(\frac{z}{t + 1}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if y < -6.5e15Initial program 95.0%
fma-define96.7%
sub-neg96.7%
log1p-define98.4%
Simplified98.4%
Taylor expanded in a around 0 88.5%
Taylor expanded in t around 0 65.5%
if -6.5e15 < y < 4.29999999999999989e-4Initial program 95.5%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
associate-*r*99.8%
associate-*r*99.8%
distribute-lft-out99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 85.9%
associate-*r*85.9%
mul-1-neg85.9%
+-commutative85.9%
distribute-lft-neg-in85.9%
distribute-rgt-neg-in85.9%
Simplified85.9%
if 4.29999999999999989e-4 < y < 2.5999999999999999e187Initial program 95.2%
fma-define97.6%
sub-neg97.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 85.9%
pow185.9%
pow-exp85.8%
pow-exp85.9%
*-commutative85.9%
exp-prod85.9%
exp-diff85.9%
add-exp-log85.9%
Applied egg-rr85.9%
unpow185.9%
Simplified85.9%
Taylor expanded in t around 0 81.2%
if 2.5999999999999999e187 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 89.1%
Taylor expanded in t around inf 94.5%
mul-1-neg94.5%
distribute-lft-neg-out94.5%
*-commutative94.5%
Simplified94.5%
Final simplification80.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -1.65e+16)
t_1
(if (<= y 0.00036)
(* x (exp (* a (- (- b) z))))
(if (<= y 8.8e+186) t_1 (* x (exp (* t (- y)))))))))
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.65e+16) {
tmp = t_1;
} else if (y <= 0.00036) {
tmp = x * exp((a * (-b - z)));
} else if (y <= 8.8e+186) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-1.65d+16)) then
tmp = t_1
else if (y <= 0.00036d0) then
tmp = x * exp((a * (-b - z)))
else if (y <= 8.8d+186) then
tmp = t_1
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 t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -1.65e+16) {
tmp = t_1;
} else if (y <= 0.00036) {
tmp = x * Math.exp((a * (-b - z)));
} else if (y <= 8.8e+186) {
tmp = t_1;
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -1.65e+16: tmp = t_1 elif y <= 0.00036: tmp = x * math.exp((a * (-b - z))) elif y <= 8.8e+186: tmp = t_1 else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -1.65e+16) tmp = t_1; elseif (y <= 0.00036) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); elseif (y <= 8.8e+186) tmp = t_1; else tmp = Float64(x * exp(Float64(t * Float64(-y)))); 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.65e+16) tmp = t_1; elseif (y <= 0.00036) tmp = x * exp((a * (-b - z))); elseif (y <= 8.8e+186) tmp = t_1; else tmp = x * exp((t * -y)); 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.65e+16], t$95$1, If[LessEqual[y, 0.00036], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.8e+186], t$95$1, N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -1.65 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.00036:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if y < -1.65e16 or 3.60000000000000023e-4 < y < 8.7999999999999993e186Initial program 95.1%
fma-define97.1%
sub-neg97.1%
log1p-define99.0%
Simplified99.0%
Taylor expanded in a around 0 87.4%
Taylor expanded in t around 0 71.8%
if -1.65e16 < y < 3.60000000000000023e-4Initial program 95.5%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
associate-*r*99.8%
associate-*r*99.8%
distribute-lft-out99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 85.9%
associate-*r*85.9%
mul-1-neg85.9%
+-commutative85.9%
distribute-lft-neg-in85.9%
distribute-rgt-neg-in85.9%
Simplified85.9%
if 8.7999999999999993e186 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 89.1%
Taylor expanded in t around inf 94.5%
mul-1-neg94.5%
distribute-lft-neg-out94.5%
*-commutative94.5%
Simplified94.5%
Final simplification80.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (pow z y))))
(if (<= y -5.2e+15)
t_1
(if (<= y 0.00045)
(* x (exp (* a (- b))))
(if (<= y 2.9e+185) t_1 (* x (exp (* t (- y)))))))))
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 <= -5.2e+15) {
tmp = t_1;
} else if (y <= 0.00045) {
tmp = x * exp((a * -b));
} else if (y <= 2.9e+185) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * (z ** y)
if (y <= (-5.2d+15)) then
tmp = t_1
else if (y <= 0.00045d0) then
tmp = x * exp((a * -b))
else if (y <= 2.9d+185) then
tmp = t_1
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 t_1 = x * Math.pow(z, y);
double tmp;
if (y <= -5.2e+15) {
tmp = t_1;
} else if (y <= 0.00045) {
tmp = x * Math.exp((a * -b));
} else if (y <= 2.9e+185) {
tmp = t_1;
} else {
tmp = x * Math.exp((t * -y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.pow(z, y) tmp = 0 if y <= -5.2e+15: tmp = t_1 elif y <= 0.00045: tmp = x * math.exp((a * -b)) elif y <= 2.9e+185: tmp = t_1 else: tmp = x * math.exp((t * -y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * (z ^ y)) tmp = 0.0 if (y <= -5.2e+15) tmp = t_1; elseif (y <= 0.00045) tmp = Float64(x * exp(Float64(a * Float64(-b)))); elseif (y <= 2.9e+185) tmp = t_1; else tmp = Float64(x * exp(Float64(t * Float64(-y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (z ^ y); tmp = 0.0; if (y <= -5.2e+15) tmp = t_1; elseif (y <= 0.00045) tmp = x * exp((a * -b)); elseif (y <= 2.9e+185) tmp = t_1; else tmp = x * exp((t * -y)); 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, -5.2e+15], t$95$1, If[LessEqual[y, 0.00045], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+185], t$95$1, N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot {z}^{y}\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.00045:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\end{array}
\end{array}
if y < -5.2e15 or 4.4999999999999999e-4 < y < 2.89999999999999988e185Initial program 95.1%
fma-define97.1%
sub-neg97.1%
log1p-define99.0%
Simplified99.0%
Taylor expanded in a around 0 87.4%
Taylor expanded in t around 0 71.8%
if -5.2e15 < y < 4.4999999999999999e-4Initial program 95.5%
Taylor expanded in z around 0 99.8%
+-commutative99.8%
associate-*r*99.8%
associate-*r*99.8%
distribute-lft-out99.8%
mul-1-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 85.9%
associate-*r*85.9%
mul-1-neg85.9%
+-commutative85.9%
distribute-lft-neg-in85.9%
distribute-rgt-neg-in85.9%
Simplified85.9%
Taylor expanded in z around 0 79.3%
mul-1-neg79.3%
*-commutative79.3%
distribute-rgt-neg-in79.3%
Simplified79.3%
if 2.89999999999999988e185 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 89.1%
Taylor expanded in t around inf 94.5%
mul-1-neg94.5%
distribute-lft-neg-out94.5%
*-commutative94.5%
Simplified94.5%
Final simplification77.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9.5e-14) (not (<= b 1.8e-108))) (* x (exp (* a (- b)))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.5e-14) || !(b <= 1.8e-108)) {
tmp = x * exp((a * -b));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-9.5d-14)) .or. (.not. (b <= 1.8d-108))) then
tmp = x * exp((a * -b))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.5e-14) || !(b <= 1.8e-108)) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -9.5e-14) or not (b <= 1.8e-108): tmp = x * math.exp((a * -b)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9.5e-14) || !(b <= 1.8e-108)) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -9.5e-14) || ~((b <= 1.8e-108))) tmp = x * exp((a * -b)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9.5e-14], N[Not[LessEqual[b, 1.8e-108]], $MachinePrecision]], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{-14} \lor \neg \left(b \leq 1.8 \cdot 10^{-108}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if b < -9.4999999999999999e-14 or 1.8e-108 < b Initial program 97.9%
Taylor expanded in z around 0 97.9%
+-commutative97.9%
associate-*r*97.9%
associate-*r*97.9%
distribute-lft-out97.9%
mul-1-neg97.9%
Simplified97.9%
Taylor expanded in y around 0 78.8%
associate-*r*78.8%
mul-1-neg78.8%
+-commutative78.8%
distribute-lft-neg-in78.8%
distribute-rgt-neg-in78.8%
Simplified78.8%
Taylor expanded in z around 0 78.8%
mul-1-neg78.8%
*-commutative78.8%
distribute-rgt-neg-in78.8%
Simplified78.8%
if -9.4999999999999999e-14 < b < 1.8e-108Initial program 92.6%
fma-define92.6%
sub-neg92.6%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 90.1%
Taylor expanded in t around 0 69.5%
Final simplification74.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.7e-18) (not (<= y 1.46e-36))) (* x (pow z y)) (* x (- 1.0 (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.7e-18) || !(y <= 1.46e-36)) {
tmp = x * pow(z, y);
} 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 ((y <= (-1.7d-18)) .or. (.not. (y <= 1.46d-36))) then
tmp = x * (z ** y)
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 ((y <= -1.7e-18) || !(y <= 1.46e-36)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * (1.0 - (a * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.7e-18) or not (y <= 1.46e-36): tmp = x * math.pow(z, y) else: tmp = x * (1.0 - (a * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.7e-18) || !(y <= 1.46e-36)) tmp = Float64(x * (z ^ y)); 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 ((y <= -1.7e-18) || ~((y <= 1.46e-36))) tmp = x * (z ^ y); else tmp = x * (1.0 - (a * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.7e-18], N[Not[LessEqual[y, 1.46e-36]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-18} \lor \neg \left(y \leq 1.46 \cdot 10^{-36}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
if y < -1.70000000000000001e-18 or 1.4599999999999999e-36 < y Initial program 95.6%
fma-define97.1%
sub-neg97.1%
log1p-define99.2%
Simplified99.2%
Taylor expanded in a around 0 84.3%
Taylor expanded in t around 0 64.4%
if -1.70000000000000001e-18 < y < 1.4599999999999999e-36Initial program 95.7%
Taylor expanded in z around 0 99.9%
+-commutative99.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 87.7%
associate-*r*87.7%
mul-1-neg87.7%
+-commutative87.7%
distribute-lft-neg-in87.7%
distribute-rgt-neg-in87.7%
Simplified87.7%
Taylor expanded in a around 0 50.2%
associate-*r*50.2%
mul-1-neg50.2%
+-commutative50.2%
distribute-lft-neg-in50.2%
unsub-neg50.2%
+-commutative50.2%
Simplified50.2%
Final simplification57.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.7e-18) (* t (* x (- y))) (if (<= y 6.2e-24) (* x (- 1.0 (* a (+ z b)))) (* x (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.7e-18) {
tmp = t * (x * -y);
} else if (y <= 6.2e-24) {
tmp = x * (1.0 - (a * (z + 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 (y <= (-1.7d-18)) then
tmp = t * (x * -y)
else if (y <= 6.2d-24) then
tmp = x * (1.0d0 - (a * (z + 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 (y <= -1.7e-18) {
tmp = t * (x * -y);
} else if (y <= 6.2e-24) {
tmp = x * (1.0 - (a * (z + b)));
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.7e-18: tmp = t * (x * -y) elif y <= 6.2e-24: tmp = x * (1.0 - (a * (z + b))) else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.7e-18) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 6.2e-24) tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + 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 (y <= -1.7e-18) tmp = t * (x * -y); elseif (y <= 6.2e-24) tmp = x * (1.0 - (a * (z + b))); else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.7e-18], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-24], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-18}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-24}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if y < -1.70000000000000001e-18Initial program 94.1%
fma-define95.6%
sub-neg95.6%
log1p-define98.5%
Simplified98.5%
Taylor expanded in a around 0 85.7%
Taylor expanded in t around inf 60.6%
mul-1-neg60.6%
distribute-lft-neg-out60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in y around 0 13.7%
mul-1-neg13.7%
unsub-neg13.7%
*-commutative13.7%
associate-*l*12.6%
Simplified12.6%
Taylor expanded in y around inf 15.1%
mul-1-neg15.1%
distribute-rgt-neg-in15.1%
distribute-rgt-neg-in15.1%
Simplified15.1%
if -1.70000000000000001e-18 < y < 6.2000000000000001e-24Initial program 95.8%
Taylor expanded in z around 0 99.9%
+-commutative99.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 87.3%
associate-*r*87.3%
mul-1-neg87.3%
+-commutative87.3%
distribute-lft-neg-in87.3%
distribute-rgt-neg-in87.3%
Simplified87.3%
Taylor expanded in a around 0 51.0%
associate-*r*51.0%
mul-1-neg51.0%
+-commutative51.0%
distribute-lft-neg-in51.0%
unsub-neg51.0%
+-commutative51.0%
Simplified51.0%
if 6.2000000000000001e-24 < y Initial program 96.9%
fma-define98.4%
sub-neg98.4%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 81.9%
Taylor expanded in t around inf 58.3%
mul-1-neg58.3%
distribute-lft-neg-out58.3%
*-commutative58.3%
Simplified58.3%
Taylor expanded in y around 0 15.4%
mul-1-neg15.4%
unsub-neg15.4%
*-commutative15.4%
associate-*l*15.5%
Simplified15.5%
Taylor expanded in y around inf 21.0%
mul-1-neg21.0%
*-commutative21.0%
associate-*r*21.1%
distribute-rgt-neg-out21.1%
distribute-lft-neg-in21.1%
Simplified21.1%
Final simplification33.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.8e-12) (not (<= y 2.6e-25))) (* t (* x (- y))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.8e-12) || !(y <= 2.6e-25)) {
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 ((y <= (-6.8d-12)) .or. (.not. (y <= 2.6d-25))) 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 ((y <= -6.8e-12) || !(y <= 2.6e-25)) {
tmp = t * (x * -y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.8e-12) or not (y <= 2.6e-25): tmp = t * (x * -y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.8e-12) || !(y <= 2.6e-25)) tmp = Float64(t * Float64(x * Float64(-y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.8e-12) || ~((y <= 2.6e-25))) tmp = t * (x * -y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.8e-12], N[Not[LessEqual[y, 2.6e-25]], $MachinePrecision]], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{-12} \lor \neg \left(y \leq 2.6 \cdot 10^{-25}\right):\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.8000000000000001e-12 or 2.6e-25 < y Initial program 95.4%
fma-define96.9%
sub-neg96.9%
log1p-define99.2%
Simplified99.2%
Taylor expanded in a around 0 85.1%
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 14.7%
mul-1-neg14.7%
unsub-neg14.7%
*-commutative14.7%
associate-*l*14.2%
Simplified14.2%
Taylor expanded in y around inf 18.2%
mul-1-neg18.2%
distribute-rgt-neg-in18.2%
distribute-rgt-neg-in18.2%
Simplified18.2%
if -6.8000000000000001e-12 < y < 2.6e-25Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 54.9%
Taylor expanded in y around 0 35.6%
Final simplification26.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.38e-11) (* t (* x (- y))) (if (<= y 6e-24) x (* x (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.38e-11) {
tmp = t * (x * -y);
} else if (y <= 6e-24) {
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 (y <= (-1.38d-11)) then
tmp = t * (x * -y)
else if (y <= 6d-24) 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 (y <= -1.38e-11) {
tmp = t * (x * -y);
} else if (y <= 6e-24) {
tmp = x;
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.38e-11: tmp = t * (x * -y) elif y <= 6e-24: tmp = x else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.38e-11) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 6e-24) 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 (y <= -1.38e-11) tmp = t * (x * -y); elseif (y <= 6e-24) tmp = x; else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.38e-11], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-24], x, N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.38 \cdot 10^{-11}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-24}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if y < -1.38e-11Initial program 94.0%
fma-define95.5%
sub-neg95.5%
log1p-define98.4%
Simplified98.4%
Taylor expanded in a around 0 88.2%
Taylor expanded in t around inf 62.4%
mul-1-neg62.4%
distribute-lft-neg-out62.4%
*-commutative62.4%
Simplified62.4%
Taylor expanded in y around 0 14.1%
mul-1-neg14.1%
unsub-neg14.1%
*-commutative14.1%
associate-*l*13.0%
Simplified13.0%
Taylor expanded in y around inf 15.5%
mul-1-neg15.5%
distribute-rgt-neg-in15.5%
distribute-rgt-neg-in15.5%
Simplified15.5%
if -1.38e-11 < y < 5.99999999999999991e-24Initial program 95.9%
fma-define95.9%
sub-neg95.9%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 54.9%
Taylor expanded in y around 0 35.6%
if 5.99999999999999991e-24 < y Initial program 96.9%
fma-define98.4%
sub-neg98.4%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 81.9%
Taylor expanded in t around inf 58.3%
mul-1-neg58.3%
distribute-lft-neg-out58.3%
*-commutative58.3%
Simplified58.3%
Taylor expanded in y around 0 15.4%
mul-1-neg15.4%
unsub-neg15.4%
*-commutative15.4%
associate-*l*15.5%
Simplified15.5%
Taylor expanded in y around inf 21.0%
mul-1-neg21.0%
*-commutative21.0%
associate-*r*21.1%
distribute-rgt-neg-out21.1%
distribute-lft-neg-in21.1%
Simplified21.1%
Final simplification26.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6.2e-24) (- x (* a (* x b))) (* x (* t (- y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e-24) {
tmp = x - (a * (x * 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 (y <= 6.2d-24) then
tmp = x - (a * (x * 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 (y <= 6.2e-24) {
tmp = x - (a * (x * b));
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6.2e-24: tmp = x - (a * (x * b)) else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.2e-24) tmp = Float64(x - Float64(a * Float64(x * 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 (y <= 6.2e-24) tmp = x - (a * (x * b)); else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.2e-24], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{-24}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if y < 6.2000000000000001e-24Initial program 95.2%
fma-define95.8%
sub-neg95.8%
log1p-define99.4%
Simplified99.4%
Taylor expanded in a around 0 64.5%
Taylor expanded in y around 0 34.0%
sub-neg34.0%
log1p-undefine34.3%
Simplified34.3%
Taylor expanded in z around 0 34.0%
mul-1-neg34.0%
unsub-neg34.0%
Simplified34.0%
if 6.2000000000000001e-24 < y Initial program 96.9%
fma-define98.4%
sub-neg98.4%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 81.9%
Taylor expanded in t around inf 58.3%
mul-1-neg58.3%
distribute-lft-neg-out58.3%
*-commutative58.3%
Simplified58.3%
Taylor expanded in y around 0 15.4%
mul-1-neg15.4%
unsub-neg15.4%
*-commutative15.4%
associate-*l*15.5%
Simplified15.5%
Taylor expanded in y around inf 21.0%
mul-1-neg21.0%
*-commutative21.0%
associate-*r*21.1%
distribute-rgt-neg-out21.1%
distribute-lft-neg-in21.1%
Simplified21.1%
Final simplification30.7%
(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.6%
fma-define96.4%
sub-neg96.4%
log1p-define99.5%
Simplified99.5%
Taylor expanded in a around 0 70.4%
Taylor expanded in y around 0 19.2%
herbie shell --seed 2024137
(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))))))