
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (fma a (- (log1p (- z)) b) (* y (- (log z) t))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(a, (log1p(-z) - b), (y * (log(z) - t))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(a, Float64(log1p(Float64(-z)) - b), Float64(y * Float64(log(z) - t))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision] + N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(a, \mathsf{log1p}\left(-z\right) - b, y \cdot \left(\log z - t\right)\right)}
\end{array}
Initial program 94.2%
+-commutative94.2%
fma-def94.6%
sub-neg94.6%
log1p-def99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5e+268) (* x (exp (* a (- (- b) z)))) (* 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) {
double tmp;
if (a <= -5e+268) {
tmp = x * exp((a * (-b - z)));
} else {
tmp = x * exp(((y * (log(z) - t)) + (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 (a <= (-5d+268)) then
tmp = x * exp((a * (-b - z)))
else
tmp = x * exp(((y * (log(z) - t)) + (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 (a <= -5e+268) {
tmp = x * Math.exp((a * (-b - z)));
} else {
tmp = x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5e+268: tmp = x * math.exp((a * (-b - z))) else: tmp = x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5e+268) tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); else tmp = Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + 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 (a <= -5e+268) tmp = x * exp((a * (-b - z))); else tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5e+268], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+268}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\end{array}
\end{array}
if a < -5.0000000000000002e268Initial program 17.7%
Taylor expanded in y around 0 34.4%
sub-neg34.4%
neg-mul-134.4%
log1p-def100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
+-commutative100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
if -5.0000000000000002e268 < a Initial program 96.0%
Final simplification96.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.45e+18) (not (<= y 4.5))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.45e+18) || !(y <= 4.5)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (-b - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.45d+18)) .or. (.not. (y <= 4.5d0))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (-b - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.45e+18) || !(y <= 4.5)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.45e+18) or not (y <= 4.5): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.45e+18) || !(y <= 4.5)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.45e+18) || ~((y <= 4.5))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.45e+18], N[Not[LessEqual[y, 4.5]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+18} \lor \neg \left(y \leq 4.5\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\end{array}
\end{array}
if y < -1.45e18 or 4.5 < y Initial program 95.7%
Taylor expanded in y around inf 87.3%
if -1.45e18 < y < 4.5Initial program 92.9%
Taylor expanded in y around 0 77.6%
sub-neg77.6%
neg-mul-177.6%
log1p-def86.1%
neg-mul-186.1%
Simplified86.1%
Taylor expanded in z around 0 86.1%
+-commutative86.1%
associate-*r*86.1%
associate-*r*86.1%
distribute-lft-out86.1%
neg-mul-186.1%
Simplified86.1%
Final simplification86.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.9e+15) (not (<= a 1.1e-105))) (* 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 ((a <= -1.9e+15) || !(a <= 1.1e-105)) {
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 ((a <= (-1.9d+15)) .or. (.not. (a <= 1.1d-105))) 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 ((a <= -1.9e+15) || !(a <= 1.1e-105)) {
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 (a <= -1.9e+15) or not (a <= 1.1e-105): 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 ((a <= -1.9e+15) || !(a <= 1.1e-105)) 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 ((a <= -1.9e+15) || ~((a <= 1.1e-105))) 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[Or[LessEqual[a, -1.9e+15], N[Not[LessEqual[a, 1.1e-105]], $MachinePrecision]], 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}\;a \leq -1.9 \cdot 10^{+15} \lor \neg \left(a \leq 1.1 \cdot 10^{-105}\right):\\
\;\;\;\;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 a < -1.9e15 or 1.10000000000000002e-105 < a Initial program 90.7%
Taylor expanded in y around 0 67.8%
sub-neg67.8%
neg-mul-167.8%
log1p-def79.9%
neg-mul-179.9%
Simplified79.9%
Taylor expanded in z around 0 79.9%
+-commutative79.9%
associate-*r*79.9%
associate-*r*79.9%
distribute-lft-out79.9%
neg-mul-179.9%
Simplified79.9%
if -1.9e15 < a < 1.10000000000000002e-105Initial program 100.0%
Taylor expanded in t around inf 76.0%
mul-1-neg76.0%
distribute-rgt-neg-out76.0%
Simplified76.0%
Final simplification78.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2e+24) (not (<= y 0.7))) (* 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 <= -2e+24) || !(y <= 0.7)) {
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 <= (-2d+24)) .or. (.not. (y <= 0.7d0))) 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 <= -2e+24) || !(y <= 0.7)) {
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 <= -2e+24) or not (y <= 0.7): 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 <= -2e+24) || !(y <= 0.7)) 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 <= -2e+24) || ~((y <= 0.7))) 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, -2e+24], N[Not[LessEqual[y, 0.7]], $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 -2 \cdot 10^{+24} \lor \neg \left(y \leq 0.7\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -2e24 or 0.69999999999999996 < y Initial program 95.6%
Taylor expanded in y around inf 86.9%
Taylor expanded in t around 0 69.5%
if -2e24 < y < 0.69999999999999996Initial program 93.0%
Taylor expanded in b around inf 74.7%
associate-*r*74.7%
*-commutative74.7%
neg-mul-174.7%
Simplified74.7%
Final simplification72.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -9.4e+47) (not (<= t 1.45e-74))) (* x (exp (* y (- t)))) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -9.4e+47) || !(t <= 1.45e-74)) {
tmp = x * exp((y * -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 ((t <= (-9.4d+47)) .or. (.not. (t <= 1.45d-74))) then
tmp = x * exp((y * -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 ((t <= -9.4e+47) || !(t <= 1.45e-74)) {
tmp = x * Math.exp((y * -t));
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -9.4e+47) or not (t <= 1.45e-74): tmp = x * math.exp((y * -t)) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -9.4e+47) || !(t <= 1.45e-74)) tmp = Float64(x * exp(Float64(y * Float64(-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 ((t <= -9.4e+47) || ~((t <= 1.45e-74))) tmp = x * exp((y * -t)); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -9.4e+47], N[Not[LessEqual[t, 1.45e-74]], $MachinePrecision]], N[(x * N[Exp[N[(y * (-t)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.4 \cdot 10^{+47} \lor \neg \left(t \leq 1.45 \cdot 10^{-74}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if t < -9.39999999999999928e47 or 1.45e-74 < t Initial program 94.6%
Taylor expanded in t around inf 76.2%
mul-1-neg76.2%
distribute-rgt-neg-out76.2%
Simplified76.2%
if -9.39999999999999928e47 < t < 1.45e-74Initial program 93.7%
Taylor expanded in b around inf 70.8%
associate-*r*70.8%
*-commutative70.8%
neg-mul-170.8%
Simplified70.8%
Final simplification73.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -8.2e-67) (not (<= y 3.05e-15))) (* x (pow z y)) (- x (* a (* x (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -8.2e-67) || !(y <= 3.05e-15)) {
tmp = x * pow(z, y);
} else {
tmp = x - (a * (x * (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 <= (-8.2d-67)) .or. (.not. (y <= 3.05d-15))) then
tmp = x * (z ** y)
else
tmp = x - (a * (x * (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 <= -8.2e-67) || !(y <= 3.05e-15)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x - (a * (x * (z + b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -8.2e-67) or not (y <= 3.05e-15): tmp = x * math.pow(z, y) else: tmp = x - (a * (x * (z + b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -8.2e-67) || !(y <= 3.05e-15)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x - Float64(a * Float64(x * Float64(z + b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -8.2e-67) || ~((y <= 3.05e-15))) tmp = x * (z ^ y); else tmp = x - (a * (x * (z + b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -8.2e-67], N[Not[LessEqual[y, 3.05e-15]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x - N[(a * N[(x * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-67} \lor \neg \left(y \leq 3.05 \cdot 10^{-15}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \left(x \cdot \left(z + b\right)\right)\\
\end{array}
\end{array}
if y < -8.1999999999999994e-67 or 3.04999999999999986e-15 < y Initial program 95.7%
Taylor expanded in y around inf 82.8%
Taylor expanded in t around 0 62.1%
if -8.1999999999999994e-67 < y < 3.04999999999999986e-15Initial program 92.4%
Taylor expanded in y around 0 79.3%
sub-neg79.3%
neg-mul-179.3%
log1p-def87.7%
neg-mul-187.7%
Simplified87.7%
Taylor expanded in z around 0 87.7%
+-commutative87.7%
associate-*r*87.7%
associate-*r*87.7%
distribute-lft-out87.7%
neg-mul-187.7%
Simplified87.7%
Taylor expanded in a around 0 41.6%
+-commutative41.6%
mul-1-neg41.6%
unsub-neg41.6%
Simplified41.6%
Final simplification52.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -0.00034)
(* (- b) (* x a))
(if (<= y -1.1e-220)
x
(if (or (<= y -7.2e-292) (not (<= y 2.2e-17))) (* a (* x (- z))) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.00034) {
tmp = -b * (x * a);
} else if (y <= -1.1e-220) {
tmp = x;
} else if ((y <= -7.2e-292) || !(y <= 2.2e-17)) {
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 <= (-0.00034d0)) then
tmp = -b * (x * a)
else if (y <= (-1.1d-220)) then
tmp = x
else if ((y <= (-7.2d-292)) .or. (.not. (y <= 2.2d-17))) 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 <= -0.00034) {
tmp = -b * (x * a);
} else if (y <= -1.1e-220) {
tmp = x;
} else if ((y <= -7.2e-292) || !(y <= 2.2e-17)) {
tmp = a * (x * -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -0.00034: tmp = -b * (x * a) elif y <= -1.1e-220: tmp = x elif (y <= -7.2e-292) or not (y <= 2.2e-17): tmp = a * (x * -z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -0.00034) tmp = Float64(Float64(-b) * Float64(x * a)); elseif (y <= -1.1e-220) tmp = x; elseif ((y <= -7.2e-292) || !(y <= 2.2e-17)) 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 <= -0.00034) tmp = -b * (x * a); elseif (y <= -1.1e-220) tmp = x; elseif ((y <= -7.2e-292) || ~((y <= 2.2e-17))) tmp = a * (x * -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.00034], N[((-b) * N[(x * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.1e-220], x, If[Or[LessEqual[y, -7.2e-292], N[Not[LessEqual[y, 2.2e-17]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00034:\\
\;\;\;\;\left(-b\right) \cdot \left(x \cdot a\right)\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-220}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-292} \lor \neg \left(y \leq 2.2 \cdot 10^{-17}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.4e-4Initial program 98.2%
Taylor expanded in b around inf 43.8%
associate-*r*43.8%
*-commutative43.8%
neg-mul-143.8%
Simplified43.8%
Taylor expanded in b around 0 10.4%
+-commutative10.4%
mul-1-neg10.4%
unsub-neg10.4%
associate-*r*17.2%
*-commutative17.2%
Simplified17.2%
Taylor expanded in a around inf 13.2%
mul-1-neg13.2%
*-commutative13.2%
associate-*r*18.3%
distribute-rgt-neg-in18.3%
*-commutative18.3%
Simplified18.3%
if -3.4e-4 < y < -1.09999999999999993e-220 or -7.2000000000000004e-292 < y < 2.2e-17Initial program 93.7%
Taylor expanded in b around inf 75.5%
associate-*r*75.5%
*-commutative75.5%
neg-mul-175.5%
Simplified75.5%
Taylor expanded in b around 0 34.6%
if -1.09999999999999993e-220 < y < -7.2000000000000004e-292 or 2.2e-17 < y Initial program 92.3%
Taylor expanded in y around 0 49.1%
sub-neg49.1%
neg-mul-149.1%
log1p-def55.7%
neg-mul-155.7%
Simplified55.7%
Taylor expanded in z around 0 55.7%
+-commutative55.7%
associate-*r*55.7%
associate-*r*55.7%
distribute-lft-out55.7%
neg-mul-155.7%
Simplified55.7%
Taylor expanded in a around 0 12.5%
+-commutative12.5%
mul-1-neg12.5%
unsub-neg12.5%
Simplified12.5%
Taylor expanded in z around inf 32.3%
mul-1-neg32.3%
Simplified32.3%
Final simplification30.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -0.00085) (* x (* a (- b))) (if (<= y 8.2e-17) (+ x (* b (* x a))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.00085) {
tmp = x * (a * -b);
} else if (y <= 8.2e-17) {
tmp = x + (b * (x * a));
} 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 <= (-0.00085d0)) then
tmp = x * (a * -b)
else if (y <= 8.2d-17) then
tmp = x + (b * (x * a))
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 <= -0.00085) {
tmp = x * (a * -b);
} else if (y <= 8.2e-17) {
tmp = x + (b * (x * a));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -0.00085: tmp = x * (a * -b) elif y <= 8.2e-17: tmp = x + (b * (x * a)) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -0.00085) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 8.2e-17) tmp = Float64(x + Float64(b * Float64(x * a))); 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 <= -0.00085) tmp = x * (a * -b); elseif (y <= 8.2e-17) tmp = x + (b * (x * a)); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.00085], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e-17], N[(x + N[(b * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00085:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-17}:\\
\;\;\;\;x + b \cdot \left(x \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -8.49999999999999953e-4Initial program 98.2%
Taylor expanded in b around inf 43.8%
associate-*r*43.8%
*-commutative43.8%
neg-mul-143.8%
Simplified43.8%
Taylor expanded in b around 0 10.4%
+-commutative10.4%
mul-1-neg10.4%
unsub-neg10.4%
associate-*r*17.2%
*-commutative17.2%
Simplified17.2%
Taylor expanded in a around inf 13.2%
mul-1-neg13.2%
distribute-rgt-neg-in13.2%
Simplified13.2%
Taylor expanded in a around 0 13.2%
associate-*r*13.2%
associate-*r*20.1%
associate-*r*20.1%
*-commutative20.1%
mul-1-neg20.1%
distribute-rgt-neg-in20.1%
Simplified20.1%
if -8.49999999999999953e-4 < y < 8.2000000000000001e-17Initial program 93.1%
Taylor expanded in b around inf 75.3%
associate-*r*75.3%
*-commutative75.3%
neg-mul-175.3%
Simplified75.3%
Taylor expanded in b around 0 35.6%
+-commutative35.6%
mul-1-neg35.6%
unsub-neg35.6%
associate-*r*34.8%
*-commutative34.8%
Simplified34.8%
sub-neg34.8%
*-commutative34.8%
associate-*r*35.6%
mul-1-neg35.6%
+-commutative35.6%
mul-1-neg35.6%
*-commutative35.6%
distribute-rgt-neg-in35.6%
add-sqr-sqrt17.2%
sqrt-unprod31.5%
sqr-neg31.5%
sqrt-unprod14.6%
add-sqr-sqrt30.1%
associate-*l*32.1%
Applied egg-rr32.1%
if 8.2000000000000001e-17 < y Initial program 92.9%
Taylor expanded in y around 0 39.5%
sub-neg39.5%
neg-mul-139.5%
log1p-def45.0%
neg-mul-145.0%
Simplified45.0%
Taylor expanded in z around 0 45.0%
+-commutative45.0%
associate-*r*45.0%
associate-*r*45.0%
distribute-lft-out45.0%
neg-mul-145.0%
Simplified45.0%
Taylor expanded in a around 0 10.2%
+-commutative10.2%
mul-1-neg10.2%
unsub-neg10.2%
Simplified10.2%
Taylor expanded in z around inf 33.3%
mul-1-neg33.3%
Simplified33.3%
Final simplification29.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -0.17) (* x (* a (- b))) (if (<= y 4.1e-16) (- x (* a (* x z))) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.17) {
tmp = x * (a * -b);
} else if (y <= 4.1e-16) {
tmp = x - (a * (x * z));
} else {
tmp = a * (x * -z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-0.17d0)) then
tmp = x * (a * -b)
else if (y <= 4.1d-16) then
tmp = x - (a * (x * z))
else
tmp = a * (x * -z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.17) {
tmp = x * (a * -b);
} else if (y <= 4.1e-16) {
tmp = x - (a * (x * z));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -0.17: tmp = x * (a * -b) elif y <= 4.1e-16: tmp = x - (a * (x * z)) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -0.17) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 4.1e-16) tmp = Float64(x - Float64(a * Float64(x * z))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -0.17) tmp = x * (a * -b); elseif (y <= 4.1e-16) tmp = x - (a * (x * z)); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.17], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e-16], N[(x - N[(a * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.17:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-16}:\\
\;\;\;\;x - a \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -0.170000000000000012Initial program 98.2%
Taylor expanded in b around inf 43.8%
associate-*r*43.8%
*-commutative43.8%
neg-mul-143.8%
Simplified43.8%
Taylor expanded in b around 0 10.4%
+-commutative10.4%
mul-1-neg10.4%
unsub-neg10.4%
associate-*r*17.2%
*-commutative17.2%
Simplified17.2%
Taylor expanded in a around inf 13.2%
mul-1-neg13.2%
distribute-rgt-neg-in13.2%
Simplified13.2%
Taylor expanded in a around 0 13.2%
associate-*r*13.2%
associate-*r*20.1%
associate-*r*20.1%
*-commutative20.1%
mul-1-neg20.1%
distribute-rgt-neg-in20.1%
Simplified20.1%
if -0.170000000000000012 < y < 4.10000000000000006e-16Initial program 93.1%
Taylor expanded in y around 0 77.5%
sub-neg77.5%
neg-mul-177.5%
log1p-def85.1%
neg-mul-185.1%
Simplified85.1%
Taylor expanded in z around 0 85.1%
+-commutative85.1%
associate-*r*85.1%
associate-*r*85.1%
distribute-lft-out85.1%
neg-mul-185.1%
Simplified85.1%
Taylor expanded in b around 0 46.3%
mul-1-neg46.3%
*-commutative46.3%
distribute-rgt-neg-in46.3%
Simplified46.3%
Taylor expanded in z around 0 34.0%
mul-1-neg34.0%
+-commutative34.0%
sub-neg34.0%
Simplified34.0%
if 4.10000000000000006e-16 < y Initial program 92.9%
Taylor expanded in y around 0 39.5%
sub-neg39.5%
neg-mul-139.5%
log1p-def45.0%
neg-mul-145.0%
Simplified45.0%
Taylor expanded in z around 0 45.0%
+-commutative45.0%
associate-*r*45.0%
associate-*r*45.0%
distribute-lft-out45.0%
neg-mul-145.0%
Simplified45.0%
Taylor expanded in a around 0 10.2%
+-commutative10.2%
mul-1-neg10.2%
unsub-neg10.2%
Simplified10.2%
Taylor expanded in z around inf 33.3%
mul-1-neg33.3%
Simplified33.3%
Final simplification30.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.42e+80) (* x (- 1.0 (* a (+ z b)))) (* a (* x (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.42e+80) {
tmp = x * (1.0 - (a * (z + b)));
} else {
tmp = a * (x * -z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.42d+80) then
tmp = x * (1.0d0 - (a * (z + b)))
else
tmp = a * (x * -z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.42e+80) {
tmp = x * (1.0 - (a * (z + b)));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.42e+80: tmp = x * (1.0 - (a * (z + b))) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.42e+80) tmp = Float64(x * Float64(1.0 - Float64(a * Float64(z + b)))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.42e+80) tmp = x * (1.0 - (a * (z + b))); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.42e+80], N[(x * N[(1.0 - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.42 \cdot 10^{+80}:\\
\;\;\;\;x \cdot \left(1 - a \cdot \left(z + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < 1.4200000000000001e80Initial program 93.7%
Taylor expanded in y around 0 65.1%
sub-neg65.1%
neg-mul-165.1%
log1p-def74.1%
neg-mul-174.1%
Simplified74.1%
Taylor expanded in z around 0 74.1%
+-commutative74.1%
associate-*r*74.1%
associate-*r*74.1%
distribute-lft-out74.1%
neg-mul-174.1%
Simplified74.1%
Taylor expanded in a around 0 30.5%
+-commutative30.5%
mul-1-neg30.5%
unsub-neg30.5%
Simplified30.5%
Taylor expanded in x around inf 31.8%
if 1.4200000000000001e80 < y Initial program 96.0%
Taylor expanded in y around 0 38.6%
sub-neg38.6%
neg-mul-138.6%
log1p-def40.5%
neg-mul-140.5%
Simplified40.5%
Taylor expanded in z around 0 40.5%
+-commutative40.5%
associate-*r*40.5%
associate-*r*40.5%
distribute-lft-out40.5%
neg-mul-140.5%
Simplified40.5%
Taylor expanded in a around 0 5.4%
+-commutative5.4%
mul-1-neg5.4%
unsub-neg5.4%
Simplified5.4%
Taylor expanded in z around inf 39.7%
mul-1-neg39.7%
Simplified39.7%
Final simplification33.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.2e-292) (not (<= y 2.3e-16))) (* a (* x (- z))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.2e-292) || !(y <= 2.3e-16)) {
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.2d-292)) .or. (.not. (y <= 2.3d-16))) 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.2e-292) || !(y <= 2.3e-16)) {
tmp = a * (x * -z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.2e-292) or not (y <= 2.3e-16): tmp = a * (x * -z) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.2e-292) || !(y <= 2.3e-16)) 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.2e-292) || ~((y <= 2.3e-16))) tmp = a * (x * -z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.2e-292], N[Not[LessEqual[y, 2.3e-16]], $MachinePrecision]], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{-292} \lor \neg \left(y \leq 2.3 \cdot 10^{-16}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -7.2000000000000004e-292 or 2.2999999999999999e-16 < y Initial program 94.7%
Taylor expanded in y around 0 51.1%
sub-neg51.1%
neg-mul-151.1%
log1p-def58.8%
neg-mul-158.8%
Simplified58.8%
Taylor expanded in z around 0 58.8%
+-commutative58.8%
associate-*r*58.8%
associate-*r*58.8%
distribute-lft-out58.8%
neg-mul-158.8%
Simplified58.8%
Taylor expanded in a around 0 16.7%
+-commutative16.7%
mul-1-neg16.7%
unsub-neg16.7%
Simplified16.7%
Taylor expanded in z around inf 23.4%
mul-1-neg23.4%
Simplified23.4%
if -7.2000000000000004e-292 < y < 2.2999999999999999e-16Initial program 92.8%
Taylor expanded in b around inf 81.9%
associate-*r*81.9%
*-commutative81.9%
neg-mul-181.9%
Simplified81.9%
Taylor expanded in b around 0 39.2%
Final simplification27.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y -0.00034) (* x (* a (- b))) (if (<= y 6.2e-16) x (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -0.00034) {
tmp = x * (a * -b);
} else if (y <= 6.2e-16) {
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 <= (-0.00034d0)) then
tmp = x * (a * -b)
else if (y <= 6.2d-16) 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 <= -0.00034) {
tmp = x * (a * -b);
} else if (y <= 6.2e-16) {
tmp = x;
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -0.00034: tmp = x * (a * -b) elif y <= 6.2e-16: tmp = x else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -0.00034) tmp = Float64(x * Float64(a * Float64(-b))); elseif (y <= 6.2e-16) 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 <= -0.00034) tmp = x * (a * -b); elseif (y <= 6.2e-16) tmp = x; else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -0.00034], N[(x * N[(a * (-b)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-16], x, N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00034:\\
\;\;\;\;x \cdot \left(a \cdot \left(-b\right)\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-16}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -3.4e-4Initial program 98.2%
Taylor expanded in b around inf 43.8%
associate-*r*43.8%
*-commutative43.8%
neg-mul-143.8%
Simplified43.8%
Taylor expanded in b around 0 10.4%
+-commutative10.4%
mul-1-neg10.4%
unsub-neg10.4%
associate-*r*17.2%
*-commutative17.2%
Simplified17.2%
Taylor expanded in a around inf 13.2%
mul-1-neg13.2%
distribute-rgt-neg-in13.2%
Simplified13.2%
Taylor expanded in a around 0 13.2%
associate-*r*13.2%
associate-*r*20.1%
associate-*r*20.1%
*-commutative20.1%
mul-1-neg20.1%
distribute-rgt-neg-in20.1%
Simplified20.1%
if -3.4e-4 < y < 6.2000000000000002e-16Initial program 93.1%
Taylor expanded in b around inf 75.3%
associate-*r*75.3%
*-commutative75.3%
neg-mul-175.3%
Simplified75.3%
Taylor expanded in b around 0 30.4%
if 6.2000000000000002e-16 < y Initial program 92.9%
Taylor expanded in y around 0 39.5%
sub-neg39.5%
neg-mul-139.5%
log1p-def45.0%
neg-mul-145.0%
Simplified45.0%
Taylor expanded in z around 0 45.0%
+-commutative45.0%
associate-*r*45.0%
associate-*r*45.0%
distribute-lft-out45.0%
neg-mul-145.0%
Simplified45.0%
Taylor expanded in a around 0 10.2%
+-commutative10.2%
mul-1-neg10.2%
unsub-neg10.2%
Simplified10.2%
Taylor expanded in z around inf 33.3%
mul-1-neg33.3%
Simplified33.3%
Final simplification29.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.5e-15) (- x (* x (* a b))) (* a (* x (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.5e-15) {
tmp = x - (x * (a * b));
} else {
tmp = a * (x * -z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.5d-15) then
tmp = x - (x * (a * b))
else
tmp = a * (x * -z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.5e-15) {
tmp = x - (x * (a * b));
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.5e-15: tmp = x - (x * (a * b)) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.5e-15) tmp = Float64(x - Float64(x * Float64(a * b))); else tmp = Float64(a * Float64(x * Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.5e-15) tmp = x - (x * (a * b)); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.5e-15], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{-15}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < 1.5e-15Initial program 94.6%
Taylor expanded in b around inf 66.0%
associate-*r*66.0%
*-commutative66.0%
neg-mul-166.0%
Simplified66.0%
Taylor expanded in b around 0 28.2%
+-commutative28.2%
mul-1-neg28.2%
unsub-neg28.2%
associate-*r*29.6%
*-commutative29.6%
Simplified29.6%
if 1.5e-15 < y Initial program 92.9%
Taylor expanded in y around 0 39.5%
sub-neg39.5%
neg-mul-139.5%
log1p-def45.0%
neg-mul-145.0%
Simplified45.0%
Taylor expanded in z around 0 45.0%
+-commutative45.0%
associate-*r*45.0%
associate-*r*45.0%
distribute-lft-out45.0%
neg-mul-145.0%
Simplified45.0%
Taylor expanded in a around 0 10.2%
+-commutative10.2%
mul-1-neg10.2%
unsub-neg10.2%
Simplified10.2%
Taylor expanded in z around inf 33.3%
mul-1-neg33.3%
Simplified33.3%
Final simplification30.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 94.2%
Taylor expanded in b around inf 58.7%
associate-*r*58.7%
*-commutative58.7%
neg-mul-158.7%
Simplified58.7%
Taylor expanded in b around 0 17.5%
Final simplification17.5%
herbie shell --seed 2023279
(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))))))