
(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 (pow E (fma y (- (log z) t) (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * pow(((double) M_E), fma(y, (log(z) - t), (a * (-b - z))));
}
function code(x, y, z, t, a, b) return Float64(x * (exp(1) ^ fma(y, Float64(log(z) - t), Float64(a * Float64(Float64(-b) - z))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Power[E, N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot {e}^{\left(\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(-b\right) - z\right)\right)\right)}
\end{array}
Initial program 95.5%
Taylor expanded in z around 0 98.4%
+-commutative98.4%
associate-*r*98.4%
associate-*r*98.4%
distribute-lft-out98.4%
mul-1-neg98.4%
Simplified98.4%
*-un-lft-identity98.4%
exp-prod98.4%
fma-define99.2%
distribute-lft-neg-out99.2%
fmm-undef98.4%
Applied egg-rr98.4%
exp-1-e98.4%
fmm-def99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.95e-44) (not (<= b 1.05e-14))) (* x (exp (- (* a (- b)) (* y t)))) (* x (exp (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.95e-44) || !(b <= 1.05e-14)) {
tmp = x * exp(((a * -b) - (y * t)));
} 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 ((b <= (-1.95d-44)) .or. (.not. (b <= 1.05d-14))) then
tmp = x * exp(((a * -b) - (y * t)))
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 ((b <= -1.95e-44) || !(b <= 1.05e-14)) {
tmp = x * Math.exp(((a * -b) - (y * t)));
} else {
tmp = x * Math.exp((y * (Math.log(z) - t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.95e-44) or not (b <= 1.05e-14): tmp = x * math.exp(((a * -b) - (y * t))) else: tmp = x * math.exp((y * (math.log(z) - t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.95e-44) || !(b <= 1.05e-14)) tmp = Float64(x * exp(Float64(Float64(a * Float64(-b)) - Float64(y * t)))); 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 ((b <= -1.95e-44) || ~((b <= 1.05e-14))) tmp = x * exp(((a * -b) - (y * t))); else tmp = x * exp((y * (log(z) - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.95e-44], N[Not[LessEqual[b, 1.05e-14]], $MachinePrecision]], N[(x * N[Exp[N[(N[(a * (-b)), $MachinePrecision] - N[(y * t), $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}\;b \leq -1.95 \cdot 10^{-44} \lor \neg \left(b \leq 1.05 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right) - y \cdot t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\end{array}
\end{array}
if b < -1.9500000000000001e-44 or 1.0499999999999999e-14 < b Initial program 97.1%
Taylor expanded in z around 0 97.1%
mul-1-neg97.1%
distribute-rgt-neg-out97.1%
Simplified97.1%
Taylor expanded in t around inf 91.3%
mul-1-neg91.3%
distribute-lft-neg-out91.3%
*-commutative91.3%
Simplified91.3%
if -1.9500000000000001e-44 < b < 1.0499999999999999e-14Initial program 93.6%
fma-define93.6%
sub-neg93.6%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 88.8%
Final simplification90.1%
(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.5%
Taylor expanded in z around 0 98.4%
+-commutative98.4%
associate-*r*98.4%
associate-*r*98.4%
distribute-lft-out98.4%
mul-1-neg98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * b)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) - (a * 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 * b)));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * b)))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * 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 * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot b}
\end{array}
Initial program 95.5%
Taylor expanded in z around 0 94.3%
mul-1-neg94.3%
distribute-rgt-neg-out94.3%
Simplified94.3%
Final simplification94.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -3.2)
(* x (pow z y))
(if (<= y 0.00155)
(* x (pow E (* a (- (- b) z))))
(* x (exp (* y (- t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.2) {
tmp = x * pow(z, y);
} else if (y <= 0.00155) {
tmp = x * pow(((double) M_E), (a * (-b - z)));
} else {
tmp = x * exp((y * -t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.2) {
tmp = x * Math.pow(z, y);
} else if (y <= 0.00155) {
tmp = x * Math.pow(Math.E, (a * (-b - z)));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.2: tmp = x * math.pow(z, y) elif y <= 0.00155: tmp = x * math.pow(math.e, (a * (-b - z))) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.2) tmp = Float64(x * (z ^ y)); elseif (y <= 0.00155) tmp = Float64(x * (exp(1) ^ Float64(a * Float64(Float64(-b) - z)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.2) tmp = x * (z ^ y); elseif (y <= 0.00155) tmp = x * (2.71828182845904523536 ^ (a * (-b - z))); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.2], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00155], N[(x * N[Power[E, N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;y \leq 0.00155:\\
\;\;\;\;x \cdot {e}^{\left(a \cdot \left(\left(-b\right) - z\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if y < -3.2000000000000002Initial program 96.8%
fma-define98.4%
sub-neg98.4%
log1p-define98.4%
Simplified98.4%
Taylor expanded in a around 0 84.4%
Taylor expanded in t around 0 70.3%
if -3.2000000000000002 < y < 0.00154999999999999995Initial program 94.0%
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%
*-un-lft-identity99.9%
exp-prod99.9%
fma-define99.9%
distribute-lft-neg-out99.9%
fmm-undef99.9%
Applied egg-rr99.9%
exp-1-e99.9%
fmm-def99.9%
Simplified99.9%
Taylor expanded in y around 0 90.5%
neg-mul-190.5%
distribute-rgt-neg-in90.5%
distribute-neg-in90.5%
mul-1-neg90.5%
unsub-neg90.5%
mul-1-neg90.5%
Simplified90.5%
if 0.00154999999999999995 < y Initial program 97.0%
Taylor expanded in z around 0 97.0%
+-commutative97.0%
associate-*r*97.0%
associate-*r*97.0%
distribute-lft-out97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t around inf 67.6%
associate-*r*67.6%
neg-mul-167.6%
Simplified67.6%
Final simplification79.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -0.85) (* x (pow z y)) (if (<= y 0.00165) (* x (exp (* a (- (- b) z)))) (* x (exp (* y (- t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.85) {
tmp = x * pow(z, y);
} else if (y <= 0.00165) {
tmp = x * exp((a * (-b - z)));
} else {
tmp = x * exp((y * -t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-0.85d0)) then
tmp = x * (z ** y)
else if (y <= 0.00165d0) then
tmp = x * exp((a * (-b - z)))
else
tmp = x * exp((y * -t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.85) {
tmp = x * Math.pow(z, y);
} else if (y <= 0.00165) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -0.85: tmp = x * math.pow(z, y) elif y <= 0.00165: tmp = x * math.exp((a * (-b - z))) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -0.85) tmp = Float64(x * (z ^ y)); elseif (y <= 0.00165) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -0.85) tmp = x * (z ^ y); elseif (y <= 0.00165) tmp = x * exp((a * (-b - z))); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.85], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00165], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.85:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;y \leq 0.00165:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if y < -0.849999999999999978Initial program 96.8%
fma-define98.4%
sub-neg98.4%
log1p-define98.4%
Simplified98.4%
Taylor expanded in a around 0 84.4%
Taylor expanded in t around 0 70.3%
if -0.849999999999999978 < y < 0.00165Initial program 94.0%
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 90.5%
associate-*r*90.5%
neg-mul-190.5%
+-commutative90.5%
distribute-lft-neg-in90.5%
Simplified90.5%
if 0.00165 < y Initial program 97.0%
Taylor expanded in z around 0 97.0%
+-commutative97.0%
associate-*r*97.0%
associate-*r*97.0%
distribute-lft-out97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t around inf 67.6%
associate-*r*67.6%
neg-mul-167.6%
Simplified67.6%
Final simplification79.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.78) (not (<= y 1.7e+23))) (* x (pow z y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.78) || !(y <= 1.7e+23)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * -b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-0.78d0)) .or. (.not. (y <= 1.7d+23))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * -b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.78) || !(y <= 1.7e+23)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.78) or not (y <= 1.7e+23): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.78) || !(y <= 1.7e+23)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -0.78) || ~((y <= 1.7e+23))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.78], N[Not[LessEqual[y, 1.7e+23]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.78 \lor \neg \left(y \leq 1.7 \cdot 10^{+23}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -0.78000000000000003 or 1.69999999999999996e23 < y Initial program 96.7%
fma-define98.4%
sub-neg98.4%
log1p-define98.4%
Simplified98.4%
Taylor expanded in a around 0 86.1%
Taylor expanded in t around 0 68.0%
if -0.78000000000000003 < y < 1.69999999999999996e23Initial program 94.4%
Taylor expanded in z around 0 92.2%
mul-1-neg92.2%
distribute-rgt-neg-out92.2%
Simplified92.2%
Taylor expanded in y around 0 81.3%
neg-mul-181.3%
distribute-rgt-neg-in81.3%
Simplified81.3%
Final simplification75.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.6) (* x (pow z y)) (if (<= y 0.0013) (* x (exp (* a (- b)))) (* x (exp (* y (- t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6) {
tmp = x * pow(z, y);
} else if (y <= 0.0013) {
tmp = x * exp((a * -b));
} else {
tmp = x * exp((y * -t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.6d0)) then
tmp = x * (z ** y)
else if (y <= 0.0013d0) then
tmp = x * exp((a * -b))
else
tmp = x * exp((y * -t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.6) {
tmp = x * Math.pow(z, y);
} else if (y <= 0.0013) {
tmp = x * Math.exp((a * -b));
} else {
tmp = x * Math.exp((y * -t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.6: tmp = x * math.pow(z, y) elif y <= 0.0013: tmp = x * math.exp((a * -b)) else: tmp = x * math.exp((y * -t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.6) tmp = Float64(x * (z ^ y)); elseif (y <= 0.0013) tmp = Float64(x * exp(Float64(a * Float64(-b)))); else tmp = Float64(x * exp(Float64(y * Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.6) tmp = x * (z ^ y); elseif (y <= 0.0013) tmp = x * exp((a * -b)); else tmp = x * exp((y * -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.6], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.0013], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{elif}\;y \leq 0.0013:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\end{array}
\end{array}
if y < -1.6000000000000001Initial program 96.8%
fma-define98.4%
sub-neg98.4%
log1p-define98.4%
Simplified98.4%
Taylor expanded in a around 0 84.4%
Taylor expanded in t around 0 70.3%
if -1.6000000000000001 < y < 0.0012999999999999999Initial program 94.0%
Taylor expanded in z around 0 91.7%
mul-1-neg91.7%
distribute-rgt-neg-out91.7%
Simplified91.7%
Taylor expanded in y around 0 83.0%
neg-mul-183.0%
distribute-rgt-neg-in83.0%
Simplified83.0%
if 0.0012999999999999999 < y Initial program 97.0%
Taylor expanded in z around 0 97.0%
+-commutative97.0%
associate-*r*97.0%
associate-*r*97.0%
distribute-lft-out97.0%
mul-1-neg97.0%
Simplified97.0%
Taylor expanded in t around inf 67.6%
associate-*r*67.6%
neg-mul-167.6%
Simplified67.6%
Final simplification75.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.6e+179) (* x (pow z y)) (* x (exp (- (* a (- b)) (* y t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.6e+179) {
tmp = x * pow(z, y);
} else {
tmp = x * exp(((a * -b) - (y * t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-4.6d+179)) then
tmp = x * (z ** y)
else
tmp = x * exp(((a * -b) - (y * t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.6e+179) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp(((a * -b) - (y * t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.6e+179: tmp = x * math.pow(z, y) else: tmp = x * math.exp(((a * -b) - (y * t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.6e+179) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(Float64(a * Float64(-b)) - Float64(y * t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.6e+179) tmp = x * (z ^ y); else tmp = x * exp(((a * -b) - (y * t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.6e+179], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[(a * (-b)), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+179}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right) - y \cdot t}\\
\end{array}
\end{array}
if y < -4.59999999999999988e179Initial program 93.8%
fma-define96.9%
sub-neg96.9%
log1p-define96.9%
Simplified96.9%
Taylor expanded in a around 0 90.8%
Taylor expanded in t around 0 78.5%
if -4.59999999999999988e179 < y Initial program 95.7%
Taylor expanded in z around 0 94.4%
mul-1-neg94.4%
distribute-rgt-neg-out94.4%
Simplified94.4%
Taylor expanded in t around inf 85.6%
mul-1-neg85.6%
distribute-lft-neg-out85.6%
*-commutative85.6%
Simplified85.6%
Final simplification84.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.0) (- x (* y (* x t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.0) {
tmp = x - (y * (x * t));
} else {
tmp = x * pow(z, y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.0d0)) then
tmp = x - (y * (x * t))
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.0) {
tmp = x - (y * (x * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.0: tmp = x - (y * (x * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.0) tmp = Float64(x - Float64(y * Float64(x * t))); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.0) tmp = x - (y * (x * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.0], N[(x - N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;x - y \cdot \left(x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1Initial program 96.7%
Taylor expanded in z around 0 96.7%
+-commutative96.7%
associate-*r*96.7%
associate-*r*96.7%
distribute-lft-out96.7%
mul-1-neg96.7%
Simplified96.7%
Taylor expanded in t around inf 82.5%
associate-*r*82.5%
neg-mul-182.5%
Simplified82.5%
Taylor expanded in t around 0 36.1%
mul-1-neg36.1%
unsub-neg36.1%
associate-*r*37.6%
*-commutative37.6%
Simplified37.6%
if -1 < t Initial program 95.1%
fma-define95.6%
sub-neg95.6%
log1p-define99.5%
Simplified99.5%
Taylor expanded in a around 0 66.8%
Taylor expanded in t around 0 62.5%
Final simplification56.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7e-34) (* b (- (/ x b) (* x a))) (if (<= y 1.6e+65) (* x (- 1.0 (* a b))) (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7e-34) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 1.6e+65) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (z * -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 <= (-7d-34)) then
tmp = b * ((x / b) - (x * a))
else if (y <= 1.6d+65) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (z * -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 <= -7e-34) {
tmp = b * ((x / b) - (x * a));
} else if (y <= 1.6e+65) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7e-34: tmp = b * ((x / b) - (x * a)) elif y <= 1.6e+65: tmp = x * (1.0 - (a * b)) else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7e-34) tmp = Float64(b * Float64(Float64(x / b) - Float64(x * a))); elseif (y <= 1.6e+65) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7e-34) tmp = b * ((x / b) - (x * a)); elseif (y <= 1.6e+65) tmp = x * (1.0 - (a * b)); else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7e-34], N[(b * N[(N[(x / b), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e+65], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-34}:\\
\;\;\;\;b \cdot \left(\frac{x}{b} - x \cdot a\right)\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+65}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -7e-34Initial program 97.1%
Taylor expanded in z around 0 97.1%
mul-1-neg97.1%
distribute-rgt-neg-out97.1%
Simplified97.1%
Taylor expanded in y around 0 43.0%
neg-mul-143.0%
distribute-rgt-neg-in43.0%
Simplified43.0%
Taylor expanded in a around 0 16.1%
neg-mul-116.1%
unsub-neg16.1%
Simplified16.1%
Taylor expanded in b around inf 29.7%
+-commutative29.7%
mul-1-neg29.7%
unsub-neg29.7%
*-commutative29.7%
Simplified29.7%
if -7e-34 < y < 1.60000000000000003e65Initial program 94.4%
Taylor expanded in z around 0 92.3%
mul-1-neg92.3%
distribute-rgt-neg-out92.3%
Simplified92.3%
Taylor expanded in y around 0 79.2%
neg-mul-179.2%
distribute-rgt-neg-in79.2%
Simplified79.2%
Taylor expanded in a around 0 47.7%
neg-mul-147.7%
unsub-neg47.7%
Simplified47.7%
if 1.60000000000000003e65 < y Initial program 96.0%
fma-define98.0%
sub-neg98.0%
log1p-define98.0%
Simplified98.0%
Taylor expanded in z around 0 78.0%
Taylor expanded in y around 0 28.4%
Taylor expanded in b around 0 5.8%
mul-1-neg5.8%
unsub-neg5.8%
Simplified5.8%
Taylor expanded in a around inf 32.4%
mul-1-neg32.4%
*-commutative32.4%
associate-*r*35.9%
distribute-rgt-neg-in35.9%
*-commutative35.9%
distribute-rgt-neg-in35.9%
Simplified35.9%
Final simplification40.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.6e+86) (- x (* t (* x y))) (if (<= y 1.75e+65) (* x (- 1.0 (* a b))) (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.6e+86) {
tmp = x - (t * (x * y));
} else if (y <= 1.75e+65) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (z * -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 <= (-4.6d+86)) then
tmp = x - (t * (x * y))
else if (y <= 1.75d+65) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (z * -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 <= -4.6e+86) {
tmp = x - (t * (x * y));
} else if (y <= 1.75e+65) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.6e+86: tmp = x - (t * (x * y)) elif y <= 1.75e+65: tmp = x * (1.0 - (a * b)) else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.6e+86) tmp = Float64(x - Float64(t * Float64(x * y))); elseif (y <= 1.75e+65) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -4.6e+86) tmp = x - (t * (x * y)); elseif (y <= 1.75e+65) tmp = x * (1.0 - (a * b)); else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.6e+86], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+65], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+86}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+65}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -4.59999999999999979e86Initial program 96.0%
Taylor expanded in z around 0 96.0%
+-commutative96.0%
associate-*r*96.0%
associate-*r*96.0%
distribute-lft-out96.0%
mul-1-neg96.0%
Simplified96.0%
Taylor expanded in t around inf 55.2%
associate-*r*55.2%
neg-mul-155.2%
Simplified55.2%
Taylor expanded in t around 0 21.4%
associate-*r*21.4%
mul-1-neg21.4%
Simplified21.4%
if -4.59999999999999979e86 < y < 1.75e65Initial program 95.1%
Taylor expanded in z around 0 93.2%
mul-1-neg93.2%
distribute-rgt-neg-out93.2%
Simplified93.2%
Taylor expanded in y around 0 76.3%
neg-mul-176.3%
distribute-rgt-neg-in76.3%
Simplified76.3%
Taylor expanded in a around 0 45.6%
neg-mul-145.6%
unsub-neg45.6%
Simplified45.6%
if 1.75e65 < y Initial program 96.0%
fma-define98.0%
sub-neg98.0%
log1p-define98.0%
Simplified98.0%
Taylor expanded in z around 0 78.0%
Taylor expanded in y around 0 28.4%
Taylor expanded in b around 0 5.8%
mul-1-neg5.8%
unsub-neg5.8%
Simplified5.8%
Taylor expanded in a around inf 32.4%
mul-1-neg32.4%
*-commutative32.4%
associate-*r*35.9%
distribute-rgt-neg-in35.9%
*-commutative35.9%
distribute-rgt-neg-in35.9%
Simplified35.9%
Final simplification39.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.5e+28) (not (<= y 1.5e-14))) (* a (* x (- z))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.5e+28) || !(y <= 1.5e-14)) {
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 <= (-7.5d+28)) .or. (.not. (y <= 1.5d-14))) 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 <= -7.5e+28) || !(y <= 1.5e-14)) {
tmp = a * (x * -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.5e+28) or not (y <= 1.5e-14): tmp = a * (x * -z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.5e+28) || !(y <= 1.5e-14)) 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 <= -7.5e+28) || ~((y <= 1.5e-14))) tmp = a * (x * -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.5e+28], N[Not[LessEqual[y, 1.5e-14]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+28} \lor \neg \left(y \leq 1.5 \cdot 10^{-14}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -7.4999999999999998e28 or 1.4999999999999999e-14 < y Initial program 96.9%
fma-define98.5%
sub-neg98.5%
log1p-define98.5%
Simplified98.5%
Taylor expanded in z around 0 70.5%
Taylor expanded in y around 0 31.6%
Taylor expanded in b around 0 5.3%
mul-1-neg5.3%
unsub-neg5.3%
Simplified5.3%
Taylor expanded in a around inf 21.7%
mul-1-neg21.7%
distribute-rgt-neg-out21.7%
distribute-rgt-neg-in21.7%
Simplified21.7%
if -7.4999999999999998e28 < y < 1.4999999999999999e-14Initial program 94.0%
fma-define94.0%
sub-neg94.0%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 56.2%
Taylor expanded in y around 0 38.2%
Final simplification29.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.85e-13) (* x (* a (- b))) (if (<= y 3.2e-17) x (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.85e-13) {
tmp = x * (a * -b);
} else if (y <= 3.2e-17) {
tmp = x;
} else {
tmp = x * (z * -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 <= (-1.85d-13)) then
tmp = x * (a * -b)
else if (y <= 3.2d-17) then
tmp = x
else
tmp = x * (z * -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 <= -1.85e-13) {
tmp = x * (a * -b);
} else if (y <= 3.2e-17) {
tmp = x;
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.85e-13: tmp = x * (a * -b) elif y <= 3.2e-17: tmp = x else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.85e-13) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 3.2e-17) tmp = x; else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.85e-13) tmp = x * (a * -b); elseif (y <= 3.2e-17) tmp = x; else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.85e-13], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-17], x, N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -1.84999999999999994e-13Initial program 96.9%
Taylor expanded in z around 0 96.9%
mul-1-neg96.9%
distribute-rgt-neg-out96.9%
Simplified96.9%
Taylor expanded in y around 0 39.8%
neg-mul-139.8%
distribute-rgt-neg-in39.8%
Simplified39.8%
Taylor expanded in a around 0 13.8%
neg-mul-113.8%
unsub-neg13.8%
Simplified13.8%
Taylor expanded in a around inf 16.3%
neg-mul-116.3%
distribute-rgt-neg-in16.3%
Simplified16.3%
if -1.84999999999999994e-13 < y < 3.2000000000000002e-17Initial program 93.8%
fma-define93.8%
sub-neg93.8%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 54.7%
Taylor expanded in y around 0 39.3%
if 3.2000000000000002e-17 < y Initial program 97.1%
fma-define98.6%
sub-neg98.6%
log1p-define98.6%
Simplified98.6%
Taylor expanded in z around 0 76.8%
Taylor expanded in y around 0 31.1%
Taylor expanded in b around 0 6.7%
mul-1-neg6.7%
unsub-neg6.7%
Simplified6.7%
Taylor expanded in a around inf 30.0%
mul-1-neg30.0%
*-commutative30.0%
associate-*r*33.9%
distribute-rgt-neg-in33.9%
*-commutative33.9%
distribute-rgt-neg-in33.9%
Simplified33.9%
Final simplification32.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.6e-13) (* x (* a (- b))) (if (<= y 4.8e-19) x (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.6e-13) {
tmp = x * (a * -b);
} else if (y <= 4.8e-19) {
tmp = x;
} 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.6d-13)) then
tmp = x * (a * -b)
else if (y <= 4.8d-19) then
tmp = x
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.6e-13) {
tmp = x * (a * -b);
} else if (y <= 4.8e-19) {
tmp = x;
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.6e-13: tmp = x * (a * -b) elif y <= 4.8e-19: tmp = x else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.6e-13) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 4.8e-19) tmp = x; 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.6e-13) tmp = x * (a * -b); elseif (y <= 4.8e-19) tmp = x; else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.6e-13], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e-19], x, N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-19}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -3.5999999999999998e-13Initial program 96.9%
Taylor expanded in z around 0 96.9%
mul-1-neg96.9%
distribute-rgt-neg-out96.9%
Simplified96.9%
Taylor expanded in y around 0 39.8%
neg-mul-139.8%
distribute-rgt-neg-in39.8%
Simplified39.8%
Taylor expanded in a around 0 13.8%
neg-mul-113.8%
unsub-neg13.8%
Simplified13.8%
Taylor expanded in a around inf 16.3%
neg-mul-116.3%
distribute-rgt-neg-in16.3%
Simplified16.3%
if -3.5999999999999998e-13 < y < 4.80000000000000046e-19Initial program 93.8%
fma-define93.8%
sub-neg93.8%
log1p-define99.9%
Simplified99.9%
Taylor expanded in a around 0 54.7%
Taylor expanded in y around 0 39.3%
if 4.80000000000000046e-19 < y Initial program 97.1%
fma-define98.6%
sub-neg98.6%
log1p-define98.6%
Simplified98.6%
Taylor expanded in z around 0 76.8%
Taylor expanded in y around 0 31.1%
Taylor expanded in b around 0 6.7%
mul-1-neg6.7%
unsub-neg6.7%
Simplified6.7%
Taylor expanded in a around inf 30.0%
mul-1-neg30.0%
distribute-rgt-neg-out30.0%
distribute-rgt-neg-in30.0%
Simplified30.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y 3.2e+65) (* x (- 1.0 (* a b))) (* x (* z (- a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 3.2e+65) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (z * -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 <= 3.2d+65) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x * (z * -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 <= 3.2e+65) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 3.2e+65: tmp = x * (1.0 - (a * b)) else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 3.2e+65) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x * Float64(z * Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 3.2e+65) tmp = x * (1.0 - (a * b)); else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 3.2e+65], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{+65}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < 3.20000000000000007e65Initial program 95.3%
Taylor expanded in z around 0 93.9%
mul-1-neg93.9%
distribute-rgt-neg-out93.9%
Simplified93.9%
Taylor expanded in y around 0 67.1%
neg-mul-167.1%
distribute-rgt-neg-in67.1%
Simplified67.1%
Taylor expanded in a around 0 37.1%
neg-mul-137.1%
unsub-neg37.1%
Simplified37.1%
if 3.20000000000000007e65 < y Initial program 96.0%
fma-define98.0%
sub-neg98.0%
log1p-define98.0%
Simplified98.0%
Taylor expanded in z around 0 78.0%
Taylor expanded in y around 0 28.4%
Taylor expanded in b around 0 5.8%
mul-1-neg5.8%
unsub-neg5.8%
Simplified5.8%
Taylor expanded in a around inf 32.4%
mul-1-neg32.4%
*-commutative32.4%
associate-*r*35.9%
distribute-rgt-neg-in35.9%
*-commutative35.9%
distribute-rgt-neg-in35.9%
Simplified35.9%
Final simplification36.9%
(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.5%
fma-define96.2%
sub-neg96.2%
log1p-define99.2%
Simplified99.2%
Taylor expanded in a around 0 70.6%
Taylor expanded in y around 0 20.9%
herbie shell --seed 2024180
(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))))))