
(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 16 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 (- (* 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 96.9%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.8e+15) (not (<= y 1.18e-55))) (* x (exp (* y (- (log z) t)))) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.8e+15) || !(y <= 1.18e-55)) {
tmp = x * exp((y * (log(z) - t)));
} else {
tmp = x * exp((a * (-z - b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.8d+15)) .or. (.not. (y <= 1.18d-55))) then
tmp = x * exp((y * (log(z) - t)))
else
tmp = x * exp((a * (-z - b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.8e+15) || !(y <= 1.18e-55)) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.8e+15) or not (y <= 1.18e-55): tmp = x * math.exp((y * (math.log(z) - t))) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.8e+15) || !(y <= 1.18e-55)) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.8e+15) || ~((y <= 1.18e-55))) tmp = x * exp((y * (log(z) - t))); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.8e+15], N[Not[LessEqual[y, 1.18e-55]], $MachinePrecision]], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+15} \lor \neg \left(y \leq 1.18 \cdot 10^{-55}\right):\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if y < -1.8e15 or 1.18e-55 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 90.4%
if -1.8e15 < y < 1.18e-55Initial program 93.0%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 89.0%
associate-*r*89.0%
mul-1-neg89.0%
+-commutative89.0%
Simplified89.0%
Final simplification89.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.4e+75) (not (<= t 6.5e-79))) (* x (exp (* t (- y)))) (* x (exp (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.4e+75) || !(t <= 6.5e-79)) {
tmp = x * exp((t * -y));
} else {
tmp = x * exp((a * (-z - b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-4.4d+75)) .or. (.not. (t <= 6.5d-79))) then
tmp = x * exp((t * -y))
else
tmp = x * exp((a * (-z - b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.4e+75) || !(t <= 6.5e-79)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.exp((a * (-z - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -4.4e+75) or not (t <= 6.5e-79): tmp = x * math.exp((t * -y)) else: tmp = x * math.exp((a * (-z - b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.4e+75) || !(t <= 6.5e-79)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-z) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -4.4e+75) || ~((t <= 6.5e-79))) tmp = x * exp((t * -y)); else tmp = x * exp((a * (-z - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.4e+75], N[Not[LessEqual[t, 6.5e-79]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{+75} \lor \neg \left(t \leq 6.5 \cdot 10^{-79}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-z\right) - b\right)}\\
\end{array}
\end{array}
if t < -4.40000000000000024e75 or 6.5000000000000003e-79 < t Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 82.8%
Taylor expanded in t around inf 82.7%
mul-1-neg82.7%
distribute-lft-neg-out82.7%
*-commutative82.7%
Simplified82.7%
if -4.40000000000000024e75 < t < 6.5000000000000003e-79Initial program 96.1%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 73.0%
associate-*r*73.0%
mul-1-neg73.0%
+-commutative73.0%
Simplified73.0%
Final simplification78.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -7.8e+74) (not (<= t 5.8e-79))) (* x (exp (* t (- y)))) (* x (exp (* (- a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -7.8e+74) || !(t <= 5.8e-79)) {
tmp = x * exp((t * -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 ((t <= (-7.8d+74)) .or. (.not. (t <= 5.8d-79))) then
tmp = x * exp((t * -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 ((t <= -7.8e+74) || !(t <= 5.8e-79)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.exp((-a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -7.8e+74) or not (t <= 5.8e-79): tmp = x * math.exp((t * -y)) else: tmp = x * math.exp((-a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -7.8e+74) || !(t <= 5.8e-79)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); else tmp = Float64(x * exp(Float64(Float64(-a) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -7.8e+74) || ~((t <= 5.8e-79))) tmp = x * exp((t * -y)); else tmp = x * exp((-a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -7.8e+74], N[Not[LessEqual[t, 5.8e-79]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-a) * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{+74} \lor \neg \left(t \leq 5.8 \cdot 10^{-79}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-a\right) \cdot b}\\
\end{array}
\end{array}
if t < -7.80000000000000015e74 or 5.8000000000000001e-79 < t Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 82.8%
Taylor expanded in t around inf 82.7%
mul-1-neg82.7%
distribute-lft-neg-out82.7%
*-commutative82.7%
Simplified82.7%
if -7.80000000000000015e74 < t < 5.8000000000000001e-79Initial program 96.1%
fma-define96.1%
sub-neg96.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 67.5%
Taylor expanded in z around 0 66.7%
associate-*r*66.7%
mul-1-neg66.7%
Simplified66.7%
Final simplification74.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -13500000000.0) (not (<= t 4e-151))) (* x (exp (* t (- y)))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -13500000000.0) || !(t <= 4e-151)) {
tmp = x * exp((t * -y));
} 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 <= (-13500000000.0d0)) .or. (.not. (t <= 4d-151))) then
tmp = x * exp((t * -y))
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 <= -13500000000.0) || !(t <= 4e-151)) {
tmp = x * Math.exp((t * -y));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -13500000000.0) or not (t <= 4e-151): tmp = x * math.exp((t * -y)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -13500000000.0) || !(t <= 4e-151)) tmp = Float64(x * exp(Float64(t * Float64(-y)))); 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 <= -13500000000.0) || ~((t <= 4e-151))) tmp = x * exp((t * -y)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -13500000000.0], N[Not[LessEqual[t, 4e-151]], $MachinePrecision]], N[(x * N[Exp[N[(t * (-y)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -13500000000 \lor \neg \left(t \leq 4 \cdot 10^{-151}\right):\\
\;\;\;\;x \cdot e^{t \cdot \left(-y\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.35e10 or 3.9999999999999998e-151 < t Initial program 96.3%
fma-define96.3%
sub-neg96.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 76.2%
Taylor expanded in t around inf 76.1%
mul-1-neg76.1%
distribute-lft-neg-out76.1%
*-commutative76.1%
Simplified76.1%
if -1.35e10 < t < 3.9999999999999998e-151Initial program 98.0%
fma-define98.0%
sub-neg98.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 66.3%
Taylor expanded in t around 0 66.3%
Final simplification72.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.1e+192) (not (<= a 2.8e+30))) (* x (pow (- z) a)) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.1e+192) || !(a <= 2.8e+30)) {
tmp = x * pow(-z, a);
} 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 ((a <= (-4.1d+192)) .or. (.not. (a <= 2.8d+30))) then
tmp = x * (-z ** a)
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 ((a <= -4.1e+192) || !(a <= 2.8e+30)) {
tmp = x * Math.pow(-z, a);
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.1e+192) or not (a <= 2.8e+30): tmp = x * math.pow(-z, a) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.1e+192) || !(a <= 2.8e+30)) tmp = Float64(x * (Float64(-z) ^ a)); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.1e+192) || ~((a <= 2.8e+30))) tmp = x * (-z ^ a); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.1e+192], N[Not[LessEqual[a, 2.8e+30]], $MachinePrecision]], N[(x * N[Power[(-z), a], $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+192} \lor \neg \left(a \leq 2.8 \cdot 10^{+30}\right):\\
\;\;\;\;x \cdot {\left(-z\right)}^{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if a < -4.10000000000000003e192 or 2.79999999999999983e30 < a Initial program 93.4%
fma-define93.4%
sub-neg93.4%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 70.3%
Taylor expanded in b around 0 12.4%
Taylor expanded in z around inf 70.1%
mul-1-neg70.1%
Simplified70.1%
if -4.10000000000000003e192 < a < 2.79999999999999983e30Initial program 98.8%
fma-define98.8%
sub-neg98.8%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 86.2%
Taylor expanded in t around 0 63.4%
Final simplification65.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.8e+259) (* a (* x (- z))) (if (<= t -4000000000000.0) (* x (- 1.0 (* y t))) (* x (pow z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.8e+259) {
tmp = a * (x * -z);
} else if (t <= -4000000000000.0) {
tmp = x * (1.0 - (y * 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 <= (-2.8d+259)) then
tmp = a * (x * -z)
else if (t <= (-4000000000000.0d0)) then
tmp = x * (1.0d0 - (y * 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 <= -2.8e+259) {
tmp = a * (x * -z);
} else if (t <= -4000000000000.0) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.8e+259: tmp = a * (x * -z) elif t <= -4000000000000.0: tmp = x * (1.0 - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.8e+259) tmp = Float64(a * Float64(x * Float64(-z))); elseif (t <= -4000000000000.0) tmp = Float64(x * Float64(1.0 - Float64(y * 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 <= -2.8e+259) tmp = a * (x * -z); elseif (t <= -4000000000000.0) tmp = x * (1.0 - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.8e+259], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4000000000000.0], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+259}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{elif}\;t \leq -4000000000000:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -2.8000000000000001e259Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 38.4%
Taylor expanded in b around 0 3.9%
Taylor expanded in z around 0 3.6%
mul-1-neg3.6%
unsub-neg3.6%
*-commutative3.6%
Simplified3.6%
Taylor expanded in z around inf 47.2%
associate-*r*47.2%
mul-1-neg47.2%
Simplified47.2%
if -2.8000000000000001e259 < t < -4e12Initial program 96.1%
fma-define96.1%
sub-neg96.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 75.8%
Taylor expanded in t around inf 75.8%
mul-1-neg75.8%
distribute-lft-neg-out75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in y around 0 43.8%
mul-1-neg43.8%
*-commutative43.8%
distribute-lft-neg-in43.8%
Simplified43.8%
Taylor expanded in x around 0 43.8%
mul-1-neg43.8%
*-commutative43.8%
sub-neg43.8%
Simplified43.8%
if -4e12 < t Initial program 97.0%
fma-define97.0%
sub-neg97.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 70.4%
Taylor expanded in t around 0 62.4%
Final simplification58.0%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.35e+155) (* x (/ (- 1.0 (* (* z a) (* z a))) (+ (* z a) 1.0))) (if (<= a 1.8e+28) (* x (- 1.0 (* y t))) (* x (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.35e+155) {
tmp = x * ((1.0 - ((z * a) * (z * a))) / ((z * a) + 1.0));
} else if (a <= 1.8e+28) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (t * -y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-1.35d+155)) then
tmp = x * ((1.0d0 - ((z * a) * (z * a))) / ((z * a) + 1.0d0))
else if (a <= 1.8d+28) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (t * -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.35e+155) {
tmp = x * ((1.0 - ((z * a) * (z * a))) / ((z * a) + 1.0));
} else if (a <= 1.8e+28) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.35e+155: tmp = x * ((1.0 - ((z * a) * (z * a))) / ((z * a) + 1.0)) elif a <= 1.8e+28: tmp = x * (1.0 - (y * t)) else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.35e+155) tmp = Float64(x * Float64(Float64(1.0 - Float64(Float64(z * a) * Float64(z * a))) / Float64(Float64(z * a) + 1.0))); elseif (a <= 1.8e+28) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * Float64(t * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.35e+155) tmp = x * ((1.0 - ((z * a) * (z * a))) / ((z * a) + 1.0)); elseif (a <= 1.8e+28) tmp = x * (1.0 - (y * t)); else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.35e+155], N[(x * N[(N[(1.0 - N[(N[(z * a), $MachinePrecision] * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(z * a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+28], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+155}:\\
\;\;\;\;x \cdot \frac{1 - \left(z \cdot a\right) \cdot \left(z \cdot a\right)}{z \cdot a + 1}\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+28}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if a < -1.34999999999999997e155Initial program 91.9%
fma-define91.9%
sub-neg91.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 67.5%
Taylor expanded in b around 0 14.2%
Taylor expanded in z around 0 14.6%
mul-1-neg14.6%
unsub-neg14.6%
*-commutative14.6%
Simplified14.6%
sub-neg14.6%
flip-+35.5%
metadata-eval35.5%
Applied egg-rr35.5%
if -1.34999999999999997e155 < a < 1.8e28Initial program 99.3%
fma-define99.3%
sub-neg99.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 87.2%
Taylor expanded in t around inf 71.2%
mul-1-neg71.2%
distribute-lft-neg-out71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in y around 0 37.8%
mul-1-neg37.8%
*-commutative37.8%
distribute-lft-neg-in37.8%
Simplified37.8%
Taylor expanded in x around 0 37.8%
mul-1-neg37.8%
*-commutative37.8%
sub-neg37.8%
Simplified37.8%
if 1.8e28 < a Initial program 93.6%
fma-define93.6%
sub-neg93.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 48.4%
Taylor expanded in t around inf 31.3%
mul-1-neg31.3%
distribute-lft-neg-out31.3%
*-commutative31.3%
Simplified31.3%
Taylor expanded in y around 0 14.1%
mul-1-neg14.1%
*-commutative14.1%
distribute-lft-neg-in14.1%
Simplified14.1%
Taylor expanded in y around inf 26.7%
mul-1-neg26.7%
*-commutative26.7%
associate-*r*34.1%
distribute-rgt-neg-in34.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Final simplification36.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2e+155) (- x (* x (* a b))) (if (<= a 5.6e+24) (* x (- 1.0 (* y t))) (* x (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2e+155) {
tmp = x - (x * (a * b));
} else if (a <= 5.6e+24) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (t * -y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-2d+155)) then
tmp = x - (x * (a * b))
else if (a <= 5.6d+24) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (t * -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2e+155) {
tmp = x - (x * (a * b));
} else if (a <= 5.6e+24) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2e+155: tmp = x - (x * (a * b)) elif a <= 5.6e+24: tmp = x * (1.0 - (y * t)) else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2e+155) tmp = Float64(x - Float64(x * Float64(a * b))); elseif (a <= 5.6e+24) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * Float64(t * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2e+155) tmp = x - (x * (a * b)); elseif (a <= 5.6e+24) tmp = x * (1.0 - (y * t)); else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2e+155], N[(x - N[(x * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.6e+24], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+155}:\\
\;\;\;\;x - x \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{+24}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if a < -2.00000000000000001e155Initial program 91.9%
fma-define91.9%
sub-neg91.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 67.5%
Taylor expanded in a around 0 24.6%
associate-*r*29.8%
sub-neg29.8%
log1p-undefine33.0%
Simplified33.0%
Taylor expanded in z around 0 24.6%
mul-1-neg24.6%
*-commutative24.6%
distribute-lft-neg-in24.6%
distribute-lft-neg-out24.6%
associate-*r*29.8%
*-commutative29.8%
associate-*l*35.0%
Simplified35.0%
if -2.00000000000000001e155 < a < 5.6000000000000003e24Initial program 99.3%
fma-define99.3%
sub-neg99.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 87.2%
Taylor expanded in t around inf 71.2%
mul-1-neg71.2%
distribute-lft-neg-out71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in y around 0 37.8%
mul-1-neg37.8%
*-commutative37.8%
distribute-lft-neg-in37.8%
Simplified37.8%
Taylor expanded in x around 0 37.8%
mul-1-neg37.8%
*-commutative37.8%
sub-neg37.8%
Simplified37.8%
if 5.6000000000000003e24 < a Initial program 93.6%
fma-define93.6%
sub-neg93.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 48.4%
Taylor expanded in t around inf 31.3%
mul-1-neg31.3%
distribute-lft-neg-out31.3%
*-commutative31.3%
Simplified31.3%
Taylor expanded in y around 0 14.1%
mul-1-neg14.1%
*-commutative14.1%
distribute-lft-neg-in14.1%
Simplified14.1%
Taylor expanded in y around inf 26.7%
mul-1-neg26.7%
*-commutative26.7%
associate-*r*34.1%
distribute-rgt-neg-in34.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Final simplification36.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -8e+155) (- x (* z (* x a))) (if (<= a 2.8e+31) (* x (- 1.0 (* y t))) (* x (* t (- y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8e+155) {
tmp = x - (z * (x * a));
} else if (a <= 2.8e+31) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (t * -y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (a <= (-8d+155)) then
tmp = x - (z * (x * a))
else if (a <= 2.8d+31) then
tmp = x * (1.0d0 - (y * t))
else
tmp = x * (t * -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -8e+155) {
tmp = x - (z * (x * a));
} else if (a <= 2.8e+31) {
tmp = x * (1.0 - (y * t));
} else {
tmp = x * (t * -y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -8e+155: tmp = x - (z * (x * a)) elif a <= 2.8e+31: tmp = x * (1.0 - (y * t)) else: tmp = x * (t * -y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -8e+155) tmp = Float64(x - Float64(z * Float64(x * a))); elseif (a <= 2.8e+31) tmp = Float64(x * Float64(1.0 - Float64(y * t))); else tmp = Float64(x * Float64(t * Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -8e+155) tmp = x - (z * (x * a)); elseif (a <= 2.8e+31) tmp = x * (1.0 - (y * t)); else tmp = x * (t * -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8e+155], N[(x - N[(z * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e+31], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{+155}:\\
\;\;\;\;x - z \cdot \left(x \cdot a\right)\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{+31}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if a < -8.00000000000000006e155Initial program 91.9%
fma-define91.9%
sub-neg91.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 67.5%
Taylor expanded in b around 0 14.2%
Taylor expanded in z around 0 14.6%
mul-1-neg14.6%
unsub-neg14.6%
associate-*r*27.4%
*-commutative27.4%
Simplified27.4%
if -8.00000000000000006e155 < a < 2.80000000000000017e31Initial program 99.3%
fma-define99.3%
sub-neg99.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 87.2%
Taylor expanded in t around inf 71.2%
mul-1-neg71.2%
distribute-lft-neg-out71.2%
*-commutative71.2%
Simplified71.2%
Taylor expanded in y around 0 37.8%
mul-1-neg37.8%
*-commutative37.8%
distribute-lft-neg-in37.8%
Simplified37.8%
Taylor expanded in x around 0 37.8%
mul-1-neg37.8%
*-commutative37.8%
sub-neg37.8%
Simplified37.8%
if 2.80000000000000017e31 < a Initial program 93.6%
fma-define93.6%
sub-neg93.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 48.4%
Taylor expanded in t around inf 31.3%
mul-1-neg31.3%
distribute-lft-neg-out31.3%
*-commutative31.3%
Simplified31.3%
Taylor expanded in y around 0 14.1%
mul-1-neg14.1%
*-commutative14.1%
distribute-lft-neg-in14.1%
Simplified14.1%
Taylor expanded in y around inf 26.7%
mul-1-neg26.7%
*-commutative26.7%
associate-*r*34.1%
distribute-rgt-neg-in34.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Final simplification35.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4e-21) (* x (* t (- y))) (if (<= y 5.8e-87) (* x (+ (* y t) 1.0)) (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4e-21) {
tmp = x * (t * -y);
} else if (y <= 5.8e-87) {
tmp = x * ((y * t) + 1.0);
} 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 <= (-4d-21)) then
tmp = x * (t * -y)
else if (y <= 5.8d-87) then
tmp = x * ((y * t) + 1.0d0)
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 <= -4e-21) {
tmp = x * (t * -y);
} else if (y <= 5.8e-87) {
tmp = x * ((y * t) + 1.0);
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4e-21: tmp = x * (t * -y) elif y <= 5.8e-87: tmp = x * ((y * t) + 1.0) else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4e-21) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 5.8e-87) tmp = Float64(x * Float64(Float64(y * t) + 1.0)); 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 <= -4e-21) tmp = x * (t * -y); elseif (y <= 5.8e-87) tmp = x * ((y * t) + 1.0); else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4e-21], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e-87], N[(x * N[(N[(y * t), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-21}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-87}:\\
\;\;\;\;x \cdot \left(y \cdot t + 1\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -3.99999999999999963e-21Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 90.4%
Taylor expanded in t around inf 64.8%
mul-1-neg64.8%
distribute-lft-neg-out64.8%
*-commutative64.8%
Simplified64.8%
Taylor expanded in y around 0 24.7%
mul-1-neg24.7%
*-commutative24.7%
distribute-lft-neg-in24.7%
Simplified24.7%
Taylor expanded in y around inf 19.9%
mul-1-neg19.9%
*-commutative19.9%
associate-*r*24.5%
distribute-rgt-neg-in24.5%
distribute-rgt-neg-in24.5%
Simplified24.5%
if -3.99999999999999963e-21 < y < 5.7999999999999998e-87Initial program 93.0%
fma-define93.0%
sub-neg93.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 48.8%
Taylor expanded in t around inf 48.8%
mul-1-neg48.8%
distribute-lft-neg-out48.8%
*-commutative48.8%
Simplified48.8%
Taylor expanded in y around 0 36.4%
mul-1-neg36.4%
*-commutative36.4%
distribute-lft-neg-in36.4%
Simplified36.4%
neg-sub036.4%
sub-neg36.4%
add-sqr-sqrt20.3%
sqrt-unprod36.4%
sqr-neg36.4%
sqrt-unprod16.0%
add-sqr-sqrt37.0%
Applied egg-rr37.0%
+-lft-identity37.0%
Simplified37.0%
if 5.7999999999999998e-87 < y Initial program 99.0%
fma-define99.0%
sub-neg99.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 36.6%
Taylor expanded in b around 0 12.6%
Taylor expanded in z around 0 8.5%
mul-1-neg8.5%
unsub-neg8.5%
*-commutative8.5%
Simplified8.5%
Taylor expanded in z around inf 30.5%
associate-*r*30.5%
mul-1-neg30.5%
Simplified30.5%
Final simplification31.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.1e-46) (not (<= y 5e-6))) (* x (* t (- y))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.1e-46) || !(y <= 5e-6)) {
tmp = x * (t * -y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.1d-46)) .or. (.not. (y <= 5d-6))) then
tmp = x * (t * -y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.1e-46) || !(y <= 5e-6)) {
tmp = x * (t * -y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.1e-46) or not (y <= 5e-6): tmp = x * (t * -y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.1e-46) || !(y <= 5e-6)) tmp = Float64(x * Float64(t * Float64(-y))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.1e-46) || ~((y <= 5e-6))) tmp = x * (t * -y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.1e-46], N[Not[LessEqual[y, 5e-6]], $MachinePrecision]], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-46} \lor \neg \left(y \leq 5 \cdot 10^{-6}\right):\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.09999999999999987e-46 or 5.00000000000000041e-6 < y Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 84.5%
Taylor expanded in t around inf 59.8%
mul-1-neg59.8%
distribute-lft-neg-out59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in y around 0 22.2%
mul-1-neg22.2%
*-commutative22.2%
distribute-lft-neg-in22.2%
Simplified22.2%
Taylor expanded in y around inf 19.6%
mul-1-neg19.6%
*-commutative19.6%
associate-*r*24.8%
distribute-rgt-neg-in24.8%
distribute-rgt-neg-in24.8%
Simplified24.8%
if -2.09999999999999987e-46 < y < 5.00000000000000041e-6Initial program 92.9%
fma-define92.9%
sub-neg92.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 56.5%
Taylor expanded in y around 0 34.9%
Final simplification29.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.1e-46) (* x (* t (- y))) (if (<= y 1.85e-81) x (* a (* x (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.1e-46) {
tmp = x * (t * -y);
} else if (y <= 1.85e-81) {
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 <= (-2.1d-46)) then
tmp = x * (t * -y)
else if (y <= 1.85d-81) 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 <= -2.1e-46) {
tmp = x * (t * -y);
} else if (y <= 1.85e-81) {
tmp = x;
} else {
tmp = a * (x * -z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.1e-46: tmp = x * (t * -y) elif y <= 1.85e-81: tmp = x else: tmp = a * (x * -z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.1e-46) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 1.85e-81) 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 <= -2.1e-46) tmp = x * (t * -y); elseif (y <= 1.85e-81) tmp = x; else tmp = a * (x * -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.1e-46], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e-81], x, N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-46}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-81}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if y < -2.09999999999999987e-46Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 79.5%
Taylor expanded in t around inf 57.5%
mul-1-neg57.5%
distribute-lft-neg-out57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in y around 0 21.7%
mul-1-neg21.7%
*-commutative21.7%
distribute-lft-neg-in21.7%
Simplified21.7%
Taylor expanded in y around inf 18.9%
mul-1-neg18.9%
*-commutative18.9%
associate-*r*22.9%
distribute-rgt-neg-in22.9%
distribute-rgt-neg-in22.9%
Simplified22.9%
if -2.09999999999999987e-46 < y < 1.84999999999999993e-81Initial program 92.2%
fma-define92.2%
sub-neg92.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 52.8%
Taylor expanded in y around 0 39.0%
if 1.84999999999999993e-81 < y Initial program 99.0%
fma-define99.0%
sub-neg99.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 36.6%
Taylor expanded in b around 0 12.6%
Taylor expanded in z around 0 8.5%
mul-1-neg8.5%
unsub-neg8.5%
*-commutative8.5%
Simplified8.5%
Taylor expanded in z around inf 30.5%
associate-*r*30.5%
mul-1-neg30.5%
Simplified30.5%
Final simplification31.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.1e-46) (* x (* t (- y))) (if (<= y 1.56e-56) x (* x (* z (- a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.1e-46) {
tmp = x * (t * -y);
} else if (y <= 1.56e-56) {
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 <= (-2.1d-46)) then
tmp = x * (t * -y)
else if (y <= 1.56d-56) 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 <= -2.1e-46) {
tmp = x * (t * -y);
} else if (y <= 1.56e-56) {
tmp = x;
} else {
tmp = x * (z * -a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.1e-46: tmp = x * (t * -y) elif y <= 1.56e-56: tmp = x else: tmp = x * (z * -a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.1e-46) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 1.56e-56) 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 <= -2.1e-46) tmp = x * (t * -y); elseif (y <= 1.56e-56) tmp = x; else tmp = x * (z * -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.1e-46], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.56e-56], x, N[(x * N[(z * (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-46}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.56 \cdot 10^{-56}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(-a\right)\right)\\
\end{array}
\end{array}
if y < -2.09999999999999987e-46Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 79.5%
Taylor expanded in t around inf 57.5%
mul-1-neg57.5%
distribute-lft-neg-out57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in y around 0 21.7%
mul-1-neg21.7%
*-commutative21.7%
distribute-lft-neg-in21.7%
Simplified21.7%
Taylor expanded in y around inf 18.9%
mul-1-neg18.9%
*-commutative18.9%
associate-*r*22.9%
distribute-rgt-neg-in22.9%
distribute-rgt-neg-in22.9%
Simplified22.9%
if -2.09999999999999987e-46 < y < 1.56000000000000003e-56Initial program 92.7%
fma-define92.7%
sub-neg92.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 52.8%
Taylor expanded in y around 0 38.9%
if 1.56000000000000003e-56 < y Initial program 98.9%
fma-define98.9%
sub-neg98.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 33.5%
Taylor expanded in b around 0 11.0%
Taylor expanded in z around 0 6.6%
mul-1-neg6.6%
unsub-neg6.6%
*-commutative6.6%
Simplified6.6%
Taylor expanded in z around inf 27.7%
mul-1-neg27.7%
*-commutative27.7%
distribute-rgt-neg-in27.7%
Simplified27.7%
Final simplification30.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x 6.8e-41) (* a (* x (- z))) (* x (- 1.0 (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 6.8e-41) {
tmp = a * (x * -z);
} else {
tmp = x * (1.0 - (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 (x <= 6.8d-41) then
tmp = a * (x * -z)
else
tmp = x * (1.0d0 - (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 (x <= 6.8e-41) {
tmp = a * (x * -z);
} else {
tmp = x * (1.0 - (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 6.8e-41: tmp = a * (x * -z) else: tmp = x * (1.0 - (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 6.8e-41) tmp = Float64(a * Float64(x * Float64(-z))); else tmp = Float64(x * Float64(1.0 - Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 6.8e-41) tmp = a * (x * -z); else tmp = x * (1.0 - (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 6.8e-41], N[(a * N[(x * (-z)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.8 \cdot 10^{-41}:\\
\;\;\;\;a \cdot \left(x \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot t\right)\\
\end{array}
\end{array}
if x < 6.7999999999999997e-41Initial program 97.3%
fma-define97.3%
sub-neg97.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 54.0%
Taylor expanded in b around 0 18.7%
Taylor expanded in z around 0 17.1%
mul-1-neg17.1%
unsub-neg17.1%
*-commutative17.1%
Simplified17.1%
Taylor expanded in z around inf 24.0%
associate-*r*24.0%
mul-1-neg24.0%
Simplified24.0%
if 6.7999999999999997e-41 < x Initial program 96.0%
fma-define96.0%
sub-neg96.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 69.4%
Taylor expanded in t around inf 55.0%
mul-1-neg55.0%
distribute-lft-neg-out55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in y around 0 26.8%
mul-1-neg26.8%
*-commutative26.8%
distribute-lft-neg-in26.8%
Simplified26.8%
Taylor expanded in x around 0 26.8%
mul-1-neg26.8%
*-commutative26.8%
sub-neg26.8%
Simplified26.8%
Final simplification24.8%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.9%
fma-define96.9%
sub-neg96.9%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 72.4%
Taylor expanded in y around 0 17.3%
herbie shell --seed 2024181
(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))))))