
(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 (fma y (- (log z) t) (* a (- (log1p (- z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(fma(y, (log(z) - t), (a * (log1p(-z) - b))));
}
function code(x, y, z, t, a, b) return Float64(x * exp(fma(y, Float64(log(z) - t), Float64(a * Float64(log1p(Float64(-z)) - b))))) end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[(N[Log[1 + (-z)], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\mathsf{log1p}\left(-z\right) - b\right)\right)}
\end{array}
Initial program 97.3%
fma-define98.1%
sub-neg98.1%
log1p-define99.6%
Simplified99.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.2e-9) (not (<= y 4.5e-41))) (* 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 <= -6.2e-9) || !(y <= 4.5e-41)) {
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 <= (-6.2d-9)) .or. (.not. (y <= 4.5d-41))) 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 <= -6.2e-9) || !(y <= 4.5e-41)) {
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 <= -6.2e-9) or not (y <= 4.5e-41): 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 <= -6.2e-9) || !(y <= 4.5e-41)) 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 <= -6.2e-9) || ~((y <= 4.5e-41))) 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, -6.2e-9], N[Not[LessEqual[y, 4.5e-41]], $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 -6.2 \cdot 10^{-9} \lor \neg \left(y \leq 4.5 \cdot 10^{-41}\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 < -6.2000000000000001e-9 or 4.5e-41 < y Initial program 97.2%
fma-define98.6%
sub-neg98.6%
log1p-define99.3%
Simplified99.3%
Taylor expanded in a around 0 89.6%
if -6.2000000000000001e-9 < y < 4.5e-41Initial program 97.5%
fma-define97.5%
sub-neg97.5%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 87.3%
Taylor expanded in z around 0 89.8%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified89.8%
Final simplification89.7%
(FPCore (x y z t a b) :precision binary64 (* x (exp (- (* y (- (log z) t)) (* a (+ z b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) - (a * (z + b))));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * exp(((y * (log(z) - t)) - (a * (z + b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) - (a * (z + b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) - (a * (z + b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) - Float64(a * Float64(z + b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) - (a * (z + b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) - a \cdot \left(z + b\right)}
\end{array}
Initial program 97.3%
Taylor expanded in z around 0 98.8%
associate-*r*98.8%
associate-*r*98.8%
distribute-lft-out98.8%
mul-1-neg98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -160.0) (not (<= y 0.37))) (* x (pow z y)) (* x (exp (* a (- (- b) z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -160.0) || !(y <= 0.37)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * (-b - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-160.0d0)) .or. (.not. (y <= 0.37d0))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * (-b - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -160.0) || !(y <= 0.37)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * (-b - z)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -160.0) or not (y <= 0.37): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * (-b - z))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -160.0) || !(y <= 0.37)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(Float64(-b) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -160.0) || ~((y <= 0.37))) tmp = x * (z ^ y); else tmp = x * exp((a * (-b - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -160.0], N[Not[LessEqual[y, 0.37]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * N[((-b) - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -160 \lor \neg \left(y \leq 0.37\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\end{array}
\end{array}
if y < -160 or 0.37 < y Initial program 96.9%
fma-define98.5%
sub-neg98.5%
log1p-define99.2%
Simplified99.2%
Taylor expanded in a around 0 90.8%
Taylor expanded in t around 0 74.8%
if -160 < y < 0.37Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 85.7%
Taylor expanded in z around 0 88.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified88.0%
Final simplification81.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.049) (not (<= y 1.45))) (* 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.049) || !(y <= 1.45)) {
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.049d0)) .or. (.not. (y <= 1.45d0))) 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.049) || !(y <= 1.45)) {
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.049) or not (y <= 1.45): 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.049) || !(y <= 1.45)) 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.049) || ~((y <= 1.45))) 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.049], N[Not[LessEqual[y, 1.45]], $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.049 \lor \neg \left(y \leq 1.45\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -0.049000000000000002 or 1.44999999999999996 < y Initial program 96.9%
fma-define98.5%
sub-neg98.5%
log1p-define99.2%
Simplified99.2%
Taylor expanded in a around 0 90.8%
Taylor expanded in t around 0 74.8%
if -0.049000000000000002 < y < 1.44999999999999996Initial program 97.7%
fma-define97.7%
sub-neg97.7%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 85.7%
Taylor expanded in z around 0 85.7%
associate-*r*85.7%
mul-1-neg85.7%
Simplified85.7%
Final simplification80.2%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.95e+172) (- 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.95e+172) {
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.95d+172)) 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.95e+172) {
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.95e+172: 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.95e+172) 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.95e+172) 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.95e+172], 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.95 \cdot 10^{+172}:\\
\;\;\;\;x - y \cdot \left(x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -1.94999999999999984e172Initial program 96.6%
Taylor expanded in z around 0 96.6%
associate-*r*96.6%
associate-*r*96.6%
distribute-lft-out96.6%
mul-1-neg96.6%
Simplified96.6%
Taylor expanded in t around inf 86.9%
associate-*r*86.9%
neg-mul-186.9%
Simplified86.9%
Taylor expanded in t around 0 43.6%
mul-1-neg43.6%
unsub-neg43.6%
associate-*r*46.0%
*-commutative46.0%
*-commutative46.0%
Simplified46.0%
if -1.94999999999999984e172 < t Initial program 97.4%
fma-define98.3%
sub-neg98.3%
log1p-define100.0%
Simplified100.0%
Taylor expanded in a around 0 70.7%
Taylor expanded in t around 0 61.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -7.2e+88)
(* x (* t (- y)))
(if (<= y 6.5e-23)
(- x (* x (* a (+ z b))))
(if (<= y 7.5e+31) (* (- a) (* x b)) (* y (- (/ x y) (* x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7.2e+88) {
tmp = x * (t * -y);
} else if (y <= 6.5e-23) {
tmp = x - (x * (a * (z + b)));
} else if (y <= 7.5e+31) {
tmp = -a * (x * b);
} else {
tmp = y * ((x / y) - (x * 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 <= (-7.2d+88)) then
tmp = x * (t * -y)
else if (y <= 6.5d-23) then
tmp = x - (x * (a * (z + b)))
else if (y <= 7.5d+31) then
tmp = -a * (x * b)
else
tmp = y * ((x / y) - (x * 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 <= -7.2e+88) {
tmp = x * (t * -y);
} else if (y <= 6.5e-23) {
tmp = x - (x * (a * (z + b)));
} else if (y <= 7.5e+31) {
tmp = -a * (x * b);
} else {
tmp = y * ((x / y) - (x * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7.2e+88: tmp = x * (t * -y) elif y <= 6.5e-23: tmp = x - (x * (a * (z + b))) elif y <= 7.5e+31: tmp = -a * (x * b) else: tmp = y * ((x / y) - (x * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7.2e+88) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 6.5e-23) tmp = Float64(x - Float64(x * Float64(a * Float64(z + b)))); elseif (y <= 7.5e+31) tmp = Float64(Float64(-a) * Float64(x * b)); else tmp = Float64(y * Float64(Float64(x / y) - Float64(x * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -7.2e+88) tmp = x * (t * -y); elseif (y <= 6.5e-23) tmp = x - (x * (a * (z + b))); elseif (y <= 7.5e+31) tmp = -a * (x * b); else tmp = y * ((x / y) - (x * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7.2e+88], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-23], N[(x - N[(x * N[(a * N[(z + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+31], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / y), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+88}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-23}:\\
\;\;\;\;x - x \cdot \left(a \cdot \left(z + b\right)\right)\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+31}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{x}{y} - x \cdot t\right)\\
\end{array}
\end{array}
if y < -7.2000000000000004e88Initial program 97.8%
Taylor expanded in z around 0 97.8%
associate-*r*97.8%
associate-*r*97.8%
distribute-lft-out97.8%
mul-1-neg97.8%
Simplified97.8%
Taylor expanded in t around inf 59.0%
associate-*r*59.0%
neg-mul-159.0%
Simplified59.0%
Taylor expanded in t around 0 24.2%
mul-1-neg24.2%
unsub-neg24.2%
associate-*r*22.4%
*-commutative22.4%
*-commutative22.4%
Simplified22.4%
Taylor expanded in y around inf 26.0%
neg-mul-126.0%
*-commutative26.0%
associate-*l*28.2%
distribute-rgt-neg-out28.2%
distribute-rgt-neg-in28.2%
Simplified28.2%
if -7.2000000000000004e88 < y < 6.5e-23Initial program 97.2%
fma-define97.2%
sub-neg97.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 79.9%
Taylor expanded in z around 0 83.4%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
mul-1-neg100.0%
Simplified83.4%
Taylor expanded in a around 0 43.3%
mul-1-neg43.3%
unsub-neg43.3%
*-commutative43.3%
associate-*l*43.4%
*-commutative43.4%
+-commutative43.4%
Simplified43.4%
if 6.5e-23 < y < 7.5e31Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 52.1%
Taylor expanded in z around 0 52.1%
associate-*r*52.1%
mul-1-neg52.1%
Simplified52.1%
Taylor expanded in a around 0 15.9%
mul-1-neg15.9%
unsub-neg15.9%
*-commutative15.9%
Simplified15.9%
Taylor expanded in a around inf 45.3%
mul-1-neg45.3%
Simplified45.3%
if 7.5e31 < y Initial program 96.5%
Taylor expanded in z around 0 96.5%
associate-*r*96.5%
associate-*r*96.5%
distribute-lft-out96.5%
mul-1-neg96.5%
Simplified96.5%
Taylor expanded in t around inf 57.4%
associate-*r*57.4%
neg-mul-157.4%
Simplified57.4%
Taylor expanded in t around 0 18.2%
mul-1-neg18.2%
unsub-neg18.2%
associate-*r*18.4%
*-commutative18.4%
*-commutative18.4%
Simplified18.4%
Taylor expanded in y around inf 28.1%
*-commutative28.1%
Simplified28.1%
Final simplification37.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -4.6e+86)
(* x (* t (- y)))
(if (<= y 9.8e-24)
(- x (* a (* x b)))
(if (<= y 1e+32) (* (- a) (* x b)) (* y (- (/ x y) (* x t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.6e+86) {
tmp = x * (t * -y);
} else if (y <= 9.8e-24) {
tmp = x - (a * (x * b));
} else if (y <= 1e+32) {
tmp = -a * (x * b);
} else {
tmp = y * ((x / y) - (x * 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+86)) then
tmp = x * (t * -y)
else if (y <= 9.8d-24) then
tmp = x - (a * (x * b))
else if (y <= 1d+32) then
tmp = -a * (x * b)
else
tmp = y * ((x / y) - (x * 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+86) {
tmp = x * (t * -y);
} else if (y <= 9.8e-24) {
tmp = x - (a * (x * b));
} else if (y <= 1e+32) {
tmp = -a * (x * b);
} else {
tmp = y * ((x / y) - (x * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -4.6e+86: tmp = x * (t * -y) elif y <= 9.8e-24: tmp = x - (a * (x * b)) elif y <= 1e+32: tmp = -a * (x * b) else: tmp = y * ((x / y) - (x * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.6e+86) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 9.8e-24) tmp = Float64(x - Float64(a * Float64(x * b))); elseif (y <= 1e+32) tmp = Float64(Float64(-a) * Float64(x * b)); else tmp = Float64(y * Float64(Float64(x / y) - Float64(x * t))); 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 * -y); elseif (y <= 9.8e-24) tmp = x - (a * (x * b)); elseif (y <= 1e+32) tmp = -a * (x * b); else tmp = y * ((x / y) - (x * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.6e+86], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.8e-24], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+32], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x / y), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+86}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 9.8 \cdot 10^{-24}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\mathbf{elif}\;y \leq 10^{+32}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{x}{y} - x \cdot t\right)\\
\end{array}
\end{array}
if y < -4.59999999999999979e86Initial program 97.9%
Taylor expanded in z around 0 97.9%
associate-*r*97.9%
associate-*r*97.9%
distribute-lft-out97.9%
mul-1-neg97.9%
Simplified97.9%
Taylor expanded in t around inf 58.7%
associate-*r*58.7%
neg-mul-158.7%
Simplified58.7%
Taylor expanded in t around 0 23.3%
mul-1-neg23.3%
unsub-neg23.3%
associate-*r*21.6%
*-commutative21.6%
*-commutative21.6%
Simplified21.6%
Taylor expanded in y around inf 25.0%
neg-mul-125.0%
*-commutative25.0%
associate-*l*29.1%
distribute-rgt-neg-out29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
if -4.59999999999999979e86 < y < 9.8000000000000002e-24Initial program 97.1%
fma-define97.1%
sub-neg97.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 80.3%
Taylor expanded in z around 0 80.3%
associate-*r*80.3%
mul-1-neg80.3%
Simplified80.3%
Taylor expanded in a around 0 43.2%
mul-1-neg43.2%
unsub-neg43.2%
*-commutative43.2%
Simplified43.2%
if 9.8000000000000002e-24 < y < 1.00000000000000005e32Initial program 100.0%
fma-define100.0%
sub-neg100.0%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 52.1%
Taylor expanded in z around 0 52.1%
associate-*r*52.1%
mul-1-neg52.1%
Simplified52.1%
Taylor expanded in a around 0 15.9%
mul-1-neg15.9%
unsub-neg15.9%
*-commutative15.9%
Simplified15.9%
Taylor expanded in a around inf 45.3%
mul-1-neg45.3%
Simplified45.3%
if 1.00000000000000005e32 < y Initial program 96.5%
Taylor expanded in z around 0 96.5%
associate-*r*96.5%
associate-*r*96.5%
distribute-lft-out96.5%
mul-1-neg96.5%
Simplified96.5%
Taylor expanded in t around inf 57.4%
associate-*r*57.4%
neg-mul-157.4%
Simplified57.4%
Taylor expanded in t around 0 18.2%
mul-1-neg18.2%
unsub-neg18.2%
associate-*r*18.4%
*-commutative18.4%
*-commutative18.4%
Simplified18.4%
Taylor expanded in y around inf 28.1%
*-commutative28.1%
Simplified28.1%
Final simplification37.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.2e+85) (* x (* t (- y))) (if (<= y 7.4e-23) (- x (* a (* x b))) (* (- a) (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.2e+85) {
tmp = x * (t * -y);
} else if (y <= 7.4e-23) {
tmp = x - (a * (x * b));
} else {
tmp = -a * (x * 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 <= (-6.2d+85)) then
tmp = x * (t * -y)
else if (y <= 7.4d-23) then
tmp = x - (a * (x * b))
else
tmp = -a * (x * 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 <= -6.2e+85) {
tmp = x * (t * -y);
} else if (y <= 7.4e-23) {
tmp = x - (a * (x * b));
} else {
tmp = -a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.2e+85: tmp = x * (t * -y) elif y <= 7.4e-23: tmp = x - (a * (x * b)) else: tmp = -a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.2e+85) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 7.4e-23) tmp = Float64(x - Float64(a * Float64(x * b))); else tmp = Float64(Float64(-a) * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -6.2e+85) tmp = x * (t * -y); elseif (y <= 7.4e-23) tmp = x - (a * (x * b)); else tmp = -a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.2e+85], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.4e-23], N[(x - N[(a * N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+85}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-23}:\\
\;\;\;\;x - a \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < -6.20000000000000023e85Initial program 97.9%
Taylor expanded in z around 0 97.9%
associate-*r*97.9%
associate-*r*97.9%
distribute-lft-out97.9%
mul-1-neg97.9%
Simplified97.9%
Taylor expanded in t around inf 58.7%
associate-*r*58.7%
neg-mul-158.7%
Simplified58.7%
Taylor expanded in t around 0 23.3%
mul-1-neg23.3%
unsub-neg23.3%
associate-*r*21.6%
*-commutative21.6%
*-commutative21.6%
Simplified21.6%
Taylor expanded in y around inf 25.0%
neg-mul-125.0%
*-commutative25.0%
associate-*l*29.1%
distribute-rgt-neg-out29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
if -6.20000000000000023e85 < y < 7.4000000000000005e-23Initial program 97.1%
fma-define97.1%
sub-neg97.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 80.3%
Taylor expanded in z around 0 80.3%
associate-*r*80.3%
mul-1-neg80.3%
Simplified80.3%
Taylor expanded in a around 0 43.2%
mul-1-neg43.2%
unsub-neg43.2%
*-commutative43.2%
Simplified43.2%
if 7.4000000000000005e-23 < y Initial program 97.3%
fma-define98.7%
sub-neg98.7%
log1p-define98.7%
Simplified98.7%
Taylor expanded in y around 0 40.4%
Taylor expanded in z around 0 39.1%
associate-*r*39.1%
mul-1-neg39.1%
Simplified39.1%
Taylor expanded in a around 0 8.4%
mul-1-neg8.4%
unsub-neg8.4%
*-commutative8.4%
Simplified8.4%
Taylor expanded in a around inf 21.7%
mul-1-neg21.7%
Simplified21.7%
Final simplification34.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.1e+89) (* x (* t (- y))) (if (<= y 4.4e-23) (* x (- 1.0 (* a b))) (* (- a) (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.1e+89) {
tmp = x * (t * -y);
} else if (y <= 4.4e-23) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -a * (x * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3.1d+89)) then
tmp = x * (t * -y)
else if (y <= 4.4d-23) then
tmp = x * (1.0d0 - (a * b))
else
tmp = -a * (x * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.1e+89) {
tmp = x * (t * -y);
} else if (y <= 4.4e-23) {
tmp = x * (1.0 - (a * b));
} else {
tmp = -a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.1e+89: tmp = x * (t * -y) elif y <= 4.4e-23: tmp = x * (1.0 - (a * b)) else: tmp = -a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.1e+89) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 4.4e-23) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(Float64(-a) * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.1e+89) tmp = x * (t * -y); elseif (y <= 4.4e-23) tmp = x * (1.0 - (a * b)); else tmp = -a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.1e+89], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e-23], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+89}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-23}:\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < -3.1e89Initial program 97.8%
Taylor expanded in z around 0 97.8%
associate-*r*97.8%
associate-*r*97.8%
distribute-lft-out97.8%
mul-1-neg97.8%
Simplified97.8%
Taylor expanded in t around inf 59.0%
associate-*r*59.0%
neg-mul-159.0%
Simplified59.0%
Taylor expanded in t around 0 24.2%
mul-1-neg24.2%
unsub-neg24.2%
associate-*r*22.4%
*-commutative22.4%
*-commutative22.4%
Simplified22.4%
Taylor expanded in y around inf 26.0%
neg-mul-126.0%
*-commutative26.0%
associate-*l*28.2%
distribute-rgt-neg-out28.2%
distribute-rgt-neg-in28.2%
Simplified28.2%
if -3.1e89 < y < 4.3999999999999999e-23Initial program 97.2%
fma-define97.2%
sub-neg97.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 79.9%
Taylor expanded in z around 0 79.9%
associate-*r*79.9%
mul-1-neg79.9%
Simplified79.9%
Taylor expanded in a around 0 42.6%
mul-1-neg42.6%
unsub-neg42.6%
*-commutative42.6%
Simplified42.6%
Taylor expanded in x around 0 42.6%
*-commutative42.6%
Simplified42.6%
if 4.3999999999999999e-23 < y Initial program 97.3%
fma-define98.7%
sub-neg98.7%
log1p-define98.7%
Simplified98.7%
Taylor expanded in y around 0 40.4%
Taylor expanded in z around 0 39.1%
associate-*r*39.1%
mul-1-neg39.1%
Simplified39.1%
Taylor expanded in a around 0 8.4%
mul-1-neg8.4%
unsub-neg8.4%
*-commutative8.4%
Simplified8.4%
Taylor expanded in a around inf 21.7%
mul-1-neg21.7%
Simplified21.7%
Final simplification34.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8.2e-67) (* x (* t (- y))) (if (<= y 2e-62) (* x (+ 1.0 (* y t))) (* (- a) (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8.2e-67) {
tmp = x * (t * -y);
} else if (y <= 2e-62) {
tmp = x * (1.0 + (y * t));
} else {
tmp = -a * (x * 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)) then
tmp = x * (t * -y)
else if (y <= 2d-62) then
tmp = x * (1.0d0 + (y * t))
else
tmp = -a * (x * 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) {
tmp = x * (t * -y);
} else if (y <= 2e-62) {
tmp = x * (1.0 + (y * t));
} else {
tmp = -a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8.2e-67: tmp = x * (t * -y) elif y <= 2e-62: tmp = x * (1.0 + (y * t)) else: tmp = -a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8.2e-67) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 2e-62) tmp = Float64(x * Float64(1.0 + Float64(y * t))); else tmp = Float64(Float64(-a) * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -8.2e-67) tmp = x * (t * -y); elseif (y <= 2e-62) tmp = x * (1.0 + (y * t)); else tmp = -a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8.2e-67], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-62], N[(x * N[(1.0 + N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{-67}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \left(1 + y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < -8.1999999999999994e-67Initial program 97.4%
Taylor expanded in z around 0 98.7%
associate-*r*98.7%
associate-*r*98.7%
distribute-lft-out98.7%
mul-1-neg98.7%
Simplified98.7%
Taylor expanded in t around inf 52.7%
associate-*r*52.7%
neg-mul-152.7%
Simplified52.7%
Taylor expanded in t around 0 16.3%
mul-1-neg16.3%
unsub-neg16.3%
associate-*r*15.3%
*-commutative15.3%
*-commutative15.3%
Simplified15.3%
Taylor expanded in y around inf 18.1%
neg-mul-118.1%
*-commutative18.1%
associate-*l*20.7%
distribute-rgt-neg-out20.7%
distribute-rgt-neg-in20.7%
Simplified20.7%
if -8.1999999999999994e-67 < y < 2.0000000000000001e-62Initial program 97.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 t around inf 55.3%
associate-*r*55.3%
neg-mul-155.3%
Simplified55.3%
Taylor expanded in t around 0 44.1%
mul-1-neg44.1%
*-commutative44.1%
distribute-rgt-neg-in44.1%
Simplified44.1%
neg-sub044.1%
sub-neg44.1%
add-sqr-sqrt23.6%
sqrt-unprod43.3%
sqr-neg43.3%
sqrt-unprod21.4%
add-sqr-sqrt44.3%
Applied egg-rr44.3%
+-lft-identity44.3%
Simplified44.3%
if 2.0000000000000001e-62 < y Initial program 97.5%
fma-define98.8%
sub-neg98.8%
log1p-define98.8%
Simplified98.8%
Taylor expanded in y around 0 43.9%
Taylor expanded in z around 0 42.8%
associate-*r*42.8%
mul-1-neg42.8%
Simplified42.8%
Taylor expanded in a around 0 13.9%
mul-1-neg13.9%
unsub-neg13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in a around inf 24.7%
mul-1-neg24.7%
Simplified24.7%
Final simplification31.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.1e-46) (not (<= y 1.56e-62))) (* (- a) (* x b)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e-46) || !(y <= 1.56e-62)) {
tmp = -a * (x * b);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.1d-46)) .or. (.not. (y <= 1.56d-62))) then
tmp = -a * (x * b)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.1e-46) || !(y <= 1.56e-62)) {
tmp = -a * (x * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.1e-46) or not (y <= 1.56e-62): tmp = -a * (x * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.1e-46) || !(y <= 1.56e-62)) tmp = Float64(Float64(-a) * Float64(x * b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.1e-46) || ~((y <= 1.56e-62))) tmp = -a * (x * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.1e-46], N[Not[LessEqual[y, 1.56e-62]], $MachinePrecision]], N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-46} \lor \neg \left(y \leq 1.56 \cdot 10^{-62}\right):\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.1e-46 or 1.56000000000000009e-62 < y Initial program 97.4%
fma-define98.7%
sub-neg98.7%
log1p-define99.4%
Simplified99.4%
Taylor expanded in y around 0 41.8%
Taylor expanded in z around 0 41.2%
associate-*r*41.2%
mul-1-neg41.2%
Simplified41.2%
Taylor expanded in a around 0 13.0%
mul-1-neg13.0%
unsub-neg13.0%
*-commutative13.0%
Simplified13.0%
Taylor expanded in a around inf 20.1%
mul-1-neg20.1%
Simplified20.1%
if -1.1e-46 < y < 1.56000000000000009e-62Initial program 97.2%
fma-define97.2%
sub-neg97.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 87.8%
Taylor expanded in a around 0 42.1%
Final simplification29.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.9e-62) (* x (* t (- y))) (if (<= y 2e-62) x (* (- a) (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.9e-62) {
tmp = x * (t * -y);
} else if (y <= 2e-62) {
tmp = x;
} else {
tmp = -a * (x * 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.9d-62)) then
tmp = x * (t * -y)
else if (y <= 2d-62) then
tmp = x
else
tmp = -a * (x * 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.9e-62) {
tmp = x * (t * -y);
} else if (y <= 2e-62) {
tmp = x;
} else {
tmp = -a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.9e-62: tmp = x * (t * -y) elif y <= 2e-62: tmp = x else: tmp = -a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.9e-62) tmp = Float64(x * Float64(t * Float64(-y))); elseif (y <= 2e-62) tmp = x; else tmp = Float64(Float64(-a) * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.9e-62) tmp = x * (t * -y); elseif (y <= 2e-62) tmp = x; else tmp = -a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.9e-62], N[(x * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-62], x, N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < -1.90000000000000003e-62Initial program 97.3%
Taylor expanded in z around 0 98.6%
associate-*r*98.6%
associate-*r*98.6%
distribute-lft-out98.6%
mul-1-neg98.6%
Simplified98.6%
Taylor expanded in t around inf 52.0%
associate-*r*52.0%
neg-mul-152.0%
Simplified52.0%
Taylor expanded in t around 0 16.5%
mul-1-neg16.5%
unsub-neg16.5%
associate-*r*15.5%
*-commutative15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in y around inf 18.4%
neg-mul-118.4%
*-commutative18.4%
associate-*l*21.0%
distribute-rgt-neg-out21.0%
distribute-rgt-neg-in21.0%
Simplified21.0%
if -1.90000000000000003e-62 < y < 2.0000000000000001e-62Initial program 97.1%
fma-define97.1%
sub-neg97.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 87.4%
Taylor expanded in a around 0 43.3%
if 2.0000000000000001e-62 < y Initial program 97.5%
fma-define98.8%
sub-neg98.8%
log1p-define98.8%
Simplified98.8%
Taylor expanded in y around 0 43.9%
Taylor expanded in z around 0 42.8%
associate-*r*42.8%
mul-1-neg42.8%
Simplified42.8%
Taylor expanded in a around 0 13.9%
mul-1-neg13.9%
unsub-neg13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in a around inf 24.7%
mul-1-neg24.7%
Simplified24.7%
Final simplification31.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.05e-62) (* t (* x (- y))) (if (<= y 1.86e-62) x (* (- a) (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.05e-62) {
tmp = t * (x * -y);
} else if (y <= 1.86e-62) {
tmp = x;
} else {
tmp = -a * (x * 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.05d-62)) then
tmp = t * (x * -y)
else if (y <= 1.86d-62) then
tmp = x
else
tmp = -a * (x * 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.05e-62) {
tmp = t * (x * -y);
} else if (y <= 1.86e-62) {
tmp = x;
} else {
tmp = -a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.05e-62: tmp = t * (x * -y) elif y <= 1.86e-62: tmp = x else: tmp = -a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.05e-62) tmp = Float64(t * Float64(x * Float64(-y))); elseif (y <= 1.86e-62) tmp = x; else tmp = Float64(Float64(-a) * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.05e-62) tmp = t * (x * -y); elseif (y <= 1.86e-62) tmp = x; else tmp = -a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.05e-62], N[(t * N[(x * (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.86e-62], x, N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-62}:\\
\;\;\;\;t \cdot \left(x \cdot \left(-y\right)\right)\\
\mathbf{elif}\;y \leq 1.86 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < -1.05e-62Initial program 97.3%
Taylor expanded in z around 0 98.6%
associate-*r*98.6%
associate-*r*98.6%
distribute-lft-out98.6%
mul-1-neg98.6%
Simplified98.6%
Taylor expanded in t around inf 52.0%
associate-*r*52.0%
neg-mul-152.0%
Simplified52.0%
Taylor expanded in t around 0 16.5%
mul-1-neg16.5%
unsub-neg16.5%
associate-*r*15.5%
*-commutative15.5%
*-commutative15.5%
Simplified15.5%
Taylor expanded in y around inf 18.4%
neg-mul-118.4%
distribute-rgt-neg-in18.4%
Simplified18.4%
if -1.05e-62 < y < 1.86000000000000001e-62Initial program 97.1%
fma-define97.1%
sub-neg97.1%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 87.4%
Taylor expanded in a around 0 43.3%
if 1.86000000000000001e-62 < y Initial program 97.5%
fma-define98.8%
sub-neg98.8%
log1p-define98.8%
Simplified98.8%
Taylor expanded in y around 0 43.9%
Taylor expanded in z around 0 42.8%
associate-*r*42.8%
mul-1-neg42.8%
Simplified42.8%
Taylor expanded in a around 0 13.9%
mul-1-neg13.9%
unsub-neg13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in a around inf 24.7%
mul-1-neg24.7%
Simplified24.7%
Final simplification30.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.7e-47) (* b (* x (- a))) (if (<= y 1.2e-62) x (* (- a) (* x b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.7e-47) {
tmp = b * (x * -a);
} else if (y <= 1.2e-62) {
tmp = x;
} else {
tmp = -a * (x * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-1.7d-47)) then
tmp = b * (x * -a)
else if (y <= 1.2d-62) then
tmp = x
else
tmp = -a * (x * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.7e-47) {
tmp = b * (x * -a);
} else if (y <= 1.2e-62) {
tmp = x;
} else {
tmp = -a * (x * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.7e-47: tmp = b * (x * -a) elif y <= 1.2e-62: tmp = x else: tmp = -a * (x * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.7e-47) tmp = Float64(b * Float64(x * Float64(-a))); elseif (y <= 1.2e-62) tmp = x; else tmp = Float64(Float64(-a) * Float64(x * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.7e-47) tmp = b * (x * -a); elseif (y <= 1.2e-62) tmp = x; else tmp = -a * (x * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.7e-47], N[(b * N[(x * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-62], x, N[((-a) * N[(x * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-47}:\\
\;\;\;\;b \cdot \left(x \cdot \left(-a\right)\right)\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-62}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(x \cdot b\right)\\
\end{array}
\end{array}
if y < -1.7000000000000001e-47Initial program 97.2%
fma-define98.6%
sub-neg98.6%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 39.4%
Taylor expanded in z around 0 39.4%
associate-*r*39.4%
mul-1-neg39.4%
Simplified39.4%
Taylor expanded in a around 0 11.9%
mul-1-neg11.9%
unsub-neg11.9%
*-commutative11.9%
Simplified11.9%
Taylor expanded in a around inf 14.8%
mul-1-neg14.8%
*-commutative14.8%
associate-*r*16.0%
distribute-rgt-neg-in16.0%
*-commutative16.0%
distribute-rgt-neg-in16.0%
Simplified16.0%
if -1.7000000000000001e-47 < y < 1.19999999999999992e-62Initial program 97.2%
fma-define97.2%
sub-neg97.2%
log1p-define100.0%
Simplified100.0%
Taylor expanded in y around 0 87.8%
Taylor expanded in a around 0 42.1%
if 1.19999999999999992e-62 < y Initial program 97.5%
fma-define98.8%
sub-neg98.8%
log1p-define98.8%
Simplified98.8%
Taylor expanded in y around 0 43.9%
Taylor expanded in z around 0 42.8%
associate-*r*42.8%
mul-1-neg42.8%
Simplified42.8%
Taylor expanded in a around 0 13.9%
mul-1-neg13.9%
unsub-neg13.9%
*-commutative13.9%
Simplified13.9%
Taylor expanded in a around inf 24.7%
mul-1-neg24.7%
Simplified24.7%
Final simplification29.4%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 97.3%
fma-define98.1%
sub-neg98.1%
log1p-define99.6%
Simplified99.6%
Taylor expanded in y around 0 60.5%
Taylor expanded in a around 0 20.3%
herbie shell --seed 2024132
(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))))))