
(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 11 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 97.6%
Taylor expanded in z around 0 100.0%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.45e-26) (not (<= y 5000000000.0))) (* 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 <= -2.45e-26) || !(y <= 5000000000.0)) {
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 <= (-2.45d-26)) .or. (.not. (y <= 5000000000.0d0))) 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 <= -2.45e-26) || !(y <= 5000000000.0)) {
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 <= -2.45e-26) or not (y <= 5000000000.0): 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 <= -2.45e-26) || !(y <= 5000000000.0)) 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 <= -2.45e-26) || ~((y <= 5000000000.0))) 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, -2.45e-26], N[Not[LessEqual[y, 5000000000.0]], $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 -2.45 \cdot 10^{-26} \lor \neg \left(y \leq 5000000000\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 < -2.45e-26 or 5e9 < y Initial program 99.3%
Taylor expanded in a around 0 88.9%
if -2.45e-26 < y < 5e9Initial program 95.6%
Taylor expanded in y around 0 82.4%
Taylor expanded in z around 0 86.8%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified86.8%
Final simplification87.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -5.2e+37) (not (<= y 8500000000000.0))) (* 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 <= -5.2e+37) || !(y <= 8500000000000.0)) {
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 <= (-5.2d+37)) .or. (.not. (y <= 8500000000000.0d0))) 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 <= -5.2e+37) || !(y <= 8500000000000.0)) {
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 <= -5.2e+37) or not (y <= 8500000000000.0): 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 <= -5.2e+37) || !(y <= 8500000000000.0)) 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 <= -5.2e+37) || ~((y <= 8500000000000.0))) 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, -5.2e+37], N[Not[LessEqual[y, 8500000000000.0]], $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 -5.2 \cdot 10^{+37} \lor \neg \left(y \leq 8500000000000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(\left(-b\right) - z\right)}\\
\end{array}
\end{array}
if y < -5.1999999999999998e37 or 8.5e12 < y Initial program 100.0%
Taylor expanded in a around 0 90.6%
Taylor expanded in t around 0 69.5%
if -5.1999999999999998e37 < y < 8.5e12Initial program 95.3%
Taylor expanded in y around 0 78.5%
Taylor expanded in z around 0 83.1%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified83.1%
Final simplification76.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.55e+34) (not (<= y 9.5e+14))) (* x (pow z y)) (* x (exp (* a (- b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e+34) || !(y <= 9.5e+14)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((a * -b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.55d+34)) .or. (.not. (y <= 9.5d+14))) then
tmp = x * (z ** y)
else
tmp = x * exp((a * -b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e+34) || !(y <= 9.5e+14)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((a * -b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.55e+34) or not (y <= 9.5e+14): tmp = x * math.pow(z, y) else: tmp = x * math.exp((a * -b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.55e+34) || !(y <= 9.5e+14)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(a * Float64(-b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.55e+34) || ~((y <= 9.5e+14))) tmp = x * (z ^ y); else tmp = x * exp((a * -b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.55e+34], N[Not[LessEqual[y, 9.5e+14]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(a * (-b)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+34} \lor \neg \left(y \leq 9.5 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{a \cdot \left(-b\right)}\\
\end{array}
\end{array}
if y < -1.54999999999999989e34 or 9.5e14 < y Initial program 100.0%
Taylor expanded in a around 0 90.7%
Taylor expanded in t around 0 69.8%
if -1.54999999999999989e34 < y < 9.5e14Initial program 95.3%
Taylor expanded in y around 0 78.4%
Taylor expanded in z around 0 78.4%
mul-1-neg78.4%
distribute-lft-neg-out78.4%
*-commutative78.4%
Simplified78.4%
Final simplification74.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -6.1e+109) (not (<= t 1.55e+193))) (* x (- (* 0.5 (* y (* y (* t t)))) (* y t))) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -6.1e+109) || !(t <= 1.55e+193)) {
tmp = x * ((0.5 * (y * (y * (t * t)))) - (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 <= (-6.1d+109)) .or. (.not. (t <= 1.55d+193))) then
tmp = x * ((0.5d0 * (y * (y * (t * t)))) - (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 <= -6.1e+109) || !(t <= 1.55e+193)) {
tmp = x * ((0.5 * (y * (y * (t * t)))) - (y * t));
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -6.1e+109) or not (t <= 1.55e+193): tmp = x * ((0.5 * (y * (y * (t * t)))) - (y * t)) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -6.1e+109) || !(t <= 1.55e+193)) tmp = Float64(x * Float64(Float64(0.5 * Float64(y * Float64(y * Float64(t * t)))) - 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 <= -6.1e+109) || ~((t <= 1.55e+193))) tmp = x * ((0.5 * (y * (y * (t * t)))) - (y * t)); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -6.1e+109], N[Not[LessEqual[t, 1.55e+193]], $MachinePrecision]], N[(x * N[(N[(0.5 * N[(y * N[(y * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.1 \cdot 10^{+109} \lor \neg \left(t \leq 1.55 \cdot 10^{+193}\right):\\
\;\;\;\;x \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot \left(t \cdot t\right)\right)\right) - y \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -6.10000000000000008e109 or 1.54999999999999993e193 < t Initial program 95.8%
Taylor expanded in a around 0 88.9%
Taylor expanded in t around inf 88.9%
neg-mul-188.9%
Simplified88.9%
Taylor expanded in y around 0 47.4%
associate-+r+47.4%
mul-1-neg47.4%
*-commutative47.4%
unsub-neg47.4%
associate-*r*47.4%
*-commutative47.4%
unpow247.4%
unpow247.4%
Simplified47.4%
Taylor expanded in y around inf 46.1%
+-commutative46.1%
associate-*r*46.1%
neg-mul-146.1%
cancel-sign-sub-inv46.1%
unpow246.1%
unpow246.1%
*-commutative46.1%
associate-*l*54.9%
Simplified54.9%
if -6.10000000000000008e109 < t < 1.54999999999999993e193Initial program 98.3%
Taylor expanded in a around 0 65.5%
Taylor expanded in t around 0 60.1%
Final simplification58.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -7.6e-49) (not (<= y 2.2e-13))) (* 0.5 (* (* x (* t t)) (* y y))) (- x (* (+ z b) (* x a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -7.6e-49) || !(y <= 2.2e-13)) {
tmp = 0.5 * ((x * (t * t)) * (y * y));
} else {
tmp = x - ((z + b) * (x * 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 <= (-7.6d-49)) .or. (.not. (y <= 2.2d-13))) then
tmp = 0.5d0 * ((x * (t * t)) * (y * y))
else
tmp = x - ((z + b) * (x * 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 <= -7.6e-49) || !(y <= 2.2e-13)) {
tmp = 0.5 * ((x * (t * t)) * (y * y));
} else {
tmp = x - ((z + b) * (x * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -7.6e-49) or not (y <= 2.2e-13): tmp = 0.5 * ((x * (t * t)) * (y * y)) else: tmp = x - ((z + b) * (x * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -7.6e-49) || !(y <= 2.2e-13)) tmp = Float64(0.5 * Float64(Float64(x * Float64(t * t)) * Float64(y * y))); else tmp = Float64(x - Float64(Float64(z + b) * Float64(x * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -7.6e-49) || ~((y <= 2.2e-13))) tmp = 0.5 * ((x * (t * t)) * (y * y)); else tmp = x - ((z + b) * (x * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -7.6e-49], N[Not[LessEqual[y, 2.2e-13]], $MachinePrecision]], N[(0.5 * N[(N[(x * N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z + b), $MachinePrecision] * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{-49} \lor \neg \left(y \leq 2.2 \cdot 10^{-13}\right):\\
\;\;\;\;0.5 \cdot \left(\left(x \cdot \left(t \cdot t\right)\right) \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - \left(z + b\right) \cdot \left(x \cdot a\right)\\
\end{array}
\end{array}
if y < -7.5999999999999994e-49 or 2.19999999999999997e-13 < y Initial program 99.4%
Taylor expanded in a around 0 85.3%
Taylor expanded in t around inf 58.2%
neg-mul-158.2%
Simplified58.2%
Taylor expanded in y around 0 30.0%
associate-+r+30.0%
mul-1-neg30.0%
*-commutative30.0%
unsub-neg30.0%
associate-*r*30.0%
*-commutative30.0%
unpow230.0%
unpow230.0%
Simplified30.0%
Taylor expanded in y around inf 35.6%
unpow235.6%
unpow235.6%
associate-*r*37.6%
Simplified37.6%
if -7.5999999999999994e-49 < y < 2.19999999999999997e-13Initial program 95.0%
Taylor expanded in y around 0 81.2%
Taylor expanded in z around 0 86.1%
associate-*r*100.0%
associate-*r*100.0%
distribute-lft-out100.0%
neg-mul-1100.0%
Simplified86.1%
Taylor expanded in a around 0 38.5%
mul-1-neg38.5%
unsub-neg38.5%
associate-*r*43.5%
*-commutative43.5%
Simplified43.5%
Final simplification39.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.2e+153) (not (<= b 9e-51))) (* x (- 1.0 (* a b))) (- x (* x (* y t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.2e+153) || !(b <= 9e-51)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x - (x * (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 ((b <= (-5.2d+153)) .or. (.not. (b <= 9d-51))) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x - (x * (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 ((b <= -5.2e+153) || !(b <= 9e-51)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x - (x * (y * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.2e+153) or not (b <= 9e-51): tmp = x * (1.0 - (a * b)) else: tmp = x - (x * (y * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.2e+153) || !(b <= 9e-51)) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x - Float64(x * Float64(y * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.2e+153) || ~((b <= 9e-51))) tmp = x * (1.0 - (a * b)); else tmp = x - (x * (y * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.2e+153], N[Not[LessEqual[b, 9e-51]], $MachinePrecision]], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{+153} \lor \neg \left(b \leq 9 \cdot 10^{-51}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if b < -5.1999999999999998e153 or 8.99999999999999948e-51 < b Initial program 100.0%
Taylor expanded in y around 0 74.4%
Taylor expanded in z around 0 74.4%
mul-1-neg74.4%
distribute-lft-neg-out74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in b around 0 29.0%
mul-1-neg29.0%
unsub-neg29.0%
Simplified29.0%
if -5.1999999999999998e153 < b < 8.99999999999999948e-51Initial program 95.8%
Taylor expanded in a around 0 79.6%
Taylor expanded in t around inf 63.1%
neg-mul-163.1%
Simplified63.1%
Taylor expanded in y around 0 34.1%
mul-1-neg34.1%
unsub-neg34.1%
*-commutative34.1%
associate-*l*34.1%
Simplified34.1%
Final simplification31.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.3e+153) (not (<= b 9.2e-51))) (* x (- 1.0 (* a b))) (- x (* t (* x y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.3e+153) || !(b <= 9.2e-51)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x - (t * (x * 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 ((b <= (-2.3d+153)) .or. (.not. (b <= 9.2d-51))) then
tmp = x * (1.0d0 - (a * b))
else
tmp = x - (t * (x * 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 ((b <= -2.3e+153) || !(b <= 9.2e-51)) {
tmp = x * (1.0 - (a * b));
} else {
tmp = x - (t * (x * y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.3e+153) or not (b <= 9.2e-51): tmp = x * (1.0 - (a * b)) else: tmp = x - (t * (x * y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.3e+153) || !(b <= 9.2e-51)) tmp = Float64(x * Float64(1.0 - Float64(a * b))); else tmp = Float64(x - Float64(t * Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.3e+153) || ~((b <= 9.2e-51))) tmp = x * (1.0 - (a * b)); else tmp = x - (t * (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.3e+153], N[Not[LessEqual[b, 9.2e-51]], $MachinePrecision]], N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+153} \lor \neg \left(b \leq 9.2 \cdot 10^{-51}\right):\\
\;\;\;\;x \cdot \left(1 - a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if b < -2.3000000000000001e153 or 9.20000000000000007e-51 < b Initial program 100.0%
Taylor expanded in y around 0 74.4%
Taylor expanded in z around 0 74.4%
mul-1-neg74.4%
distribute-lft-neg-out74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in b around 0 29.0%
mul-1-neg29.0%
unsub-neg29.0%
Simplified29.0%
if -2.3000000000000001e153 < b < 9.20000000000000007e-51Initial program 95.8%
Taylor expanded in a around 0 79.6%
Taylor expanded in y around 0 37.0%
associate-*r*35.1%
Simplified35.1%
Taylor expanded in t around inf 34.1%
mul-1-neg34.1%
*-commutative34.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Final simplification31.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.02e-53) (not (<= y 4.7e-183))) (* a (* x (- b))) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.02e-53) || !(y <= 4.7e-183)) {
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.02d-53)) .or. (.not. (y <= 4.7d-183))) 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.02e-53) || !(y <= 4.7e-183)) {
tmp = a * (x * -b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.02e-53) or not (y <= 4.7e-183): tmp = a * (x * -b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.02e-53) || !(y <= 4.7e-183)) tmp = Float64(a * Float64(x * Float64(-b))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.02e-53) || ~((y <= 4.7e-183))) tmp = a * (x * -b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.02e-53], N[Not[LessEqual[y, 4.7e-183]], $MachinePrecision]], N[(a * N[(x * (-b)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-53} \lor \neg \left(y \leq 4.7 \cdot 10^{-183}\right):\\
\;\;\;\;a \cdot \left(x \cdot \left(-b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.02000000000000002e-53 or 4.7000000000000001e-183 < y Initial program 98.9%
Taylor expanded in y around 0 49.6%
Taylor expanded in z around 0 48.5%
mul-1-neg48.5%
distribute-lft-neg-out48.5%
*-commutative48.5%
Simplified48.5%
Taylor expanded in b around 0 16.9%
mul-1-neg16.9%
unsub-neg16.9%
Simplified16.9%
Taylor expanded in a around inf 16.6%
mul-1-neg16.6%
distribute-rgt-neg-in16.6%
Simplified16.6%
if -1.02000000000000002e-53 < y < 4.7000000000000001e-183Initial program 94.3%
Taylor expanded in a around 0 54.3%
Taylor expanded in y around 0 40.3%
Final simplification23.3%
(FPCore (x y z t a b) :precision binary64 (* x (- 1.0 (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
return x * (1.0 - (a * b));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x * (1.0d0 - (a * b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * (1.0 - (a * b));
}
def code(x, y, z, t, a, b): return x * (1.0 - (a * b))
function code(x, y, z, t, a, b) return Float64(x * Float64(1.0 - Float64(a * b))) end
function tmp = code(x, y, z, t, a, b) tmp = x * (1.0 - (a * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[(1.0 - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - a \cdot b\right)
\end{array}
Initial program 97.6%
Taylor expanded in y around 0 59.8%
Taylor expanded in z around 0 59.0%
mul-1-neg59.0%
distribute-lft-neg-out59.0%
*-commutative59.0%
Simplified59.0%
Taylor expanded in b around 0 24.6%
mul-1-neg24.6%
unsub-neg24.6%
Simplified24.6%
Final simplification24.6%
(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.6%
Taylor expanded in a around 0 71.9%
Taylor expanded in y around 0 15.9%
Final simplification15.9%
herbie shell --seed 2023271
(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))))))