
(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 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 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define99.6%
Simplified99.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1e-192) (not (<= y 8.5e-64))) (* x (exp (- (* y (- (log z) t)) (* z a)))) (* x (exp (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1e-192) || !(y <= 8.5e-64)) {
tmp = x * exp(((y * (log(z) - t)) - (z * a)));
} else {
tmp = x * exp((a * (log((1.0 - 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 <= (-1d-192)) .or. (.not. (y <= 8.5d-64))) then
tmp = x * exp(((y * (log(z) - t)) - (z * a)))
else
tmp = x * exp((a * (log((1.0d0 - 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 <= -1e-192) || !(y <= 8.5e-64)) {
tmp = x * Math.exp(((y * (Math.log(z) - t)) - (z * a)));
} else {
tmp = x * Math.exp((a * (Math.log((1.0 - z)) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1e-192) or not (y <= 8.5e-64): tmp = x * math.exp(((y * (math.log(z) - t)) - (z * a))) else: tmp = x * math.exp((a * (math.log((1.0 - z)) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1e-192) || !(y <= 8.5e-64)) tmp = Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(z * a)))); else tmp = Float64(x * exp(Float64(a * Float64(log(Float64(1.0 - z)) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1e-192) || ~((y <= 8.5e-64))) tmp = x * exp(((y * (log(z) - t)) - (z * a))); else tmp = x * exp((a * (log((1.0 - z)) - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1e-192], N[Not[LessEqual[y, 8.5e-64]], $MachinePrecision]], N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-192} \lor \neg \left(y \leq 8.5 \cdot 10^{-64}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if y < -1.0000000000000001e-192 or 8.49999999999999996e-64 < y Initial program 98.4%
Taylor expanded in z around 0 99.4%
+-commutative99.4%
associate-*r*99.4%
associate-*r*99.4%
distribute-lft-out99.4%
mul-1-neg99.4%
Simplified99.4%
Taylor expanded in b around 0 87.5%
+-commutative87.5%
associate-*r*87.5%
mul-1-neg87.5%
cancel-sign-sub-inv87.5%
Simplified87.5%
if -1.0000000000000001e-192 < y < 8.49999999999999996e-64Initial program 94.8%
fma-define94.8%
sub-neg94.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 93.5%
Final simplification89.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4.1e-8) (not (<= y 3.1e-63))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4.1e-8) || !(y <= 3.1e-63)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (log((1.0 - 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 <= (-4.1d-8)) .or. (.not. (y <= 3.1d-63))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (log((1.0d0 - 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 <= -4.1e-8) || !(y <= 3.1e-63)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (Math.log((1.0 - z)) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4.1e-8) or not (y <= 3.1e-63): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (math.log((1.0 - z)) - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4.1e-8) || !(y <= 3.1e-63)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(log(Float64(1.0 - z)) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4.1e-8) || ~((y <= 3.1e-63))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (log((1.0 - z)) - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4.1e-8], N[Not[LessEqual[y, 3.1e-63]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-8} \lor \neg \left(y \leq 3.1 \cdot 10^{-63}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if y < -4.10000000000000032e-8 or 3.09999999999999984e-63 < y Initial program 99.3%
fma-define99.3%
sub-neg99.3%
log1p-define99.3%
Simplified99.3%
Taylor expanded in a around 0 89.4%
if -4.10000000000000032e-8 < y < 3.09999999999999984e-63Initial program 95.0%
fma-define95.0%
sub-neg95.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 85.0%
Final simplification87.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.5e-8) (not (<= y 3e-60))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.5e-8) || !(y <= 3e-60)) {
tmp = x * exp((y * (log(z) - t)));
} 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 <= (-3.5d-8)) .or. (.not. (y <= 3d-60))) then
tmp = x * exp((y * (log(z) - t)))
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 <= -3.5e-8) || !(y <= 3e-60)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.5e-8) or not (y <= 3e-60): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.5e-8) || !(y <= 3e-60)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); 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 <= -3.5e-8) || ~((y <= 3e-60))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.5e-8], N[Not[LessEqual[y, 3e-60]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-8} \lor \neg \left(y \leq 3 \cdot 10^{-60}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -3.50000000000000024e-8 or 3.00000000000000019e-60 < y Initial program 99.3%
fma-define99.3%
sub-neg99.3%
log1p-define99.3%
Simplified99.3%
Taylor expanded in a around 0 89.4%
if -3.50000000000000024e-8 < y < 3.00000000000000019e-60Initial program 95.0%
fma-define95.0%
sub-neg95.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 85.0%
Taylor expanded in z around 0 84.2%
associate-*r*84.2%
mul-1-neg84.2%
Simplified84.2%
Final simplification87.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -9.2e-8) (* x (exp (* y (- t)))) (if (<= y 5.8e-5) (* x (exp (* a (- b)))) (* x (sqrt (pow z (* y 2.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -9.2e-8) {
tmp = x * exp((y * -t));
} else if (y <= 5.8e-5) {
tmp = x * exp((a * -b));
} else {
tmp = x * sqrt(pow(z, (y * 2.0)));
}
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.2d-8)) then
tmp = x * exp((y * -t))
else if (y <= 5.8d-5) then
tmp = x * exp((a * -b))
else
tmp = x * sqrt((z ** (y * 2.0d0)))
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.2e-8) {
tmp = x * Math.exp((y * -t));
} else if (y <= 5.8e-5) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.sqrt(Math.pow(z, (y * 2.0)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -9.2e-8: tmp = x * math.exp((y * -t)) elif y <= 5.8e-5: tmp = x * math.exp((a * -b)) else: tmp = x * math.sqrt(math.pow(z, (y * 2.0))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -9.2e-8) tmp = Float64(x * exp(Float64(y * Float64(-t)))); elseif (y <= 5.8e-5) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * sqrt((z ^ Float64(y * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -9.2e-8) tmp = x * exp((y * -t)); elseif (y <= 5.8e-5) tmp = x * exp((a * -b)); else tmp = x * sqrt((z ^ (y * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -9.2e-8], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-5], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Sqrt[N[Power[z, N[(y * 2.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{-8}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \sqrt{{z}^{\left(y \cdot 2\right)}}\\
\end{array}
\end{array}
if y < -9.2000000000000003e-8Initial program 100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 67.0%
associate-*r*67.0%
neg-mul-167.0%
Simplified67.0%
if -9.2000000000000003e-8 < y < 5.8e-5Initial program 95.4%
fma-define95.4%
sub-neg95.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 83.8%
Taylor expanded in z around 0 83.0%
associate-*r*83.0%
mul-1-neg83.0%
Simplified83.0%
if 5.8e-5 < y Initial program 98.3%
fma-define98.3%
sub-neg98.3%
log1p-define98.3%
Simplified98.3%
Taylor expanded in a around 0 85.0%
Taylor expanded in t around 0 73.3%
add-sqr-sqrt73.3%
sqrt-unprod73.3%
pow-sqr73.3%
Applied egg-rr73.3%
*-commutative73.3%
Simplified73.3%
Final simplification76.4%
(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 97.3%
Taylor expanded in z around 0 99.6%
+-commutative99.6%
associate-*r*99.6%
associate-*r*99.6%
distribute-lft-out99.6%
mul-1-neg99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.52e-7) (not (<= y 5.8e-5))) (* 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.52e-7) || !(y <= 5.8e-5)) {
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.52d-7)) .or. (.not. (y <= 5.8d-5))) 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.52e-7) || !(y <= 5.8e-5)) {
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.52e-7) or not (y <= 5.8e-5): 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.52e-7) || !(y <= 5.8e-5)) 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.52e-7) || ~((y <= 5.8e-5))) 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.52e-7], N[Not[LessEqual[y, 5.8e-5]], $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.52 \cdot 10^{-7} \lor \neg \left(y \leq 5.8 \cdot 10^{-5}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.52000000000000011e-7 or 5.8e-5 < y Initial program 99.2%
fma-define99.2%
sub-neg99.2%
log1p-define99.2%
Simplified99.2%
Taylor expanded in a around 0 90.1%
Taylor expanded in t around 0 68.7%
if -1.52000000000000011e-7 < y < 5.8e-5Initial program 95.4%
fma-define95.4%
sub-neg95.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 83.8%
Taylor expanded in z around 0 83.0%
associate-*r*83.0%
mul-1-neg83.0%
Simplified83.0%
Final simplification75.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -5.7e-8) (* x (exp (* y (- t)))) (if (<= y 5.8e-5) (* 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 (y <= -5.7e-8) {
tmp = x * exp((y * -t));
} else if (y <= 5.8e-5) {
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 (y <= (-5.7d-8)) then
tmp = x * exp((y * -t))
else if (y <= 5.8d-5) 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 (y <= -5.7e-8) {
tmp = x * Math.exp((y * -t));
} else if (y <= 5.8e-5) {
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 y <= -5.7e-8: tmp = x * math.exp((y * -t)) elif y <= 5.8e-5: 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 (y <= -5.7e-8) tmp = Float64(x * exp(Float64(y * Float64(-t)))); elseif (y <= 5.8e-5) 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 (y <= -5.7e-8) tmp = x * exp((y * -t)); elseif (y <= 5.8e-5) tmp = x * exp((a * -b)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.7e-8], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-5], 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}\;y \leq -5.7 \cdot 10^{-8}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if y < -5.70000000000000009e-8Initial program 100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 67.0%
associate-*r*67.0%
neg-mul-167.0%
Simplified67.0%
if -5.70000000000000009e-8 < y < 5.8e-5Initial program 95.4%
fma-define95.4%
sub-neg95.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 83.8%
Taylor expanded in z around 0 83.0%
associate-*r*83.0%
mul-1-neg83.0%
Simplified83.0%
if 5.8e-5 < y Initial program 98.3%
fma-define98.3%
sub-neg98.3%
log1p-define98.3%
Simplified98.3%
Taylor expanded in a around 0 85.0%
Taylor expanded in t around 0 73.3%
Final simplification76.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.5e-8) (not (<= y 3.4e-7))) (* x (pow z y)) (* x (- 1.0 (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.5e-8) || !(y <= 3.4e-7)) {
tmp = x * pow(z, y);
} 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 <= (-2.5d-8)) .or. (.not. (y <= 3.4d-7))) then
tmp = x * (z ** y)
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 <= -2.5e-8) || !(y <= 3.4e-7)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * (1.0 - (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.5e-8) or not (y <= 3.4e-7): tmp = x * math.pow(z, y) else: tmp = x * (1.0 - (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.5e-8) || !(y <= 3.4e-7)) tmp = Float64(x * (z ^ y)); 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 <= -2.5e-8) || ~((y <= 3.4e-7))) tmp = x * (z ^ y); else tmp = x * (1.0 - (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.5e-8], N[Not[LessEqual[y, 3.4e-7]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{-8} \lor \neg \left(y \leq 3.4 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\end{array}
\end{array}
if y < -2.4999999999999999e-8 or 3.39999999999999974e-7 < y Initial program 99.2%
fma-define99.2%
sub-neg99.2%
log1p-define99.2%
Simplified99.2%
Taylor expanded in a around 0 90.1%
Taylor expanded in t around 0 68.3%
if -2.4999999999999999e-8 < y < 3.39999999999999974e-7Initial program 95.3%
fma-define95.3%
sub-neg95.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 83.7%
Taylor expanded in z around 0 82.9%
associate-*r*82.9%
mul-1-neg82.9%
Simplified82.9%
Taylor expanded in a around 0 48.4%
neg-mul-148.4%
distribute-rgt-neg-in48.4%
Simplified48.4%
Final simplification58.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.1e-13) (- x (* t (* x y))) (if (<= y 380000000000.0) (* x (- 1.0 (* a b))) (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.1e-13) {
tmp = x - (t * (x * y));
} else if (y <= 380000000000.0) {
tmp = x * (1.0 - (a * b));
} 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.1d-13)) then
tmp = x - (t * (x * y))
else if (y <= 380000000000.0d0) then
tmp = x * (1.0d0 - (a * b))
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.1e-13) {
tmp = x - (t * (x * y));
} else if (y <= 380000000000.0) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.1e-13: tmp = x - (t * (x * y)) elif y <= 380000000000.0: tmp = x * (1.0 - (a * b)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.1e-13) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= 380000000000.0) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.1e-13) tmp = x - (t * (x * y)); elseif (y <= 380000000000.0) tmp = x * (1.0 - (a * b)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.1e-13], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 380000000000.0], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-13}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 380000000000:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -4.1000000000000002e-13Initial program 98.7%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 66.1%
associate-*r*66.1%
neg-mul-166.1%
Simplified66.1%
Taylor expanded in t around 0 26.4%
mul-1-neg26.4%
unsub-neg26.4%
*-commutative26.4%
Simplified26.4%
if -4.1000000000000002e-13 < y < 3.8e11Initial program 96.1%
fma-define96.1%
sub-neg96.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 83.7%
Taylor expanded in z around 0 82.9%
associate-*r*82.9%
mul-1-neg82.9%
Simplified82.9%
Taylor expanded in a around 0 48.9%
neg-mul-148.9%
distribute-rgt-neg-in48.9%
Simplified48.9%
if 3.8e11 < y Initial program 98.2%
fma-define98.3%
sub-neg98.3%
log1p-define98.3%
Simplified98.3%
Taylor expanded in y around 0 40.5%
Taylor expanded in z around 0 40.5%
associate-*r*40.5%
mul-1-neg40.5%
Simplified40.5%
Taylor expanded in a around 0 8.2%
mul-1-neg8.2%
unsub-neg8.2%
*-commutative8.2%
Simplified8.2%
Taylor expanded in a around inf 21.0%
mul-1-neg21.0%
associate-*r*27.7%
*-commutative27.7%
distribute-rgt-neg-in27.7%
distribute-rgt-neg-in27.7%
Simplified27.7%
Final simplification37.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7.2e-13) (- x (* t (* x y))) (if (<= y 0.000145) (- x (* b (* x a))) (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.2e-13) {
tmp = x - (t * (x * y));
} else if (y <= 0.000145) {
tmp = x - (b * (x * a));
} 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 <= (-7.2d-13)) then
tmp = x - (t * (x * y))
else if (y <= 0.000145d0) then
tmp = x - (b * (x * a))
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 <= -7.2e-13) {
tmp = x - (t * (x * y));
} else if (y <= 0.000145) {
tmp = x - (b * (x * a));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.2e-13: tmp = x - (t * (x * y)) elif y <= 0.000145: tmp = x - (b * (x * a)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.2e-13) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= 0.000145) tmp = Float64(x - Float64(b * Float64(x * a))); else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.2e-13) tmp = x - (t * (x * y)); elseif (y <= 0.000145) tmp = x - (b * (x * a)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.2e-13], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.000145], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-13}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 0.000145:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -7.1999999999999996e-13Initial program 98.7%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 66.1%
associate-*r*66.1%
neg-mul-166.1%
Simplified66.1%
Taylor expanded in t around 0 26.4%
mul-1-neg26.4%
unsub-neg26.4%
*-commutative26.4%
Simplified26.4%
if -7.1999999999999996e-13 < y < 1.45e-4Initial program 96.0%
fma-define96.0%
sub-neg96.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 84.4%
Taylor expanded in z around 0 83.6%
associate-*r*83.6%
mul-1-neg83.6%
Simplified83.6%
Taylor expanded in a around 0 47.0%
mul-1-neg47.0%
unsub-neg47.0%
*-commutative47.0%
Simplified47.0%
Taylor expanded in a around 0 47.0%
associate-*r*49.3%
*-commutative49.3%
associate-*r*47.5%
*-commutative47.5%
*-commutative47.5%
*-commutative47.5%
Simplified47.5%
if 1.45e-4 < y Initial program 98.3%
fma-define98.3%
sub-neg98.3%
log1p-define98.3%
Simplified98.3%
Taylor expanded in y around 0 39.8%
Taylor expanded in z around 0 39.8%
associate-*r*39.8%
mul-1-neg39.8%
Simplified39.8%
Taylor expanded in a around 0 8.1%
mul-1-neg8.1%
unsub-neg8.1%
*-commutative8.1%
Simplified8.1%
Taylor expanded in a around inf 20.7%
mul-1-neg20.7%
associate-*r*27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
distribute-rgt-neg-in27.2%
Simplified27.2%
Final simplification36.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.5e-12) (* x (- 1.0 (* y t))) (if (<= y 0.00038) (- x (* b (* x a))) (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.5e-12) {
tmp = x * (1.0 - (y * t));
} else if (y <= 0.00038) {
tmp = x - (b * (x * a));
} 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 <= (-1.5d-12)) then
tmp = x * (1.0d0 - (y * t))
else if (y <= 0.00038d0) then
tmp = x - (b * (x * a))
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 <= -1.5e-12) {
tmp = x * (1.0 - (y * t));
} else if (y <= 0.00038) {
tmp = x - (b * (x * a));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.5e-12: tmp = x * (1.0 - (y * t)) elif y <= 0.00038: tmp = x - (b * (x * a)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.5e-12) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (y <= 0.00038) tmp = Float64(x - Float64(b * Float64(x * a))); else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.5e-12) tmp = x * (1.0 - (y * t)); elseif (y <= 0.00038) tmp = x - (b * (x * a)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.5e-12], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00038], N[(x - N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;y \leq 0.00038:\\
\;\;\;\;x - b \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -1.5000000000000001e-12Initial program 98.7%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 66.1%
associate-*r*66.1%
neg-mul-166.1%
Simplified66.1%
Taylor expanded in t around 0 22.7%
neg-mul-122.7%
unsub-neg22.7%
Simplified22.7%
if -1.5000000000000001e-12 < y < 3.8000000000000002e-4Initial program 96.0%
fma-define96.0%
sub-neg96.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 84.4%
Taylor expanded in z around 0 83.6%
associate-*r*83.6%
mul-1-neg83.6%
Simplified83.6%
Taylor expanded in a around 0 47.0%
mul-1-neg47.0%
unsub-neg47.0%
*-commutative47.0%
Simplified47.0%
Taylor expanded in a around 0 47.0%
associate-*r*49.3%
*-commutative49.3%
associate-*r*47.5%
*-commutative47.5%
*-commutative47.5%
*-commutative47.5%
Simplified47.5%
if 3.8000000000000002e-4 < y Initial program 98.3%
fma-define98.3%
sub-neg98.3%
log1p-define98.3%
Simplified98.3%
Taylor expanded in y around 0 39.8%
Taylor expanded in z around 0 39.8%
associate-*r*39.8%
mul-1-neg39.8%
Simplified39.8%
Taylor expanded in a around 0 8.1%
mul-1-neg8.1%
unsub-neg8.1%
*-commutative8.1%
Simplified8.1%
Taylor expanded in a around inf 20.7%
mul-1-neg20.7%
associate-*r*27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
distribute-rgt-neg-in27.2%
Simplified27.2%
Final simplification35.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.58e-12) (* x (- 1.0 (* y t))) (if (<= y 380000000000.0) (- x (* a (* x b))) (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.58e-12) {
tmp = x * (1.0 - (y * t));
} else if (y <= 380000000000.0) {
tmp = x - (a * (x * b));
} 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 <= (-1.58d-12)) then
tmp = x * (1.0d0 - (y * t))
else if (y <= 380000000000.0d0) then
tmp = x - (a * (x * b))
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 <= -1.58e-12) {
tmp = x * (1.0 - (y * t));
} else if (y <= 380000000000.0) {
tmp = x - (a * (x * b));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.58e-12: tmp = x * (1.0 - (y * t)) elif y <= 380000000000.0: tmp = x - (a * (x * b)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.58e-12) tmp = Float64(x * Float64(1.0 - Float64(y * t))); elseif (y <= 380000000000.0) tmp = Float64(x - Float64(a * Float64(x * b))); else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.58e-12) tmp = x * (1.0 - (y * t)); elseif (y <= 380000000000.0) tmp = x - (a * (x * b)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.58e-12], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 380000000000.0], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.58 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{elif}\;y \leq 380000000000:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -1.57999999999999993e-12Initial program 98.7%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 66.1%
associate-*r*66.1%
neg-mul-166.1%
Simplified66.1%
Taylor expanded in t around 0 22.7%
neg-mul-122.7%
unsub-neg22.7%
Simplified22.7%
if -1.57999999999999993e-12 < y < 3.8e11Initial program 96.1%
fma-define96.1%
sub-neg96.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 83.7%
Taylor expanded in z around 0 82.9%
associate-*r*82.9%
mul-1-neg82.9%
Simplified82.9%
Taylor expanded in a around 0 46.7%
mul-1-neg46.7%
unsub-neg46.7%
*-commutative46.7%
Simplified46.7%
if 3.8e11 < y Initial program 98.2%
fma-define98.3%
sub-neg98.3%
log1p-define98.3%
Simplified98.3%
Taylor expanded in y around 0 40.5%
Taylor expanded in z around 0 40.5%
associate-*r*40.5%
mul-1-neg40.5%
Simplified40.5%
Taylor expanded in a around 0 8.2%
mul-1-neg8.2%
unsub-neg8.2%
*-commutative8.2%
Simplified8.2%
Taylor expanded in a around inf 21.0%
mul-1-neg21.0%
associate-*r*27.7%
*-commutative27.7%
distribute-rgt-neg-in27.7%
distribute-rgt-neg-in27.7%
Simplified27.7%
Final simplification35.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.9e-21) (not (<= y 6e-11))) (* x (* a (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -3.9e-21) || !(y <= 6e-11)) {
tmp = x * (a * -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 <= (-3.9d-21)) .or. (.not. (y <= 6d-11))) then
tmp = x * (a * -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 <= -3.9e-21) || !(y <= 6e-11)) {
tmp = x * (a * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.9e-21) or not (y <= 6e-11): tmp = x * (a * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -3.9e-21) || !(y <= 6e-11)) tmp = Float64(x * Float64(a * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -3.9e-21) || ~((y <= 6e-11))) tmp = x * (a * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -3.9e-21], N[Not[LessEqual[y, 6e-11]], $MachinePrecision]], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{-21} \lor \neg \left(y \leq 6 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.9000000000000001e-21 or 6e-11 < y Initial program 98.6%
fma-define98.6%
sub-neg98.6%
log1p-define99.3%
Simplified99.3%
Taylor expanded in y around 0 35.9%
Taylor expanded in z around 0 35.2%
associate-*r*35.2%
mul-1-neg35.2%
Simplified35.2%
Taylor expanded in a around 0 9.7%
mul-1-neg9.7%
unsub-neg9.7%
*-commutative9.7%
Simplified9.7%
Taylor expanded in a around inf 17.0%
mul-1-neg17.0%
associate-*r*19.8%
*-commutative19.8%
distribute-rgt-neg-in19.8%
distribute-rgt-neg-in19.8%
Simplified19.8%
if -3.9000000000000001e-21 < y < 6e-11Initial program 95.8%
fma-define95.8%
sub-neg95.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 85.1%
Taylor expanded in a around 0 37.9%
Final simplification28.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6e-56) (* a (* x (- b))) (if (<= y 7.5e-11) x (* x (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6e-56) {
tmp = a * (x * -b);
} else if (y <= 7.5e-11) {
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 <= (-6d-56)) then
tmp = a * (x * -b)
else if (y <= 7.5d-11) 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 <= -6e-56) {
tmp = a * (x * -b);
} else if (y <= 7.5e-11) {
tmp = x;
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6e-56: tmp = a * (x * -b) elif y <= 7.5e-11: tmp = x else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6e-56) tmp = Float64(a * Float64(x * Float64(-b))); elseif (y <= 7.5e-11) tmp = x; else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6e-56) tmp = a * (x * -b); elseif (y <= 7.5e-11) tmp = x; else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6e-56], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e-11], x, N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{-56}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < -5.99999999999999979e-56Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 36.1%
Taylor expanded in z around 0 34.9%
associate-*r*34.9%
mul-1-neg34.9%
Simplified34.9%
Taylor expanded in a around 0 12.5%
mul-1-neg12.5%
unsub-neg12.5%
*-commutative12.5%
Simplified12.5%
Taylor expanded in a around inf 16.1%
associate-*r*16.1%
neg-mul-116.1%
*-commutative16.1%
Simplified16.1%
if -5.99999999999999979e-56 < y < 7.5e-11Initial program 95.6%
fma-define95.6%
sub-neg95.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 85.1%
Taylor expanded in a around 0 38.0%
if 7.5e-11 < y Initial program 98.3%
fma-define98.3%
sub-neg98.3%
log1p-define98.4%
Simplified98.4%
Taylor expanded in y around 0 40.6%
Taylor expanded in z around 0 40.6%
associate-*r*40.6%
mul-1-neg40.6%
Simplified40.6%
Taylor expanded in a around 0 9.9%
mul-1-neg9.9%
unsub-neg9.9%
*-commutative9.9%
Simplified9.9%
Taylor expanded in a around inf 21.7%
mul-1-neg21.7%
associate-*r*28.1%
*-commutative28.1%
distribute-rgt-neg-in28.1%
distribute-rgt-neg-in28.1%
Simplified28.1%
Final simplification28.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y 4.8e-8) (* x (- 1.0 (* y t))) (* x (* a (- b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4.8e-8) {
tmp = x * (1.0 - (y * t));
} 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.8d-8) then
tmp = x * (1.0d0 - (y * t))
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.8e-8) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (a * -b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 4.8e-8: tmp = x * (1.0 - (y * t)) else: tmp = x * (a * -b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 4.8e-8) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * Float64(a * Float64(-b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 4.8e-8) tmp = x * (1.0 - (y * t)); else tmp = x * (a * -b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 4.8e-8], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\end{array}
\end{array}
if y < 4.79999999999999997e-8Initial program 97.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 58.2%
associate-*r*58.2%
neg-mul-158.2%
Simplified58.2%
Taylor expanded in t around 0 31.9%
neg-mul-131.9%
unsub-neg31.9%
Simplified31.9%
if 4.79999999999999997e-8 < y Initial program 98.3%
fma-define98.3%
sub-neg98.3%
log1p-define98.4%
Simplified98.4%
Taylor expanded in y around 0 40.6%
Taylor expanded in z around 0 40.6%
associate-*r*40.6%
mul-1-neg40.6%
Simplified40.6%
Taylor expanded in a around 0 9.9%
mul-1-neg9.9%
unsub-neg9.9%
*-commutative9.9%
Simplified9.9%
Taylor expanded in a around inf 21.7%
mul-1-neg21.7%
associate-*r*28.1%
*-commutative28.1%
distribute-rgt-neg-in28.1%
distribute-rgt-neg-in28.1%
Simplified28.1%
Final simplification31.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define99.6%
Simplified99.6%
Taylor expanded in y around 0 58.6%
Taylor expanded in a around 0 20.1%
herbie shell --seed 2024157
(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))))))